[OpenSIPS-Users] ACK on private IP, NAT

Bogdan-Andrei Iancu bogdan at opensips.org
Mon Feb 10 10:27:50 CET 2014


Hello,

The ACK is sent to the contact URI from the 200 OK. As you found, the 
problem is when the 200 OK is processed by your OpenSIPS - the private 
IP in the 200 OK Contact header must be replaced with the public one 
(take from the network level) by the fix_nated_contact() (or similar 
function).

So be sure your 200 OK hits the onreply route and the function is triggered.

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 20.01.2014 10:19, Miha wrote:
> HI,
>
> Problem is that I am relaying call throught FS and I guess I am arming 
> on_replay_route on wrong spot. I am arming it when call is send to UAC.
>
> Here is my replay_route:
>
> onreply_route[1] {
>         xlog("on replay");
>        if (client_nat_test("3")) {
>                 xlog("L_INFO", "NAT Reply\n");
>                 fix_contact();
>         }
>         exit;
> }
>
>
> here is a sip trace:
>
> U UAC_PUBLIC_IP:1079 -> opensips_ip:5060
> SIP/2.0 200 OK.
> Via: SIP/2.0/UDP opensips_ip:5060;branch=z9hG4bK13dc.ad5b3917.0.
> Via: SIP/2.0/UDP 
> FS_IP:5080;received=FS_IP;rport=5080;branch=z9hG4bKj26KZH1XvKm9p.
> Record-Route: 
> <sip:opensips_ip;lr;ftag=c8N0ZtF52D3vF;vsf=AAAAAAMLBwYFAAACA3cFcQAfAx0fARoLGg8eNjA-;did=b88.c27c8733>.
> From: "031545477" <sip:44431545477 at FS_IP>;tag=c8N0ZtF52D3vF.
> To: <sip:44418108754 at opensips_ip>;tag=581792008.
> Call-ID: 65b7d8a0-fc4c-1231-bb95-005056b2fe3d.
> CSeq: 54766485 INVITE.
> Contact: <sip:44418108754 at 10.105.15.67:5060>.
> Supported: replaces, path, timer.
> User-Agent: Grandstream GXP1405 1.0.5.32.
> Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, 
> REFER, UPDATE, MESSAGE.
> Content-Type: application/sdp.
> Content-Length:   242.
> .
> v=0.
> o=44418108754 8000 8000 IN IP4 10.105.15.67.
> s=SIP Call.
> c=IN IP4 10.105.15.67.
> t=0 0.
> m=audio 5004 RTP/AVP 8 0 101.
> a=sendrecv.
> a=rtpmap:8 PCMA/8000.
> a=ptime:20.
> a=rtpmap:0 PCMU/8000.
> a=rtpmap:101 telephone-event/8000.
> a=fmtp:101 0-15.
>
>
> U opensips_ip:5060 -> FS_IP:5080
> SIP/2.0 200 OK.
> Via: SIP/2.0/UDP 
> FS_IP:5080;received=FS_IP;rport=5080;branch=z9hG4bKj26KZH1XvKm9p.
> Record-Route: 
> <sip:opensips_ip;lr;ftag=c8N0ZtF52D3vF;vsf=AAAAAAMLBwYFAAACA3cFcQAfAx0fARoLGg8eNjA-;did=b88.c27c8733>.
> From: "031545477" <sip:031545477 at FS_IP>;tag=c8N0ZtF52D3vF.
> To: <sip:44418108754 at opensips_ip>;tag=581792008.
> Call-ID: 65b7d8a0-fc4c-1231-bb95-005056b2fe3d.
> CSeq: 54766485 INVITE.
> Contact: <sip:44418108754 at 10.105.15.67:5060>.
> Supported: replaces, path, timer.
> User-Agent: Grandstream GXP1405 1.0.5.32.
> Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, 
> REFER, UPDATE, MESSAGE.
> Content-Type: application/sdp.
> Content-Length:   242.
> .
> v=0.
> o=44418108754 8000 8000 IN IP4 10.105.15.67.
> s=SIP Call.
> c=IN IP4 10.105.15.67.
> t=0 0.
> m=audio 5004 RTP/AVP 8 0 101.
> a=sendrecv.
> a=rtpmap:8 PCMA/8000.
> a=ptime:20.
> a=rtpmap:0 PCMU/8000.
> a=rtpmap:101 telephone-event/8000.
> a=fmtp:101 0-15.
>
>
> U FS_IP:5080 -> opensips_ip:5060
> ACK sip:44418108754 at 10.105.15.67:5060 SIP/2.0.
> Via: SIP/2.0/UDP FS_IP:5080;rport;branch=z9hG4bKKB0c1cj1Svavj.
> Route: 
> <sip:opensips_ip;lr;ftag=c8N0ZtF52D3vF;vsf=AAAAAAMLBwYFAAACA3cFcQAfAx0fARoLGg8eNjA-;did=b88.c27c8733>.
> Max-Forwards: 70.
> From: "031545477" <sip:031545477 at FS_IP>;tag=c8N0ZtF52D3vF.
> To: <sip:44418108754 at opensips_ip>;tag=581792008.
> Call-ID: 65b7d8a0-fc4c-1231-bb95-005056b2fe3d.
> CSeq: 54766485 ACK.
> Contact: <sip:mod_sofia at FS_IP:5080>.
> Content-Length: 0.
> .
>
>
> U opensips_ip:5060 -> 10.105.15.67:5060
> ACK sip:44418108754@*10.105.15.67*:5060 SIP/2.0.
> Via: SIP/2.0/UDP opensips_ip:5060;branch=z9hG4bK13dc.ad5b3917.2.
> Via: SIP/2.0/UDP 
> FS_IP:5080;received=FS_IP;rport=5080;branch=z9hG4bKKB0c1cj1Svavj.
> Max-Forwards: 69.
> From: "031545477" <sip:44431545477 at FS_IP>;tag=c8N0ZtF52D3vF.
> To: <sip:44418108754 at opensips_ip>;tag=581792008.
> Call-ID: 65b7d8a0-fc4c-1231-bb95-005056b2fe3d.
> CSeq: 54766485 ACK.
> Contact: <sip:mod_sofia at FS_IP:5080>.
> Content-Length: 0.
>
> Dne 1/17/2014 2:13 PM, pis(e Miha:
>> Hi,
>>
>> in my config I have:
>>
>>       if (nat_uac_test("18")) {
>>         xlog("fixing nat");
>>                 if (method=="REGISTER") {
>>                         fix_nated_register();
>>                         fix_nated_contact();
>>                 } else {
>>                         fix_nated_contact();
>>                 };
>>                 force_rport();
>>         };
>>
>>
>> In location table I can see that ip:port is saved from source ip:port 
>> and not from contact which is good (contact has private_ip). Invites 
>> are also send to right ip:port. Problem is that ACK is send to 
>> private ip instead to public_ip:port.
>>
>> What I am missing?
>>
>> br
>> miha
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20140210/65da41ce/attachment-0001.htm>


More information about the Users mailing list