You are on page 1of 128

snom VoIP Primer

Christian Stredicke

June 2003

1. Introduction to VoIP 2. H.323 3. SIP 4. snom technology suite 5. Installation of snom 4S 6. Conclusion 7. Test

V1.0

The Internet evolved from a research network into a real-time communications network
PPPoE PPTP PPP SOAP DiffSrv RSVP HTTP

TLS SIP WAP

IM
Presence PBX

IPv6

SMTP (Email) ftp IPv4


TCP UDP
V1.0

SNMP AAAA SRV NAPTR ENUM

POP3 DHCP RIP NAT DNS

The Internet Protocol (IP) is based on sending packets


Example anatomy of an audio packet
Ethernet Header IP UDP RTP G.711 Ethernet Checksum

Preamble 6 Byte Src 6 Byte Dst 2 Byte Type

Version Length DiffSrv ID Flags Fragment Time to live Protocol Checksum Source Destination 20 Bytes

Source Port Dest Port Length Checksum 8 bytes

Version Padding Extension Source IDs Marker Payload Type Sequence Number Timestamp Sync ID

V1.0

RTP = Real-time transport protocol 54 Bytes header for every audio packet = 21.6 kBit @ 20 ms! Packets can easily be viewed with Ethereal (www.ethereal.com)

Sending voice packets is like sending freight with forwarders*


Arrive with jitter, out of order Local Forwarder

May get lost during transportation


LH901

Receiver in India

LH710

Local Forwarder Sender in Germany V1.0

May take different routes Packet are sent with Priority tag

* Just faster!

Computer networks are designed for high bandwidth, but no delivery guarantee
ISDN BRI = 128 kBit/s Ethernet 10 BT = 78 BRI Ethernet 100 BT = 781 BRI At 39 for a PC card! Ethernet 1000 BT = 7812 BRI WLAN 802.11 11 MBit/s = 85 BRI 54 MBit/s = 421 BRI 802.16

V1.0

RTP sometimes has to pass bottlenecks, especially on the network edges

Customer can control outgoing traffic

TCP (http) may block Bs RTP traffic

Phone
Router Router

Other
TCP RTP

RTP

Distance

Other

DSL Line

Backbone

V1.0

Bandwidth

Amongst the attempts to get telephony working on a IP-based network SIP seems to be the best
MGCP H.323 MEGACO H.323v2 SIP (RFC2543)

H.450 H.323v4 (Avaya etc.) (Skinny)

SIP (RFC3261 ff.)

ISDN over IP

V1.0

H.323 and SIP fight for customer acceptance

H.323
Official standard Some devices in the market already (legacy devices) Most devices do not support supplementary services (H.450)

SIP
Similar to HTTP Less requirement on program space than H.323 Suitable for large operators Cisco and Microsoft support SIP Darling of the Internet society Almost everybody jumping on the train

V1.0

10

Microsoft XP is going for the VoIP industry


Getting Microsoft Windows XP means getting a SIP client 70 ms latency end to end, kernel support Acoustic echo cancellation (hands free speaking) Presence list Stability is ok Microsoft-like nice user interface

Windows XP embedded and Windows Pocket PC Includes SIP stack as well as other features Many gateways and stand alone equipment will this stuff

V1.0

11

1. Introduction to VoIP 2. H.323 3. SIP 4. snom technology suite 5. Installation of snom 4S 6. Conclusion 7. Test

V1.0

12

Basic elements of an H.323 system


Terminals Telephones Videophones IVR devices Voicemail systems Softphones

Gateways
Gatekeepers Multipoint Control Units (MCUs)

V1.0

13

Gateways

Gateways interface an H.323 network to other networks (ISDN,PSTN etc). Composed of Media Gateway Controller (MGC) and Media Gateway (MG). MGC handles all the call signaling functions. MG handles the media related functions.

V1.0

14

Gatekeepers

Optional Component of an H.323 system.


Responsible for Registration, Address translation, Admission control, Bandwidth control and Zone management functions (RAS). Logical component of an H.323 system but Can be colocated within a gateway. Can perform direct or routed call signaling.

V1.0

15

Media Control Units (MCUs)

Responsible for managing multipoint conferences (two or more endpoint engaged in a conference). The MCU contains a Multipoint Controller (MC) that manages the call signaling and may optionally have Multipoint Processors (MPs) to handle media mixing, switching, or other media processing.

V1.0

16

A typical H.323 network

V1.0

17

A simple H.323 call

V1.0

18

The big problem: H.323 is not really interoperable


Most vendors are stuck in interoperability problems
Private Small Business Professional H.323 SIP Proprietary

ASN.1 reduces productivity


Effort

Most implementers used openh323 The star is falling

ROSE

Software concept works for stand alone PC, but can not be used on embedded systems

ASN.1

openh323 Features

V1.0

19

1. Introduction to VoIP 2. H.323 3. SIP 4. snom technology suite 5. Installation of snom 4S 6. Conclusion 7. Test

V1.0

20

3. SIP 3.1 User Point of View 3.2 Architecture 3.3 Registration 3.4 Basic Call 3.5 Call Control 3.6 PSTN interoperability

V1.0

21

The URL is the unique description of a telephony contact


New URL types: Christian Stredicke <sip:cs@snom.de> Christian Stredicke <tel:03039907830@telekom.de> Entering URL in hard phones is not so much fun Some tricks to ease the pain Automatic appending of domain Address book, redial Using TAPI for dialing from PC Clever number setup (cs, np, tb, ...) URL must always start with the sip scheme May contain a large range of characters like +, -, %, . Display names are encoded using UTF-8 (Unicode)

V1.0

22

SIP proxies search for the right person


Registration includes information about probability of presence Moving the mouse changes the probability to 1.0 Leaving the mouse untouched lowers continuously the probability Mailbox has low probability (but above 0.0) Sequential forking: Ringing one potential endpoint after another Parallel forking Calling several parties at the same time The first one picking up the call gets the call Phones can register for several accounts with different probabilities
V1.0

23

3. SIP 3.1 User Point of View 3.2 Architecture 3.3 Registration 3.4 Basic Call 3.5 Call Control 3.6 PSTN interoperability

