Title: CallC: A Domain Specific Language for IP Telephony Services
1Call/CA Domain Specific Languagefor IP
Telephony Services
- Claus Brabrand
- joint work with Charles Consel Fabien Latry
- COMPOSE Group
- INRIA, University of Bordeaux I, France
2Outline
- Introduction
- Infrastructure (SIP)
- Programming Telephony Services
- Call/C
- Examples
- Domain Specific Analysis
- Conclusion and Future Work
3Outline
- Introduction
- Infrastructure (SIP)
- Programming Telephony Services
- Call/C
- Examples
- Domain Specific Analysis
- Conclusion and Future Work
4Introduction
05 12 34 56 78
"Call a place"
5Introduction
1-1
06 12 34 56 78
"Call a phone"
6Introduction
chirac_at_elysee.fr
"Call a person"
7Introduction
chirac_at_elysee.fr
"Call a person"
8Outline
- Introduction
- Infrastructure (SIP)
- Programming Telephony Services
- Call/C
- Examples
- Domain Specific Analysis
- Conclusion and Future Work
9Outline
- Introduction
- Infrastructure (SIP)
- Programming Telephony Services
- Call/C
- Examples
- Domain Specific Analysis
- Conclusion and Future Work
10Infrastructure (SIP)
- SIP (Session Initiation Protocol )
11Infrastructure (SIP)
- SIP (Session Initiation Protocol )
SIP Servers
12Infrastructure (SIP)
- SIP (Session Initiation Protocol )
SIP Servers
SIP Clients
13Infrastructure (SIP)
- SIP (Session Initiation Protocol )
SIP Servers
SIP Clients
14SIP (Registration)
1.2.3.4
chirac
15SIP (Registration)
1.2.3.4
chirac
chirac_at_1.2.3.4
16SIP (Registration)
Location server chirac?1.2.3.4
chirac_at_ 1.2.3.4
200 OK
REGISTER
200 OK
1.2.3.4
chirac
elysee.fr
chirac_at_1.2.3.4
17SIP (Registration)
Location server chirac?1.2.3.4
chirac_at_ 1.2.3.4
200 OK
REGISTER
200 OK
1.2.3.4
chirac
elysee.fr
chirac_at_1.2.3.4
18SIP (Registration)
Location server chirac?1.2.3.4
chirac_at_ 1.2.3.4
200 OK
REGISTER
200 OK
1.2.3.4
chirac
elysee.fr
chirac_at_1.2.3.4
19SIP (Registration)
Location server chirac?1.2.3.4
chirac_at_ 1.2.3.4
200 OK
REGISTER
200 OK
1.2.3.4
chirac
elysee.fr
chirac_at_1.2.3.4
20SIP (Registration)
Location server chirac?1.2.3.4
chirac_at_ 1.2.3.4
200 OK
REGISTER
200 OK
1.2.3.4
chirac
elysee.fr
chirac_at_1.2.3.4
21SIP (Registration)
Location server chirac?1.2.3.4
chirac_at_ 1.2.3.4
200 OK
REGISTER
200 OK
1.2.3.4
chirac
elysee.fr
chirac_at_1.2.3.4
22SIP (Registration)
Location server chirac?1.2.3.4
chirac_at_ 1.2.3.4
200 OK
REGISTER
chirac_at_elysee.fr
200 OK
1.2.3.4
chirac
elysee.fr
chirac_at_1.2.3.4
23SIP (Initiation)
- Call chirac_at_elysee.fr ? bush_at_whitehouse.gov
1.2.3.4
chirac
elysee.fr
whitehouse.gov
5.6.7.8
bush
24SIP (Initiation)
Location server bush?5.6.7.8
ring
DNS lookup whitehouse.gov?
accept
bush?
5.6.7.8
INVITE
INVITE
INVITE
200 OK
200 OK
200 OK
1.2.3.4
chirac
elysee.fr
whitehouse.gov
5.6.7.8
bush
ACK
...multi-media communication...
25SIP (Initiation)
Location server bush?5.6.7.8
ring
DNS lookup whitehouse.gov?
accept
bush?
5.6.7.8
INVITE
INVITE
INVITE
200 OK
200 OK
200 OK
1.2.3.4
chirac
elysee.fr
whitehouse.gov
5.6.7.8
bush
ACK
...multi-media communication...
26SIP (Initiation)
Location server bush?5.6.7.8
ring
DNS lookup whitehouse.gov?
accept
bush?
5.6.7.8
INVITE
INVITE
INVITE
200 OK
200 OK
200 OK
1.2.3.4
chirac
elysee.fr
whitehouse.gov
5.6.7.8
bush
ACK
...multi-media communication...
27SIP (Initiation)
Location server bush?5.6.7.8
ring
DNS lookup whitehouse.gov?
accept
bush?
5.6.7.8
INVITE
INVITE
INVITE
200 OK
200 OK
200 OK
1.2.3.4
chirac
elysee.fr
whitehouse.gov
5.6.7.8
bush
ACK
...multi-media communication...
28SIP (Initiation)
Location server bush?5.6.7.8
ring
DNS lookup whitehouse.gov?
accept
bush?
5.6.7.8
INVITE
INVITE
INVITE
200 OK
200 OK
200 OK
1.2.3.4
chirac
elysee.fr
whitehouse.gov
5.6.7.8
bush
ACK
...multi-media communication...
29SIP (Initiation)
Location server bush?5.6.7.8
ring
DNS lookup whitehouse.gov?
accept
bush?
5.6.7.8
INVITE
INVITE
INVITE
200 OK
200 OK
200 OK
1.2.3.4
chirac
elysee.fr
whitehouse.gov
5.6.7.8
bush
ACK
...multi-media communication...
30SIP (Initiation)
Location server bush?5.6.7.8
ring
DNS lookup whitehouse.gov?
accept
bush?
5.6.7.8
INVITE
INVITE
INVITE
200 OK
200 OK
200 OK
1.2.3.4
chirac
elysee.fr
whitehouse.gov
5.6.7.8
bush
ACK
...multi-media communication...
31SIP (Initiation)
Location server bush?5.6.7.8
ring
DNS lookup whitehouse.gov?
accept
bush?
5.6.7.8
INVITE
INVITE
INVITE
200 OK
200 OK
200 OK
1.2.3.4
chirac
elysee.fr
whitehouse.gov
5.6.7.8
bush
ACK
...multi-media communication...
32SIP (Initiation)
Location server bush?5.6.7.8
ring
DNS lookup whitehouse.gov?
accept
bush?
5.6.7.8
INVITE
INVITE
INVITE
200 OK
200 OK
200 OK
1.2.3.4
chirac
elysee.fr
whitehouse.gov
5.6.7.8
bush
ACK
...multi-media communication...
33SIP (Initiation)
Location server bush?5.6.7.8
ring
DNS lookup whitehouse.gov?
accept
bush?
5.6.7.8
INVITE
INVITE
INVITE
200 OK
200 OK
200 OK
1.2.3.4
chirac
elysee.fr
whitehouse.gov
5.6.7.8
bush
200 OK 302 Moved Temporarily 486 Busy Here 603
Decline ...
ACK
...multi-media communication...
34SIP (Initiation)
Location server bush?5.6.7.8
ring
DNS lookup whitehouse.gov?
accept
bush?
5.6.7.8
INVITE
INVITE
INVITE
200 OK
200 OK
200 OK
1.2.3.4
chirac
elysee.fr
whitehouse.gov
5.6.7.8
bush
200 OK 302 Moved Temporarily 486 Busy Here 603
Decline ...
ACK
...multi-media communication...
35SIP (Initiation)
Location server bush?5.6.7.8
ring
DNS lookup whitehouse.gov?
accept
bush?
5.6.7.8
INVITE
INVITE
INVITE
200 OK
200 OK
200 OK
1.2.3.4
chirac
elysee.fr
whitehouse.gov
5.6.7.8
bush
ACK
...multi-media communication...
36SIP (Initiation)
Location server bush?5.6.7.8
ring
DNS lookup whitehouse.gov?
accept
bush?
5.6.7.8
INVITE
INVITE
INVITE
200 OK
200 OK
200 OK
1.2.3.4
chirac
elysee.fr
whitehouse.gov
5.6.7.8
bush
ACK
...multi-media communication...
37SIP (Initiation)
Location server bush?5.6.7.8
ring
DNS lookup whitehouse.gov?
accept
bush?
5.6.7.8
INVITE
INVITE
INVITE
200 OK
200 OK
200 OK
1.2.3.4
chirac
elysee.fr
whitehouse.gov
5.6.7.8
bush
ACK
...multi-media communication...
38SIP (Initiation)
Location server bush?5.6.7.8
ring
DNS lookup whitehouse.gov?
accept
bush?
5.6.7.8
INVITE
INVITE
INVITE
200 OK
200 OK
200 OK
1.2.3.4
chirac
elysee.fr
whitehouse.gov
5.6.7.8
bush
ACK
...multi-media communication...
39SIP (Initiation)
Location server bush?5.6.7.8
ring
DNS lookup whitehouse.gov?
accept
bush?
5.6.7.8
INVITE
INVITE
INVITE
200 OK
200 OK
200 OK
1.2.3.4
chirac
elysee.fr
whitehouse.gov
5.6.7.8
bush
ACK
...multi-media communication...
40Outline
- Introduction
- Infrastructure (SIP)
- Programming Telephony Services
- Call/C
- Examples
- Domain Specific Analysis
- Conclusion and Future Work
41Outline
- Introduction
- Infrastructure (SIP)
- Programming Telephony Services
- Call/C
- Examples
- Domain Specific Analysis
- Conclusion and Future Work
42Programming Telephony Services
lookup
call
forward
response
fixed behavior
43Programming Telephony Services
call
response
programmable
44Programming Telephony Services
call
if() else
response
programmable
- Dependent on (time, request, preferences, state,
)
45Programming Telephony Services
call
forward
if() else
response
programmable
- Dependent on (time, request, preferences, state,
) - Signalling actions
- lookup, forward, respond
46Programming Telephony Services
call
forward
if() else
y f(x)
response
programmable
- Dependent on (time, request, preferences, state,
) - Signalling actions
- lookup, forward, respond
- Non-signalling actions
- computations, remote procedure calls,
side-effects, ...
47Existing Solutions
- General Purpose Languages
- SIP Common Gateway Interface (SIP/CGI)
- Java SIP Servlets
- ...
48Existing Solutions
- General Purpose Languages
- SIP Common Gateway Interface (SIP/CGI)
- Java SIP Servlets
- ...
Expressive, but unsafe
49Existing Solutions
- General Purpose Languages
- SIP Common Gateway Interface (SIP/CGI)
- Java SIP Servlets
- ...
Expressive, but unsafe
50Safety
- Requirements for a call processing language
- Verifiability
- Call completion
- Safety of execution
- ...
"Programming Internet Telephony Services"
-- J. Rosenberg, J.
Lennox, and H. Schulzrinne
51Safety
- 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
52Safety
- 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
53Safety
- 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
54Existing Solutions (contd)
- General Purpose Languages
- SIP Common Gateway Interface (SIP/CGI)
- Java SIP Servlets
- ...
Expressive, but unsafe
55Existing Solutions (contd)
- General Purpose Languages
- SIP Common Gateway Interface (SIP/CGI)
- Java SIP Servlets
- ...
- Domain Specific Languages
- The Call Processing Language (CPL)
Expressive, but unsafe
56Existing Solutions (contd)
- 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
57Existing Solutions (contd)
- 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
58Outline
- Introduction
- Infrastructure (SIP)
- Programming Telephony Services
- Call/C
- Examples
- Domain Specific Analysis
- Conclusion and Future Work
59Outline
- Introduction
- Infrastructure (SIP)
- Programming Telephony Services
- Call/C
- Examples
- Domain Specific Analysis
- Conclusion and Future Work
60Interaction Approach
Rest of Internet
Telephony Service
61Interaction Approach
call
Rest of Internet
Telephony Service
62Interaction Approach
call
lookup
Rest of Internet
Telephony Service
63Interaction Approach
call
lookup
Rest of Internet
result
Telephony Service
64Interaction Approach
call
lookup
Rest of Internet
result
forward
Telephony Service
65Interaction Approach
call
lookup
Rest of Internet
result
forward
response
Telephony Service
66Interaction Approach
call
lookup
Rest of Internet
result
forward
response
response
Telephony Service
67Implicit Control-Flow
call
lookup
Rest of Internet
result
forward
response
response
Telephony Service
68Manually save/restore state
call
lookup
SAVE
Rest of Internet
result
RESTORE
forward
SAVE
response
RESTORE
response
Telephony Service
69Session-Centered withHigh-Level Signalling
Abstractions
call
lookup
Rest of Internet
forward
return
1 Service Program
70Explicit Control-Flow
call
lookup
Rest of Internet
forward
return
1 Service Program
71Automatically Compiled to Underlying model (with
save/restore)
call
lookup
SAVEEXIT
RESTORE
Rest of Internet
forward
SAVEEXIT
RESTORE
return
1 Service Program
72C-like core language with...
- Safety restrictions
- Domain-specific extensions
73C-like core language with...
- Safety restrictions
- Looping control structures do / while / for
- Recursion, pointers, array indexing, ...
- Domain-specific extensions
74C-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 / ...
75Outline
- Introduction
- Infrastructure (SIP)
- Programming Telephony Services
- Call/C
- Examples
- Domain Specific Analysis
- Conclusion and Future Work
76Outline
- Introduction
- Infrastructure (SIP)
- Programming Telephony Services
- Call/C
- Examples
- Domain Specific Analysis
- Conclusion and Future Work
77Call/C Example I
- Decline calls outside working hours
bool isWorkHour() time t now() if
(t.weekday gt FRIDAY) return false return
(t.hour gt 9) (t.hour lt 17) response
incoming(call in) if (!isWorkHour())
return decline("OFFICE HOURS 9-17")
78Call/C Example II
- Forward depending on caller
sip WORK_PHONE 'sipoffice328_at_enseirb.fr'
sip CELL_PHONE 'sipclaus_brabrand_at_bouygues.
fr' response incoming(call in) if (in.from
._at_enseirb.fr) in.subject "WORK "
in.subject "" return forward(in,
WORK_PHONE) else return forward(in,
CELL_PHONE)
79Call/C Example III
- Forward unhandled calls to secretary
sip BOSS 'sipCEO_at_company.com' sip SECRETARY
'sipsecr_at_company.com' 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
80Outline
- Introduction
- Infrastructure (SIP)
- Programming Telephony Services
- Call/C
- Examples
- Domain Specific Analysis
- Conclusion and Future Work
81Outline
- Introduction
- Infrastructure (SIP)
- Programming Telephony Services
- Call/C
- Examples
- Domain Specific Analysis
- Conclusion and Future Work
82Domain Specific Analyses
- ? Domain-specific optimization
response x x forward(in, 'sipuser_at_domain.com
') return x
83Domain Specific Analyses
- ? Domain-specific optimization
- Tail-call identification
- Disable script invocation after forward
- Default (SIP server) behavior propagate response
response x x forward(in, 'sipuser_at_domain.com
') return x
84Outline
- Introduction
- Infrastructure (SIP)
- Programming Telephony Services
- Call/C
- Examples
- Domain Specific Analysis
- Conclusion and Future Work
85Outline
- Introduction
- Infrastructure (SIP)
- Programming Telephony Services
- Call/C
- Examples
- Domain Specific Analysis
- Conclusion and Future Work
86Future Work
- Composable services
- Specification and semantics
- Interference analysis
87Future Work
- Composable services
- Specification and semantics
- Interference analysis
- Cost analysis
- Resource cost models forbilling, admission
control, server size prediction,
88Future Work
- Composable services
- Specification and semantics
- Interference analysis
- Cost analysis
- Resource cost models forbilling, admission
control, server size prediction, - Capability-based compilation
- Different users have different capabilities
89Conclusion
- Safety
- Verifiability
- Call completion
- Safety of execution
90Conclusion
- Safety
- Verifiability
- Call completion
- Safety of execution
- Expressivity
- Enough for many interesting services (beyond CPL)
91Conclusion
- Safety
- Verifiability
- Call completion
- Safety of execution
- Expressivity
- Enough for many interesting services (beyond CPL)
- and "usual" DSL benefits
- Conciseness, readability, maintainability,
usability, ...
92Merci!
93 bonus slides
94Session Abstractionsincoming / outgoing
- Program bound to user (SIP address)
// declarations response incoming(call in)
// handle incoming call response outgoing(call
out) // handle outgoing call
dispatched when in.to user
dispatched when out.from user
95Predefined Structurescall / response
response incoming(call in) response x
in.subject "Hello!" x forward(in,
'sipx_at_y.z') return x
struct call sip from sip to string
subject sip via
union response ok
// 200 OK string contact redirect // 302
MOVED TEMPLY busy //
486 BUSY HERE string reason decline //
603 DECLINE int code error //
xxx ERROR...
96Domain Specific Analyses
- ? Domain-specific verification
response incoming(call in) if ()
x forward(in, s) x
forward(in, 'sipuser_at_domain.com') return
x
97Domain Specific Analyses
- ? Domain-specific verification
response incoming(call in) if ()
x forward(in, s) x
forward(in, 'sipuser_at_domain.com') return
x
Explicit control-flow!