Más contenido relacionado Similar a Developing SIP Applications (20) Developing SIP Applications1. Sep 16th, 2008
TMC Communication Developer Conference
Developing SIP Applications
RJ Auburn
CTO
rj@voxeo.com
© Voxeo Corporation
16. Application
API XML Tools
Platform
16 © Voxeo Corporation
17. Application
JSR289, CCXML
REST, & Designer
SOAP VoiceXML
Prophecy
17 © Voxeo Corporation
18. Application
Application
API XML Tools
Platform
18 © Voxeo Corporation
20. Session Initiation Protocol
- Session Initiation Protocol (SIP)
defines how to establish a
communication session between
two endpoints
- Primarily used for voice, but can for IM or virtually
any other protocol
- Almost always used in client/server configuration
with quot;SIP proxiesquot; in control of quot;SIP endpointsquot;
- Work going on in P2PSIP - see www.p2psip.org
- Text-based protocol, originally modeled on HTTP
© Voxeo Corporation
21. SIP Communication
INVITE
Alice 180 RINGING Bob
200 OK
ACK
RTP (voice)
BYE
200 OK
© Voxeo Corporation
22. Proxy Proxy
A SIP B
P
SIP
SI
Alice RTP Bob
© Voxeo Corporation
23. SIP Resources
- Internet Engineering Task Force (IETF)
- RFC 3261
- Hitchhiker’s Guide to SIP
- Open Source Info
- VoIP Info Wiki: www.voip-info.org
- Industry Sites
- SIP Forum: www.sipforum.org
- SIP Foundry: www.sipfoundry.org
- OpenSBC: www.opensourcesip.org
© Voxeo Corporation
24. Open Source SIP Software
- Systems
- Asterisk: www.asterisk.org
- sipXecs: www.sipfoundry.org
- FreeSWITCH: www.freeswitch.org
- OpenSER: www.openser.org
- SIP Stacks
- reSIProcate: www.resiprocate.org
- Phones:
- Gizmo: www.gizmoproject.org
- MANY, many more: www.voip-info.org
© Voxeo Corporation
27. CCXML
- Call Control XML (CCXML) is the
W3C standard for call control
using XML
- Sister standard to VoiceXML
- Integrates with VoiceXML for dialog control
- Provides a framework for issuing call control
commands and handling call control events
- http://www.w3.org/TR/ccxml/
© Voxeo Corporation
29. CCXML Hello World
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<ccxml version=quot;1.0quot;>
<eventprocessor>
<transition event=quot;connection.alertingquot;>
<log expr=quot;'***** CONNECTION ALERTING *****'quot;/>
<if cond=quot;event$.connection.remote == '8315551234'quot;>
<reject/>
<else/>
<accept/>
</if>
</transition>
<transition event=quot;connection.connectedquot;>
<log expr=quot;'***** CALL WAS ANSWERED *****'quot;/>
</transition>
<transition event=”connection.disconnected”>
<log expr=”‘*** Call was disconnected ***’”/>
<exit/>
</transition>
<transition event=quot;error.*quot;>
<log expr=quot;'an error has occured (' + event$.reason + ')'quot;/>
<exit/>
</transition>
</eventprocessor>
</ccxml>
© Voxeo Corporation
31. SIP Servlets
- Standard Java based API for writing SIP
applications.
- 1.0 standardized as JSR-116.
- 2.0 just released as JSR-289
- Extends the HTTP Servlet model to support SIP
and telephony applications
- http://www.sipservlet.com/
- Supported by a large number of application
servers including Oracle (BEA), IBM, Sun, Voxeo.
31 © Voxeo Corporation
33. JSR-309
- Java Media Server API
- Based on the CCXML media model
- Still in draft stage
- Provides dialog resources, conferencing, media
routing to Java applications
33 © Voxeo Corporation
34. Example
Application
© Voxeo Corporation
35. Sample Application Overview
- Caller dials in to the application
- Caller is bridged to the subscriber
- Results of the call attempt are posted to Twitter
via their REST API
35
© Voxeo Corporation
36. Follow Me/Find Me + Twitter
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<ccxml xmlns=quot;http://www.w3.org/2002/09/ccxmlquot; version=quot;1.0quot;>
<var name=quot;statequot; expr=quot;'init'quot;/>
<var name=quot;incomingcallquot;/>
<var name=quot;tURLquot;
expr=quot;'http://zscgeek:password@twitter.com/statuses/update.xml'quot;/>
<eventprocessor statevariable=quot;statequot;>
<transition event=quot;connection.alertingquot; state=quot;initquot;>
<accept/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;initquot;>
<assign name=quot;statequot; expr=quot;'calling'quot;/>
<assign name=quot;incomingcallquot; expr=quot;event$.connectionidquot;/>
<createcall dest=quot;'tel:+18312392883'quot;/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'connected'quot;/>
<join id1=quot;event$.connectionidquot; id2=quot;incomingcallquot;/>
<var name=quot;statusquot; expr=quot;'RJ is on the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.failedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is not answering his phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.disconnectedquot; state=quot;connectedquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is off the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;send.successfulquot; state=quot;donequot;>
<exit/>
</transition>
</eventprocessor>
</ccxml>
36 © Voxeo Corporation
37. Follow Me/Find Me + Twitter
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<ccxml xmlns=quot;http://www.w3.org/2002/09/ccxmlquot; version=quot;1.0quot;>
<var name=quot;statequot; expr=quot;'init'quot;/>
<var name=quot;incomingcallquot;/>
<var name=quot;tURLquot;
expr=quot;'http://zscgeek:password@twitter.com/statuses/update.xml'quot;/>
<eventprocessor statevariable=quot;statequot;>
<transition event=quot;connection.alertingquot; state=quot;initquot;>
<accept/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;initquot;>
<assign name=quot;statequot; expr=quot;'calling'quot;/>
<assign name=quot;incomingcallquot; expr=quot;event$.connectionidquot;/>
<createcall dest=quot;'tel:+18312392883'quot;/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'connected'quot;/>
<join id1=quot;event$.connectionidquot; id2=quot;incomingcallquot;/>
<var name=quot;statusquot; expr=quot;'RJ is on the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.failedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is not answering his phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.disconnectedquot; state=quot;connectedquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is off the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;send.successfulquot; state=quot;donequot;>
<exit/>
</transition>
</eventprocessor>
</ccxml>
37 © Voxeo Corporation
38. Follow Me/Find Me + Twitter
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<ccxml xmlns=quot;http://www.w3.org/2002/09/ccxmlquot; version=quot;1.0quot;>
<var name=quot;statequot; expr=quot;'init'quot;/>
<var name=quot;incomingcallquot;/>
<var name=quot;tURLquot;
expr=quot;'http://zscgeek:password@twitter.com/statuses/update.xml'quot;/>
<eventprocessor statevariable=quot;statequot;>
<transition event=quot;connection.alertingquot; state=quot;initquot;>
<accept/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;initquot;>
<assign name=quot;statequot; expr=quot;'calling'quot;/>
<assign name=quot;incomingcallquot; expr=quot;event$.connectionidquot;/>
<createcall dest=quot;'tel:+18312392883'quot;/>
</transition>
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<transition event=quot;connection.connectedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'connected'quot;/>
<ccxml version=quot;1.0quot; is id2=quot;incomingcallquot;/>
<join id1=quot;event$.connectionidquot;
<var name=quot;statusquot; expr=quot;'RJ on the phone'quot;/>
xmlns=quot;http://www.w3.org/2002/09/ccxmlquot;>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</ccxml>
</transition>
<transition event=quot;connection.failedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is not answering his phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.disconnectedquot; state=quot;connectedquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is off the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;send.successfulquot; state=quot;donequot;>
<exit/>
</transition>
</eventprocessor>
</ccxml>
38 © Voxeo Corporation
39. Follow Me/Find Me + Twitter
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<ccxml xmlns=quot;http://www.w3.org/2002/09/ccxmlquot; version=quot;1.0quot;>
<var name=quot;statequot; expr=quot;'init'quot;/>
<var name=quot;incomingcallquot;/>
<var name=quot;tURLquot;
expr=quot;'http://zscgeek:password@twitter.com/statuses/update.xml'quot;/>
<eventprocessor statevariable=quot;statequot;>
<transition event=quot;connection.alertingquot; state=quot;initquot;>
<accept/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;initquot;>
<assign name=quot;statequot; expr=quot;'calling'quot;/>
<assign name=quot;incomingcallquot; expr=quot;event$.connectionidquot;/>
<createcall dest=quot;'tel:+18312392883'quot;/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'connected'quot;/>
<join id1=quot;event$.connectionidquot; id2=quot;incomingcallquot;/>
<var name=quot;statusquot; expr=quot;'RJ is on the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.failedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is not answering his phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.disconnectedquot; state=quot;connectedquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is off the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;send.successfulquot; state=quot;donequot;>
<exit/>
</transition>
</eventprocessor>
</ccxml>
39 © Voxeo Corporation
40. Follow Me/Find Me + Twitter
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<ccxml xmlns=quot;http://www.w3.org/2002/09/ccxmlquot; version=quot;1.0quot;>
<var name=quot;statequot; expr=quot;'init'quot;/>
<var name=quot;incomingcallquot;/>
<var name=quot;tURLquot;
expr=quot;'http://zscgeek:password@twitter.com/statuses/update.xml'quot;/>
<eventprocessor statevariable=quot;statequot;>
<transition event=quot;connection.alertingquot; state=quot;initquot;>
<accept/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;initquot;>
<assign name=quot;statequot; expr=quot;'calling'quot;/>
<assign name=quot;incomingcallquot; expr=quot;event$.connectionidquot;/>
<createcall dest=quot;'tel:+18312392883'quot;/>
<var name=quot;statequot; expr=quot;'init'quot;/>
</transition>
<var name=quot;incomingcallquot;/>
<transition event=quot;connection.connectedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'connected'quot;/>
<var name=quot;tURLquot;
<join id1=quot;event$.connectionidquot; id2=quot;incomingcallquot;/>
<var name=quot;statusquot; expr=quot;'RJ is on the phone'quot;/>
expr=quot;'http://zscgeek:password@twitter.com/statuses/update.xml'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.failedquot; state=quot;callingquot;>
<eventprocessor statevariable=quot;statequot;> his phone'quot;/>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is not answering
</eventprocessor>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.disconnectedquot; state=quot;connectedquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is off the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;send.successfulquot; state=quot;donequot;>
<exit/>
</transition>
</eventprocessor>
</ccxml>
40 © Voxeo Corporation
41. Follow Me/Find Me + Twitter
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<ccxml xmlns=quot;http://www.w3.org/2002/09/ccxmlquot; version=quot;1.0quot;>
<var name=quot;statequot; expr=quot;'init'quot;/>
<var name=quot;incomingcallquot;/>
<var name=quot;tURLquot;
expr=quot;'http://zscgeek:password@twitter.com/statuses/update.xml'quot;/>
<eventprocessor statevariable=quot;statequot;>
<transition event=quot;connection.alertingquot; state=quot;initquot;>
<accept/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;initquot;>
<assign name=quot;statequot; expr=quot;'calling'quot;/>
<assign name=quot;incomingcallquot; expr=quot;event$.connectionidquot;/>
<createcall dest=quot;'tel:+18312392883'quot;/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'connected'quot;/>
<join id1=quot;event$.connectionidquot; id2=quot;incomingcallquot;/>
<var name=quot;statusquot; expr=quot;'RJ is on the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.failedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is not answering his phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.disconnectedquot; state=quot;connectedquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is off the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;send.successfulquot; state=quot;donequot;>
<exit/>
</transition>
</eventprocessor>
</ccxml>
41 © Voxeo Corporation
42. Follow Me/Find Me + Twitter
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<ccxml xmlns=quot;http://www.w3.org/2002/09/ccxmlquot; version=quot;1.0quot;>
<var name=quot;statequot; expr=quot;'init'quot;/>
<var name=quot;incomingcallquot;/>
<var name=quot;tURLquot;
expr=quot;'http://zscgeek:password@twitter.com/statuses/update.xml'quot;/>
<eventprocessor statevariable=quot;statequot;>
<transition event=quot;connection.alertingquot; state=quot;initquot;>
<accept/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;initquot;>
<assign name=quot;statequot; expr=quot;'calling'quot;/>
<assign name=quot;incomingcallquot; expr=quot;event$.connectionidquot;/>
<createcall dest=quot;'tel:+18312392883'quot;/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;callingquot;>
<transition event=quot;connection.alertingquot; state=quot;initquot;>
<assign name=quot;statequot; expr=quot;'connected'quot;/>
<join id1=quot;event$.connectionidquot; id2=quot;incomingcallquot;/>
<accept/>
<var name=quot;statusquot; expr=quot;'RJ is on the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
</transition>
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.failedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is not answering his phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.disconnectedquot; state=quot;connectedquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is off the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;send.successfulquot; state=quot;donequot;>
<exit/>
</transition>
</eventprocessor>
</ccxml>
42 © Voxeo Corporation
43. Follow Me/Find Me + Twitter
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<ccxml xmlns=quot;http://www.w3.org/2002/09/ccxmlquot; version=quot;1.0quot;>
<var name=quot;statequot; expr=quot;'init'quot;/>
<var name=quot;incomingcallquot;/>
<var name=quot;tURLquot;
expr=quot;'http://zscgeek:password@twitter.com/statuses/update.xml'quot;/>
<eventprocessor statevariable=quot;statequot;>
<transition event=quot;connection.alertingquot; state=quot;initquot;>
<accept/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;initquot;>
<assign name=quot;statequot; expr=quot;'calling'quot;/>
<assign name=quot;incomingcallquot; expr=quot;event$.connectionidquot;/>
<createcall dest=quot;'tel:+18312392883'quot;/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'connected'quot;/>
<join id1=quot;event$.connectionidquot; id2=quot;incomingcallquot;/>
<var name=quot;statusquot; expr=quot;'RJ is on the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.failedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is not answering his phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.disconnectedquot; state=quot;connectedquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is off the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;send.successfulquot; state=quot;donequot;>
<exit/>
</transition>
</eventprocessor>
</ccxml>
43 © Voxeo Corporation
44. Follow Me/Find Me + Twitter
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<ccxml xmlns=quot;http://www.w3.org/2002/09/ccxmlquot; version=quot;1.0quot;>
<var name=quot;statequot; expr=quot;'init'quot;/>
<var name=quot;incomingcallquot;/>
<var name=quot;tURLquot;
expr=quot;'http://zscgeek:password@twitter.com/statuses/update.xml'quot;/>
<eventprocessor statevariable=quot;statequot;>
<transition event=quot;connection.alertingquot; state=quot;initquot;>
<accept/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;initquot;>
<assign name=quot;statequot; expr=quot;'calling'quot;/>
<assign name=quot;incomingcallquot; expr=quot;event$.connectionidquot;/>
<createcall dest=quot;'tel:+18312392883'quot;/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;initquot;>
<transition event=quot;connection.connectedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'connected'quot;/>
<assign name=quot;statequot; expr=quot;'calling'quot;/>
<join id1=quot;event$.connectionidquot; id2=quot;incomingcallquot;/>
<var name=quot;statusquot; expr=quot;'RJ is on the phone'quot;/>
<assign name=quot;incomingcallquot; expr=quot;event$.connectionidquot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
<createcall dest=quot;'tel:+18312392883'quot;/>
</transition>
<transition event=quot;connection.failedquot; state=quot;callingquot;>
</transition>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is not answering his phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.disconnectedquot; state=quot;connectedquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is off the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;send.successfulquot; state=quot;donequot;>
<exit/>
</transition>
</eventprocessor>
</ccxml>
44 © Voxeo Corporation
45. Follow Me/Find Me + Twitter
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<ccxml xmlns=quot;http://www.w3.org/2002/09/ccxmlquot; version=quot;1.0quot;>
<var name=quot;statequot; expr=quot;'init'quot;/>
<var name=quot;incomingcallquot;/>
<var name=quot;tURLquot;
expr=quot;'http://zscgeek:password@twitter.com/statuses/update.xml'quot;/>
<eventprocessor statevariable=quot;statequot;>
<transition event=quot;connection.alertingquot; state=quot;initquot;>
<accept/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;initquot;>
<assign name=quot;statequot; expr=quot;'calling'quot;/>
<assign name=quot;incomingcallquot; expr=quot;event$.connectionidquot;/>
<createcall dest=quot;'tel:+18312392883'quot;/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'connected'quot;/>
<join id1=quot;event$.connectionidquot; id2=quot;incomingcallquot;/>
<var name=quot;statusquot; expr=quot;'RJ is on the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.failedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is not answering his phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.disconnectedquot; state=quot;connectedquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is off the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;send.successfulquot; state=quot;donequot;>
<exit/>
</transition>
</eventprocessor>
</ccxml>
45 © Voxeo Corporation
46. Follow Me/Find Me + Twitter
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<ccxml xmlns=quot;http://www.w3.org/2002/09/ccxmlquot; version=quot;1.0quot;>
<var name=quot;statequot; expr=quot;'init'quot;/>
<var name=quot;incomingcallquot;/>
<var name=quot;tURLquot;
expr=quot;'http://zscgeek:password@twitter.com/statuses/update.xml'quot;/>
<eventprocessor statevariable=quot;statequot;>
<transition event=quot;connection.alertingquot; state=quot;initquot;>
<accept/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;initquot;>
<assign name=quot;statequot; expr=quot;'calling'quot;/>
<transition dest=quot;'tel:+18312392883'quot;/>
<createcall event=quot;connection.connectedquot; state=quot;callingquot;>
<assign name=quot;incomingcallquot; expr=quot;event$.connectionidquot;/>
<assign name=quot;statequot; expr=quot;'connected'quot;/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;callingquot;>
<join id1=quot;event$.connectionidquot; id2=quot;incomingcallquot;/>
<assign name=quot;statequot; expr=quot;'connected'quot;/> id2=quot;incomingcallquot;/>
<join
id1=quot;event$.connectionidquot;
<var name=quot;statusquot; expr=quot;'RJ is on the phone'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is on the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
<send target=quot;tURLquot; namelist=quot;statusquot;/> name=quot;'update'quot;
targettype=quot;'basichttp'quot;
</transition>
target=quot;tURLquot; namelist=quot;statusquot;/>
<transition event=quot;connection.failedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
</transition>
<var name=quot;statusquot; expr=quot;'RJ is not answering his phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.disconnectedquot; state=quot;connectedquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is off the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;send.successfulquot; state=quot;donequot;>
<exit/>
</transition>
</eventprocessor>
</ccxml>
46 © Voxeo Corporation
47. Follow Me/Find Me + Twitter
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<ccxml xmlns=quot;http://www.w3.org/2002/09/ccxmlquot; version=quot;1.0quot;>
<var name=quot;statequot; expr=quot;'init'quot;/>
<var name=quot;incomingcallquot;/>
<var name=quot;tURLquot;
expr=quot;'http://zscgeek:password@twitter.com/statuses/update.xml'quot;/>
<eventprocessor statevariable=quot;statequot;>
<transition event=quot;connection.alertingquot; state=quot;initquot;>
<accept/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;initquot;>
<assign name=quot;statequot; expr=quot;'calling'quot;/>
<assign name=quot;incomingcallquot; expr=quot;event$.connectionidquot;/>
<createcall dest=quot;'tel:+18312392883'quot;/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'connected'quot;/>
<join id1=quot;event$.connectionidquot; id2=quot;incomingcallquot;/>
<var name=quot;statusquot; expr=quot;'RJ is on the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.failedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is not answering his phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.disconnectedquot; state=quot;connectedquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is off the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;send.successfulquot; state=quot;donequot;>
<exit/>
</transition>
</eventprocessor>
</ccxml>
47 © Voxeo Corporation
48. Follow Me/Find Me + Twitter
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<ccxml xmlns=quot;http://www.w3.org/2002/09/ccxmlquot; version=quot;1.0quot;>
<var name=quot;statequot; expr=quot;'init'quot;/>
<var name=quot;incomingcallquot;/>
<var name=quot;tURLquot;
expr=quot;'http://zscgeek:password@twitter.com/statuses/update.xml'quot;/>
<eventprocessor statevariable=quot;statequot;>
<transition event=quot;connection.alertingquot; state=quot;initquot;>
<accept/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;initquot;>
<assign name=quot;statequot; expr=quot;'calling'quot;/>
<assign name=quot;incomingcallquot; expr=quot;event$.connectionidquot;/>
<createcall dest=quot;'tel:+18312392883'quot;/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'connected'quot;/>
<transition event=quot;connection.failedquot; state=quot;callingquot;>
<join id1=quot;event$.connectionidquot; id2=quot;incomingcallquot;/>
<var name=quot;statusquot; expr=quot;'RJ is on the phone'quot;/>
<assigntargettype=quot;'basichttp'quot; name=quot;'update'quot;
<send name=quot;statequot; expr=quot;'done'quot;/>
target=quot;tURLquot; namelist=quot;statusquot;/>
<var name=quot;statusquot; expr=quot;'RJ is not answering his phone'quot;/>
</transition>
<transition event=quot;connection.failedquot; state=quot;callingquot;>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is not answering his phone'quot;/>
<sendtarget=quot;tURLquot; namelist=quot;statusquot;/>
targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
</transition>
<transition event=quot;connection.disconnectedquot; state=quot;connectedquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is off the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;send.successfulquot; state=quot;donequot;>
<exit/>
</transition>
</eventprocessor>
</ccxml>
48 © Voxeo Corporation
49. Follow Me/Find Me + Twitter
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<ccxml xmlns=quot;http://www.w3.org/2002/09/ccxmlquot; version=quot;1.0quot;>
<var name=quot;statequot; expr=quot;'init'quot;/>
<var name=quot;incomingcallquot;/>
<var name=quot;tURLquot;
expr=quot;'http://zscgeek:password@twitter.com/statuses/update.xml'quot;/>
<eventprocessor statevariable=quot;statequot;>
<transition event=quot;connection.alertingquot; state=quot;initquot;>
<accept/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;initquot;>
<assign name=quot;statequot; expr=quot;'calling'quot;/>
<assign name=quot;incomingcallquot; expr=quot;event$.connectionidquot;/>
<createcall dest=quot;'tel:+18312392883'quot;/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'connected'quot;/>
<join id1=quot;event$.connectionidquot; id2=quot;incomingcallquot;/>
<var name=quot;statusquot; expr=quot;'RJ is on the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.failedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is not answering his phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.disconnectedquot; state=quot;connectedquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is off the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;send.successfulquot; state=quot;donequot;>
<exit/>
</transition>
</eventprocessor>
</ccxml>
49 © Voxeo Corporation
50. Follow Me/Find Me + Twitter
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<ccxml xmlns=quot;http://www.w3.org/2002/09/ccxmlquot; version=quot;1.0quot;>
<var name=quot;statequot; expr=quot;'init'quot;/>
<var name=quot;incomingcallquot;/>
<var name=quot;tURLquot;
expr=quot;'http://zscgeek:password@twitter.com/statuses/update.xml'quot;/>
<eventprocessor statevariable=quot;statequot;>
<transition event=quot;connection.alertingquot; state=quot;initquot;>
<accept/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;initquot;>
<assign name=quot;statequot; expr=quot;'calling'quot;/>
<assign name=quot;incomingcallquot; expr=quot;event$.connectionidquot;/>
<createcall dest=quot;'tel:+18312392883'quot;/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;callingquot;>
<transition name=quot;statequot; expr=quot;'connected'quot;/>
<assign
<join id1=quot;event$.connectionidquot; id2=quot;incomingcallquot;/> state=quot;connectedquot;>
event=quot;connection.disconnectedquot;
<assignname=quot;statusquot; expr=quot;'RJ isname=quot;'update'quot;
<var on the phone'quot;/>
name=quot;statequot; expr=quot;'done'quot;/>
<send targettype=quot;'basichttp'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
<var name=quot;statusquot; expr=quot;'RJ is off the phone'quot;/>
</transition>
<transition event=quot;connection.failedquot; state=quot;callingquot;>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is not answering his phone'quot;/>
target=quot;tURLquot; namelist=quot;statusquot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
</transition>target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.disconnectedquot; state=quot;connectedquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is off the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;send.successfulquot; state=quot;donequot;>
<exit/>
</transition>
</eventprocessor>
</ccxml>
50 © Voxeo Corporation
51. Follow Me/Find Me + Twitter
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<ccxml xmlns=quot;http://www.w3.org/2002/09/ccxmlquot; version=quot;1.0quot;>
<var name=quot;statequot; expr=quot;'init'quot;/>
<var name=quot;incomingcallquot;/>
<var name=quot;tURLquot;
expr=quot;'http://zscgeek:password@twitter.com/statuses/update.xml'quot;/>
<eventprocessor statevariable=quot;statequot;>
<transition event=quot;connection.alertingquot; state=quot;initquot;>
<accept/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;initquot;>
<assign name=quot;statequot; expr=quot;'calling'quot;/>
<assign name=quot;incomingcallquot; expr=quot;event$.connectionidquot;/>
<createcall dest=quot;'tel:+18312392883'quot;/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'connected'quot;/>
<join id1=quot;event$.connectionidquot; id2=quot;incomingcallquot;/>
<var name=quot;statusquot; expr=quot;'RJ is on the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.failedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is not answering his phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.disconnectedquot; state=quot;connectedquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is off the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;send.successfulquot; state=quot;donequot;>
<exit/>
</transition>
</eventprocessor>
</ccxml>
51 © Voxeo Corporation
52. Follow Me/Find Me + Twitter
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<ccxml xmlns=quot;http://www.w3.org/2002/09/ccxmlquot; version=quot;1.0quot;>
<var name=quot;statequot; expr=quot;'init'quot;/>
<var name=quot;incomingcallquot;/>
<var name=quot;tURLquot;
expr=quot;'http://zscgeek:password@twitter.com/statuses/update.xml'quot;/>
<eventprocessor statevariable=quot;statequot;>
<transition event=quot;connection.alertingquot; state=quot;initquot;>
<accept/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;initquot;>
<assign name=quot;statequot; expr=quot;'calling'quot;/>
<assign name=quot;incomingcallquot; expr=quot;event$.connectionidquot;/>
<createcall dest=quot;'tel:+18312392883'quot;/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'connected'quot;/>
<join id1=quot;event$.connectionidquot; id2=quot;incomingcallquot;/>
<var name=quot;statusquot; expr=quot;'RJ is on the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
<transition event=quot;send.successfulquot; state=quot;donequot;>
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<exit/>
<transition event=quot;connection.failedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
</transition>
<var name=quot;statusquot; expr=quot;'RJ is not answering his phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.disconnectedquot; state=quot;connectedquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is off the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;send.successfulquot; state=quot;donequot;>
<exit/>
</transition>
</eventprocessor>
</ccxml>
52 © Voxeo Corporation
53. Follow Me/Find Me + Twitter
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<ccxml xmlns=quot;http://www.w3.org/2002/09/ccxmlquot; version=quot;1.0quot;>
<var name=quot;statequot; expr=quot;'init'quot;/>
<var name=quot;incomingcallquot;/>
<var name=quot;tURLquot;
expr=quot;'http://zscgeek:password@twitter.com/statuses/update.xml'quot;/>
<eventprocessor statevariable=quot;statequot;>
<transition event=quot;connection.alertingquot; state=quot;initquot;>
<accept/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;initquot;>
<assign name=quot;statequot; expr=quot;'calling'quot;/>
<assign name=quot;incomingcallquot; expr=quot;event$.connectionidquot;/>
<createcall dest=quot;'tel:+18312392883'quot;/>
</transition>
<transition event=quot;connection.connectedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'connected'quot;/>
<join id1=quot;event$.connectionidquot; id2=quot;incomingcallquot;/>
<var name=quot;statusquot; expr=quot;'RJ is on the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.failedquot; state=quot;callingquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is not answering his phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;connection.disconnectedquot; state=quot;connectedquot;>
<assign name=quot;statequot; expr=quot;'done'quot;/>
<var name=quot;statusquot; expr=quot;'RJ is off the phone'quot;/>
<send targettype=quot;'basichttp'quot; name=quot;'update'quot;
target=quot;tURLquot; namelist=quot;statusquot;/>
</transition>
<transition event=quot;send.successfulquot; state=quot;donequot;>
<exit/>
</transition>
</eventprocessor>
</ccxml>
53 © Voxeo Corporation
55. Follow Me/Find Me + Twitter
package com.voxeo.rj.fmdemo;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.sip.*;
import net.unto.twitter.Api;
import net.unto.twitter.TwitterException;
public class FMServlet extends SipServlet {
Api twitter_api;
List<URI> targets;
public void init() throws ServletException {
twitter_api = new Api(quot;zscgeekquot;, quot;passwordquot;);
SipFactory sipFactory = (SipFactory)getServletContext().getAttribute(SIP_FACTORY);
targets = new ArrayList<URI>();
targets.add(sipFactory.createURI(quot;sip:rj@voxeo.comquot;));
targets.add(sipFactory.createURI(quot;sip:rj@rjauburn.comquot;));
targets.add(sipFactory.createURI(quot;sip:8312392883@provider.comquot;));
}
protected void doInvite(SipServletRequest req) throws ServletException, IOException {
if (req.isInitial()) {
Proxy proxy = req.getProxy();
proxy.setRecordRoute(true);
proxy.setParallel(true);
proxy.proxyTo(targets);
}
}
protected void doSuccessResponse(SipServletResponse resp) throws IOException {
if (resp.getMethod().equalsIgnoreCase(quot;invitequot;))
{
try {
twitter_api.updateStatus(quot;RJ is taking a phone call from quot;
+ resp.getRequest().getRequestURI());
} catch (TwitterException e) {log(quot;failed to update twitterquot;,e);}
}
}
}
55 © Voxeo Corporation
56. Follow Me/Find Me + Twitter
package com.voxeo.rj.fmdemo;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.sip.*;
import net.unto.twitter.Api;
import net.unto.twitter.TwitterException;
public class FMServlet extends SipServlet {
Api twitter_api;
List<URI> targets;
public void init() throws ServletException {
twitter_api = new Api(quot;zscgeekquot;, quot;passwordquot;);
SipFactory sipFactory = (SipFactory)getServletContext().getAttribute(SIP_FACTORY);
targets = new ArrayList<URI>();
targets.add(sipFactory.createURI(quot;sip:rj@voxeo.comquot;));
targets.add(sipFactory.createURI(quot;sip:rj@rjauburn.comquot;));
targets.add(sipFactory.createURI(quot;sip:8312392883@provider.comquot;));
}
protected void doInvite(SipServletRequest req) throws ServletException, IOException {
if (req.isInitial()) {
Proxy proxy = req.getProxy();
proxy.setRecordRoute(true);
proxy.setParallel(true);
proxy.proxyTo(targets);
}
}
protected void doSuccessResponse(SipServletResponse resp) throws IOException {
if (resp.getMethod().equalsIgnoreCase(quot;invitequot;))
{
try {
twitter_api.updateStatus(quot;RJ is taking a phone call from quot;
+ resp.getRequest().getRequestURI());
} catch (TwitterException e) {log(quot;failed to update twitterquot;,e);}
}
}
}
56 © Voxeo Corporation
57. Follow Me/Find Me + Twitter
package com.voxeo.rj.fmdemo;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.sip.*;
import net.unto.twitter.Api;
import net.unto.twitter.TwitterException;
public class FMServlet extends SipServlet {
Api twitter_api; com.voxeo.rj.fmdemo;
package
List<URI> targets;
public void init() throws ServletException {
import java.io.IOException;
twitter_api = new Api(quot;zscgeekquot;, quot;passwordquot;);
SipFactory sipFactory = (SipFactory)getServletContext().getAttribute(SIP_FACTORY);
import java.util.ArrayList;
targets = new ArrayList<URI>();
targets.add(sipFactory.createURI(quot;sip:rj@voxeo.comquot;));
import java.util.List;
targets.add(sipFactory.createURI(quot;sip:rj@rjauburn.comquot;));
targets.add(sipFactory.createURI(quot;sip:8312392883@provider.comquot;));
} import javax.servlet.ServletException;
import javax.servlet.sip.*;
protected void doInvite(SipServletRequest req) throws ServletException, IOException {
if import net.unto.twitter.Api;
(req.isInitial()) {
Proxy proxy = req.getProxy();
import net.unto.twitter.TwitterException;
proxy.setRecordRoute(true);
proxy.setParallel(true);
proxy.proxyTo(targets);
}
}
protected void doSuccessResponse(SipServletResponse resp) throws IOException {
if (resp.getMethod().equalsIgnoreCase(quot;invitequot;))
{
try {
twitter_api.updateStatus(quot;RJ is taking a phone call from quot;
+ resp.getRequest().getRequestURI());
} catch (TwitterException e) {log(quot;failed to update twitterquot;,e);}
}
}
}
57 © Voxeo Corporation
58. Follow Me/Find Me + Twitter
package com.voxeo.rj.fmdemo;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.sip.*;
import net.unto.twitter.Api;
import net.unto.twitter.TwitterException;
public class FMServlet extends SipServlet {
Api twitter_api;
List<URI> targets;
public void init() throws ServletException {
twitter_api = new Api(quot;zscgeekquot;, quot;passwordquot;);
SipFactory sipFactory = (SipFactory)getServletContext().getAttribute(SIP_FACTORY);
targets = new ArrayList<URI>();
targets.add(sipFactory.createURI(quot;sip:rj@voxeo.comquot;));
targets.add(sipFactory.createURI(quot;sip:rj@rjauburn.comquot;));
targets.add(sipFactory.createURI(quot;sip:8312392883@provider.comquot;));
}
protected void doInvite(SipServletRequest req) throws ServletException, IOException {
if (req.isInitial()) {
Proxy proxy = req.getProxy();
proxy.setRecordRoute(true);
proxy.setParallel(true);
proxy.proxyTo(targets);
}
}
protected void doSuccessResponse(SipServletResponse resp) throws IOException {
if (resp.getMethod().equalsIgnoreCase(quot;invitequot;))
{
try {
twitter_api.updateStatus(quot;RJ is taking a phone call from quot;
+ resp.getRequest().getRequestURI());
} catch (TwitterException e) {log(quot;failed to update twitterquot;,e);}
}
}
}
58 © Voxeo Corporation
59. Follow Me/Find Me + Twitter
package com.voxeo.rj.fmdemo;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.sip.*;
import net.unto.twitter.Api;
import net.unto.twitter.TwitterException;
public class FMServlet extends SipServlet {
public class FMServlet extends SipServlet
Api twitter_api;
List<URI> targets; {
public void init() ServletException {
public void init() throws
throws ServletException {
twitter_api = new Api(quot;zscgeekquot;, quot;passwordquot;);
SipFactory sipFactory = (SipFactory)getServletContext().getAttribute(SIP_FACTORY);
} targets = new ArrayList<URI>();
targets.add(sipFactory.createURI(quot;sip:rj@voxeo.comquot;));
targets.add(sipFactory.createURI(quot;sip:rj@rjauburn.comquot;));
targets.add(sipFactory.createURI(quot;sip:8312392883@provider.comquot;));
protected void doInvite(SipServletRequest req)
}
throws ServletException, IOException {
protected void doInvite(SipServletRequest req) throws ServletException, IOException {
if (req.isInitial()) {
} Proxy proxy = req.getProxy();
proxy.setRecordRoute(true);
proxy.setParallel(true);
proxy.proxyTo(targets);
protected void doSuccessResponse(SipServletResponse resp)
}
}
throws IOException {
} if (resp.getMethod().equalsIgnoreCase(quot;invitequot;))resp) throws IOException {
protected void doSuccessResponse(SipServletResponse
{
} try {
twitter_api.updateStatus(quot;RJ is taking a phone call from quot;
+ resp.getRequest().getRequestURI());
} catch (TwitterException e) {log(quot;failed to update twitterquot;,e);}
}
}
}
59 © Voxeo Corporation
60. Follow Me/Find Me + Twitter
package com.voxeo.rj.fmdemo;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.sip.*;
import net.unto.twitter.Api;
import net.unto.twitter.TwitterException;
public class FMServlet extends SipServlet {
Api twitter_api;
List<URI> targets;
public void init() throws ServletException {
twitter_api = new Api(quot;zscgeekquot;, quot;passwordquot;);
SipFactory sipFactory = (SipFactory)getServletContext().getAttribute(SIP_FACTORY);
targets = new ArrayList<URI>();
targets.add(sipFactory.createURI(quot;sip:rj@voxeo.comquot;));
targets.add(sipFactory.createURI(quot;sip:rj@rjauburn.comquot;));
targets.add(sipFactory.createURI(quot;sip:8312392883@provider.comquot;));
}
protected void doInvite(SipServletRequest req) throws ServletException, IOException {
if (req.isInitial()) {
Proxy proxy = req.getProxy();
proxy.setRecordRoute(true);
proxy.setParallel(true);
proxy.proxyTo(targets);
}
}
protected void doSuccessResponse(SipServletResponse resp) throws IOException {
if (resp.getMethod().equalsIgnoreCase(quot;invitequot;))
{
try {
twitter_api.updateStatus(quot;RJ is taking a phone call from quot;
+ resp.getRequest().getRequestURI());
} catch (TwitterException e) {log(quot;failed to update twitterquot;,e);}
}
}
}
60 © Voxeo Corporation
61. Follow Me/Find Me + Twitter
package com.voxeo.rj.fmdemo;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.sip.*;
import net.unto.twitter.Api;
import net.unto.twitter.TwitterException;
public class FMServlet extends SipServlet {
Api twitter_api;
Api twitter_api;
List<URI> targets;
List<URI> void init() throws
public targets; ServletException {
twitter_api = new Api(quot;zscgeekquot;, quot;passwordquot;);
SipFactory sipFactory = (SipFactory)getServletContext().getAttribute(SIP_FACTORY);
public void init() throws ServletException {
targets = new ArrayList<URI>();
targets.add(sipFactory.createURI(quot;sip:rj@voxeo.comquot;));
twitter_api = new Api(quot;zscgeekquot;, quot;passwordquot;);
targets.add(sipFactory.createURI(quot;sip:rj@rjauburn.comquot;));
targets.add(sipFactory.createURI(quot;sip:8312392883@provider.comquot;));
SipFactory sipFactory =
}
(SipFactory)getServletContext().getAttribute(SIP_FACTORY);
protected void doInvite(SipServletRequest req) throws ServletException, IOException {
if (req.isInitial()) {
targets = Proxy proxy = req.getProxy();
new ArrayList<URI>();
proxy.setRecordRoute(true);
targets.add(sipFactory.createURI(quot;sip:rj@voxeo.comquot;));
proxy.setParallel(true);
proxy.proxyTo(targets);
targets.add(sipFactory.createURI(quot;sip:rj@rjauburn.comquot;));
}
}
targets.add(sipFactory.createURI(quot;sip:8312392883@provider.comquot;));
protected void doSuccessResponse(SipServletResponse resp) throws IOException {
} if (resp.getMethod().equalsIgnoreCase(quot;invitequot;))
{
try {
twitter_api.updateStatus(quot;RJ is taking a phone call from quot;
+ resp.getRequest().getRequestURI());
} catch (TwitterException e) {log(quot;failed to update twitterquot;,e);}
}
}
}
61 © Voxeo Corporation
62. Follow Me/Find Me + Twitter
package com.voxeo.rj.fmdemo;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.sip.*;
import net.unto.twitter.Api;
import net.unto.twitter.TwitterException;
public class FMServlet extends SipServlet {
Api twitter_api;
List<URI> targets;
public void init() throws ServletException {
twitter_api = new Api(quot;zscgeekquot;, quot;passwordquot;);
SipFactory sipFactory = (SipFactory)getServletContext().getAttribute(SIP_FACTORY);
targets = new ArrayList<URI>();
targets.add(sipFactory.createURI(quot;sip:rj@voxeo.comquot;));
targets.add(sipFactory.createURI(quot;sip:rj@rjauburn.comquot;));
targets.add(sipFactory.createURI(quot;sip:8312392883@provider.comquot;));
}
protected void doInvite(SipServletRequest req) throws ServletException, IOException {
if (req.isInitial()) {
Proxy proxy = req.getProxy();
proxy.setRecordRoute(true);
proxy.setParallel(true);
proxy.proxyTo(targets);
}
}
protected void doSuccessResponse(SipServletResponse resp) throws IOException {
if (resp.getMethod().equalsIgnoreCase(quot;invitequot;))
{
try {
twitter_api.updateStatus(quot;RJ is taking a phone call from quot;
+ resp.getRequest().getRequestURI());
} catch (TwitterException e) {log(quot;failed to update twitterquot;,e);}
}
}
}
62 © Voxeo Corporation
63. Follow Me/Find Me + Twitter
package com.voxeo.rj.fmdemo;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.sip.*;
import net.unto.twitter.Api;
import net.unto.twitter.TwitterException;
public class FMServlet extends SipServlet {
Api protected void doInvite(SipServletRequest
twitter_api; req) throws
List<URI> targets;
public void init() throws ServletException { {
ServletException, IOException
if (req.isInitial()) {
twitter_api = new Api(quot;zscgeekquot;, quot;passwordquot;);
SipFactory sipFactory = (SipFactory)getServletContext().getAttribute(SIP_FACTORY);
Proxy proxy = req.getProxy();
targets = new ArrayList<URI>();
targets.add(sipFactory.createURI(quot;sip:rj@voxeo.comquot;));
proxy.setRecordRoute(true);
targets.add(sipFactory.createURI(quot;sip:rj@rjauburn.comquot;));
targets.add(sipFactory.createURI(quot;sip:8312392883@provider.comquot;));
} proxy.setParallel(true);
protected void proxy.proxyTo(targets);throws ServletException, IOException {
doInvite(SipServletRequest req)
if (req.isInitial()) {
}
Proxy proxy = req.getProxy();
proxy.setRecordRoute(true);
} proxy.setParallel(true);
proxy.proxyTo(targets);
}
}
protected void doSuccessResponse(SipServletResponse resp) throws IOException {
if (resp.getMethod().equalsIgnoreCase(quot;invitequot;))
{
try {
twitter_api.updateStatus(quot;RJ is taking a phone call from quot;
+ resp.getRequest().getRequestURI());
} catch (TwitterException e) {log(quot;failed to update twitterquot;,e);}
}
}
}
63 © Voxeo Corporation
64. Follow Me/Find Me + Twitter
package com.voxeo.rj.fmdemo;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.sip.*;
import net.unto.twitter.Api;
import net.unto.twitter.TwitterException;
public class FMServlet extends SipServlet {
Api twitter_api;
List<URI> targets;
public void init() throws ServletException {
twitter_api = new Api(quot;zscgeekquot;, quot;passwordquot;);
SipFactory sipFactory = (SipFactory)getServletContext().getAttribute(SIP_FACTORY);
targets = new ArrayList<URI>();
targets.add(sipFactory.createURI(quot;sip:rj@voxeo.comquot;));
targets.add(sipFactory.createURI(quot;sip:rj@rjauburn.comquot;));
targets.add(sipFactory.createURI(quot;sip:8312392883@provider.comquot;));
}
protected void doInvite(SipServletRequest req) throws ServletException, IOException {
if (req.isInitial()) {
Proxy proxy = req.getProxy();
proxy.setRecordRoute(true);
proxy.setParallel(true);
proxy.proxyTo(targets);
}
}
protected void doSuccessResponse(SipServletResponse resp) throws IOException {
if (resp.getMethod().equalsIgnoreCase(quot;invitequot;))
{
try {
twitter_api.updateStatus(quot;RJ is taking a phone call from quot;
+ resp.getRequest().getRequestURI());
} catch (TwitterException e) {log(quot;failed to update twitterquot;,e);}
}
}
}
64 © Voxeo Corporation
65. Follow Me/Find Me + Twitter
package com.voxeo.rj.fmdemo;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.sip.*;
import net.unto.twitter.Api;
import net.unto.twitter.TwitterException;
public class FMServlet extends SipServlet {
protected void doSuccessResponse(SipServletResponse
Api twitter_api;
List<URI> targets; resp)
throws IOException {
public void init() throws ServletException {
if (resp.getMethod().equalsIgnoreCase(quot;invitequot;))
twitter_api = new Api(quot;zscgeekquot;, quot;passwordquot;);
SipFactory sipFactory = (SipFactory)getServletContext().getAttribute(SIP_FACTORY);
{ targets = new ArrayList<URI>();
targets.add(sipFactory.createURI(quot;sip:rj@voxeo.comquot;));
trytargets.add(sipFactory.createURI(quot;sip:rj@rjauburn.comquot;));
{
targets.add(sipFactory.createURI(quot;sip:8312392883@provider.comquot;));
} twitter_api.updateStatus(quot;RJ is taking a phone call from quot;
+ resp.getRequest().getRequestURI());
protected void doInvite(SipServletRequest req) throws ServletException, IOException {
if (req.isInitial()) {
} catch(TwitterException e){log(quot;failed to update twitterquot;,e);}
Proxy proxy = req.getProxy();
proxy.setRecordRoute(true);
} proxy.setParallel(true);
proxy.proxyTo(targets);
} }
}
protected void doSuccessResponse(SipServletResponse resp) throws IOException {
if (resp.getMethod().equalsIgnoreCase(quot;invitequot;))
{
try {
twitter_api.updateStatus(quot;RJ is taking a phone call from quot;
+ resp.getRequest().getRequestURI());
} catch (TwitterException e) {log(quot;failed to update twitterquot;,e);}
}
}
}
65 © Voxeo Corporation
66. Follow Me/Find Me + Twitter
package com.voxeo.rj.fmdemo;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.sip.*;
import net.unto.twitter.Api;
import net.unto.twitter.TwitterException;
public class FMServlet extends SipServlet {
Api twitter_api;
List<URI> targets;
public void init() throws ServletException {
twitter_api = new Api(quot;zscgeekquot;, quot;passwordquot;);
SipFactory sipFactory = (SipFactory)getServletContext().getAttribute(SIP_FACTORY);
targets = new ArrayList<URI>();
targets.add(sipFactory.createURI(quot;sip:rj@voxeo.comquot;));
targets.add(sipFactory.createURI(quot;sip:rj@rjauburn.comquot;));
targets.add(sipFactory.createURI(quot;sip:8312392883@provider.comquot;));
}
protected void doInvite(SipServletRequest req) throws ServletException, IOException {
if (req.isInitial()) {
Proxy proxy = req.getProxy();
proxy.setRecordRoute(true);
proxy.setParallel(true);
proxy.proxyTo(targets);
}
}
protected void doSuccessResponse(SipServletResponse resp) throws IOException {
if (resp.getMethod().equalsIgnoreCase(quot;invitequot;))
{
try {
twitter_api.updateStatus(quot;RJ is taking a phone call from quot;
+ resp.getRequest().getRequestURI());
} catch (TwitterException e) {log(quot;failed to update twitterquot;,e);}
}
}
}
66 © Voxeo Corporation
67. So why is this important?
© Voxeo Corporation
73. Project Green Phone
- By Mark Headd
- http://www.voiceingov.org/blog/?p=135
- VoiceXML, JavaScript, CCXML, PHP
- Application:
- Caller dials in to app
- App uses ANI/Caller ID and makes web service
query to a database to determine location
- Makes another web service query to find location of
nearest E85/Biodiesel stations
- Relays information to caller
- Sends caller a SMS text msg with info
© Voxeo Corporation
74. Rocketsource.org
- www.rocketsource.org
- Vox-Attendant
- A VoiceXML-based, speech-driven auto attendant that can connect callers
with any person or group with an enterprise, via their desk, cellular, or
VoIP phones.
- Vox-Mail
- A VoiceXML-based, speech-driven voicemail application that can store
messages locally or integrate with any IMAP email server to provide basic
unified messaging.
- Voice Conference Manager
- A VoiceXML and CCXML-based, speech-driven conference manager that
features both phone and web-based conference call creation, access, and
management.
- VoiceXML, CCXML, grXML, JavaScript, Java, and Python
© Voxeo Corporation
76. Look at the big picture
© Voxeo Corporation http://flickr.com/photos/txd/100437832
81. RJ Auburn
rj@voxeo.com
http://www.voxeo.com/prophecy
http://evolution.voxeo.com
© Voxeo Corporation