V1.0

24

The SIP architecture looks like a mixture of HTTP and Email


Proxy 2
Gateway 2

Internet
Proxy 1 Registrar 1 UA Gateway 1

UA

Intranet VPN
Registrar 2

V1.0

UA

UA

UA

UA

25

The SIP proxy can be compared to a HTTP proxy: Taking complexity away from the client
Finding a destination Comparable to HTTP proxy But real-time Requests may be redirected to other proxies Stateless proxies Just forwarding packets Stateful proxies Taking care of a call Other functions Billing Maintenance Outbound proxy handles all traffic of a dumb phone
V1.0

26

A stateless proxy just forwards packets to the right destination

Proxy

(1) INVITE

(2) INVITE (3) 100 Trying (5) 180 Ringing (7) 200 Ok

(4) 100 Trying (6) 180 Ringing


(8) 200 Ok (9) ACK

(10) ACK

V1.0

27

A stateful proxy may fork a call to multiple destinations


Proxy

(1) INVITE (2) 100 Trying (3a) INVITE (3b) INVITE (4a) 100 Trying (5) 180 Ringing (4b) 180 Ringing (6a) 100 Trying (6b) 180 Ringing (8) 200 Ok (10) ACK V1.0 (7) 200 Ok (9) ACK

28

Registrars remember where users can be found


Close relationship with proxies Usually registrar and proxy are the same program Registrars keep a list of registrations One user can be found in different locations Comparable to gatekeeper registration

V1.0

29

User agents (UA) are the endpoints of a SIP call


Usually a hard or soft phone Gateways are user agents as well UA client (UAC) initiates something UA server (UAS) answers something

UAS and UAC may change during a call From and To-Fields are exchanges in this case

V1.0

30

SIP URLs provide a powerful way to describe a contact and its parameters
Like HTTP URL Examples: sip:cs@snom.de: Simple URL <sip:cs@snom.de:5061>: Adding port number Fred F. Feuerstein <sip:fff@snom.de>: Real name <sip:fff@snom.de>;q=1.0: Probability of presence <sip:fff@snom.de:5061;transport=tls>: Transport layer <sip:fff@snom.de>;q=1.0;expires=360: Several parameters sip:j.doe@big.com?subject=project%20x&priority=ur gent Details in RFC 3261
V1.0

31

Messages are encoding using ASCII characters (bit hackers go home!)


printf() instead of ASN.1Compiler Line termination with \r\n (tribute to MS-DOS) Double line termination means end of message body Attachments may follow of Content-Length indicates so Line continuation if new line starts with space Example:
REGISTER sip:cs@snom.de SIP/2.0 From: Christian Stredicke <sip:cs@snom.de> ;q=1.0 To: Christian Stredicke <sip:cs@snom.de>;q=1.0 Cseq: 1 REGISTER Content-Language: en User-Agent: snom V1.8b Content-Type: image/jpeg Content-Length: 376 Jg45tzw49tz59p q3tz erihgisrgz dfkjh skdfgh hfg sdlfjgh sdfgjh sldfghsfghsdfhg lsfhg lskfgh sfkgh sfkgh slkfdg

See Email and HTTP.

V1.0

32

Principle of communication between entities


Requests Initiate something Have something like REQUEST sip:address SIP/2.0 in the first line of the message Response Responds to a request Look like SIP/2.0 486 Busy Here in the first line Codes < 200 are intermediate responses Codes >= 200 and < 300 are success responses Codes >= 300 are failure responses Acknowledge Stands a little bit out in the communication Terminates an INVITE transaction

V1.0

33

Via headers trace the path of a request and allow a respond to travel that path back
Every instance tags the path of a request taken so far by adding a via field Replies must be send back popping Via fields off the message Forking proxies add branch parameters to the via fields to tag different branches

Via: host3;branch=123.2 Via: host2 Via: host1

Via: host3;branch=123.1 Via: host2 Via: host1

Via: host2 Via: host1

Via: host1

V1.0

34

Record-Route fields are used to ensure that some proxies are part of subsequent requests
SIP does not mandate 1st request that requests between two UA take the same Record-Route: h2, h4 path Contact: h1 Actually, SIP encourages taking a direct path even Record-Route: h2 for ACK Contact: h1 That causes problems with stateful proxies and billing systems Record-Route: h2 Record-Route ensures that proxies that add themselves to the route are in the message chain in future requests
V1.0 Contact: h1 Subsequent requests

3 Route: h4 2

Contact: h1 1

Route: h2, h4

35

Every message has a sequence number


CSeq field CSeq: 1 REGISTER CSeq: 1 INVITE Sequence numbers are kept within: A call A registration A notify, subscribe, ... UAC and UAS keep their own sequence numbers for requests If a client receives a message with an CSeq number less or equal to the one received, it is takes an message repetition Relevant for UDP

V1.0

36

SIP can be transported over UDP, TCP and TLS


UDP Messages may get lost Mandatory Repetition of messages:

Requests until a response arrives (same CSeq) Responses if a request repetition arrives ACK if a response arrives twice

TCP Like HTTP Content-Length becomes very important TLS Is a SSL (Secure Socket Layer) version Keeps SIP traffic secure Like TCP Different port to avoid misunderstandings (e.g. 5061)
V1.0

37

To save some space, short names of header fields are available


Saving space makes up 0.000143 % of an average call In other words, does not make sense May help to keep the UDP message size boundary (but not really) However, feature is mandatory From = f To = t Content-Length: l Call-ID: I

See draft

V1.0

38

3. SIP 3.1 User Point of View 3.2 Architecture 3.3 Registration 3.4 Basic Call 3.5 Call Control 3.6 PSTN interoperability

V1.0

39

Registration is a simple mechanism to give the UA an identity


UA sends REGISTER request to registrar (or outbound proxy) Registrar answer with response 200 Ok: Registration is ok 404 Not Found: User may not register here 403 Not Found: User is not known 100 Trying: Intermediate response 401 Authentication Required: UA has to provide a password Any Response!

V1.0

40

Example 1: Successful registration


