Prophecy 9.0 Development Guide Home  |  Frameset Home

  Appendix I: Sample Applications  |  TOC

Blind Transfers

In some cases, a developer may want to free up ports during a call transfer to an external destination to conserve resources with Prophecy. In order to do so, it is suggested that the developer checks with the network provider to make sure that the  "blind transfer" feature is supported on the telco network. The provider must support the SIP REFER method.

CallXML 3.0 Indial Blind Transfer Sample Code

Within the CallXML 3.0 context, initiating a blind transfer is as simple as specifying <transfer method="refer">, as illustrated below:


<?xml version="1.0" encoding="UTF-8"?>
<callxml version="3.0">

  <do label="B1">

    <say>
      Preparing to place your call.
    </say>

    <transfer method="refer" value="tel:4072223333"
      maxtime="50s" playvalue="ringtone.wav" termdigit="1"/>

    <on event="maxtime">
    <log> *** MAXTIME EVENT DETECTED ***</log>
      <say>
        You hit max time for the call, and were disconnected.
      </say>
    </on>

    <on event="callfailure:hangup">
    <log> *** HANGUP EVENT DETECTED ***</log>
    </on>

    <on event="termdigit:1">
    <log> *** TERMDIGIT PRESSED BY USER ***</log>
      <say>
        you must have pressed 1 to end the call.
      </say>
    </on>

    <on event="callfailure:unreachable">
      <log>*** UNREACHABLE EVENT DETECTED ***</log>
      <say>
        the called number returned an un reachable event.
      </say>
    </on>

    <on event="callfailure:busy">
      <log>*** BUSY EVENT DETECTED ***</log>
      <say>
        the number that you dialed is busy.
      </say>
    </on>

<!-- note that an 'anonymous' callfailure handler -->
<!-- will catch all call failure events -->
<!-- that do not have their own specific handler. -->
<!-- if the developer employs this soultion, -->
<!-- note that this handler *must* reside below all other handlers -->

    <on event="callfailure">
      <log>*** RECEIVED AN ANONYMOUS CALLFAILURE EVENT ***</log>
    </on>

  </do>

</callxml>


CCXML 1.0 Indial Sample Code


From CCXML you can issue a sip REFER by doing a <redirect/> after the line has been <accept/>'ed. On the same token if a <redirect/> is issued prior to the call be <accepted/>'ed a 302 REDIRECT will be issued.


<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0" xmlns="http://www.w3.org/2002/09/ccxml">

  <var name="conn_id" expr="''" />
  <var name="statevar" expr="'state0'"/>

  <eventprocessor statevariable="statevar">

    <transition state="state0" event="connection.alerting">
      <assign name="statevar" expr="'state1'"/>
      <assign name="conn_id" expr="event$.connectionid" />
      <log expr="'*** Accepting the connection ***'"/>
      <accept connectionid="conn_id"/>
    </transition>

    <transition state="state1" event="connection.connected">
      <assign name="statevar" expr="'state2'"/>
      <log expr="'*** Redirecting, please stand by ***'"/>
      <!-- Since the call has been accepted already a SIP REFER will be executed here -->
      <redirect connectionid="conn_id" dest="'tel:+14071112222'"/>
    </transition>

    <transition state="state2" event="connection.redirected">
        <log expr="'Redirect successful!'"/>
        <exit/>
    </transition>

    <transition event="connection.redirect.failed">
      <log expr="'The redirect failed...'"/>
      <exit/>
    </transition>

    <transition event="error.*">
      <log expr="'An error occurred: ' + event$.reason"/>
      <exit/>
    </transition>

  </eventprocessor>
</ccxml>


VoiceXML Transfer REFER


The below VoiceXML transfer application will perform a SIP refer, after this point the user is no longer able to interact with the platform as the call has been removed.


<?xml version="1.0" encoding="UTF-8"?>

<vxml version = "2.1">

<meta name="author" content="Matthew Henry"/>
<meta name="copyright" content="2009 voxeo corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>

<form id="F1">
  <transfer name="T_1" bridge="false" type="refer"
                dest="tel:+12223334444">

<!-- ************************************************* -->
<!-- Transfer code remix, courtesy of  D.J. Johnnie Cochran -->
<!-- ************************************************* -->

    <prompt> Placing the call, y'all</prompt>
      <filled>
        <if cond="T_1 == 'busy'">
            <prompt>The line is busy, Lizzie. </prompt>
            <exit/>
        <elseif cond="T_1 == 'noanswer'"/>
            <prompt> No one's home, metronome. </prompt>
        </if>
      </filled>
  </transfer>
  <block>
      <goto next="#F2"/>
  </block>
</form>

<form id="F2">
  <block>
      <prompt>if the bridge is true,
            then the call goes on for you.
      </prompt>
  </block>
</form>
</vxml>



  ANNOTATIONS: EXISTING POSTS
0 posts - click the button below to add a note to this page

login
  Appendix I: Sample Applications  |  TOC

© 2010 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site