CallFlow Cheat Sheet



Index

Call setup elements

Initiate a CallFlow call
Connect the call to a callee
End the currently active call
Pause CallFlow execution
Handle inbound calls based on caller URI
Handle inbound calls based on callee URI

Interactive voice elements

Play an announcement
Play a prompt and collect DTMF / touchtone input
Record and store a voice message
Generate and send DTMF digits to the connected call

Application integration elements

Send a notification to an application
Add dynamically generated elements to an existing CallFlow
Process XML returned by getCallFlowInformation(s)

Common Patterns

Implement a find-me-follow-me feature
Play announcement to first AND second party
Join a service requiring a DTMF / touchtone PIN (e.g. a conference call)


Cheat Sheet

Basic Functions

Initiate a CallFlow call

<call id="start" target="sip:joe@bloggs.com" next="ring" timeout="60" onFailure="sorry"/>

Play an announcement

<announcement id="ring" audio="karsten.wav" next="verifyPin"/>

Play a prompt and collect DTMF / touchtone input

<prompt id="prompt" audio="please_enter_pin.wav" barge="false" maxDigits="1" enterKey="#">

<input pattern="1" next="option_1"/>
<default next="invalid_option"/>
</prompt>

Connect the call to a callee

<dialog id="call_me" audio="ring.wav" target="tel:44567890123" next="after_the_call" timeout="10" />

Record and store a voice message

<record id="recordit" audio="prompt.wav" terminationKey="#" target="newfile.wav" next="playit"/>

End the currently active call

<hangup id="stopCall"/>

... or simply do not define a 'next' transition

Generate and send DTMF digits to the connected call

<dtmf-gen id="generate_digits" digits="1234" next="connect_user"/>

Pause CallFlow execution

<pause id="wait_five_seconds" seconds="5" next="connect_party"/>

Handle inbound calls based on caller URI

<matchCall id="matchFrom" source="from">
<input pattern=".*\.si" next="#slovene"/>
<default next="#english"/>

</matchCall>

Handle inbound calls based on called URI

<matchCall id="test" source="to">
<input pattern=".*?mysite.com" next="matchFrom"/>

<default next="notAvailable"/>
</matchCall>

Send a notification to an application

<notification id="notify" next="abc"/>

<resource uri="http://mysite.com/notify/${callee}" method="POST">
<parameter name="caller" value="${caller}"/>
</resource>

</notification>

Add dynamically generated elements to an existing CallFlow

<subflow id="validate_user" audio="please_wait.wav" start="external_element_id" onFailure="unavailable">

<resource uri="http://mysite.com/input/${prompt.digits}" method="GET">
<parameter name="caller" value="${caller}"/>
</resource>

</subflow>

Feature Templates

Implement a find-me-follow-me feature

<call id="start" target="sip:me@person.com" next="welcome"/>
<announcement id="welcome" audio="welcome.wav" next="office"/>

<dialog id="office" target="sip:you@office.com" onFailure="officeNA"/>
<announcement id="officeNA" audio="busy.wav" next="mobile"/>

<dialog id="mobile" target="sip:you@mobile.com" onFailure="mobileNA"/>
<announcement id="mobileNA" audio="busy.wav" next="home"/>

<dialog id="home" target="sip:you@home.com" onFailure="homeNA"/>
<announcement id="homeNA" audio="busy.wav" next="goodbye"/>

Play announcement to first AND second party

<call id="start" target="sip:someone@somewhere.com" next="please_wait" />
<announcement id="please_wait" audio="please_wait.wav" next="connect"/>

<dialog id="connect" target="sip:callee@phone.net" init="greet" next="end" callerDisconectedAudio="goodbye.wav" />

<announcement id="greet" audio="you_have_a_call.wav"/>
<announcement id="end" audio="goodbye.wav" />

Join a service requiring a DTMF / touchtone PIN (e.g. a conference call):

<?xml version="1.0" encoding="UTF-8"?>
<callflow xmlns="http://sdk.bt.com/callflow/2007/04">
<call id="start" target="tel:441234567890" next="wait"/>

<pause id="wait" seconds="10" next="dtmfgen"/>
<dtmf-gen id="dtmfgen" digits="123123123#" next="call-participant"/>

<dialog id="call-participant" target="sip:me@mydomain.com"/>
</callflow>

Record the audio and then play it back:

<record id="recordit" audio="prompt.wav" terminationKey="#" target="newfile.wav" next="playit"/>
<announcement id="playit" audio="newfile.wav" />

XML Returned by getCallFlowInformation(s)

1. Outbound script. call->prompt->prompt again->play announcement

<bt:flowexecutions xmlns:bt="http://www.bt.com/voiceflow/report">
<flowexecution type="outbound" status="finished" startTime="2007-10-11T09:24:04.718+02:00" id="flow_exe:07db16cfca80a925cb70da4fdafe5a5c" endTime="2007-10-11T09:24:
30.109+02:00">

<call target="sip:joebloggs@mydomain.com:5060" response="OK" startTime="2007-10-11T09:24:04.734+02:00" id="start" endTime="2007-10-11T09:24:07.562+02:00 "/>

