[SR-Users] Help debugging a missing ACK (is Asterisk covering up a mistake in my Kamailio config?)

Daniel-Constantin Mierla miconda at gmail.com
Thu Sep 4 09:18:20 CEST 2014


On 02/09/14 19:05, Alex Villací­s Lasso wrote:
> El 02/09/14 05:17, Daniel-Constantin Mierla escribió:
>> If you get signling routed ok but no audio, then you have problems 
>> bridging rtp stream.
>>
>> Most probably you need to use rtpproxy (eventually with advertise 
>> address (there is a patch or use second parameter for 
>> rtpproxy_manage())) to bridge.
>>
> I am already using rtpproxy in all my tests. All of my audio is routed 
> correctly when I do not use advertised_address, without any log 
> messages. However, in the original setup, when the non-Asterisk SIP 
> trunk fails to route the ACK correctly, the Asterisk in localhost 
> drops the call after 10 to 30 seconds.
This is the typical situation for missing ACK.
>
> When I introduce advertised_address into the setup, with no other 
> changes, I get the audio issues.
>> I never used sip-natting in kernel, so I am not aware how good it is. 
>> I would rather do just simple port forwarding on the firewall and let 
>> kamailio and rtpproxy to work with advertised address.
>>
> I will try to negotiate this.
>> Then you can use:
>>
>> listen=privateip advertise publicip
>>
> The private ip serves both phones in the same LAN as the Kamailio 
> interface, and the gateway. Will the publicip advertising cause 
> problems with the SIP clients in the LAN?

I guess the firwall will forward properly, if the rule is on everything 
received on external ip and port, but has to be tested.

Better to use different ports, so you have two listen sockets, or if 
possible two private ips.

