Žilinská univerzita > Fakulta riadenia a informatiky > Katedra informačných sietí

Kamailio 3.1 with IPv6

http://tools.ietf.org/html/rfc5118 

 

Prerequisities

  • IPv6 enabled network
    • Correct IPv6 setting on your SIP Server
    • DHCPv6 server (in debian wide-dhcpv6-server for example) for correct IPv6 client DNS address assignment
  • DNS with IPv6 AAAA records (standard ISC dns server) for your SIP topology
  • SIP clients supporting IPv6
  • HW phones supporting IPv6

Note

  • SIP clients whose does not suppor IPv6
    • Bria 2.4, Bria 3.0, Xlite, EayBeam
    • Jitsi (SIP-communicator)

DNS configuration

In my case, where I'm extending my existing kamailio installation which already is working over IPv4 I have to add AAAA record

pstest          IN      AAAA    2001:4118:300:122:58ec:fcff:fe3a:17f4

For both, the IPv4 and IPv6 it is:

_sip._udp       IN      SRV 0 1 5060    pstest
_sip._tcp       IN      SRV 0 1 5060    pstest
_sips._tcp      IN      SRV     200 1 5061        pstest

pstest          IN      A       158.193.139.51
pstest          IN      AAAA    2001:4118:300:122:58ec:fcff:fe3a:17f4 

The modification of kamailio configuration

We have to slightly modify our config file, so we have to add our IPv6 address on which our server will listen:

listen=udp:2001:4118:300:122:58ec:fcff:fe3a:17f4:5060
listen=tcp:2001:4118:300:122:58ec:fcff:fe3a:17f4:5060

Do not forgett restart Kamailio server.

That's all!

Testing

Registration

Just open your IPv6 SIP client (Linphone here) and try to register. When the registration was sucesfull we should see an user among online, registered users:

pstest:/home/palo# kamctl ul show database engine 'MYSQL' loaded
Control engine 'FIFO' loaded
entering fifo_cmd ul_dump
Domain:: location table=512 records=1 max_slot=1
        AOR:: pepe
                Contact:: sip:pepe@[2001:4118:300:121:a00:27ff:fe86:c661] Q=
                        Expires:: 3347
                        Callid:: 1275699248
                        Cseq:: 2
                        User-agent:: Linphone/3.3.2 (eXosip2/3.3.0)
                        State:: CS_SYNC
                        Flags:: 0
                        Cflag:: 0
                        Socket:: udp:[2001:4118:300:122:58EC:FCFF:FE3A:17F4]:5060                         
Methods:: 4294967295
FIFO command was:
:ul_dump:openser_receiver_23650

Call flow

This simple call flow scenario includes two clients, one is using linphone on Ubuntu and another one Linphone on win7/64bit. They are both on the same IPv6 subnet with global unique IPv6 addresses. As SIP proxy we are using Kamailio IPv6 enabled Proxy with Global unique IPv6 address too.

|Time     | 2001:4118:300:121:a00:27ff:fe86:c661  | 2001:4118:300:121:a966:82b8:6a46:dbd5 |  
                            (SIP client 1)                         (SIP client 2)
|         |                   | 2001:4118:300:122:58ec:fcff:fe3a:17f4             
                                              (SIP Proxy server) 
