| CCXML 1.0-W3C Development Guide | Home | Frameset Home |
|
<dialogterminate> element being executed. As such, its intended purpose is for short audio prompts, or being used as 'hold music'.
<?xml version="1.0" encoding="UTF-8" ?>
<ccxml version="1.0">
<meta name="author" content="Jeff Menkel"/>
<meta name="copyright" content="2007 Voxeo Corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>
<var name="initState" expr="'state_1'"/>
<var name="MyCallID"/>
<eventprocessor statevariable="initState">
<transition event="connection.alerting" state="state_1">
<assign name="MyCallID" expr="event$.connectionid"/>
<send data="'MyEvent'" target="session.id"/>
</transition>
<transition event="MyEvent">
<accept connectionid="MyCallID"/>
</transition>
<transition event="connection.connected" state="state_1">
<log expr="'***** CALL WAS ANSWERED *****'"/>
<dialogstart src="'tastyburger.wav'" type="'audio/wav'"/>
</transition>
<transition event="error.dialog.notstarted'" state="state_1">
<log expr="'****** ERROR.DIALOGNOTSTARTED.NAME = ' + event$.name"/>
</transition>
<transition event="dialog.exit">
<log expr="'***** CALL EXITING *****'"/>
<exit/>
</transition>
</eventprocessor>
</ccxml>
| ANNOTATIONS: EXISTING POSTS |
amaghazaji
|
|
| This code wont work unless you make a few changes to it. you need to Add xmlns and connectionid's.
My problem is the create call is timing out after 60 seconds even though I set the timeout to 90 and it is giving "unknown" as the reason for disconnecting the attempted outcall. any ideas on how to increase that? <?xml version="1.0" encoding="UTF-8" ?> <ccxml version="1.0" xmlns="http://www.w3.org/2002/09/ccxml" xmlns:voxeo="http://community.voxeo.com/xmlns/ccxml"> <var name="state0" expr="'init'"/> <var name="callid_in"/> <var name="callid_out"/> <var name="holdMusicDlg"/> <var name="mainVXMLDlg"/> <eventprocessor statevariable="state0"> <!-- ***************************************** --> <!-- Inbound call is accepted. --> <!-- ***************************************** --> <transition state="init" event="connection.alerting"> <log expr="'ACCEPTING INBOUND CALL'"/> <accept/> </transition> <!-- ***************************************** --> <!-- Begin playing the main VXML dialog. --> <!-- ***************************************** --> <transition state="init" event="connection.connected" name="evt"> <log expr="'INBOUND CALL CONNECTED / STARTING MAIN VXML DIALOG'"/> <assign name="callid_in" expr="evt.connectionid"/> <assign name="state0" expr="'mainVXMLDialog'"/> <dialogstart src="'testVXML.xml'" dialogid="mainVXMLDlg" connectionid="callid_in"/> </transition> <!-- ***************************************** --> <!-- If the caller chooses to make the --> <!-- Outbound call then play hold music for --> <!-- Inbound call and then create the Outbound --> <!-- call. --> <!-- ***************************************** --> <transition state="mainVXMLDialog" event="dialog.exit" name="evt"> <log expr="'FINISHED MAIN VXML DIALOG / CALLERS ANSWER IS: ' + evt.values.answer"/> <if cond="'1' == evt.values.answer"> <assign name="state0" expr="'calling'"/> <dialogstart src="'testholdmusic.xml'" dialogid="holdMusicDlg" connectionid="callid_in"/> <createcall dest="'sip:xxx'" timeout="'90s'" /> <else/> <exit/> </if> </transition> <!-- ***************************************** --> <!-- If outbound call fails. --> <!-- ***************************************** --> <transition state="calling" event="connection.failed" name="evt"> <log expr="'OUTBOUND CALL FAILED Reason:' + evt.reason + ':' + evt.info"/> <assign name="state0" expr="'callfailed'"/> <dialogterminate dialogid="holdMusicDlg" immediate="true"/> </transition> <transition state="callfailed" event="dialog.exit"> <assign name="state0" expr="'playingCallFailed'"/> <dialogstart src="'testcallfaild.xml'" connectionid="callid_in"/> </transition> <transition state="playingCallFailed" event="dialog.exit"> <log expr="'DISCONNECTING INBOUND CALL'"/> <disconnect/> </transition> <!-- ***************************************** --> <!-- Outbound call is answered and played a --> <!-- "whisper" VXML dialog. --> <!-- ***************************************** --> <transition state="calling" event="connection.connected" name="evt"> <log expr="'OUTBOUND CALL CONNECTED / STARTING WHISPER DIALOG'"/> <assign name="callid_out" expr="evt.connectionid"/> <assign name="state0" expr="'callAccepted'"/> <dialogstart src="'testwhisper.xml'" connectionid="callid_out"/> </transition> <!-- ***************************************** --> <!-- When "whisper" dialog is finished stop --> <!-- hold music for Inbound call. --> <!-- ***************************************** --> <transition state="callAccepted" event="dialog.exit" name="evt"> <log expr="'WHISPER DIALOG ENDED / KILLING HOLD MUSIC ----'" /> <assign name="state0" expr="'endHoldMusic'"/> <dialogterminate dialogid="holdMusicDlg" immediate="true"/> </transition> <!-- ***************************************** --> <!-- When hold music dialog is finished join --> <!-- Outbound and Inbound call legs. --> <!-- ***************************************** --> <transition state="endHoldMusic" event="dialog.exit"> <log expr="'HOLD MUSIC ENDED'"/> <assign name="state0" expr="'bridged'"/> <send name="'bridgeCall'" target="session.id" delay="'4s'"/> </transition> <transition event="bridgeCall" state="bridged"> <join id1="callid_in" id2="callid_out" duplex="'full'"/> <log expr="'JOIN CALLS LEGS'"/> </transition> <transition event="connection.disconnected" name="evt"> <if cond="callid_in == evt.connectionid"> <exit/> </if> </transition> <transition event="error.*" name="evt"> <log expr="'AN ERROR HAS OCCURED (' + evt.reason + ')'"/> <exit/> </transition> </eventprocessor> </ccxml> |
|
VoxeoDustin
|
|
| Hey Amaghazaji,
In our hosted environment, we will try the outbound call over three different carriers. If all attempts fail to complete, our session border controllers will return that the call failed, even if the application set timeout has not expired. In a Premise installation, this value would be honored as long as you set it or until your VoIP provider returned a failure code. Cheers, Dustin |
| login |
|