Phone wants to register as 1 at registrar 62.254.248.7 Address does not need to be a dots-and-number address
REGISTER sip:62.254.248.7 SIP/2.0 From: <sip:1@62.254.248.7> To: <sip:1@62.254.248.7> Call-ID: 200108161729222931115@62.254.248.56 Date: Thu, 16 Aug 2001 17:29:22 GMT CSeq: 1 REGISTER Contact: <sip:1@62.254.248.56:5060;transport=udp> Via: SIP/2.0/UDP 62.254.248.56:5060 Expires: 3600 Content-Length: 0

Registrar returns all registrations for this number


Expiry time indicates how long the registration will last and is determined by the registrar Example taken from Cisco proxy registration
V1.0

SIP/2.0 200 OK Via: SIP/2.0/UDP 62.254.248.56:5060 Call-ID: 20010816172922294833@62.254.248.56 From: <sip:1@62.254.248.7> To: <sip:1@62.254.248.7> CSeq: 1 REGISTER Contact: <sip:1@62.254.248.56:5060;transport=udp>;expires="Th u, 16 Aug 2001 15:31:14 GMT" Contact: <sip:1@62.254.248.213;method=INVITE>;description="OP EN";expires="Thu, 16 Aug 2001 21:57:01 GMT" Expires: 3600 Content-Length: 0

41

Example 2: Failed registration


Phone wants to register as 1 at registrar a1.sipbakeoff.org Registrar responds with intermediate message 100 Trying
REGISTER sip:a1.sipbakeoff.org SIP/2.0 From: <sip:1@a1.sipbakeoff.org> To: <sip:1@a1.sipbakeoff.org> Call-ID: 200108161729012822929@62.254.248.56 Date: Thu, 16 Aug 2001 17:29:01 GMT CSeq: 1 REGISTER Contact: <sip:1@62.254.248.56:5060;transport=udp> Via: SIP/2.0/UDP 62.254.248.56:5060 Expires: 3600 Content-Length: 0

400 Code indicates that something went wrong


403 means that there was no account set up at the registrar

SIP/2.0 100 Trying Via: SIP/2.0/UDP 62.254.248.56:5060 From: sip:1@a1.sipbakeoff.org To: sip:1@a1.sipbakeoff.org Call-ID: 200108161729012916541@62.254.248.56 CSeq: 1 REGISTER Content-Length: 0
SIP/2.0 403 - Forbidden Via: SIP/2.0/UDP 62.254.248.56:5060 From: sip:1@a1.sipbakeoff.org To: sip:1@a1.sipbakeoff.org Call-ID: 200108161729012822929@62.254.248.56 CSeq: 1 REGISTER Content-Length: 0

V1.0

42

Example 3: Authentication challenges the UAC with a 401/407 response


Registrar denies registration with 401 Authentication Required 401 contains challenge that must be answered by UAC
REGISTER sip:a1.sipbakeoff.org SIP/2.0 From: <sip:1@a1.sipbakeoff.org> ... Cseq: 1 REGISTER Content-Length: 0 SIP/2.0 401 Authentication Required WWW-Authenticate: Digest realm="a.com",domain="sip:snom1@a1.sipbakeoff.org:70 72;maddr=62.254.248.14",nonce="aWGQ03+9PIZNYfTthPUSl A==",algorithm=MD5 Cseq: 1 REGISTER Content-Length: 0 REGISTER sip:a1.sipbakeoff.org SIP/2.0 From: <sip:1@a1.sipbakeoff.org> ... Authorization: Digest username="01",realm="a.com",nonce="9wTTyVG1WlOwkdpHB EmioQ==",response="d39db66212c999fbb0f1c767364479eb" ,uri="sip:62.254.248.14:5070" Cseq: 2 REGISTER Content-Length: 0 SIP/2.0 200 Ok ... Cseq: 2 REGISTER Content-Length: 0

UAC tries again with Authentication-Field


Seconds register is new request, therefore CSeq is increased In general, every request can be challenged Multiple times, multiple lines Digest mandatory, Basic discouraged

V1.0

43

Which information does a client has to set up for port forwarding in NAT equipment?
Router needs information where to send packets in private network Map port to private address and port By default packets will be rejected or sent to DMZ Router needs hint for security checking Accept packets from any destination Accept packets only from associated host Accept packets only from associated host and port
V1.0

123.123.123.123

192.168.0.1

Client

Client Router

44

STUN uses the digging hole trick to set up port associations


Initialization procedure checks environment Goal: Check if STUN is needed Type of NAT does actually not really matter because user is not interested in failure reason SIP port kept alive by sending packets every 15-60 s

RTP ports are allocated dynamically when starting a call Otherwise keep-alive traffic would be double RTCP port can not be allocated because next port allocation is unlikely Long ringing and putting caller on hold is problematic (no port refresh during this time)

V1.0

45

How does port forwarding in UPnP work?


Find the Internet access device Broadcast messages (no user setup required) Download the description of the UPnP device via http Retrieve the public IP address from the router Set up port mapping explicitly http requests using XML (SOAP) attachments Other commands also available UPnP is much more than setting up port forwarding on routers

V1.0

46

Registering Procedure of the snom phones


1. Send a REGISTER message with the IP unchanged identity (coming from DHCP or static setup) Includes a rport parameter in the top via This parameter get completed if the proxy receives the packet from a IP address that is different from the unchanged identity The proxy sends the packet to the port indicated by rport (thats how the packet makes it back to the phone) If the phone does not receive the changed rport back, the registration is done (public IP address, ALG, inside private network registration) 2. If there is a rport parameter returned, the phone will try to do UPnP or STUN Default policy is to try UPnP first, then STUN Can be changed in the settings 3. If the public IP address has been determined, the phone will register with this Then there is no more checking NAT method
V1.0

47

3. SIP 3.1 User Point of View 3.2 Architecture 3.3 Registration 3.4 Basic Call 3.5 Call Control 3.6 PSTN interoperability

V1.0

48

INVITE is used to establish a call


UAC sends INVITE UAS may respond with 100 Trying If expected answer takes a while UAS may respond with a 180 Ringing Indicates that the UAS is ringing the user UAS sends 200 Ok if the connection is set up UAC sends ACK to confirm that session has been set up
V1.0 (1) INVITE

