Beruflich Dokumente
Kultur Dokumente
Kundan Singh
Agenda
Introducing VoIP
What does it take to build simple audio telephony? What are the main features of SIP How do we implement various services like call transfer, auto-attendant, voicemail?
Introduction to VoIP 2
Digitization (e.g., sampling at 8kHz, 16 bits per sample, i.e, 128 kb/s or 320 bytes per 20 ms) Real-time compression/encoding (e.g., G.729A at 8 kb/s) Transport to remote IP address and port number over UDP (Why not TCP?) Processing on receiver side is the reverse
Introduction to VoIP
1010111101101101
-127
Sample at twice the highest voice frequency 2 x 4000=8000 Hz (interval of 125 sec)
5
(a)
7
(b)
1
Receiver
Unreliable UDP a) Packet loss b) Out-of-order (very rarely) c) Jitter (delay variation)
Introduction to VoIP 5
Receive buffer
(playout buffer or circular buffer)
read microphone 20 ms packet sendto(remote IP:port)
write speaker
20 ms packet
get
put while (true) { buf = read(au,20ms); //blocks if (!silence) sendto(remote, buf); buf = get(20 ms); write(au, buf); } playout buffer
Received packet
recvfrom()
Introduction to VoIP
Receive buffer
(playout buffer or circular buffer)
Sender 1 2 3
Receive buffer: to absorb jitter Tradeoff in buffer size Adaptive delay adjustment Sequence number: to detect packet loss; Just ignore the loss!
4 5 6 7 8 9 0 1 2 3 4
1 Receiver 3 2 1
2 1
7 2 1 5 2 3 5 7 6 8 7 9 8 0 9 2 0 3 2
Introduction to VoIP
Sender
t1 1
t2 2
t3 3
t4
t5
t6 4
t7 5
t8 6
t9 7
Silence
1 Receiver
V PX
CC
M Payload type
Sequence number
msg
Encoded Audio
Introduction to VoIP
RTPRTP-based conference
ssrc=5263 224.1.2.3:8000
ssrc=7182
ssrc=2639
ssrc=9844
10
RTPRTP-based conference
Mixer mixes multiple streams, and puts rtp.ssrcs of contributors in the mixed packet as rtp.csrc
Q-law
Transcoder converts one encoding to another. Typically to accommodate heterogeneous bandwidth links.
Mixer
7
Q-law
Q-law
Transcoder
G.729
Q-law
G.729
Introduction to VoIP
11
Bob 202.16.49.27
Alice 128.59.19.194
Sam 154.28.32.112
Henry 125.33.2.81
12
office.com
Bob
DNS: uses naming authority pointer and service records Database or service logic: within a domain
home.com
columbia.edu yahoo.com Alice 128.59.19.194 Jane 128.59.19.61
$ dig t naptr columbia.edu columbia.edu. 3600 IN NAPTR 1 0 "s" "SIP+D2U" "" _sip._udp.columbia.edu. columbia.edu. 3600 IN NAPTR 2 0 "s" "SIP+D2T" "" _sip._tcp.columbia.edu. $ dig t srv _sip._udp.columbia.edu _sip._udp.columbia.edu. 3600 IN SRV 10 10 5060 cocoa.cc.columbia.edu. _sip._udp.columbia.edu. 3600 IN SRV 10 10 5060 eclair.cc.columbia.edu. $ dig t a cocoa.cc.columbia.edu cocoa.cc.columbia.edu. 3600 IN A 128.59.59.199
Introduction to VoIP
13
INVITE sip:alice@home.com SIP/2.0 From: Bob <bob@office.com> To: Alice <alice@home.com> Subject: How are you? ...
Response
SIP/2.0 200 OK From: Bob <bob@office.com> To: Alice <alice@home.com> Subject: How are you? ...
Introduction to VoIP
14
Bob
Alice
202.16.49.27
128.59.19.194
Introduction to VoIP
15
Agenda
Introducing VoIP
What does it take to build simple audio telephony? What are the main features of SIP How do we implement various services like call transfer, auto-attendant, voicemail?
Introduction to VoIP 17
Addressing
Personal mobility:
yahoo.com
tel:12125551234
tel:19172223333
pc12.columbia.edu
Examples:
Requests:
Text-based, request-response Request method operates on the resource/entity identified in URI To, From, Call-ID, CSeq: transaction identification Via: response traverses the reverse request path Content-Length, Content-Type: message body information White-space doesn t matter except in first line Lines can be folded Multi-valued header fields can be combiled as a comma-list
Headers:
INVITE, ACK, BYE, CANCEL: related to call setup and tear down OPTIONS, INFO, COMET, PRACK, SUBSCRIBE, NOTIFY, PUBLISH, REFER, Provisional: 100 Trying, 180 Ringing, 183 Session progress, Success: 200 OK, 202 Pending, Redirection: 301 Moved permanently, 302 Moved temporarily, Request failure: 400 Bad Request, 401 Unauthorized, 404 Not found, 480 Not available, 486 Busy here, Server failure: 500 Internal server error, 501 Not implemented, Global failure: 600 Busy everywhere, 603 Decline,
Responses:
Syntax:
Introduction to VoIP
20
Building blocks
Maintaining state
Enterprise servers, . . .
routes call requests accepts name to address mapping maintains name to address mapping
SIP registrar
Location server
Other entities: outbound proxy, back-to-back user agent (b2bua), application-levelgateway (ALG),
Introduction to VoIP
21
Message routing
Usually direct end-to-end transport after initial request Forcing request path: Record-route and Route headers. Request forking: parallel vs sequential (use qvalue in Contact) Caller and callee info: further govern request routing
q=1.0
q=0.7
q=0.2
Introduction to VoIP
22
Alice
(10) (6)
(8)
@visiting.com
Introduction to VoIP
23
Transport
SIP can operate on any packet network, reliable or unreliable UDP: most common
Transport reliability
Low state overhead But small max packet size Use with SSL Connection setup overhead Head of line blocking for trunks (use SCTP instead)
Request retransmissions, exponential back-off interval INVITE different than other methods
TCP:
Introduction to VoIP
24
NAT traversal
Problem:
iptel.org INVITE alice@
Solutions:
Smart servers
(open)SER allows detecting nodes behind a NAT Use application level gateway and media-proxy Symmetric response routing for UDP (rport) Connection reuse for TCP/TLS (sip-outbound) STUN: Simple traversal of UDP through NAT TURN: Traversal using relay NAT ICE: Interactive connectivity establishment
SIP Signaling
E=128.59.19.194:8123
Media
L=10.1.2.3:5060
Introduction to VoIP
25
INVITE (offer)
example.net OK (answer)
E=128.59.19.194:8123
L=10.1.2.3:8000 10.1.2.3:8000 Gather addresses (L,E,R) 10.1.2.3:8000 (local) 128.59.19.194:8123 (external) 192.1.2.3:7002 (relay)
192.168.1.2:6000
Introduction to VoIP
26
Agenda
Introducing VoIP
What does it take to build simple audio telephony? What are the main features of SIP How do we implement various services like call transfer, auto-attendant, voicemail?
Introduction to VoIP 27
Multi-party features
speed dial call forwarding follow me call filtering/blocking (in/out) do not disturb distinctive ringing autoanswer
call waiting call transfer (blind, consultative) conference call call park call pickup music on hold call monitoring
Presence-enabled calls
place call only if callee is available call conference participants when all are online and not busy receive IM when someone joins a conference receive email, IM alert for new voicemails
Presence-enabled conferencing
IM conference alerts
Unified messaging
Programmability of services
Introduction to VoIP 29
B2BUA
Make call when boss is online
Endpoint
Proxy/registrar
Forward to office phone during day, and home phone during evening
Endpoint
Language for End System Services (LESS) for endpoint service creation Direct user interaction, direct media control Handle converged information, e.g., call, presence, email
CGI-PROXY-REQUEST stdout
Common gateway interface -SIP-CGI (RFC 3050) Call processing language -CPL (XML-based, allows GUI) SIP servlets (Java)
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"; } } Low-priority Urgent
SIP proxy
Phone
Introduction to VoIP
32 Voicemail
Call transfer
A B
Introduction to VoIP
33
Back-to-back UA
B A
SIP SIP
Services
ACK
Voicemail
Various design alternatives
Endpoint based
alice@vmail.yahoo.com
Proxy controls
vmail.pl
CGI-PROXY-REQUEST stdout
If no response
Introduction to VoIP
35
PSTN
Telephone
Internet
Voice gateway VXML Voice and telephony functions VoiceXML browser
HTML Internet user
IVR platform Voice and telephony functions (ASR, TTS, DTMF) Service logic (application specific)
Introduction to VoIP
36
VoiceXML contd.
<form action=url> Enter your Id: <input name=id> <input type=submit> </form> <form> <field name=id> <prompt> Your ID, please. </prompt> </field> <block> <submit next=url/> </block> </form>
Telephony, speech synthesis or audio output, user input and grammar, program flow, variable and properties, error handling,
Introduction to VoIP 37
DTMF
PSTN
Telephone SIP/PSTN gateway
Internet
Internet user Audio
D
SIP INFO
RTP/ RFC2833
Introduction to VoIP
38
IP to telephone Telephone to IP Static mapping Telephone Gateway knows the SIP server Telephone SIP/PSTN SIP server
network subscriber gateway <sip:4567@gateway2.example.com ;user=phone>
1-212854xxxx=>@gw1.columbia.edu
IP endpoint
Overlapping networks E164 numbering (using ENUM Translating audio (-law/A-law) Multiple providers DNS) Translating signaling (PRI/T1,ISUP) Load balancing +1 212 9397042 => Overlap signaling 2.4.0.7.9.3.9.2.1.2.1.e164.arp Telephony routing over IP (TRIP) a => sip:hgs@cs.columbia.edu in SIP are Route in PSTN Advanced features lost advertisement
Can be implemented in outbound proxy Translating identifiers (phone number) hierarchical network Suitable for current +1 Determining transition points @service.mci.com at 4/min +1212 @nyc.gw.com at 1/min +1212939 @itgw1.columbia.edu free
Introduction to VoIP
39
Summary
Introducing VoIP
Basic audio transfer, why we need RTP and SIP/SDP? Message format, addressing, building blocks, routing, transport, NAT traversal, Types of services, programmability, call transfer, third-party, voicemail, interactive voice response, telephone interworking,
Introduction to VoIP 40
Inside SIP
VoIP activities
IETF working groups: sip, sipping, mmusic, xcon, p2psip, simple, impp, iptel, enum, ecrit, avt, sigtran, midcom, Elsewhere: 3GPP, ITU-T, W3C, Jabber/XSF, ETSITiphon, IMTC, sip-forum, VON,
Introduction to VoIP
41
References
SIP: RFC 3261-3265 http://www.cs.columbia.edu/sip RTP: RFC 3550, 3551, http://www.cs.columbia.edu/~hgs/rtp My thesis: http://www.cs.columbia.edu/~kns10/publication/thesis.pdf (part III: Enterprise IP telephony) Open source SIP server: http://www.openser.org Free SIP accounts: http://iptel.org
Introduction to VoIP
42