Cheers,
Daniel
>> You will get rid of record routing log message about missing socket. 
>> Otherwise, you should ignore it if the sip routing is ok.
>>
>> Cheers,
>> Daniel
>>
>> On 01/09/14 18:55, Alex Villací­s Lasso wrote:
>>> [...]
>>>
>>> Maybe I should explain my setup better.
>>>
>>> The test setup I want to run is, in a way, twice natted. The 
>>> asterisk instance runs in localhost, the innermost net. The asterisk 
>>> is not supposed to get its SIP signaling from anyone but Kamailio. 
>>> The /etc/asterisk/sip.conf contains this:
>>>
>>> [root at elx3 ~]# cat /etc/asterisk/sip.conf
>>> [general]
>>> context=default
>>> allowoverlap=no
>>> allowguest=no
>>> realm=asterisk
>>> srvlookup=yes
>>> tos_sip=cs3
>>> tos_audio=ef
>>> tos_video=af41
>>> relaxdtmf=yes
>>> trustrpid=no
>>> sendrpid=yes
>>> sendrpid=pai
>>> disallow=all
>>> allow=ulaw
>>> allow=alaw
>>> allow=gsm
>>> rtcachefriends=yes
>>> callcounter=yes
>>> alwaysauthreject=yes
>>> faxdetect=yes
>>> t38pt_udptl=yes
>>> vmexten=*97
>>> videosupport=yes
>>> maxcallbitrate=384
>>> nat=force_rport,comedia
>>> directmedia=no
>>> accept_outofcall_message=yes
>>> auth_message_requests=yes
>>>
>>> ;The following settings restrict Asterisk to localhost for Kamailio 
>>> integration
>>> deny=0.0.0.0/0.0.0.0
>>> permit=127.0.0.1/255.255.255.0
>>> bindport=5080
>>> outboundproxy=127.0.0.1
>>> outboundproxyport=5060
>>>
>>> #include sip_general_custom.conf
>>> #include sip_register.conf
>>> #include sip_custom.conf
>>>
>>>
>>> The kamailio instance is the first instance of routing. It listens 
>>> on all interfaces on port 5060 and routes packets from all the other 
>>> interfaces to localhost and back. One of these interfaces is the 
>>> local network (192.168.2.18), which routes to our gateway.
>>>
>>> If kamailio is given a public interface, then our setup works 
>>> correctly. The exchange in the first mail shows what happens when 
>>> the packet is routed through our gateway (the second instance of 
>>> routing, and an actual NAT). Our gateway is a linux system with a 
>>> kernel module (nf_nat_sip, nf_conntrack_sip) that rewrites the 
>>> headers on the fly, resulting in the packet exchange as seen in the 
>>> first mail. From what I have seen, the kernel modules rewrite To, 
>>> From, but not Record-Route, where an instance of the internal IP 
>>> remains. If I understand correctly, the remote system tries to route 
>>> to its own interpretation of 192.168.2.18, which fails.
>>>
>>> If I add the advertised_address parameter and set it to the public 
>>> IP, outgoing calls from asterisk to a registered SIP client break 
>>> and get established with no audio (tested with Jitsi). I get the 
>>> following exchange from 192.168.2.18:
>>>
>>> INVITE 
>>> sip:avillacis at 192.168.3.2:5060;transport=udp;registering_acc=pbx_villacis_com 
>>> SIP/2.0
>>> Record-Route: <sip:201.234.196.170;r2=on;lr=on;ftag=as0551c44f>
>>> Record-Route: <sip:127.0.0.1;r2=on;lr=on;ftag=as0551c44f>
>>> Via: SIP/2.0/UDP 
>>> 201.234.196.170;branch=z9hG4bKd5f3.6bce295bab666c7aceeddfebdc70c190.0
>>> Via: SIP/2.0/UDP 127.0.0.1:5080;branch=z9hG4bK696d3bf6;rport=5080
>>> Max-Forwards: 69
>>> From: "Anonymous" <sip:anonymous at anonymous.invalid:5080>;tag=as0551c44f
>>> To: 
>>> <sip:avillacis at 192.168.3.2:5060;transport=udp;registering_acc=pbx_villacis_com>
>>> Contact: <sip:anonymous at 127.0.0.1:5080>
>>> Call-ID: 4f40ffcc123459313daf47397e18b0af at 127.0.0.1:5080
>>> CSeq: 102 INVITE
>>> User-Agent: Asterisk PBX 11.12.0
>>> Date: Mon, 01 Sep 2014 16:11:44 GMT
>>> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, 
>>> INFO, PUBLISH, MESSAGE
>>> Supported: replaces, timer
>>> Content-Type: application/sdp
>>> Content-Length: 277
>>> P-hint: outbound
>>>
>>> v=0
>>> o=root 1851320733 1851320733 IN IP4 127.0.0.1
>>> s=Asterisk PBX 11.12.0
>>> c=IN IP4 127.0.0.1
>>> t=0 0
>>> m=audio 18624 RTP/AVP 0 8 3 101
>>> a=rtpmap:0 PCMU/8000
>>> a=rtpmap:8 PCMA/8000
>>> a=rtpmap:3 GSM/8000
>>> a=rtpmap:101 telephone-event/8000
>>> a=fmtp:101 0-16
>>> a=ptime:20
>>> a=sendrecv
>>> SIP/2.0 180 Ringing
>>> To: 
>>> <sip:avillacis at 192.168.3.2:5060;transport=udp;registering_acc=pbx_villacis_com>;tag=d28a3a6e
>>> Via: SIP/2.0/UDP 
>>> 201.234.196.170;branch=z9hG4bKd5f3.6bce295bab666c7aceeddfebdc70c190.0;received=192.168.2.18,SIP/2.0/UDP 
>>> 127.0.0.1:5080;branch=z9hG4bK696d3bf6;rport=5080
>>> Record-Route: 
>>> <sip:201.234.196.170;r2=on;lr=on;ftag=as0551c44f>,<sip:127.0.0.1;r2=on;lr=on;ftag=as0551c44f>
>>> CSeq: 102 INVITE
>>> Call-ID: 4f40ffcc123459313daf47397e18b0af at 127.0.0.1:5080
>>> From: "Anonymous" <sip:anonymous at anonymous.invalid:5080>;tag=as0551c44f
>>> Contact: "avillacis" 
>>> <sip:avillacis at 192.168.3.2:5060;transport=udp;registering_acc=pbx_villacis_com>
>>> User-Agent: Jitsi2.5.5255Linux
>>> Content-Length: 0
>>>
>>> SIP/2.0 200 OK
>>> To: 
>>> <sip:avillacis at 192.168.3.2:5060;transport=udp;registering_acc=pbx_villacis_com>;tag=d28a3a6e
>>> Via: SIP/2.0/UDP 
>>> 201.234.196.170;branch=z9hG4bKd5f3.6bce295bab666c7aceeddfebdc70c190.0;received=192.168.2.18,SIP/2.0/UDP 
>>> 127.0.0.1:5080;branch=z9hG4bK696d3bf6;rport=5080
>>> Record-Route: 
>>> <sip:201.234.196.170;r2=on;lr=on;ftag=as0551c44f>,<sip:127.0.0.1;r2=on;lr=on;ftag=as0551c44f>
>>> CSeq: 102 INVITE
>>> Call-ID: 4f40ffcc123459313daf47397e18b0af at 127.0.0.1:5080
>>> From: "Anonymous" <sip:anonymous at anonymous.invalid:5080>;tag=as0551c44f
>>> Contact: "avillacis" 
>>> <sip:avillacis at 192.168.3.2:5060;transport=udp;registering_acc=pbx_villacis_com>
>>> User-Agent: Jitsi2.5.5255Linux
>>> Content-Type: application/sdp
>>> Content-Length: 217
>>>
>>> v=0
>>> o=avillacis-jitsi.org 0 0 IN IP4 192.168.3.2
>>> s=-
>>> c=IN IP4 192.168.3.2
>>> t=0 0
>>> m=audio 5006 RTP/AVP 0 8 3 101
>>> a=rtpmap:0 PCMU/8000
>>> a=rtpmap:8 PCMA/8000
>>> a=rtpmap:3 GSM/8000
>>> a=rtpmap:101 telephone-event/8000
>>> ACK 
>>> sip:avillacis at 192.168.3.2:5060;transport=udp;registering_acc=pbx_villacis_com 
>>> SIP/2.0
>>> Via: SIP/2.0/UDP 
>>> 201.234.196.170;branch=z9hG4bKd5f3.805fac86b0d1e9c1dc577d5ca12f12d3.0
>>> Via: SIP/2.0/UDP 127.0.0.1:5080;branch=z9hG4bK2d32b799;rport=5080
>>> Max-Forwards: 69
>>> From: "Anonymous" <sip:anonymous at anonymous.invalid:5080>;tag=as0551c44f
>>> To: 
>>> <sip:avillacis at 192.168.3.2:5060;transport=udp;registering_acc=pbx_villacis_com>;tag=d28a3a6e
>>> Contact: <sip:anonymous at 127.0.0.1:5080>
>>> Call-ID: 4f40ffcc123459313daf47397e18b0af at 127.0.0.1:5080
>>> CSeq: 102 ACK
>>> User-Agent: Asterisk PBX 11.12.0
>>> Content-Length: 0
>>>
>>> At the same time, I get this on the kamailio log:
>>>
>>> WARNING: rr [loose.c:830]: after_loose(): no socket found for match 
>>> second RR
>>>
>>> If I try the incoming call from the internet, while 
>>> advertised_address is enabled, I get the following exchange. I also 
>>> get the exact same log message, and one-way audio.
>>>
>>> INVITE sip:*43 at 201.234.196.170:5060 SIP/2.0
>>> Via: SIP/2.0/UDP 198.58.101.75:5060;branch=z9hG4bK587b52bc;rport
>>> Max-Forwards: 70
>>> From: "9003" <sip:9003 at 198.58.101.75>;tag=as69ee0744
>>> To: <sip:*43 at 201.234.196.170:5060>
>>> Contact: <sip:9003 at 198.58.101.75:5060>
>>> Call-ID: 0398a11d3149031240ec2e70077a99fe at 198.58.101.75:5060
>>> CSeq: 102 INVITE
>>> User-Agent: FPBX-2.8.1(1.8.20.0)
>>> Date: Mon, 01 Sep 2014 16:46:43 GMT
>>> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, 
>>> INFO, PUBLISH
>>> Supported: replaces, timer
>>> Content-Type: application/sdp
>>> Content-Length: 301
>>>
>>> v=0
>>> o=root 1281221163 1281221163 IN IP4 198.58.101.75
>>> s=Asterisk PBX 1.8.13.1~dfsg1-3+deb7u3
>>> c=IN IP4 198.58.101.75
>>> t=0 0
>>> m=audio 12958 RTP/AVP 0 8 3 101
>>> a=rtpmap:0 PCMU/8000
>>> a=rtpmap:8 PCMA/8000
>>> a=rtpmap:3 GSM/8000
>>> a=rtpmap:101 telephone-event/8000
>>> a=fmtp:101 0-16
>>> a=ptime:20
>>> a=sendrecv
>>>
>>> SIP/2.0 100 trying -- your call is important to us
>>> Via: SIP/2.0/UDP 198.58.101.75:5060;branch=z9hG4bK587b52bc;rport=5060
>>> From: "9003" <sip:9003 at 198.58.101.75>;tag=as69ee0744
>>> To: <sip:*43 at 201.234.196.170:5060>
>>> Call-ID: 0398a11d3149031240ec2e70077a99fe at 198.58.101.75:5060
>>> CSeq: 102 INVITE
>>> Server: kamailio (4.1.5 (x86_64/linux))
>>> Content-Length: 0
>>>
>>>
>>> SIP/2.0 200 OK
>>> Via: SIP/2.0/UDP 198.58.101.75:5060;branch=z9hG4bK587b52bc;rport=5060
>>> Record-Route: 
>>> <sip:201.234.196.170;r2=on;lr=on;ftag=as69ee0744;vsf=SBoZSkpbSEZaLF1YW0dGeB8ICB8bDxsxMDEuNzU->
>>> Record-Route: 
>>> <sip:192.168.2.18;r2=on;lr=on;ftag=as69ee0744;vsf=SBoZSkpbSEZaLF1YW0dGeB8ICB8bDxsxMDEuNzU->
>>> From: "9003" <sip:9003 at 198.58.101.75>;tag=as69ee0744
>>> To: <sip:*43 at 201.234.196.170:5060>;tag=as5f3239b9
>>> Call-ID: 0398a11d3149031240ec2e70077a99fe at 198.58.101.75:5060
>>> CSeq: 102 INVITE
>>> Server: Asterisk PBX 11.12.0
>>> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, 
>>> INFO, PUBLISH, MESSAGE
>>> Supported: replaces, timer
>>> Session-Expires: 1800;refresher=uas
>>> Contact: <sip:*43 at 127.0.0.1:5080>
>>> Content-Type: application/sdp
>>> Require: timer
>>> Content-Length: 277
>>>
>>> v=0
>>> o=root 1757515753 1757515753 IN IP4 127.0.0.1
>>> s=Asterisk PBX 11.12.0
>>> c=IN IP4 127.0.0.1
>>> t=0 0
>>> m=audio 16396 RTP/AVP 0 8 3 101
>>> a=rtpmap:0 PCMU/8000
>>> a=rtpmap:8 PCMA/8000
>>> a=rtpmap:3 GSM/8000
>>> a=rtpmap:101 telephone-event/8000
>>> a=fmtp:101 0-16
>>> a=ptime:20
>>> a=sendrecv
>>>
>>> ACK sip:*43 at 127.0.0.1:5080 SIP/2.0
>>> Via: SIP/2.0/UDP 198.58.101.75:5060;branch=z9hG4bK636e2948;rport
>>> Route: 
>>> <sip:192.168.2.18;r2=on;lr=on;ftag=as69ee0744;vsf=SBoZSkpbSEZaLF1YW0dGeB8ICB8bDxsxMDEuNzU->,<sip:201.234.196.170;r2=on;lr=on;ftag=as69ee0744;vsf=SBoZSkpbSEZaLF1YW0dGeB8ICB8bDxsxMDEuNzU->
>>> Max-Forwards: 70
>>> From: "9003" <sip:9003 at 198.58.101.75>;tag=as69ee0744
>>> To: <sip:*43 at 201.234.196.170:5060>;tag=as5f3239b9
>>> Contact: <sip:9003 at 198.58.101.75:5060>
>>> Call-ID: 0398a11d3149031240ec2e70077a99fe at 198.58.101.75:5060
>>> CSeq: 102 ACK
>>> User-Agent: FPBX-2.8.1(1.8.20.0)
>>> Content-Length: 0
>>>
>>> How can I fix the "no socket found for match second RR" error?
>>>
>>> _______________________________________________
>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>> sr-users at lists.sip-router.org
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA




More information about the sr-users mailing list