(2) 100 Trying (3) 180 Ringing (4) 200 Ok (5) ACK

49

Example 4: Successful INVITE: Sending out the INVITE


First line contains destination May contain tags UAC tags from-field that contains the origin however this address is not used for reaching the originator Call-ID should be unique in universe Contact field indicates where requests may be sent SDP attachment describes where audio may be sent
V1.0
INVITE sip:abc@62.254.248.105 SIP/2.0 From: <sip:snom1@a1.sb.org:7071>;tag=hsuiykhtpf To: sip:abc@62.254.248.105 Via: SIP/2.0/UDP 62.254.248.56:5060 Call-ID: 20010817113026866334@62.254.248.56 CSeq: 1 INVITE Contact: <sip:snom1@62.254.248.56:5060;transport=udp> User-Agent: snom Accept-Language: en Accept: application/sdp Supported: sip-cc, sip-cc-01, timer Session-Expires: 120 Content-Type: application/sdp Content-Length: 236 v=0 o=root 26500 26500 IN IP4 62.254.248.56 s=Call from 62.254.248.56 c=IN IP4 62.254.248.56 t=0 0 m=audio 5000 RTP/AVP 0 3 8 101 a=rtpmap:0 pcmu/8000 a=rtpmap:3 gsm/8000 a=rtpmap:8 pcma/8000 a=rtpmap:101 telephone-event/8000

50

Example 4: Successful INVITE: Receiving provisional responses


100 Trying Probably came from proxy Stops repeating UDP messages To field still untagged in this case It may be tagged and then we have a call leg If tagged the call splits into main call (untagged) and legs 180 Ringing UA may play ring back now Provisional responses may be acknowledged by PRACK Capability to receive PRACK has to be indicated in Allow header
SIP/2.0 100 Trying To: sip:abc@62.254.248.105 From: <sip:snom1@a1.sb.org:7071>;tag=7q30roe94y Via: SIP/2.0/UDP 62.254.248.56:5060 Call-ID: 20010817113103899961@62.254.248.56 CSeq: 1 INVITE Content-Length: 0

SIP/2.0 180 Ringing To: sip:abc@62.254.248.105 From: <sip:snom1@a1.sb.org:7071>;tag=7q30roe94y Via: SIP/2.0/UDP 62.254.248.56:5060 Call-ID: 20010817113103899961@62.254.248.56 CSeq: 1 INVITE Content-Length: 0

V1.0

51

Example 4: Successful INVITE: Receiving 200 Ok


To field now contains a tag Call now being split up into legs Contact field indicates where further requests may be sent
SIP/2.0 200 OK To: sip:abc@62.254.248.105;tag=150148666 From: <sip:snom1@a1.sb.org:7071>;tag=7q30roe94y Via: SIP/2.0/UDP 62.254.248.56:5060 Call-ID: 20010817113103899961@62.254.248.56 CSeq: 1 INVITE Contact: sip:deepa@62.254.248.105 Content-Type: application/sdp Content-Length: 153 v=0 o=deepa 134278 968037671 IN IP4 62.254.248.105 s=IPNess c=IN IP4 62.254.248.105 t=0 0 m=audio 5000 RTP/AVP 0 a=rtpmap:0 PCMU/8000 a=ptime:30

SDP attachment contains media data

V1.0

52

Example 4: Successful INVITE: Sending ACK


CSeq number remains unchanged ACK is not a new request In this case the ACK is directly sent to the address given in the Contact field Obviously, no proxy requested Record-Routing
ACK sip:deepa@62.254.248.105 SIP/2.0 Via: SIP/2.0/UDP 62.254.248.56:5060 From: <sip:snom1@a1.sb.org:7071>;tag=7q30roe94y To: sip:abc@62.254.248.105;tag=150148666 Call-ID: 20010817113103899961@62.254.248.56 CSeq: 1 ACK User-Agent: snom Content-Length: 0

V1.0

53

Example 4: Successful INVITE: Hanging up


BYE request directly sent to Contact Alternative would be using outbound proxy To and From-fields just copied If other party hangs up, To and From has to be exchanged CSeq in increased But only on the UAC side!
BYE sip:deepa@62.254.248.105 SIP/2.0 Via: SIP/2.0/UDP 62.254.248.56:5060 From: <sip:snom1@a1.sb.org:7071>;tag=7q30roe94y To: sip:abc@62.254.248.105;tag=150148666 Call-ID: 20010817113103899961@62.254.248.56 CSeq: 2 BYE Content-Language: en Content-Length: 0 SIP/2.0 200 OK To: sip:abc@62.254.248.105;tag=150148666 From: <sip:snom1@a1.sb.org:7071>;tag=7q30roe94y Via: SIP/2.0/UDP 62.254.248.56:5060 Call-ID: 20010817113103899961@62.254.248.56 CSeq: 2 BYE Content-Length: 0

All other requests except INVITE and not acknowledged by ACK


V1.0

54

Example 5: Canceling a call (1)


INVITE, 100 Trying and 180 Ringing like before User decides to cancel call, UAC sends out CANCEL CSeq number remains unchanged but method becomes CANCEL To field does not contain tag UAC receives 200 Ok on CANCEL This is only on the CANCEL!
CANCEL sip:abc@62.254.248.105 SIP/2.0 Via: SIP/2.0/UDP 62.254.248.56:5060 From: <sip:snom1@a1.sb.org:7071>;tag=qnbibiw4zj To: sip:abc@62.254.248.105 Call-ID: 200108171131320617421@62.254.248.56 CSeq: 1 CANCEL Content-Language: en Content-Length: 0 SIP/2.0 200 Ok To: sip:abc@62.254.248.105 From: <sip:snom1@a1.sb.org:7071>;tag=qnbibiw4zj Via: SIP/2.0/UDP 62.254.248.56:5060 Call-ID: 200108171131320617421@62.254.248.56 CSeq: 1 CANCEL Content-Length: 0

V1.0

55

Example 5: Canceling a call (2)


