Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Stepwise Approach to Developing Languages for SIP Telephony Service Creation Nicolas Palix*, Charles Consel*, Laurent Réveillère*, Julia Lawall * Phoenix.

Similar presentations


Presentation on theme: "A Stepwise Approach to Developing Languages for SIP Telephony Service Creation Nicolas Palix*, Charles Consel*, Laurent Réveillère*, Julia Lawall * Phoenix."— Presentation transcript:

1 A Stepwise Approach to Developing Languages for SIP Telephony Service Creation Nicolas Palix*, Charles Consel*, Laurent Réveillère*, Julia Lawall * Phoenix Group DIKU LaBRI – INRIA, FranceUniversity of Copenhagen, Denmark {palix, consel,

2 2 Introduction SIP telephony services Enriched telephony services Address book Calendar CRM Legacy technologies General-purpose languages –Large and complex low-level platform APIs –Error-prone Scripting languages –High-level –Dedicated to the telephony domain

3 3 Issues Legacy technologies Formal semantics unavailable Reference implementation may be unavailable Service developers Must study reference implementation Must not corrupt the underlying platform Platform developers Difficult to port a language to another run-time system Difficult to provide another implementation of a run-time system How to design and develop a scripting language dedicated to the development of robust telephony services?

4 4 Our Approach SPL SIP Virtual Machine SIP Platform Dsadsadfmsdfklsdmfolmfosfn Sdadadfdklsfjsdofmnsdklfjsdf Dadadadflsdfnsdk Sdasdddfksdnfmklsdjfnks Dsadsadeiwqodndiofgwjr9timnf Dsadsaderjfrtjwfnsddaodnqi Sdadadmfodsfmnrjewifjmnfjkldfn dadadajnfilsdfnw Sdasddd kfnsfnsifuwnfisdn Dsadsadfs,fpjwotijwogjsg Dsadsad,mfiopjfowifmnioune Sdadadspfmoiwerfmnrowimf Dadadapeork03qrjfm wopi ne;o Dsadsadfmsdfklsdmfolmfosfn Sdadadfdklsfjsdofmnsdklfjsdf Dadadadflsdfnsdk Sdasdddfksdnfmklsdjfnks Dsadsadeiwqodndiofgwjr9timnf Dsadsaderjfrtjwfnsddaodnqi Sdadadmfodsfmnrjewifjmnfjkldfn dadadajnfilsdfnw Sdasddd kfnsfnsifuwnfisdn Dsadsadfs,fpjwotijwogjsg Dsadsad,mfiopjfowifmnioune Sdadadspfmoiwerfmnrowimf Dadadapeork03qrjfm wopi ne;o Domain Specific Language Simple and expressive Reflects the SIP VM abstractions Formally defined Static semantics Dynamic semantics Domain Specific SIP Virtual Machine Raises the abstraction level Consists of a set of events and a state Focuses on sessions Static semantics Type checker Service analyses Dynamic semantics Defines SPL runtime behavior Eases implementation Verifies runtime properties

5 5 Dialog SIP Virtual Machine SIP Platform 1 st Step: A SIP Virtual Machine INVITE REINVITE INVITE Refines SIP messages in events Manages sessions BYE Internet SIP Messages Virtual Machine Events

6 6 Registration Service INVITE REINVITE Dialog SIP Virtual Machine SIP Platform 1 st Step: A SIP Virtual Machine INVITE Refines SIP messages in events Manages sessions Organizes sessions hierarchically Introduces SIP VM events Stores and restores service state BYE REGISTER Internet REGISTER unregister deploy undeploy

7 7 SPL response incoming INVITE() { […] response resp = forward; if (resp == /ERROR) { resp = forward } return resp; } SIP Virtual Machine SIP Platform 2 nd Step: The Session Processing Language INVITE BUSY INVITE secretary INVITE secretary OK Internet Multimedia connection OK

8 8 2 nd Step: The Session Processing Language service hotline {... processing { uri employees = <>; void deploy() {...} void undeploy() {...} registration {... response outgoing REGISTER() { uri employee = FROM; push employees employee; return forward; }... dialog {... response incoming INVITE() { return forward employees; }

9 9 dialog { response incoming INVITE() { response r;... if (...) {... return r branch hotline; } else {... return r branch personal; } void incoming ACK(){ branch hotline {... } branch default {... } } response BYE() { branch hotline {... } branch personal {... } branch default {... } } Advanced features: Inter-Event Control Flow INVITE INVITE request ACK request ACK BYE request BYE

10 10 3 rd Step: Formal Semantics Dynamic semantics Defines SPL runtime behavior Eases implementation Verifies runtime properties Static semantics How to verify properties which are critical for the telephony domain? Type-checking Service analyses e.g. forward use SPL SIP Virtual Machine SIP Platform Dsadsadfmsdfklsdmfolmfosfn Sdadadfdklsfjsdofmnsdklfjsdf Dadadadflsdfnsdk Sdasdddfksdnfmklsdjfnks Dsadsadeiwqodndiofgwjr9timnf Dsadsaderjfrtjwfnsddaodnqi Sdadadmfodsfmnrjewifjmnfjkldfn dadadajnfilsdfnw Sdasddd kfnsfnsifuwnfisdn Dsadsadfs,fpjwotijwogjsg Dsadsad,mfiopjfowifmnioune Sdadadspfmoiwerfmnrowimf Dadadapeork03qrjfm wopi ne;o Dsadsadfmsdfklsdmfolmfosfn Sdadadfdklsfjsdofmnsdklfjsdf Dadadadflsdfnsdk Sdasdddfksdnfmklsdjfnks Dsadsadeiwqodndiofgwjr9timnf Dsadsaderjfrtjwfnsddaodnqi Sdadadmfodsfmnrjewifjmnfjkldfn dadadajnfilsdfnw Sdasddd kfnsfnsifuwnfisdn Dsadsadfs,fpjwotijwogjsg Dsadsad,mfiopjfowifmnioune Sdadadspfmoiwerfmnrowimf Dadadapeork03qrjfm wopi ne;o

11 11 Static semantics: Type-Checking dialog { uri caller; time start; response incoming INVITE() { caller = FROM; return forward; } void incoming ACK(){ if(caller == log(Personal call); start = getTime(); } response BYE() { string duration = time_to_string(getTime() – start); log(Call: + duration + +uri_to_string(caller)); return forward; }

12 12 SPL Dsadsadfmsdfklsdmfolmfosfn Sdadadfdklsfjsdofmnsdklfjsdf Dadadadflsdfnsdk Sdasdddfksdnfmklsdjfnks Dsadsadeiwqodndiofgwjr9timnf Dsadsaderjfrtjwfnsddaodnqi Sdadadmfodsfmnrjewifjmnfjkldfn dadadajnfilsdfnw Sdasddd kfnsfnsifuwnfisdn Dsadsadfs,fpjwotijwogjsg Dsadsad,mfiopjfowifmnioune Sdadadspfmoiwerfmnrowimf Dadadapeork03qrjfm wopi ne;o Static semantics: Service Analyses Example of property to ensure: forward use When a positive response is received, no additional forwarding operation is allowed SIP Virtual Machine SIP Platform OK Internet OK forward

13 13 response incoming INVITE() { […] response r = forward; if (r == /ERROR) { r = forward return r; }else { return r; } response Some(incoming) INVITE { response r; r = fwd None; cond(r == /ERROR, r = fwd Some return r, return r) } Service Analyses - forward Use Example Abstract syntax Concrete syntax

14 14 forward Use Analysis for a Valid Service Interne t Call Environment Safe True (r, error)True (r, success)True (r, ) True (r, error)True (r, ) True (r, ) True (r, success)True response Some(incoming) INVITE { response r; r = fwd None; cond( r == /ERROR, r = fwd Some return r, return r ) } (r, ) True

15 15 response incoming INVITE() { […] response r = forward; if (r == /ERROR) { return r; } else { r = forward return r; } response incoming INVITE() { […] response r = forward; if (r == /ERROR) { r = forward return r; } else { return r; } Service Analyses - forward Use Example

16 16 forward Use Analysis for an Invalid Service response Some(incoming) INVITE { response r; r = fwd None; cond(r == /ERROR, return r, r = fwd Some return r ) } Interne t Call Environment Safe True (r, error)True (r, success)True (r, ) True (r, error)True (r, success)False (r, error)True (r, ) False (r, success)False

17 17 3 rd Step: Formal Semantics Dynamic semantics Defines SPL runtime behavior Eases implementation Verifies runtime properties Static semantics How to verify properties which are critical for the telephony domain? Type-checking Service analyses e.g. forward use SPL SIP Virtual Machine SIP Platform Dsadsadfmsdfklsdmfolmfosfn Sdadadfdklsfjsdofmnsdklfjsdf Dadadadflsdfnsdk Sdasdddfksdnfmklsdjfnks Dsadsadeiwqodndiofgwjr9timnf Dsadsaderjfrtjwfnsddaodnqi Sdadadmfodsfmnrjewifjmnfjkldfn dadadajnfilsdfnw Sdasddd kfnsfnsifuwnfisdn Dsadsadfs,fpjwotijwogjsg Dsadsad,mfiopjfowifmnioune Sdadadspfmoiwerfmnrowimf Dadadapeork03qrjfm wopi ne;o Dsadsadfmsdfklsdmfolmfosfn Sdadadfdklsfjsdofmnsdklfjsdf Dadadadflsdfnsdk Sdasdddfksdnfmklsdjfnks Dsadsadeiwqodndiofgwjr9timnf Dsadsaderjfrtjwfnsddaodnqi Sdadadmfodsfmnrjewifjmnfjkldfn dadadajnfilsdfnw Sdasddd kfnsfnsifuwnfisdn Dsadsadfs,fpjwotijwogjsg Dsadsad,mfiopjfowifmnioune Sdadadspfmoiwerfmnrowimf Dadadapeork03qrjfm wopi ne;o

18 18 let interpret message phi sigma service = match message with (I_INVITE(rid, did), direction, rqid) -> let address = [service;(Reg, rid);(Dial, did)] in let branch = lookup_branches(sigma, parent(address)) in let sigma' = create_session(phi, sigma, address, branch, Some(If.UNINVITE)) in let (m_par, decls, stmts, envs, sigma'') = prepare_handler(phi, sigma', address, direction, If.INVITE) in let tau = (sigma'', address) in let rho = (envs, (m_par, rqid), []) in spl_handler_body tau rho ([]::[[T_INITIAL_INVITE(phi)]]) (decls, stmts) A Direct Interpreter Implementation From The Dynamic Semantics

19 19 Dynamic Semantics About 100 semantic rules Documentation To understand program behavior To implement the SPL interpreter Language independent Straightforward implementation 1 week in OCaml 2 weeks in JAVA

20 20 Conclusion Stepwise approach Domain-Specific virtual machine Domain-Specific Language Formal semantics Benefits High-level language Robust and verifiable services Straightforward implementation The Session Processing Language A call queuing service in about 100 lines A SIP application server based on JAIN SIP API

21 21 Ongoing Work Other SPL properties Feature Interactions –Multiple users –Multiple services Inter-event control flow reachability Optimizations (Pantachou) Composition language for ubiquitous services Rely on SIP network

22 22 Thank You For Your Attention !

23 23 Perspective – Optimization Opportunities Stateless service response incoming INVITE() { return /ERROR/CLIENT/BUSY_HERE; } response incoming INVITE() { return forward; } response incoming INVITE() { return forward }

24 24 Perspective - Optimization Opportunities response incoming INVITE() { […] response resp = forward; if (resp == /ERROR) { resp = forward } return resp; } Stateless service Transaction stateful Call stateful dialog { response incoming INVITE() { response r;... if (...) {... return r branch hotline; } else {... return r branch personal; } void incoming ACK(){ branch hotline {... } branch default {... } } response BYE() { branch hotline {... } branch personal {... } branch default {... } } response incoming INVITE() { return /ERROR/CLIENT/BUSY_HERE; }

25 25 service example { processing { dialog { INVITE() response incoming INVITE() { response r = forward ' '; if (r == /ERROR/CLIENT/BUSY_HERE) return forward ' '; else if (r == /ERROR) { if (FROM == ' ') return forward ' tel: '; return r; } public class Example implements SipListener { [...] private AddressFactory factory = getAddressFactory(); public void processRequest (RequestEvent requestEvent) { Request rq_request = requestEvent.getRequest(); SipProvider rq_sipProvider = (SipProvider) requestEvent.getSource(); String method = rq_request.getMethod(); [...] if (method.equals (Request.INVITE)) { SipURI uri = factory.createSipURI ( bob ", phone.example.com "); rq_request.setRequestURI (uri); ClientTransaction ct = rq_sipProvider.getNewClientTransaction(rq); ct.sendRequest (rq_request);... } public void processResponse (ResponseEvent responseEvent) { ClientTransaction rs_ct = responseEvent.getClientTransaction(); if (rs_ct != null) { Request rs_request = rs_ct.getRequest(); Response rs_response = responseEvent.getResponse(); SipProvider rs_sipProvider = (SipProvider) responseEvent.getSource(); String method = rs_request.getMethod(); rs_responseCode = rs_response.getStatusCode(); if (method.equals (Request.INVITE)) { if (rs_responseCode == 486) { SipURI uri = factory.createSipURI ( bob ", voic .example.com "); rs_request.setRequestURI (uri); rs_sipProvider.sendRequest (rs_request); } else if (rs_responseCode >= 300) { if (rs_request.getHeader("FROM").equals( ")) { TelURL tel = factory.createTelURL ( tel: "); rs_request.setRequestURI (tel); rs_sipProvider.sendRequest (rs_request); } else { rs_sipProvider.sendResponse (rs_response); }... } SPL JAIN SIP


Download ppt "A Stepwise Approach to Developing Languages for SIP Telephony Service Creation Nicolas Palix*, Charles Consel*, Laurent Réveillère*, Julia Lawall * Phoenix."

Similar presentations


Ads by Google