|5,662    |         INVITE SDP ( speex speex speex GSM g711U g711A...lephone-even)          |                   |SIP From: sip:pepe@ps.sip.uniza.sk To:sip:palo@ps.sip.uniza.sk
|         |(5060)   ------------------>  (5060)   |                   |
|5,663    |         407 Proxy Authentication Required          |                   |SIP Status
|         |(5060)   <------------------  (5060)   |                   |
|5,672    |         ACK       |                   |                   |SIP Request
|         |(5060)   ------------------>  (5060)   |                   |
|5,730    |         INVITE SDP ( speex speex speex GSM g711U g711A...lephone-even)          |                   |SIP From: sip:pepe@ps.sip.uniza.sk To:sip:palo@ps.sip.uniza.sk
|         |(5060)   ------------------>  (5060)   |                   |
|5,732    |         100 trying -- your call is important to us          |                   |SIP Status
|         |(5060)   <------------------  (5060)   |                   |
|5,732    |                   |         INVITE SDP ( speex speex speex GSM g711U g711A...lephone-even)          |SIP Request
|         |                   |(5060)   ------------------>  (5060)   |
|5,740    |                   |         100 Trying|                   |SIP Status
|         |                   |(5060)   <------------------  (5060)   |
|5,740    |                   |         101 Dialog Establishement          |SIP Status
|         |                   |(5060)   <------------------  (5060)   |
|5,741    |         101 Dialog Establishement          |                   |SIP Status
|         |(5060)   <------------------  (5060)   |                   |
|8,044    |                   |         180 Ringing                   |SIP Status
|         |                   |(5060)   <------------------  (5060)   |
|8,044    |         180 Ringing                   |                   |SIP Status
|         |(5060)   <------------------  (5060)   |                   |
|9,255    |                   |         200 OK SDP ( speex speex speex GSM g711U g711A...lephone-even)          |SIP Status
|         |                   |(5060)   <------------------  (5060)   |
|9,255    |         200 OK SDP ( speex speex speex GSM g711U g711A...lephone-even)          |                   |SIP Status
|         |(5060)   <------------------  (5060)   |                   |
|9,280    |         ACK       |                   |                   |SIP Request
|         |(5060)   ------------------>  (5060)   |                   |
|9,281    |                   |         ACK       |                   |SIP Request
|         |                   |(5060)   ------------------>  (5060)   |
|11,508   |         BYE       |                   |                   |SIP Request
|         |(5060)   ------------------>  (5060)   |                   |
|11,509   |                   |         BYE       |                   |SIP Request
|         |                   |(5060)   ------------------>  (5060)   |
|11,513   |                   |         200 OK    |                   |SIP Status
|         |                   |(5060)   <------------------  (5060)   |
|11,513   |         200 OK    |                   |                   |SIP Status
|         |(5060)   <------------------  (5060)   |                   |

INVITE sip:palo@ps.sip.uniza.sk SIP/2.0
Via: SIP/2.0/UDP [2001:4118:300:121:a00:27ff:fe86:c661]:5060;branch=z9hG4bK7027080
From: <sip:pepe@ps.sip.uniza.sk>;tag=555706276
To: <sip:palo@ps.sip.uniza.sk>
Call-ID: 1178851616
CSeq: 20 INVITE
Contact: <sip:pepe@[2001:4118:300:121:a00:27ff:fe86:c661]>
Content-Type: application/sdp
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
Max-Forwards: 70
User-Agent: Linphone/3.3.2 (eXosip2/3.3.0)
Subject: Phone call
Content-Length:   452

v=0
o=pepe 123456 654321 IN IP6 2001:4118:300:121:a00:27ff:fe86:c661
s=A conversation
c=IN IP6 2001:4118:300:121:a00:27ff:fe86:c661
t=0 0
m=audio 7078 RTP/AVP 112 111 110 3 0 8 101
a=rtpmap:112 speex/32000/1
a=fmtp:112 vbr=on
a=rtpmap:111 speex/16000/1
a=fmtp:111 vbr=on
a=rtpmap:110 speex/8000/1
a=fmtp:110 vbr=on
a=rtpmap:3 GSM/8000/1
a=rtpmap:0 PCMU/8000/1
a=rtpmap:8 PCMA/8000/1
a=rtpmap:101 telephone-event/8000/1
a=fmtp:101 0-11
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP [2001:4118:300:121:a00:27ff:fe86:c661]:5060;branch=z9hG4bK7027080;rport=5060
From: <sip:pepe@ps.sip.uniza.sk>;tag=555706276
To: <sip:palo@ps.sip.uniza.sk>;tag=f11c829fa10fd0f1cba4621773c131eb.c870
Call-ID: 1178851616
CSeq: 20 INVITE
Proxy-Authenticate: Digest realm="ps.sip.uniza.sk", nonce="Ta7Yq02u139SLgraDGzEiWndAYf0nbWZ"
Server: kamailio (3.1.2 (x86_64/linux))
Content-Length: 0