<prompt
input="63957" startTime="2007-10-11T09:24:07.578+02:00" id="collect" endTime="2007-10-11T09:24:14.281+02:00"/>
<prompt input="12345" startTime="2007-10-11T09:24: 14.296+02:00" id="collect" endTime="2007-10-11T09:24:18.453+02:00"/>
<announcement
audio="greet.wav" startTime="2007-10-11T09:24:18.453+02:00" id="greeting" endTime="2007-10-11T09:24: 30.109+02:00"/>

</flowexecution>
</bt:flowexecutions>

2. The above script still executing at "greeting" element.

<bt:flowexecutions xmlns:bt="http://www.bt.com/voiceflow/report">

<flowexecution type="outbound" status="pending" startTime="2007-10-11T09:24:04.718+02:00" pendingElementID="greeting" id="flow_exe:07db16cfca80a925cb70da4fdafe5a5c">
<call target="sip:joebloggs@mydomain.com:5060" response="OK" startTime="2007-10-11T09:24:04.734+02:00" id="start" endTime="2007-10-11T09:24:07.562+02:00"/>

<prompt input="63957" startTime="2007-10-11T09:24:07.578+02:00" id="collect" endTime="2007-10-11T09:24:14.281+02:00"/>
<prompt input="12345" startTime="2007-10-11T09:24: 14.296+02:00" id="collect" endTime="2007-10-11T09:24:18.453+02:00"/>
</flowexecution>

</bt:flowexecutions>

3. Inbound "inSimpleMenu". 2 successfull, one failed.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bt:flowexecutions xmlns:bt="http://www.bt.com/voiceflow/report">

<flowexecution type="inbound" status="finished" startTime="2007-10-11T09:33:44.437+02:00" sourceUri="sip:voiceflow@bt.com" id="flow_exe:ff77cc930ff4e2c9cce9983300618551" flowName=" inSimpleMenu.xml" endTime="2007-10-11T09:34:02.421+02:00" destinationUri="sip:voiceflow@bt.com">

<match value=" sip:voiceflow@bt.com,sip:voiceflow@bt.com" startTime="2007-10-11T09:33:44.453+02:00" id="test" endTime="2007-10-11T09:33:44.468+02:00"/>
<match value="sip:voiceflow@bt.com,sip:voiceflow@bt.com" startTime="2007-10-11T09:33:44.468+02:00" id="matchFrom" endTime="2007-10-11T09:33: 44.468+02:00"/>

<announcement audio="welcome.wav" startTime="2007-10-11T09:33:44.484+02:00" id="english" endTime="2007-10-11T09:33:53.156+02:00"/>
<dialog target=" sip:english@192.168.2.156" response="OK" startTime="2007-10-11T09:33:53.156+02:00" id="operator" endTime="2007-10-11T09:34:02.421+02:00"/>

</flowexecution>
<flowexecution type="inbound" status="failed" startTime="2007-10-11T10:02:28.703+02:00" sourceUri="sip:voiceflow@bt.si" id="flow_exe:3a1600430a63e798cccb79423da1313d" flowName=" inSimpleMenu.xml" errorMessage="Could not evaluate &quot;operatorSI&quot;. Internal error." endTime="2007-10-11T10:02:37.453+02:00" destinationUri="sip:voiceflow@bt.com">

<match value="sip:voiceflow@bt.si,sip:voiceflow@bt.com" startTime="2007-10-11T10:02: 28.734+02:00" id="test" endTime="2007-10-11T10:02:28.734+02:00"/>
<match value="sip:voiceflow@bt.si, sip:voiceflow@bt.com" startTime="2007-10-11T10:02:28.750+02:00" id="matchFrom" endTime="2007-10-11T10:02:28.750+02:00"/>

<announcement audio="welcome_slovene.wav" startTime="2007-10-11T10:02:28.750+02:00" id="slovene" endTime="2007-10-11T10:02:37.359+02:00"/>
<dialog target="sip:slovene192.168.2.156" response="OK" startTime="2007-10-11T10:02:37.359+02:00" id="operatorSI" endTime="2007-10-11T10:02: 37.453+02:00"/>

</flowexecution>
<flowexecution type="inbound" status="finished" startTime="2007-10-11T10:03:36.046+02:00" sourceUri="sip:voiceflow@bt.si" id="flow_exe:99a1c73543cde19ea33ea8f93f75bb4f" flowName="inSimpleMenu.xml" endTime="2007-10-11T10:03:49.812+02:00" destinationUri=" sip:voiceflow@bt.com">
<match value="sip:voiceflow@bt.si,sip:voiceflow@bt.com" startTime="2007-10-11T10:03: 36.109+02:00" id="test" endTime="2007-10-11T10:03:36.109+02:00"/>

<match value="sip:voiceflow@bt.si, sip:voiceflow@bt.com" startTime="2007-10-11T10:03:36.109+02:00" id="matchFrom" endTime="2007-10-11T10:03:36.109+02:00"/>
<announcement audio="welcome_slovene.wav" startTime="2007-10-11T10:03:36.109+02:00" id="slovene" endTime="2007-10-11T10:03:39.625+02:00"/>

<dialog target="sip:slovene@192.168.2.156" response="OK" startTime="2007-10-11T10:03: 39.625+02:00" id="operatorSI" endTime="2007-10-11T10:03:49.796+02:00"/>
</flowexecution>

</bt:flowexecutions>