UAC receives 487 on INVITE Therefore, the INVITE failed If UAC receives 200 Ok on INVITE, the call is established Anyway, the UAC has to acknowledge the final result with an ACK
SIP/2.0 487 Request Terminated To: sip:abc@62.254.248.105 From: <sip:snom1@a1.sb.org:7071>;tag=qnbibiw4zj Via: SIP/2.0/UDP 62.254.248.56:5060 Call-ID: 200108171131320617421@62.254.248.56 CSeq: 1 INVITE Content-Length: 0 ACK sip:abc@62.254.248.105 SIP/2.0 Via: SIP/2.0/UDP 62.254.248.56:5060 From: <sip:snom1@a1.sb.org:7071>;tag=qnbibiw4zj To: sip:abc@62.254.248.105 Call-ID: 200108171131320617421@62.254.248.56 CSeq: 1 ACK User-Agent: snom Content-Length: 0

V1.0

56

3. SIP 3.1 User Point of View 3.2 Architecture 3.3 Registration 3.4 Basic Call 3.5 Call Control 3.6 PSTN interoperability

V1.0

57

Hold is just a modification of the SDP record that has been sent to the other party
To put the other party on hold, either party may send a re-INVITE The IP address 0.0.0.0 indicates the other party that it should stop sending media Re-INVITE must be replied to with a 200 Ok 100 Trying not necessary 180 Ringing not allowed here
INVITE sip:789@62.254.248.56:5060;transport=udp SIP/2.0 Via:SIP/2.0/UDP 62.254.248.6:5060;branch=bw.62.254.248.6 From:<sip:3015553333@62.254.248.6>;tag=247792666997982268876 To:<sip:789@62.254.248.56:5060>;tag=oe94ywxqnb Call-ID:20010816141657975436@62.254.248.56 CSeq:774927797 INVITE Contact:<sip:62.254.248.6:5060> Allow:ACK,BYE,CANCEL,INFO,INVITE,PRACK,REFER Supported:100rel,timer Content-Length:210 Content-Type:application/sdp v=0 o=CiscoSystemsSIP-IPPhone-UserAgent 6734 5093 IN IP4 62.254.249.87 s=SIP Call c=IN IP4 0.0.0.0 t=0 0 m=audio 16392 RTP/AVP 0 101 a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0

UAC answers with ACK


200 Ok may contain SDP record as well In order to allow music on hold, it should not do that

V1.0

58

Call forwarding is implemented using 301 and 302 responses


301 and 302 are treated like error codes Transaction is acknowledged and over That implies that the new transaction may have a new CSeq A new INVITE is sent to the given contact 301 and 302 are business of proxies In the context of parallel and sequential forking Multiple contacts cause trouble on most UA
V1.0
INVITE sip:19785551111@62.254.249.86 SIP/2.0 From: <sip:789@62.254.248.57:5060>;tag=nxawl7blpm To: sip:19785551111@62.254.249.86 Via: SIP/2.0/UDP 62.254.248.57:5060 Call-ID: 200108151150449828253@62.254.248.57 CSeq: 1 INVITE Contact: <sip:789@62.254.248.57:5060>;transport=UDP ... SIP/2.0 302 Moved temporarily Via: SIP/2.0/UDP 62.254.248.57:5060 From: <sip:789@62.254.248.57:5060>;tag=nxawl7blpm To: sip:19785551111@62.254.249.86 CSeq: 1 INVITE Call-ID: 200108151150449828253@62.254.248.57 Contact: sip:user1@62.254.249.92 ACK sip:19785551111@62.254.249.86 SIP/2.0 ...

INVITE sip:user1@62.254.249.92 SIP/2.0 From: <sip:789@62.254.248.57:5060>;tag=nxawl7blpm To: sip:19785551111@62.254.249.86 Via: SIP/2.0/UDP 62.254.248.57:5060 Call-ID: 200108151150451812316@62.254.248.57 CSeq: 1 INVITE ...

59

Transferring a call using REFER (1)

(1) INVITE (hold)

(2) 200 Ok
(3) ACK (4) REFER (5) 202 Accepted (6) INVITE (7) 200 Ok (9) NOTIFY (10) 200 Ok (11) BYE (12) 200 Ok V1.0 (8) ACK

60

Transferring a call using REFER (2)


First put the call on hold (1-3) Otherwise the other phone could get into trouble having only one media stream (would have to put the call on hold as well) Request a transfer with REFER 202 Response stops retransmission of the request Other party now tries to set up the requested call Notify originator about transfer result REFER request is already over, so a new request must be initiated be the other party Attachment contains result If everything went ok, the original call can be closed If not, the original call be be reactivated
V1.0

61

To know which state another UA is in, UA should subscribe to Dialog-State


Similar to presence, but more phone specific States for ringing and on hold XML-Based coding State information Call-ID, From, To

Important for Call Pickup


Important for LED control

V1.0

62

Music on hold, call park, call pick & friends


Are implemented using the methods above Music on hold invites the media server to the other party Call park initiates transfer to park server Sometimes this is also called hold Call pick is done by a INVITE with the Replaces header Information known by dialog state-subscription No introduction of new messages for call control

V1.0

63

NOTIFY is a simple and powerful way to send information to a UAS


NOTIFY carries attachment Could be the result of a REFER Could be presence status Type is indicated in Content-Type Uses the transport mechanism of SIP like all other messages Has From, To, Call-ID, CSeq, Content-Length like all other messages Is subject to the message repeating mechanism like all other messages

V1.0

64

Message waiting indication (MWI) is a good example for the usage of the NOTIFY mechanism
NOTIFY goes through proxy as unknown message All registered users (including mailbox) receives NOTIFY All users answer and effectively stop sender from repeating Whoever reads the message responds with a 200 Ok
NOTIFY sip:123@62.254.248.56 SIP/2.0 Via: SIP/2.0/UDP 62.254.248.89:5060 From: <sip:Comverse_vm@62.254.248.89>;tag=19140-1058962.254.248.89 To: <sip:123@62.254.248.56> CSeq: 21911 NOTIFY Call-ID: 31961-997948029-177396725@62.254.248.89 Content-Type: application/simple-message-summary Event: simple-message-summary Content-Length: 48

Message-Waiting: yes Voicemail: 3/0 Fax: 1/0