ACK sip:palo@ps.sip.uniza.sk SIP/2.0
Via: SIP/2.0/UDP [2001:4118:300:121:a00:27ff:fe86:c661]:5060;branch=z9hG4bK7027080
From: <sip:pepe@ps.sip.uniza.sk>;tag=555706276
To: <sip:palo@ps.sip.uniza.sk>;tag=f11c829fa10fd0f1cba4621773c131eb.c870
Call-ID: 1178851616
CSeq: 20 ACK
Content-Length: 0


INVITE sip:palo@ps.sip.uniza.sk SIP/2.0
Via: SIP/2.0/UDP [2001:4118:300:121:a00:27ff:fe86:c661]:5060;branch=z9hG4bK1488857377
From: <sip:pepe@ps.sip.uniza.sk>;tag=555706276
To: <sip:palo@ps.sip.uniza.sk>
Call-ID: 1178851616
CSeq: 21 INVITE
Contact: <sip:pepe@[2001:4118:300:121:a00:27ff:fe86:c661]>
Proxy-Authorization: Digest username="pepe", realm="ps.sip.uniza.sk", nonce="Ta7Yq02u139SLgraDGzEiWndAYf0nbWZ", uri="sip:palo@ps.sip.uniza.sk", response="0e922cdf4129940e6f13012dc5cfbb44", algorithm=MD5
Content-Type: application/sdp
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
Max-Forwards: 70
User-Agent: Linphone/3.3.2 (eXosip2/3.3.0)
Subject: Phone call
Content-Length:   452

v=0
o=pepe 123456 654321 IN IP6 2001:4118:300:121:a00:27ff:fe86:c661
s=A conversation
c=IN IP6 2001:4118:300:121:a00:27ff:fe86:c661
t=0 0
m=audio 7078 RTP/AVP 112 111 110 3 0 8 101
a=rtpmap:112 speex/32000/1
a=fmtp:112 vbr=on
a=rtpmap:111 speex/16000/1
a=fmtp:111 vbr=on
a=rtpmap:110 speex/8000/1
a=fmtp:110 vbr=on
a=rtpmap:3 GSM/8000/1
a=rtpmap:0 PCMU/8000/1
a=rtpmap:8 PCMA/8000/1
a=rtpmap:101 telephone-event/8000/1
a=fmtp:101 0-11


SIP/2.0 100 trying -- your call is important to us
Via: SIP/2.0/UDP [2001:4118:300:121:a00:27ff:fe86:c661]:5060;branch=z9hG4bK1488857377;rport=5060
From: <sip:pepe@ps.sip.uniza.sk>;tag=555706276
To: <sip:palo@ps.sip.uniza.sk>
Call-ID: 1178851616
CSeq: 21 INVITE
Server: kamailio (3.1.2 (x86_64/linux))
Content-Length: 0


SIP/2.0 101 Dialog Establishement
Via: SIP/2.0/UDP [2001:4118:300:121:a00:27ff:fe86:c661]:5060;rport=5060;branch=z9hG4bK1488857377
Record-Route: <sip:[2001:4118:300:122:58EC:FCFF:FE3A:17F4];lr=on>
From: <sip:pepe@ps.sip.uniza.sk>;tag=555706276
To: <sip:palo@ps.sip.uniza.sk>;tag=6334
Call-ID: 1178851616
CSeq: 21 INVITE
Contact: <sip:palo@[2001:4118:300:121:a966:82b8:6a46:dbd5]:5060>
User-Agent: Linphone/3.4.3 (eXosip2/3.3.0)
Content-Length: 0


SIP/2.0 180 Ringing
Via: SIP/2.0/UDP [2001:4118:300:121:a00:27ff:fe86:c661]:5060;rport=5060;branch=z9hG4bK1488857377
Record-Route: <sip:[2001:4118:300:122:58EC:FCFF:FE3A:17F4];lr=on>
From: <sip:pepe@ps.sip.uniza.sk>;tag=555706276
To: <sip:palo@ps.sip.uniza.sk>;tag=6334
Call-ID: 1178851616
CSeq: 21 INVITE
Contact: <sip:palo@[2001:4118:300:121:a966:82b8:6a46:dbd5]:5060>
User-Agent: Linphone/3.4.3 (eXosip2/3.3.0)
Content-Length: 0


