I am trying to set up a very basic SIP server. I can only establish external-to-internal calls using the following parameters with the default configuration files:
RTP Engine Config File interface=server_local_ip!public_domain_name
Kamailio Config File alias="public_domain_name" listen=server_local_ip:5061 adverise public_domain_name:5061
I cannot establish internal-to-external calls nor external-to-external calls with the above configuration settings. In these failed calls, the answering external callee UA sends 200-OK, but the caller UA does not ACK. In looking at the sip trace messages, no alias for the public ip address is appended to the Contact header of the external UA's 200-OK SIP message. So perhaps the caller doesn't know where to send the ACK.
The network setup has the local UAs and the Kamailio server behind a port-forwarded NAT routher. External (internet) UAs are also behind NAT routers.
Is there a change or addition to the above config snippets that would solve the problem, or do I need to add some instruction to the routing section?
Finally, does anyone sell or otherwise offer basic Kamailio/RTPEngine configuration files that work more or less "out-of-the box" for the described setup?
Thanks,
Steve Hamilton
Hello, can you show us some Sip logs of the call, you can use something like sngrep.
Below are some SIP snippets from both a successful call and a failed call:
Successful call from External (Internet) UA to Internal UA behind same NAT router as Kamailio server
Frame 77 (External UA Caller to Kamailio Server) Session Initiation Protocol (INVITE) Request-Line: INVITE sip:wow@pub-domain-name.net SIP/2.0 Method: INVITE Request-URI: sip:wow@pub-domain-name.net [Resent Packet: False] Message Header Call-ID: 5130c2963b8c1f46de2aa92e5ff3dee7@0:0:0:0:0:0:0:0 [Generated Call-ID: 5130c2963b8c1f46de2aa92e5ff3dee7@0:0:0:0:0:0:0:0] CSeq: 2 INVITE Sequence Number: 2 Method: INVITE From: "Think" sip:think@pub-domain-name.net;tag=da48a35 SIP from display info: "Think" SIP from address: sip:think@pub-domain-name.net SIP from tag: da48a35 To: sip:wow@pub-domain-name.net SIP to address: sip:wow@pub-domain-name.net Max-Forwards: 70 Contact: "Think" sip:think@192.168.9.150:49872;transport=tcp;registering_acc=pub-domain-net_net User-Agent: Jitsi2.10.5550Windows 10 Content-Type: application/sdp Via: SIP/2.0/TCP 192.168.9.150:49872;branch=z9hG4bK-363937-300d55dbdefe8ad301c7961b7c4c0e8a Proxy-Authorization: Digest username="think",realm="pub-domain-name.net",nonce="aHqfVWh6nikvR+zIKjSHaJPKD8Hlgooy",uri="sip:wow@pub-domain-name.net",response="b7d5db659208fcbfdd3b441e869bc253" Content-Length: 550 Message Body Session Description Protocol Session Description Protocol Version (v): 0 Owner/Creator, Session Id (o): think-jitsi.org 0 0 IN IP4 192.168.9.150 Session Name (s): - Connection Information (c): IN IP4 192.168.9.150
Frame 80 (Kamailio Server to Internal UA callee; external UA public ip address added to Contact header as alias) Session Initiation Protocol (INVITE) Request-Line: INVITE sip:wow@192.168.2.13:50060;transport=tcp;registering_acc=pub-domain-net_net SIP/2.0 Method: INVITE Request-URI: sip:wow@192.168.2.13:50060;transport=tcp;registering_acc=pub-domain-net_net [Resent Packet: False] Message Header Record-Route: sip:pub-domain-name.net;transport=tcp;lr=on;nat=yes Call-ID: 5130c2963b8c1f46de2aa92e5ff3dee7@0:0:0:0:0:0:0:0 [Generated Call-ID: 5130c2963b8c1f46de2aa92e5ff3dee7@0:0:0:0:0:0:0:0] CSeq: 2 INVITE Sequence Number: 2 Method: INVITE From: "Think" sip:think@pub-domain-name.net;tag=da48a35 SIP from display info: "Think" SIP from address: sip:think@pub-domain-name.net SIP from tag: da48a35 To: sip:wow@pub-domain-name.net SIP to address: sip:wow@pub-domain-name.net Max-Forwards: 69 Contact: "Think" sip:think@192.168.9.150:49872;transport=tcp;registering_acc=pub-domain-net_net;alias=172.59.210.229~28301~2 SIP C-URI display info: "Think" Contact URI: sip:think@192.168.9.150:49872;transport=tcp;registering_acc=pub-domain-net_net;alias=172.59.210.229~28301~2 User-Agent: Jitsi2.10.5550Windows 10 Content-Type: application/sdp Via: SIP/2.0/TCP pub-domain-name.net:5060;branch=z9hG4bK5818.37b0c4a1d32535a805caaa6cc7d97071.0;i=6 Via: SIP/2.0/TCP 192.168.9.150:49872;rport=28301;received=172.59.210.229;branch=z9hG4bK-363937-300d55dbdefe8ad301c7961b7c4c0e8a Content-Length: 594 Message Body Session Description Protocol Session Description Protocol Version (v): 0 Owner/Creator, Session Id (o): think-jitsi.org 0 0 IN IP4 73.150.xxx.xxx Session Name (s): - Connection Information (c): IN IP4 73.150.xxx.xxx
Frame 91 (Internal UA callee to Kamailio Server: 200-OK) Session Initiation Protocol (200) Status-Line: SIP/2.0 200 OK Status-Code: 200 [Resent Packet: False] [Request Frame: 80] [Response Time (ms): 4837] Message Header CSeq: 2 INVITE Sequence Number: 2 Method: INVITE Call-ID: 5130c2963b8c1f46de2aa92e5ff3dee7@0:0:0:0:0:0:0:0 [Generated Call-ID: 5130c2963b8c1f46de2aa92e5ff3dee7@0:0:0:0:0:0:0:0] From: "Think" sip:think@pub-domain-name.net;tag=da48a35 SIP from display info: "Think" SIP from address: sip:think@pub-domain-name.net SIP from tag: da48a35 To: sip:wow@pub-domain-name.net;tag=a160389a SIP to address: sip:wow@pub-domain-name.net SIP to tag: a160389a […]Via: SIP/2.0/TCP pub-domain-name.net:5060;branch=z9hG4bK5818.37b0c4a1d32535a805caaa6cc7d97071.0;i=6;received=73.150.xxx.xxx;rport=5060,SIP/2.0/TCP 192.168.9.150:49872;rport=28301;received=172.59.210.229;branch=z9hG4bK-363937-300d55d Record-Route: sip:pub-domain-name.net;transport=tcp;lr=on;nat=yes Contact: "wow" sip:wow@192.168.2.13:50060;transport=tcp;registering_acc=pub-domain-net_net SIP C-URI display info: "wow" Contact URI: sip:wow@192.168.2.13:50060;transport=tcp;registering_acc=pub-domain-net_net User-Agent: Jitsi2.10.5550Windows 10 Content-Type: application/sdp Content-Length: 546 Message Body Session Description Protocol Session Description Protocol Version (v): 0 Owner/Creator, Session Id (o): wow-jitsi.org 0 0 IN IP4 192.168.2.13 Session Name (s): - Connection Information (c): IN IP4 192.168.2.13 Connection Network Type: IN Connection Address Type: IP4 Connection Address: 192.168.2.13 Time Description, active time (t): 0 0 Media Description, name and address (m): audio 5000 RTP/AVP 96
Frame 92 (Kamailio server to External UA caller: 200-OK) Session Initiation Protocol (200) Status-Line: SIP/2.0 200 OK Status-Code: 200 [Resent Packet: False] [Request Frame: 77] [Response Time (ms): 4893] Message Header CSeq: 2INVITE Sequence Number: 2 Method: INVITE Call-ID: 5130c2963b8c1f46de2aa92e5ff3dee7@0:0:0:0:0:0:0:0 [Generated Call-ID: 5130c2963b8c1f46de2aa92e5ff3dee7@0:0:0:0:0:0:0:0] From: "Think" sip:think@pub-domain-name.net;tag=da48a35 SIP from display info: "Think" SIP from address: sip:think@pub-domain-name.net SIP from tag: da48a35 To: sip:wow@pub-domain-name.net;tag=a160389a SIP to address: sip:wow@pub-domain-name.net SIP to tag: a160389a Via: SIP/2.0/TCP 192.168.9.150:49872;rport=28301;received=172.59.210.229;branch=z9hG4bK-363937-300d55dbdefe8ad301c7961b7c4c0e8a Record-Route: sip:pub-domain-name.net;transport=tcp;lr=on;nat=yes Contact: "wow" sip:wow@192.168.2.13:50060;transport=tcp;registering_acc=pub-domain-net_net SIP C-URI display info: "wow" Contact URI: sip:wow@192.168.2.13:50060;transport=tcp;registering_acc=pub-domain-net_net User-Agent: Jitsi2.10.5550Windows 10 Content-Type: application/sdp Content-Length: 1182 Message Body Session Description Protocol Session Description Protocol Version (v): 0 Owner/Creator, Session Id (o): wow-jitsi.org 0 0 IN IP4 73.150.xxx.xxx Session Name (s): - Connection Information (c): IN IP4 73.150.xxx.xxx Connection Network Type: IN Connection Address Type: IP4 Connection Address: 73.150.xxx.xxx Time Description, active time (t): 0 0 Media Description, name and address (m): audio 35010 RTP/AVP 96
Frame 95 (External Caller UA to Kamailio Server: ACK of 200-OK) Session Initiation Protocol (ACK) Request-Line: ACK sip:wow@192.168.2.13:50060;transport=tcp;registering_acc=pub-domain-net_net SIP/2.0 Method: ACK Request-URI: sip:wow@192.168.2.13:50060;transport=tcp;registering_acc=pub-domain-net_net [Resent Packet: False] [Request Frame: 77] [Response Time (ms): 5144] Message Header Call-ID: 5130c2963b8c1f46de2aa92e5ff3dee7@0:0:0:0:0:0:0:0 [Generated Call-ID: 5130c2963b8c1f46de2aa92e5ff3dee7@0:0:0:0:0:0:0:0] CSeq: 2 ACK Sequence Number: 2 Method: ACK Via: SIP/2.0/TCP 192.168.9.150:49872;branch=z9hG4bK-363937-acd86ef1272918c02f80646a7ffd32c3 From: "Think" sip:think@pub-domain-name.net;tag=da48a35 SIP from display info: "Think" SIP from address: sip:think@pub-domain-name.net SIP from tag: da48a35 To: "wow" sip:wow@pub-domain-name.net;tag=a160389a SIP to display info: "wow" SIP to address: sip:wow@pub-domain-name.net SIP to tag: a160389a Max-Forwards: 70 Route: sip:pub-domain-name.net;transport=tcp;lr=on;nat=yes Contact: "Think" sip:think@192.168.9.150:49872;transport=tcp;registering_acc=pub-domain-net_net SIP C-URI display info: "Think" Contact URI: sip:think@192.168.9.150:49872;transport=tcp;registering_acc=pub-domain-net_net User-Agent: Jitsi2.10.5550Windows 10 Content-Length: 0
Frame 96 (Kamailio Server to Internal UA: ACK of 200-OK) Session Initiation Protocol (ACK) Request-Line: ACK sip:wow@192.168.2.13:50060;transport=tcp;registering_acc=pub-domain-net_net SIP/2.0 Method: ACK Request-URI: sip:wow@192.168.2.13:50060;transport=tcp;registering_acc=pub-domain-net_net [Resent Packet: False] [Request Frame: 80] [Response Time (ms): 5101] Message Header Call-ID: 5130c2963b8c1f46de2aa92e5ff3dee7@0:0:0:0:0:0:0:0 [Generated Call-ID: 5130c2963b8c1f46de2aa92e5ff3dee7@0:0:0:0:0:0:0:0] CSeq: 2 ACK Sequence Number: 2 Method: ACK Via: SIP/2.0/TCP pub-domain-name.net:5060;branch=z9hG4bK5818.98ab28cca407d8483ad6a69389305265.0;i=6 Via: SIP/2.0/TCP 192.168.9.150:49872;rport=28301;received=172.59.210.229;branch=z9hG4bK-363937-acd86ef1272918c02f80646a7ffd32c3 From: "Think" sip:think@pub-domain-name.net;tag=da48a35 SIP from display info: "Think" SIP from address: sip:think@pub-domain-name.net SIP from tag: da48a35 To: "wow" sip:wow@pub-domain-name.net;tag=a160389a SIP to display info: "wow" SIP to address: sip:wow@pub-domain-name.net SIP to tag: a160389a Max-Forwards: 69 Contact: "Think" sip:think@192.168.9.150:49872;transport=tcp;registering_acc=pub-domain-net_net;alias=172.59.210.229~28301~2 SIP C-URI display info: "Think" Contact URI: sip:think@192.168.9.150:49872;transport=tcp;registering_acc=pub-domain-net_net;alias=172.59.210.229~28301~2 User-Agent: Jitsi2.10.5550Windows 10 Content-Length: 0 RTP Connection finalized and succesful call is made.
Failed Call: Frame 58 (Int->Ext UA Caller Invite to Kamailio Server) Session Initiation Protocol (INVITE) Request-Line: INVITE sip:think@pub-domain-name.net SIP/2.0 Method: INVITE Request-URI: sip:think@pub-domain-name.net [Resent Packet: False] Message Header Call-ID: 12e8162ae975b2a1b7cc2fed4101e962@0:0:0:0:0:0:0:0 [Generated Call-ID: 12e8162ae975b2a1b7cc2fed4101e962@0:0:0:0:0:0:0:0] CSeq: 2 INVITE From: "WOW" sip:wow@pub-domain-name.net;tag=b1fd2e81 To: sip:think@pub-domain-name.net Max-Forwards: 70 Contact: "WOW" sip:wow@192.168.2.13:53616;transport=tcp;registering_acc=pub-domain-name_net User-Agent: Jitsi2.10.5550Windows 10 Content-Type: application/sdp Via: SIP/2.0/TCP 192.168.2.13:53616;branch=z9hG4bK-333030-96dd852a7c0145c94806d428bfd52f71 Transport: TCP Sent-by Address: 192.168.2.13 Sent-by port: 53616 Branch: z9hG4bK-333030-96dd852a7c0145c94806d428bfd52f71 Proxy-Authorization: Digest username="wow",realm="pub-domain-name.net",nonce="aIE222iBNa9LWBxxscVnnbDdGK4JO0FZ",uri="sip:think@pub-domain-name.net",response="29a3edef773fdde72fe0d462f827f35f" Content-Length: 890 Message Body Session Description Protocol Session Description Protocol Version (v): 0 Owner/Creator, Session Id (o): wow-jitsi.org 0 0 IN IP4 192.168.2.13 Session Name (s): - Connection Information (c): IN IP4 192.168.2.13 Time Description, active time (t): 0 0 Media Description, name and address (m): audio 5000 RTP/AVP 96 97 98 9 100 102 0 8 103 3 104 101
Frame 61 (Int->Ext Call - Kamailio to External UA) Session Initiation Protocol (INVITE) Request-Line: INVITE sip:think@192.168.6.129:62162;transport=tcp;registering_acc=pub-domain-name_net SIP/2.0 Method: INVITE Request-URI: sip:think@192.168.6.129:62162;transport=tcp;registering_acc=pub-domain-name_net [Resent Packet: False] Message Header Record-Route: sip:pub-domain-name.net;transport=tcp;lr=on;nat=yes Call-ID: 12e8162ae975b2a1b7cc2fed4101e962@0:0:0:0:0:0:0:0 [Generated Call-ID: 12e8162ae975b2a1b7cc2fed4101e962@0:0:0:0:0:0:0:0] CSeq: 2 INVITE From: "WOW" sip:wow@pub-domain-name.net;tag=b1fd2e81 To: sip:think@pub-domain-name.net Max-Forwards: 69 Contact: "WOW" sip:wow@192.168.2.13:53616;transport=tcp;registering_acc=pub-domain-name_net;alias=192.168.2.13~53616~2 User-Agent: Jitsi2.10.5550Windows 10 Content-Type: application/sdp Via: SIP/2.0/TCP pub-domain-name.net:5060;branch=z9hG4bK21a9.589fa94c2a5f6bf663ed3ab3f2c76f52.0;i=1 Transport: TCP Sent-by Address: pub-domain-name.net Sent-by port: 5060 Branch: z9hG4bK21a9.589fa94c2a5f6bf663ed3ab3f2c76f52.0 i=1 Via: SIP/2.0/TCP 192.168.2.13:53616;rport=53616;branch=z9hG4bK-333030-96dd852a7c0145c94806d428bfd52f71 Transport: TCP Sent-by Address: 192.168.2.13 Sent-by port: 53616 RPort: 53616 Branch: z9hG4bK-333030-96dd852a7c0145c94806d428bfd52f71 Content-Length: 936 Message Body Session Description Protocol Session Description Protocol Version (v): 0 Owner/Creator, Session Id (o): wow-jitsi.org 0 0 IN IP4 73.150.xxx.xxx Session Name (s): - Connection Information (c): IN IP4 73.150.xxx.xxx Time Description, active time (t): 0 0 Media Description, name and address (m): audio 35000 RTP/AVP 96 97 98 9 100 102 0 8 103 3 104 101
Frame 84 (External Callee to Kamailio Server: 200-OK) Session Initiation Protocol (200) Status-Line: SIP/2.0 200 OK Status-Code: 200 [Resent Packet: False] Message Header CSeq: 2 INVITE Call-ID: 12e8162ae975b2a1b7cc2fed4101e962@0:0:0:0:0:0:0:0 [Generated Call-ID: 12e8162ae975b2a1b7cc2fed4101e962@0:0:0:0:0:0:0:0] From: "WOW" sip:wow@pub-domain-name.net;tag=b1fd2e81 To: sip:think@pub-domain-name.net;tag=1186416 Via: SIP/2.0/TCP pub-domain-name.net:5060;branch=z9hG4bK21a9.589fa94c2a5f6bf663ed3ab3f2c76f52.0;i=1;received=73.150.xxx.xxx;rport=5060,SIP/2.0/TCP 192.168.2.13:53616;rport=53616;branch=z9hG4bK-333030-96dd852a7c0145c94806d428bfd52f71 Transport: TCP Sent-by Address: pub-domain-name.net Sent-by port: 5060 Branch: z9hG4bK21a9.589fa94c2a5f6bf663ed3ab3f2c76f52.0 i=1 Received: 73.150.xxx.xxx RPort: 5060 Transport: TCP Sent-by Address: 192.168.2.13 Sent-by port: 53616 RPort: 53616 Branch: z9hG4bK-333030-96dd852a7c0145c94806d428bfd52f71 Record-Route: sip:pub-domain-name.net;transport=tcp;lr=on;nat=yes Contact: "Think" sip:think@192.168.6.129:62162;transport=tcp;registering_acc=pub-domain-name_net User-Agent: Jitsi2.10.5550Windows 10 Content-Type: application/sdp Content-Length: 556 Message Body Session Description Protocol Session Description Protocol Version (v): 0 Owner/Creator, Session Id (o): think-jitsi.org 0 0 IN IP4 192.168.6.129 Session Name (s): - Connection Information (c): IN IP4 192.168.6.129 Time Description, active time (t): 0 0 Media Description, name and address (m): audio 5000 RTP/AVP 103
Frame 86 (Kamailio to Internal Caller UA: 200-OK)
Session Initiation Protocol (200) Status-Line: SIP/2.0 200 OK Status-Code: 200 [Resent Packet: False] Message Header CSeq: 2 INVITE Call-ID: 12e8162ae975b2a1b7cc2fed4101e962@0:0:0:0:0:0:0:0 [Generated Call-ID: 12e8162ae975b2a1b7cc2fed4101e962@0:0:0:0:0:0:0:0] From: "WOW" sip:wow@pub-domain-name.net;tag=b1fd2e81 To: sip:think@pub-domain-name.net;tag=1186416 Via: SIP/2.0/TCP 192.168.2.13:53616;rport=53616;branch=z9hG4bK-333030-96dd852a7c0145c94806d428bfd52f71 Transport: TCP Sent-by Address: 192.168.2.13 Sent-by port: 53616 RPort: 53616 Branch: z9hG4bK-333030-96dd852a7c0145c94806d428bfd52f71 Record-Route: sip:pub-domain-name.net;transport=tcp;lr=on;nat=yes Contact: "Think" sip:think@192.168.6.129:62162;transport=tcp;registering_acc=pub-domain-name_net User-Agent: Jitsi2.10.5550Windows 10 Content-Type: application/sdp Content-Length: 1223 Message Body Session Description Protocol Session Description Protocol Version (v): 0 Owner/Creator, Session Id (o): think-jitsi.org 0 0 IN IP4 73.150.xxx.xxx Session Name (s): - Connection Information (c): IN IP4 73.150.xxx.xxx Time Description, active time (t): 0 0 Media Description, name and address (m): audio 35022 RTP/AVP 103 Media Description, name and address (m): audio 35066 RTP/AVP 103
Frame 136 (Internal caller UA sending SIP-ACK for 200-OK to Kamailio Server) Session Initiation Protocol (ACK) Request-Line: ACK sip:think@192.168.6.129:62162;transport=tcp;registering_acc=pub-domain-name_net SIP/2.0 Method: ACK Request-URI: sip:think@192.168.6.129:62162;transport=tcp;registering_acc=pub-domain-name_net [Resent Packet: False] Message Header Call-ID: 12e8162ae975b2a1b7cc2fed4101e962@0:0:0:0:0:0:0:0 [Generated Call-ID: 12e8162ae975b2a1b7cc2fed4101e962@0:0:0:0:0:0:0:0] CSeq: 2 ACK Via: SIP/2.0/TCP 192.168.2.13:53616;branch=z9hG4bK-333030-7fe73867b52851d45ac33961e1368312 Transport: TCP Sent-by Address: 192.168.2.13 Sent-by port: 53616 Branch: z9hG4bK-333030-7fe73867b52851d45ac33961e1368312 From: "WOW" sip:wow@pub-domain-name.net;tag=b1fd2e81 To: "Think" sip:think@pub-domain-name.net;tag=1186416 Max-Forwards: 70 Route: sip:pub-domain-name.net;transport=tcp;lr=on;nat=yes Contact: "WOW" sip:wow@192.168.2.13:53616;transport=tcp;registering_acc=pub-domain-name_net User-Agent: Jitsi2.10.5550Windows 10 Content-Length: 0
Kamailio Server sends a TCP ack back to internal UA caller but does not forward the SIP-response ACK to external UA callee -- NO RTP CONNECTION, CALL FAILS.