SIP/2.0 200 OK From: <sip:Comverse_vm@62.254.248.89>;tag=19140-1058962.254.248.89 To: <sip:123@62.254.248.56> Via: SIP/2.0/UDP 62.254.248.89:5060 Call-ID: 31961-997948029-177396725@62.254.248.89 CSeq: 21911 NOTIFY User-Agent: snom V1.6c Content-Length: 0

V1.0

65

3. SIP 3.1 User Point of View 3.2 Architecture 3.3 Registration 3.4 Basic Call 3.5 Call Control 3.6 PSTN interoperability

V1.0

66

Overlap dialing is implemented using the 484 response


Gateway Proxy

(1) INVITE (CSeq = 1) (2) 484 Address Incomplete (3) ACK Timeout (4) INVITE (CSeq = 2) (5) 100 Trying (8) 180 Ringing (10) 200 Ok (11) ACK (6) INVITE (7) 180 Ringing (9) 200 Ok (12) ACK SAM Subsequent Address Message IAM Initial Address Message

V1.0

67

Provisional acknowledge (PRACK)


Problem: Provisional responses (1xx) are not reliable in UDP This important because temporary provisional media streams need acknowledge Solution: Acknowledge them with PRACK PRACK has its own sequence number (RSeq)
INVITE sip:abc@62.254.248.105 SIP/2.0 Supported: 100rel ... Content-Type: application/sdp Content-Length: 236 SIP/2.0 183 Proceeding Require: 100rel RSeq: 776655 ... CSeq: 1 INVITE Content-Length: 0 PRACK sip:watson@mypc.bell-tel.com SIP/2.0 RAck: 776655 1 INVITE ... CSeq: 2 PRACK SIP/2.0 200 OK Via: SIP/2.0/UDP saturn.bell-tel.com ... CSeq: 2 PRACK

See example

V1.0

68

Temporary provisional media streams (183)


Initial INVITE indicates where audio is expected Gateway sends 183 Session Progress and starts playing audio one way
(1) INVITE (sdp = ) Gateway

(2) 100 Trying


(3) 183 Session Progress (Ringback RTP) (4) PRACK (5) 200 Ok (PRACK)

UAC confirms provisional with PRACK


When other party picks up, 200 Ok is send and UAC starts sending audio as well

(6) 200 Ok (7) ACK (2 way audio)

V1.0

69

1. Introduction to VoIP 2. H.323 3. SIP 4. snom technology suite 5. Installation of snom 4S 6. Conclusion 7. Test

V1.0

70

The snom 4S consists of a real-time part (media server) and a call control part Intelligent, but sometimes takes a little time

Proxy

Fast, but not too intelligent


V1.0

Media Server

71

The proxy consists of several components that are necessary for SIP

Web Interface
Scripting
Billing

Registrar

Proxy

Location Server

Logging

XML
V1.0

DNS

72

The proxy runs different domains completely separately


Like renting a hotel room Different customers with different domains (snom.com, bnc.co.jp) Test and productive system Customers may access the proxy with their private password Data is kept separate Customer A cannot see what customer B is doing Enables central IP services

V1.0

73

Stateful information is permanently stored in the file system


Stateful Information Registration Information Messages But not ongoing calls XML Human readable/editable format Can be used together with revision control systems (CVS) Allows large scalability 1 Million users fit easily on modern hard disk Performance then is the problem

V1.0

74

The scripting makes customization and programming of the proxy simple and safe
Copy success story of PHP (Apache) Easy to understand Extremely flexible Cannot crash proxy so easily No CPL (Call Processing Language)! Too complicated Not powerful enough Web Interface sets variables that are interpreted by default script Quick setup for most typical cases No programming necessary

V1.0

75

NAT support has great important in practical usage


Reject private address registration Give a hint using the rport parameter Frustrating history of users trying to register their phone behind NAT STUN server included Only necessary functionality Support of path registrations Clients register with a list of addresses instead on only one

V1.0

76

Instant messaging is not the job of the proxy; however the proxy does its best to support it
Normal request handling rules Implements full IM functionality Store & Forward Store messages on file system until user registered again Simple & effective

Welcome Message When users sign in first time they get a greeting message

V1.0

77

Presence can be done on the user agents; caution has to be taken about performance
Number of presence updates can easily kill the proxy 10000 users with 50 contacts each changing their state every hour generate more than 100 transactions per second! Questions the presence promise We wait until a feasible solution for this problem has been identified When user agents support presence (like Microsoft Messenger) proxy can handle it

V1.0

78

Billing: One of these tricky issues


Has been forgotten by SIP in the beginning Interfaces: Plain file (named pipe, ) XML billing notifications via SIP RADIUS

Problems Bypassing proxy (solution for PSTN termination: gateway setup) Caller information Hangup upon account expiration

V1.0

79

ENUM allows the lookup of telephone numbers to DNS names


Simple mechanism tel:+493039833401 1.0.4.3.3.8.9.3.0.3.9.4.arpa.net Service pointer for this DNS entry Today there are some problems Overlap dialing does not work with ENUM Security is hard to ensure (redirecting to expensive PSTN numbers) snom 4S offers ENUM Secure DNS missing (will be available at end of March)

V1.0

80

The user may access the proxy to see the call list, messages, redirection settings, passwords, etc.
See missed calls even if not registered Independent from location where phone is Simple redirection Simple setup for redirecting to cell phone Voice mail integration with different account number

V1.0

81

The media server is based on a generic XMLprogrammable subsystem


Simple description of the various media types Variables Substitutions for date, number of messages etc Simple commands like store message Programming errors cannot crash the media server Performance is very good XML is converted to internal table Users can set up their own media types Adding new language Modifying existing types Creating new types Subsystem supports transcoding Conference between different codec calls Using the snom phone SIP stack
V1.0

82

We offer the most typical media types in the standard installation


Mailbox
Sample mailbox with different modes (personal greeting, standard greeting, absence, etc.)

Auto Attendant
Auto attendant initiates transfer of existing call or early media call (REFER or 3xx redirect).

Conference Music, Error


Simple conference bridge with or without authentication of users. Can also be used for callback and click-to dial and B2BUA. Music on hold server. Reading error explanations.

Calling Card
Simple Calling Card application with precise billing.

V1.0

83

