Programmable End System Services Using SIP Xiaotao Wu, Henning Schulzrinne 2nd New York Metro Area Networking Workshop September 3rd, 2002 Agenda Brief introduction to SIP SIP endpoints can perform service functions Network service creation techniques are not good for end system services Endpoint Service Markup Language (ESML) Comparison between ESML and the other XML based solutions for service creation Future work SIP is …, SIP is not … SIP = core protocol for establishing sessions in the Internet (peer-to-peer) Transports session description information from initiator (caller) to callee Allows change of parameters in mid-session Terminate session NOT for distribution of multimedia data NOT suitable for media gateway control Basic call setup Phone sends INVITE; acts as UAC INVITE sip:alice@m2.home.com … To: sip:alice@home.com From: “Bob” <sip:bob@office.com> … c=IN IP4 135.180.144.33 m=audio 8000 RTP/AVP 0 5 8 office.com alice bob m2.home.com Basic call setup Phone sends INVITE; acts as UAC Alice’s phone rings; acts as a UAS User agent server SIP/2.0 180 Ringing office.com alice bob m2.home.com home.com Basic call setup Phone sends INVITE; acts as UAC Alice’s phone rings; acts as a UAS When Alice picks up, call is accepted and bob’s phone sends ACK to complete the setup office.com alice m2.home.com bob SIP/2.0 200 OK … c=IN IP4 135.180.144.32 m=audio 9000 RTP/AVP 0 8 home.com Basic call setup Encoded audio packets sent over RTP office.com alice bob home.com Basic call setup Encoded audio packets sent over RTP When either party hangs up BYE is sent BYE sip:bob@office.com office.com alice bob home.com SIP beyond audio call Presence extensions Instant messaging SUBSCRIBE to request notifications NOTIFY when event occurs MESSAGE with text body Device control Today’s Endpoints Processing ability Graphical rendering Storage capacity Converged information SIP endpoints are more than IPbased POTS phones SIP promotes end system services Two SIP UAs can talk to each other directly. Service-related information is explicitly contained in SIP headers. Contact: sip:1.2.3.4;mobility="fixed";q=0.8 The simplicity of SIP makes it easier for end system to perform services. SIP CGI Priority.pl SIP_FROM SIP_TO stdin CGI-PROXY-REQUEST stdout Programming language independent Maintains state via an opaque token For SIP proxies and endpoints: call routing controlling forking call rejection call modification (Priority, Call-Info) RFC 3050 SIP CGI contd. Block *@anonymous.com: if (defined $ENV{SIP_FROM} && $ENV{SIP_FROM} =~ "sip:*@anonymous.com") { print "SIP/2.0 600 I can't talk right now\n\n"; } Make calls from boss as urgent: if (defined $ENV{SIP_FROM} && $ENV{SIP_FROM} =~ /sip:boss@mycompany.com/) { foreach $reg (get_regs()) { print "CGI-PROXY-REQUEST $reg SIP/2.0\n"; print "Priority: urgent\n\n"; } } CPL XML-based; interpreted Control address, language, time, priority Action incoming and outgoing events Switch Restricted to branching and subroutines no variables, no loops structured tree describing actions performed on call setup event Event Call Proxy, redirect, reject (busy) Graphical tools not match match actions Protocol-independent SIP, H.323 Extensions CPL for presence Logging Email CPL contd. <?xml version="1.0" ?> <!DOCTYPE cpl PUBLIC "-//IETF//DTD RFC2824 CPL 1.0//EN" "cpl.dtd"> <cpl> <incoming> <time-switch> <time dtstart="20020830T140000Z" dtend="20020830T150000Z"> <reject status="reject" reason=“Busy" /> </time> </time-switch> </incoming> </cpl> SIP servlet Java-based Runs in SIP server Receives SIP objects and processes them public class RejectServlet extends SipServletAdapter { public boolean doInvite(SipRequest req) { SipResponse res = req.createResponse(); res.setStatus(603); res.send(); return true; } } Services in sipc Hardcoded services SIP CGI engine CPL engine ESML engine Service module Service Moderator SIP stack SIP messages Need a language for end system service creation CPL SIP CGI Cannot originate a call Cannot be activated through non-call events An interface, not a language Can do nearly anything Existing techniques for network services are not appropriate for end system service creation Existing techniques for Network Services are not sufficient for End System Services Call Call Connection Connection Address1 Address2 a. Network service call model Address app1 app2 app3 b. End system service call model Existing techniques for Network Services are not sufficient for End System Services Network services Developer Experienced developers Media and other Indirect end system control applications User interaction Indirect End system services Nonprogrammers Direct control Direct Requirement for an end system service language Simple and easy to understand by nonprogrammers Platform neutral Express user interactions Control media and other end system applications Extensible to accommodate new services Restricted to certain class of services, not necessarily Turing-complete Endpoint Service Markup Language (ESML) XML based language Defined as an XML schema Platform and underlying programming language neutral Readable by non-programmers Derivation of new types Pre-defined types Tree-like structure Use packages to group events and actions ESML example <esml name="online_call" require="generic presence ui"> <notification status="online" priority="0.5"> <address-switch field="origin"> <address is="xyz@foo.com"> <call /> <alert sound=“foo.au" text="Calling xyz@foo.com" /> </address> </address-switch> </notification> </esml> ESML packages SIP user agent im email web Presence presence agent calendar conference SIP Basic user agent Generic Media UI x10 vcr Device agent Extend ‘generic’ to ‘sip’ <xs:schema targetNamespace="esml:sip" xmlns:sip="esml:sip" xmlns:generic="esml:generic" .......... <xs:complexType name="IncomingType"> <xs:complexContent> <xs:extension base="generic:IncomingType"> <xs:attribute name="priority" type="PriorityType"/> .......... </xs:extension> </xs:complexContent> </xs:complexType> ESML Service Creation ESML editor esml.xsl xsl:if service.esml (template) XSLT service.html address is=$var configuration editor translate.cgi service_foo.esml Compare to other languages CPL SCML Not able to initiate a call Not able to handle non-call events connection Developed by the JAIN forum address1 Closely tied to the JAIN Java Call Control (JCC) API. and defined using an XML Schema. Object model of JCC CCXML call connection address2 Defined in W3C, for voice browser call control, such as VoiceXML The states and events for CCXML is in a lower level abstraction than those for ESML and CPL. (like the events call.CALL_CONNECTED, call.CALL_ACTIVE, connection.CONNECTION_ALERTING) Future work Service partition between end system services and network services Feature interaction