ENSEIRB, FranceCall/CSeptember 29, 2003 Call/C: A Domain Specific Language for IP Telephony Services Claus Brabrand [ joint work with Charles Consel & Fabien Latry ] COMPOSE Group INRIA, University of Bordeaux I, France
ENSEIRB, FranceCall/CSeptember 29, 2003 Outline Introduction Infrastructure (SIP) Programming Telephony Services Call/C Examples Domain Specific Analysis Conclusion and Future Work
ENSEIRB, FranceCall/CSeptember 29, 2003 Outline Introduction Infrastructure (SIP) Programming Telephony Services Call/C Examples Domain Specific Analysis Conclusion and Future Work
ENSEIRB, FranceCall/CSeptember 29, 2003 Introduction Yesterday: "Call a place"
ENSEIRB, FranceCall/CSeptember 29, 2003 Introduction Today: "Call a phone"
ENSEIRB, FranceCall/CSeptember 29, 2003 Introduction Tomorrow: "Call a person"
ENSEIRB, FranceCall/CSeptember 29, 2003 Introduction Tomorrow: "Call a person"
ENSEIRB, FranceCall/CSeptember 29, 2003 Outline Introduction Infrastructure (SIP) Programming Telephony Services Call/C Examples Domain Specific Analysis Conclusion and Future Work
ENSEIRB, FranceCall/CSeptember 29, 2003 Outline Introduction Infrastructure (SIP) Programming Telephony Services Call/C Examples Domain Specific Analysis Conclusion and Future Work
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Session Initiation Protocol ): Infrastructure (SIP)
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Session Initiation Protocol ): Infrastructure (SIP) SIP Servers
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Session Initiation Protocol ): Infrastructure (SIP) SIP Servers SIP Clients
ENSEIRB, FranceCall/CSeptember 29, 2003 Infrastructure (SIP) SIP Servers SIP Clients SIP (Session Initiation Protocol ):
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Registration) chirac
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Registration) chirac
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Registration) chiracelysee.fr REGISTER 200 OK Location server: [chirac ] 200 OK
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Registration) chiracelysee.fr REGISTER 200 OK Location server: [chirac ] 200 OK
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Registration) chiracelysee.fr REGISTER 200 OK Location server: [chirac ] 200 OK
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Registration) chiracelysee.fr REGISTER 200 OK Location server: [chirac ] 200 OK
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Registration) chiracelysee.fr REGISTER 200 OK Location server: [chirac ] 200 OK
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Registration) chiracelysee.fr REGISTER 200 OK Location server: [chirac ] 200 OK
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Registration) chiracelysee.fr REGISTER 200 OK Location server: [chirac ] 200 OK
ENSEIRB, FranceCall/CSeptember 29, 2003 Call: SIP (Initiation) chiracelysee.frwhitehouse.gov bush
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Initiation) chiracelysee.frwhitehouse.gov bush INVITE bush? Location server: [bush ] DNS lookup: whitehouse.gov? 200 OK accept ring ACK...multi-media communication...
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Initiation) chiracelysee.frwhitehouse.gov bush INVITE bush? Location server: [bush ] DNS lookup: whitehouse.gov? 200 OK accept ring ACK...multi-media communication...
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Initiation) chiracelysee.frwhitehouse.gov bush INVITE bush? Location server: [bush ] DNS lookup: whitehouse.gov? 200 OK accept ring ACK...multi-media communication...
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Initiation) chiracelysee.frwhitehouse.gov bush INVITE bush? Location server: [bush ] DNS lookup: whitehouse.gov? 200 OK accept ring ACK...multi-media communication...
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Initiation) chiracelysee.frwhitehouse.gov bush INVITE bush? Location server: [bush ] DNS lookup: whitehouse.gov? 200 OK accept ring ACK...multi-media communication...
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Initiation) chiracelysee.frwhitehouse.gov bush INVITE bush? Location server: [bush ] DNS lookup: whitehouse.gov? 200 OK accept ring ACK...multi-media communication...
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Initiation) chiracelysee.frwhitehouse.gov bush INVITE bush? Location server: [bush ] DNS lookup: whitehouse.gov? 200 OK accept ring ACK...multi-media communication...
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Initiation) chiracelysee.frwhitehouse.gov bush INVITE bush? Location server: [bush ] DNS lookup: whitehouse.gov? 200 OK accept ring ACK...multi-media communication...
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Initiation) chiracelysee.frwhitehouse.gov bush INVITE bush? Location server: [bush ] DNS lookup: whitehouse.gov? 200 OK accept ring ACK...multi-media communication...
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Initiation) chiracelysee.frwhitehouse.gov bush INVITE bush? Location server: [bush ] DNS lookup: whitehouse.gov? 200 OK accept ring ACK...multi-media communication OK 302 Moved Temporarily 486 Busy Here 603 Decline...
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Initiation) chiracelysee.frwhitehouse.gov bush INVITE bush? Location server: [bush ] DNS lookup: whitehouse.gov? 200 OK accept ring ACK...multi-media communication OK 302 Moved Temporarily 486 Busy Here 603 Decline...
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Initiation) chiracelysee.frwhitehouse.gov bush INVITE bush? Location server: [bush ] DNS lookup: whitehouse.gov? 200 OK accept ring ACK...multi-media communication...
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Initiation) chiracelysee.frwhitehouse.gov bush INVITE bush? Location server: [bush ] DNS lookup: whitehouse.gov? 200 OK accept ring ACK...multi-media communication...
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Initiation) chiracelysee.frwhitehouse.gov bush INVITE bush? Location server: [bush ] DNS lookup: whitehouse.gov? 200 OK accept ring ACK...multi-media communication...
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Initiation) chiracelysee.frwhitehouse.gov bush INVITE bush? Location server: [bush ] DNS lookup: whitehouse.gov? 200 OK accept ring ACK...multi-media communication...
ENSEIRB, FranceCall/CSeptember 29, 2003 SIP (Initiation) chiracelysee.frwhitehouse.gov bush INVITE bush? Location server: [bush ] DNS lookup: whitehouse.gov? 200 OK accept ring ACK...multi-media communication...
ENSEIRB, FranceCall/CSeptember 29, 2003 Outline Introduction Infrastructure (SIP) Programming Telephony Services Call/C Examples Domain Specific Analysis Conclusion and Future Work
ENSEIRB, FranceCall/CSeptember 29, 2003 Outline Introduction Infrastructure (SIP) Programming Telephony Services Call/C Examples Domain Specific Analysis Conclusion and Future Work
ENSEIRB, FranceCall/CSeptember 29, 2003 Programming Telephony Services call forward response fixed behavior lookup
ENSEIRB, FranceCall/CSeptember 29, 2003 Programming Telephony Services call response programmable
ENSEIRB, FranceCall/CSeptember 29, 2003 Programming Telephony Services call response programmable Dependent on (time, request, preferences, state, …): if(…) else
ENSEIRB, FranceCall/CSeptember 29, 2003 Programming Telephony Services call response programmable Dependent on (time, request, preferences, state, …): Signalling actions: lookup, forward, respond forward if(…) else
ENSEIRB, FranceCall/CSeptember 29, 2003 Programming Telephony Services call response programmable Dependent on (time, request, preferences, state, …): Signalling actions: lookup, forward, respond Non-signalling actions: computations, remote procedure calls, side-effects,... forward y = f(x) if(…) else
ENSEIRB, FranceCall/CSeptember 29, 2003 Existing Solutions General Purpose Languages: SIP Common Gateway Interface (SIP/CGI) Java SIP Servlets ...
ENSEIRB, FranceCall/CSeptember 29, 2003 Existing Solutions General Purpose Languages: SIP Common Gateway Interface (SIP/CGI) Java SIP Servlets ... Expressive, but unsafe
ENSEIRB, FranceCall/CSeptember 29, 2003 Existing Solutions General Purpose Languages: SIP Common Gateway Interface (SIP/CGI) Java SIP Servlets ... Expressive, but unsafe
ENSEIRB, FranceCall/CSeptember 29, 2003 Safety Requirements for a call processing language: Verifiability: Call completion: Safety of execution: ... "Programming Internet Telephony Services" -- J. Rosenberg, J. Lennox, and H. Schulzrinne
ENSEIRB, FranceCall/CSeptember 29, 2003 Safety Requirements for a call processing language: Verifiability: Static syntactic/semantic analysis Call completion: Safety of execution: ... "Programming Internet Telephony Services" -- J. Rosenberg, J. Lennox, and H. Schulzrinne
ENSEIRB, FranceCall/CSeptember 29, 2003 Safety Requirements for a call processing language: Verifiability: Static syntactic/semantic analysis Call completion: All calls handled (termination) Safety of execution: ... "Programming Internet Telephony Services" -- J. Rosenberg, J. Lennox, and H. Schulzrinne
ENSEIRB, FranceCall/CSeptember 29, 2003 Safety Requirements for a call processing language: Verifiability: Static syntactic/semantic analysis Call completion: All calls handled (termination) Safety of execution: Controlled access to underlying server and platform Bounded resource consumption ... "Programming Internet Telephony Services" -- J. Rosenberg, J. Lennox, and H. Schulzrinne
ENSEIRB, FranceCall/CSeptember 29, 2003 Existing Solutions (cont’d) General Purpose Languages: SIP Common Gateway Interface (SIP/CGI) Java SIP Servlets ... Expressive, but unsafe
ENSEIRB, FranceCall/CSeptember 29, 2003 Existing Solutions (cont’d) General Purpose Languages: SIP Common Gateway Interface (SIP/CGI) Java SIP Servlets ... Domain Specific Languages: The Call Processing Language (CPL) Expressive, but unsafe
ENSEIRB, FranceCall/CSeptember 29, 2003 Existing Solutions (cont’d) General Purpose Languages: SIP Common Gateway Interface (SIP/CGI) Java SIP Servlets ... Domain Specific Languages: The Call Processing Language (CPL) Expressive, but unsafe Safe, but inexpressive
ENSEIRB, FranceCall/CSeptember 29, 2003 Existing Solutions (cont’d) General Purpose Languages: SIP Common Gateway Interface (SIP/CGI) Java SIP Servlets ... Domain Specific Languages: The Call Processing Language (CPL) Expressive, but unsafe Safe, but inexpressive
ENSEIRB, FranceCall/CSeptember 29, 2003 Outline Introduction Infrastructure (SIP) Programming Telephony Services Call/C Examples Domain Specific Analysis Conclusion and Future Work
ENSEIRB, FranceCall/CSeptember 29, 2003 Outline Introduction Infrastructure (SIP) Programming Telephony Services Call/C Examples Domain Specific Analysis Conclusion and Future Work
ENSEIRB, FranceCall/CSeptember 29, 2003 Interaction Approach Rest of Internet Telephony Service
ENSEIRB, FranceCall/CSeptember 29, 2003 Interaction Approach Rest of Internet call Telephony Service
ENSEIRB, FranceCall/CSeptember 29, 2003 Interaction Approach Rest of Internet call lookup Telephony Service
ENSEIRB, FranceCall/CSeptember 29, 2003 Interaction Approach Rest of Internet call result lookup Telephony Service
ENSEIRB, FranceCall/CSeptember 29, 2003 Interaction Approach Rest of Internet call forward result lookup Telephony Service
ENSEIRB, FranceCall/CSeptember 29, 2003 Interaction Approach Rest of Internet call response forward result lookup Telephony Service
ENSEIRB, FranceCall/CSeptember 29, 2003 Interaction Approach Rest of Internet call response forward result lookup Telephony Service
ENSEIRB, FranceCall/CSeptember 29, 2003 Implicit Control-Flow Rest of Internet call response forward result lookup Telephony Service
ENSEIRB, FranceCall/CSeptember 29, 2003 Manually save/restore state Rest of Internet call response forward result lookup Telephony Service SAVE SAVE RESTORE RESTORE
ENSEIRB, FranceCall/CSeptember 29, 2003 Session-Centered with High-Level Signalling Abstractions 1 Service Program Rest of Internet forward lookup call return
ENSEIRB, FranceCall/CSeptember 29, 2003 Explicit Control-Flow Rest of Internet forward lookup call return 1 Service Program
ENSEIRB, FranceCall/CSeptember 29, 2003 Automatically Compiled to Underlying model (with save/restore) Rest of Internet forward lookup call return SAVE;EXIT RESTORE RESTORE 1 Service Program
ENSEIRB, FranceCall/CSeptember 29, 2003 C-like core language with... Safety restrictions: Domain-specific extensions:
ENSEIRB, FranceCall/CSeptember 29, 2003 C-like core language with... Safety restrictions: Looping control structures: do / while / for Recursion, pointers, array indexing,... Domain-specific extensions:
ENSEIRB, FranceCall/CSeptember 29, 2003 C-like core language with... Safety restrictions: Looping control structures: do / while / for Recursion, pointers, array indexing,... Domain-specific extensions: Session abstractions: incoming / outgoing Signalling abstractions: forward / lookup / return SIP address type: sip Predefined structures: call / response Predefined responses: ok / busy / decline /...
ENSEIRB, FranceCall/CSeptember 29, 2003 Outline Introduction Infrastructure (SIP) Programming Telephony Services Call/C Examples Domain Specific Analysis Conclusion and Future Work
ENSEIRB, FranceCall/CSeptember 29, 2003 Outline Introduction Infrastructure (SIP) Programming Telephony Services Call/C Examples Domain Specific Analysis Conclusion and Future Work
ENSEIRB, FranceCall/CSeptember 29, 2003 Decline calls outside working hours…: Call/C Example I bool isWorkHour() { time t = now(); if (t.weekday > FRIDAY) return false; return (t.hour >= 9) && (t.hour <= 17); } response incoming(call in) { if (!isWorkHour()) { return decline("OFFICE HOURS 9-17"); }
ENSEIRB, FranceCall/CSeptember 29, 2003 Forward depending on caller…: Call/C Example II sip WORK_PHONE = sip CELL_PHONE = response incoming(call in) { if (in.from ~ { in.subject = "[WORK: " + in.subject + "]"; return forward(in, WORK_PHONE); } else { return forward(in, CELL_PHONE); }
ENSEIRB, FranceCall/CSeptember 29, 2003 Forward unhandled calls to secretary…: Call/C Example III sip BOSS = sip SECRETARY = response incoming(call in) { response x = forward(in, BOSS); switch (x) { case busy: case decline: in.subject = "[Fwd: " + in.subject + "]"; return forward(in, SECRETARY); default: return x; }
ENSEIRB, FranceCall/CSeptember 29, 2003 Outline Introduction Infrastructure (SIP) Programming Telephony Services Call/C Examples Domain Specific Analysis Conclusion and Future Work
ENSEIRB, FranceCall/CSeptember 29, 2003 Outline Introduction Infrastructure (SIP) Programming Telephony Services Call/C Examples Domain Specific Analysis Conclusion and Future Work
ENSEIRB, FranceCall/CSeptember 29, 2003 Domain Specific Analyses Domain-specific optimization response x; … x = forward(in, return x;
ENSEIRB, FranceCall/CSeptember 29, 2003 Domain Specific Analyses Domain-specific optimization Tail-call identification: Disable script invocation after forward Default (SIP server) behavior: propagate response response x; … x = forward(in, return x;
ENSEIRB, FranceCall/CSeptember 29, 2003 Outline Introduction Infrastructure (SIP) Programming Telephony Services Call/C Examples Domain Specific Analysis Conclusion and Future Work
ENSEIRB, FranceCall/CSeptember 29, 2003 Outline Introduction Infrastructure (SIP) Programming Telephony Services Call/C Examples Domain Specific Analysis Conclusion and Future Work
ENSEIRB, FranceCall/CSeptember 29, 2003 Future Work Composable services: Specification and semantics Interference analysis
ENSEIRB, FranceCall/CSeptember 29, 2003 Future Work Composable services: Specification and semantics Interference analysis Cost analysis: Resource cost models for billing, admission control, server size prediction, …
ENSEIRB, FranceCall/CSeptember 29, 2003 Future Work Composable services: Specification and semantics Interference analysis Cost analysis: Resource cost models for billing, admission control, server size prediction, … Capability-based compilation: Different users have different capabilities
ENSEIRB, FranceCall/CSeptember 29, 2003 Conclusion Safety: Verifiability Call completion Safety of execution
ENSEIRB, FranceCall/CSeptember 29, 2003 Conclusion Safety: Verifiability Call completion Safety of execution Expressivity: Enough for many interesting services (beyond CPL)
ENSEIRB, FranceCall/CSeptember 29, 2003 Conclusion Safety: Verifiability Call completion Safety of execution Expressivity: Enough for many interesting services (beyond CPL) …and "usual" DSL benefits: Conciseness, readability, maintainability, usability,...
ENSEIRB, FranceCall/CSeptember 29, 2003 Merci!
ENSEIRB, FranceCall/CSeptember 29, 2003 [ bonus slides ]
ENSEIRB, FranceCall/CSeptember 29, 2003 Session Abstractions: incoming / outgoing // declarations response incoming(call in) { // handle incoming call } response outgoing(call out) { // handle outgoing call } Program bound to user (SIP address) dispatched when: in.to == user dispatched when: out.from == user
ENSEIRB, FranceCall/CSeptember 29, 2003 response incoming(call in) { response x; in.subject = "Hello!"; x = forward(in, return x; } Predefined Structures: call / response struct call { sip from; sip to; string subject; sip[] via; } union response { { } ok; // 200 OK { string contact; } redirect; // 302 MOVED TEMP’LY { } busy; // 486 BUSY HERE { string reason; } decline; // 603 DECLINE { int code; } error; // xxx ERROR... }
ENSEIRB, FranceCall/CSeptember 29, 2003 Domain Specific Analyses Domain-specific verification: response incoming(call in) { … if (…) { … x = forward(in, s); … } … x = forward(in, … return x; }
ENSEIRB, FranceCall/CSeptember 29, 2003 Domain Specific Analyses Domain-specific verification: response incoming(call in) { … if (…) { … x = forward(in, s); … } … x = forward(in, … return x; } Explicit control-flow!