Performance measurements have shown good performance for G.711 and caution for G.729A
1 0,9 0,8 0,7 0,6 0,5 0,4 0,3 0,2 0,1 0

750 MHz Pentium II

2 G729 4 G729A 20 G711 30 G711 10 G711 Conf

V1.0

84

Calling Cards
Main problem: What happens when card becomes empty? User continues talking User is not warned User may want to hear a gong for every coin he uses Solution: Calling Card in media server Media server keeps track on used coins No multiple call problem Media server generates tones for billing information

V1.0

85

Scaling snom 4S
SIP can inherently be scaled If user agents support DNS SRV Proxy supports database replication Performance is not the issue on the proxy 1 Mio calls per day results in a approx. 50 transactions per second (no problem) Media Server needs to

V1.0

86

We run our proxy and media server for more than a year now at snom.com
Several domains snom.info for snom 200 phones Plug & Play snomag.de as free proxy for everyone who wants to try snom.com for our telephony traffic stredicke.de for sip:christian@stredicke.de Pubic media accounts sip:conf@snom.com for sample conferencing sip:info1@snomag.de for test calls sip:moh@snomag.de for Internet music on hold Plug & Play setup of snom.info mailboxes Exposed to the public Internet We had a few DoS attacks But no problems with the proxy stability Performance seems not to be an issue Currently, approx. 1000 users are actively using the proxy
V1.0

87

The snom 105 is a small-size phone with a graphical display


Optimized design for VoIP Connectors on the back 128 x 64 B/W display Cellular phone like functions Function keys Animated menus Message display Asian character support Multiple registrations, multiple calls

V1.0

88

The snom 200 is a office phone with a two-line display


Phone for business area LED keys Dedicated keys for special functions Large handset, good audio performance 2-line display More simple to produce Smart functions Number guessing Remote state indication

V1.0

89

The embedded web server make access to the proxy easy


Complex setup can be done via the web browser Line registrations Diagnostics Remote management Address book management Dialing from the web browser Helpful for SIP URL Web browser allows remote control Also from other applications E.g. TAPI (Outlook)

V1.0

90

Plug and Play support makes mass deployment easy


Large installations must have a mechanism that automatically installs the phones No new mechanism should be used for SIP and VoIP snom uses http for transporting the configuration data Existing infrastructure can be used (Apache, mysql) Simple ASCII based format Tunnels trough firewalls and NAT Settings can be made read-only Phones can be put into operators realm Redirect according to MAC address Users may select operator realm from web interface Automatic software update
V1.0

91

1. Introduction to VoIP 2. H.323 3. SIP 4. snom technology suite 5. Installation of snom 4S 6. Conclusion 7. Test

V1.0

92

Installation on Windows Platforms can be done easily if you follow some rules
Just follow the dialog and the manual! Be sure to be administrator Otherwise you might have problems adding the proxy as a new service In this case, the proxy does not start automatically

You dont need to reboot the machine Manually starting from the service manager But make sure that after a reboot the proxy is coming up
Check the event log for extraordinary messages

V1.0

93

Windows stores some basic information in the registry and then reads the rest from the files
Get the root directory from the registry HKEY_LOCAL_MACHINE/SOFTWARE/snom/proxy is the root path reg_dir contains the root directory for the proxy html_port_number and sip_port_number define the ports Other configuration information is stored in config.xml Configuration of the admin account Domains are stored in the domain directories Dont edit this file when the proxy is running (changes will overwrite it)

V1.0

94

Updating the Windows service is not so easy, you have to follow some voodoo-tricks (warp II)
Mark the service for manual starting Keeps Windows from using this file after reboot Reboot Uninstall the old software Is now safe because image is not being used Install the new software Start it in the service manager Check the version number and the build If they did not change you have a problem

V1.0

95

The install.sh script simplifes the Linux installation for SuSE and RedHat
Follow the descriptions in the manual Make sure you are root The script sets up run level information and copies the executable into the /usr/sbin directory Be careful with name mixing (rcsnomproxy, snomproxy) Old proxy was named sip-proxy, new has name snomproxy

V1.0

96

RedHat startup procedure


/etc/snomproxy.conf contains the variables for startup information START_SNOMPROXY: yes or no SNOMPROXY_OPTS contains the command line interface arguments This usually contains the html/sip port and the startup directory snomproxy.conf is overwritten during (re-)installation Use /etc/init.d/snomproxy stop/start for controlling the proxy

V1.0

97

Should the customer use Linux or Windows?


If the customer has a preference, dont try to convince him Proxy runs fine on both platforms Performance is good on both systems Linux is easier to access with telnet/SSH For operators that can be an advantage SuSE is European style, RedHat American We had some trouble with RedHat, now its a well supported platform Try to stay away from other distributions as we dont support them Windows can be managed by most administrators For companies that can be an advantage
V1.0

98

Licensing keeps people from using illegal copies of our software


Licensing is bound to the IP address The current IP address of the proxy can be seen on the Licensing Web page (on the top) The proxy must match the IP address to one of the hostnames All license names must be in the hostname list Later we do DNS resolution on the hostnames as well If the proxy is not licensed it rejects all requests with 500 License Expired But the rest of the proxy is operative

V1.0

99

You can go to the domain by clicking on the link or by logging in

Log in as: Administrator Domain Administrator User

V1.0

100

Checking if the SIP proxy is up & running


Check the product version Version 2.xy (x = major, y = minor release) Version 2.xyz (z = beta release indicator) Check if the service comes up after reboot Check if the product is licensed

V1.0

101

First you should make sure that the fundamental settings are ok
Choose Ports Logging helps identifying problems Use this only if the proxy runs on several IP addresses Set a password

Leave this empty in the beginning


V1.0

102

Before you can start operating the proxy, you need to set up a domain

Click here to go to the domain

Edit or remove an existing domain

Enter a domain name here to create a new domain V1.0

103

Take a look at the domain settings first and set the password for the domain administrator

Set your domain password here

Enter the link to the media server (see below) V1.0

104

Define the way the proxy handles registrations

Allow only known users to register

Define the expiration Default probability for user agents V1.0

Avoid problems with devices behind NAT

105

Set up your first user account

Name of the account

Name for authentication (usually the same as the account name)

Choose password that cannot be guessed easily Single registration avoids problems when clients register with changing addresses Other names for the account

V1.0

106

Check if your account has been set up

Name of the account

Click here to edit this account

Number of current registrations on this account Remove the account

V1.0

Accounts can be enabled or disabled

107

On the phone, set up the registration information as well (credentials first)

Define for which lines the line is valid

Typically the domain name

Define the expiration Password Username as Default defined on the for probability proxy (not userthe agents account!)

V1.0

108

Enter the account information in the SIP/Line Settings menu on the phone web interface
Choose on of the accounts

Put your real name in here

The account name of the proxy (not the username) Mailbox address (leave empty for now)

Domain name

Probability that user can be found on this phone V1.0

Leave as is

Leave as is

109

Check if the registration succeeded

Current local time How the phone can be reached, maybe including the path to the user agent

Phone type

Domain Account name V1.0 Real name

Duration of registration Remove this registration (account is not deleted)

110

Looking at the SIP trace you also get an idea what's going on
Local time of reception IP address Packet behind link

Good registration

UDP or TCP Rx = Received (normally) Tx = Send (normally) Rr = Repetition received Ta = Send automatic answer Tr = Send message repetition Tf = Send failed

Good registration, message repetition

V1.0

111

After making your first call, you should see the call in the call trace
Local time of call Source; clicking here show details of the call Destination

Duration V1.0

112

A typical call flow includes forking the request to several destination


Initial Invite Forking to phone and mailbox

Phones show that they are ringing

Mailbox picks the calls up Acknowledgement of cancel Proxy cancels the call to the phone

V1.0

Hang up

113

A simple dial plan for a office with a single gateway


Mode is always forward All calls with at least 4 digits go to the gateway

Incomplete incoming calls (at least 5 digits) go to central number

Redirect calls to the FAX to another number

V1.0

114

Before operating the media server, you should check the fundamental settings
Make sure the IP address is correct

If you want to use Email, enter the server information here

Making entering number more simple

Make sure these ports are available Avoid CPU overload V1.0

115

The stack settings of the media server normally need no change


Only necessary if you are using NAT

Set during installation

Message repetition (in ms) Automatic hang-up when clients dont reconnect

Switching between transport layers

V1.0

116

Also, the codec settings normally dont need to be changed


U-law has best quality, but high bandwidth Packet delay is important only for conferencing

Force a specific codec

V1.0

Payload type is normally negotiated

Media server automatically detects DTMF, this setting is about indicating this

117

The currently known accounts on the media server


Edit an account Name of the account Delete an account

Type of the account V1.0

118

You can add accounts by selecting its type and account name
Name of the account Type of the account

V1.0

119

The music on hold account type just plays music; the user may select the type with DTMF
Authentication information All accounts have a language setting

Location of the music files

All accounts have a password

Where the account should register V1.0

120

The conferencing account mixes the audio streams of all participants


Authentication information

If password is present, the caller is prompted for the password before he can join the conference

V1.0

121

The conferencing account mixes the audio streams of all participants


Time until the mailbox picks up Authentication information If this matches the To-header, the mailbox does not ask for the password After recording a message, the mailbox sends a MWI to this destination

Maximum recording length


V1.0

122

User defined account types may implement all kinds of media-related services like calling-card
<?xml version ="1.0" standalone="yes"?> <media_definition>

Hidden settings

<!-- global options for the mailbox --> <option name="x-type">Mailbox2</option> <option name="x-conference">false</option> <option name="x-msg_send_mwi">true</option> <option name="x-msg_send_email_summary">true</option> <option name="email_url"></option> <option name="email_name"></option> <option name="x-email_file"></option>

Web settings Find the initial state

<!-- find the start state --> <start condition="equal ${owner} true">welcome_main_menu</start> <start condition="equal ${x-mailbox_mode} mb_name">mailbox_enabled_name</start> <start>mailbox_enabled_stand</start> <!-- default -->

State the

<!-- Welcome to the voicemail system of 123. Leave your message after the beep --> <state name="mailbox_enabled_stand"> Description of <!-- define the audio output: --> audio <audio type="file">${audio}/${lang}/mb_you_have_reached_the_voicemail_system.wav</audio> <audio type="file">${audio}/${lang}/mb_leave_msg_after_tone_two_minutes.wav</audio> <audio type="file">${audio}/${lang}/bi_beep.wav</audio>

V1.0

<!-- define the behavior: --> State transition <event name="audio_end"><cmd>msg_create</cmd><cmd>goto record_message</cmd></event> <event name="0-9"><cmd>set collect ${digit}</cmd><cmd>goto collect_digits</cmd></event> description <event name="#"><cmd>set collect</cmd><cmd>goto collect_digits</cmd></event> <event name="*"><cmd>set collect</cmd><cmd>goto collect_digits</cmd></event> </state>

123

1. Introduction to VoIP 2. H.323 3. SIP 4. snom technology suite 5. Installation of snom 4S 6. Conclusion 7. Test

V1.0

124

Conclusion
Voice over IP is a complex technology! However, has huge potentials Using computer infrastructure instead of specialized equipment Integration with computer network makes things easier (web browser, email-notification, etc.) SIP is getting mature Most of the services known from PSTN are possible Many new features that were not possible with PSTN snom offers phones and SIP proxy, media server VoIP technology can be integrated with any vendor Quality is important
V1.0

125

1. Introduction to VoIP 2. H.323 3. SIP 4. snom technology suite 5. Installation of snom 4S 6. Conclusion 7. Test

V1.0

126

Examination

V1.0

sip:info@snom.com

2003 snom technology Aktiengesellschaft Written by: Dr. Christian Stredicke Version: 1.0
The author has made his best effort to prepare this document. The content is based upon latest information whenever possible. The author makes no representation or warranties of any kind with regard to the completeness or accuracy of the contents herein and accept no liability of any kind including but not limited to performance, merchantability, fitness for any particular purpose, or any losses or damages of any kind caused or alleged to be caused directly or indirectly from this document.
For more information, mail info@snom.de, Pascalstr. 10B, 10587 Berlin, Germany.

You might also like