SIP/2.0 200 OK
Via: SIP/2.0/UDP [2001:4118:300:121:a00:27ff:fe86:c661]:5060;rport=5060;branch=z9hG4bK1488857377
Record-Route: <sip:[2001:4118:300:122:58EC:FCFF:FE3A:17F4];lr=on>
From: <sip:pepe@ps.sip.uniza.sk>;tag=555706276
To: <sip:palo@ps.sip.uniza.sk>;tag=6334
Call-ID: 1178851616
CSeq: 21 INVITE
Contact: <sip:palo@[2001:4118:300:121:a966:82b8:6a46:dbd5]>
Content-Type: application/sdp
User-Agent: Linphone/3.4.3 (eXosip2/3.3.0)
Content-Length:   361

v=0
o=palo 1949 1949 IN IP6 2001:4118:300:121:a966:82b8:6a46:dbd5
s=Talk
c=IN IP6 2001:4118:300:121:a966:82b8:6a46:dbd5
t=0 0
m=audio 7078 RTP/AVP 112 111 110 3 0 8 101
a=rtpmap:112 speex/32000
a=fmtp:112 vbr=on
a=rtpmap:111 speex/16000
a=fmtp:111 vbr=on
a=rtpmap:110 speex/8000
a=fmtp:110 vbr=on
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-11


ACK sip:palo@[2001:4118:300:121:a966:82b8:6a46:dbd5] SIP/2.0
Via: SIP/2.0/UDP [2001:4118:300:121:a00:27ff:fe86:c661]:5060;branch=z9hG4bK16237548
Route: <sip:[2001:4118:300:122:58EC:FCFF:FE3A:17F4];lr=on>
From: <sip:pepe@ps.sip.uniza.sk>;tag=555706276
To: <sip:palo@ps.sip.uniza.sk>;tag=6334
Call-ID: 1178851616
CSeq: 21 ACK
Contact: <sip:pepe@[2001:4118:300:121:a00:27ff:fe86:c661]>
Proxy-Authorization: Digest username="pepe", realm="ps.sip.uniza.sk", nonce="Ta7Yq02u139SLgraDGzEiWndAYf0nbWZ", uri="sip:palo@ps.sip.uniza.sk", response="0e922cdf4129940e6f13012dc5cfbb44", algorithm=MD5
Max-Forwards: 70
User-Agent: Linphone/3.3.2 (eXosip2/3.3.0)
Content-Length: 0


BYE sip:palo@[2001:4118:300:121:a966:82b8:6a46:dbd5] SIP/2.0
Via: SIP/2.0/UDP [2001:4118:300:121:a00:27ff:fe86:c661]:5060;branch=z9hG4bK1607863714
Route: <sip:[2001:4118:300:122:58EC:FCFF:FE3A:17F4];lr=on>
From: <sip:pepe@ps.sip.uniza.sk>;tag=555706276
To: <sip:palo@ps.sip.uniza.sk>;tag=6334
Call-ID: 1178851616
CSeq: 22 BYE
Contact: <sip:pepe@[2001:4118:300:121:a00:27ff:fe86:c661]:5060>
Max-Forwards: 70
User-Agent: Linphone/3.3.2 (eXosip2/3.3.0)
Content-Length: 0


SIP/2.0 200 OK
Via: SIP/2.0/UDP [2001:4118:300:121:a00:27ff:fe86:c661]:5060;rport=5060;branch=z9hG4bK1607863714
From: <sip:pepe@ps.sip.uniza.sk>;tag=555706276
To: <sip:palo@ps.sip.uniza.sk>;tag=6334
Call-ID: 1178851616
CSeq: 22 BYE
User-Agent: Linphone/3.4.3 (eXosip2/3.3.0)
Content-Length: 0

 

AttachmentSize
File ipv6sip.pcap30.94 KB
Groups: