[OpenSIPS-Users] Opensips do not route ACK to Asterisk

Ovidiu Sas osas at voipembedded.com
Mon Nov 22 15:46:31 CET 2010


When using opensips behind NAT, the config needs to be adjusted to
properly format:
 - via headers,
 - record-route headers,
 - contact header,
 - IP addresses inside SDP.

If at least one of the above headers is not properly formated, the SIP
signaling will not work.
Check your SIP traffic and make sure that that all your SIP messages
are properly formated.

Because you are bridging traffic from/to your private network to/from
the public domain, make sure that signaling is properly formated for
both sides (private and public).


Regards,
Ovidiu Sas

On Sun, Nov 21, 2010 at 4:17 PM, aleks <xtomahawkx at gmail.com> wrote:
>
> Dear all,
>
> i'm having scenario where opensips 1.6.3 and asterisk is on the same host
> behind nat and in DMZ. Opensips binds on port 5060 and asterisk on 5061.
>
> Rtp proxy for nat traversal also running on same machine started and
> opensips do not report any errors.   ( started like  rtpproxy -l
> public_ip_opensips_and* -s udp:127.0.0.1:7890 -F -u rtpproxy). RTP proxy use
> default udp range 350000-65534 and asterisk use 10000-35000 range.
>
>
>
> UA is X-lite and behind nat.
> Calls are getting connected but they drop after 30 sec. X-lite recive 200 ok
> from * and sends back ACK. But ACK not getting to Asterisk. Asterisk reports
> retransmit timeout error.
>
> I'm think that problem is like they say in sip-retransmit file
>
> - A SIP middlebox (SBC) that rewrites contact: headers
>  so that we can't reach the other side with our reply
>  or the ACK.
> - A badly configured SIP proxy that forgets to add
>  record-route headers to make sure that signalling works.
>
> When X-lite is in lan where is opensips error do not exists.
>
> Here is 200 ok that asterisk keep retransmiting:
>
> ^[[0KRetransmitting #2 (no NAT) to 192.168.1.42:5060:
> SIP/2.0 200 OK
> v: SIP/2.0/UDP
> 192.168.1.42;branch=z9hG4bKe31e.f8aa9df6.0;received=192.168.1.42
> v: SIP/2.0/UDP
> PUBLIC_IP_OF_UA:59788;rport=59788;received=PUBLIC_IP_OF_UA;branch=z9hG4bK-d8754z-c754d54c1f044c74-1---d8754z-
> Record-Route: <sip:192.168.1.42;lr=on>
> f: "tommy2" <sip:6557181066 at PUBLIC_IP_OF_OPENSIPS_AND*>;tag=740b0d14
> t: "7890100" <sip:7890100 at 8PUBLIC_IP_OF_OPENSIPS_AND*>;tag=as57556733
> i: YjNjZThlNjljMjk2ODE5MmU1NDNiNTJhMTY5ZDg2MWQ.
> CSeq: 2 INVITE
> Server: Asterisk PBX
> ^[[0Kllow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
> INFO, PUBLISH
> k: replaces, timer
> m: <sip:7890100 at 192.168.1.42:5061>
> c: application/sdp
> l: 261
> In opensips.cfg file i have this 2 section that involves ACK:
>
> if ( is_method("ACK") ) {
>
>
>                                        if ( t_check_trans() ) {
>                                        # non loose-route, but stateful ACK;
> must be an ACK after
>                                        # a 487 or e.g. 404 from upstream
> server
>                                        t_relay();
>                                        exit;
>                                } else {
>                                        # ACK without matching transaction
> ->
>                                        # ignore and discard
>                                        exit;
>                                }
>                        }
>                        sl_send_reply("404","Not here");
>                }
>                exit;
>        }
>
> and :
>
>
> # preloaded route checking
>        if (loose_route()) {
>                xlog("L_ERR",
>                "Attempt to route with preloaded Route's
> [$fu/$tu/$ru/$ci]");
>                if (!is_method("ACK"))
>                        sl_send_reply("403","Preload Route denied");
>                append_hf("P-hint: rr-enforced\r\n");
>                route(1);
>        }
>
>
> i'm sending calls this way :
>
>
> route[4] {
>  #---- PSTN route ----#
>  rewritehostport("192.168.1.42:5061");
>        route(1);
>        exit;
> }
>
> Opensips log reports
>
> Nov 20 16:38:16 localhost /sbin/opensips[30143]: DBG:core:parse_headers:
> flags=ffffffffffffffff
> Nov 20 16:38:16 localhost /sbin/opensips[30143]: DBG:core:check_ip_address:
> params PUBLIC_IP_XLITE,PUBLIC_IP_XLITE , 0
> Nov 20 16:38:16 localhost /sbin/opensips[30143]: DBG:core:destroy_avp_list:
> destroying list (nil)
> Nov 20 16:38:16 localhost /sbin/opensips[30143]: DBG:core:receive_msg:
> cleaning up
> Nov 20 16:38:16 localhost /sbin/opensips[30146]: DBG:core:parse_msg: SIP
> Request:
> Nov 20 16:38:16 localhost /sbin/opensips[30146]: DBG:core:parse_msg:
> method:  <ACK>
> Nov 20 16:38:16 localhost /sbin/opensips[30146]: DBG:core:parse_msg:  uri:
> <sip:007890100 at PUB_IP_OPENSIPS>
> Nov 20 16:38:16 localhost /sbin/opensips[30146]: DBG:core:parse_msg:
> version: <SIP/2.0>
> Nov 20 16:38:16 localhost /sbin/opensips[30146]: DBG:core:parse_headers:
> flags=2
> Nov 20 16:38:16 localhost /sbin/opensips[30146]: DBG:core:parse_via_param:
> found param type 232, <branch> = <z9hG4bK-9364702f>; state=16
> Nov 20 16:38:16 localhost /sbin/opensips[30146]: DBG:core:parse_via: end of
> header reached, state=5
> Nov 20 16:38:16 localhost /sbin/opensips[30146]: DBG:core:parse_headers: via
> found, flags=2
> Nov 20 16:38:16 localhost /sbin/opensips[30146]: DBG:core:parse_headers:
> this is the first via
> Nov 20 16:38:16 localhost /sbin/opensips[30146]: DBG:core:receive_msg: After
> parse_msg...
> Nov 20 16:38:16 localhost /sbin/opensips[30146]: DBG:core:receive_msg:
> preparing to run routing scripts...
> Nov 20 16:38:16 localhost /sbin/opensips[30146]: DBG:core:parse_headers:
> flags=8
> Nov 20 16:38:16 localhost /sbin/opensips[30146]: DBG:core:parse_to_param:
> tag=a7848d58f55defae860d8b40a448cabf.2507
> Nov 20 16:38:16 localhost /sbin/opensips[30146]: DBG:core:parse_to: end of
> header reached, state=29
> Nov 20 16:38:16 localhost /sbin/opensips[30146]: DBG:core:parse_to:
> display={}, ruri={sip:007890100 at PUB_IP_OPENSIPS}
> Nov 20 16:38:16 localhost /sbin/opensips[30146]: DBG:core:get_hdr_field:
> <To> [73]; uri=[sip:007890100 at PUB_IP_OPENSIPS]
> Nov 20 16:38:16 localhost /sbin/opensips[30146]: DBG:core:get_hdr_field: to
> body [<sip:007890100 at PUB_IP_OPENSIPS200@>]
> Nov 20 16:38:16 localhost /sbin/opensips[30146]: DBG:sl:sl_filter_ACK: local
> ACK found -> dropping it!
> Nov 20 16:38:16 localhost /sbin/opensips[30146]: DBG:core:destroy_avp_list:
> destroying list (nil)
> Nov 20 16:38:16 localhost /sbin/opensips[30146]: DBG:core:receive_msg:
> cleaning up
>
> Is opensips dropping ACK ? How to fix this? TY!!!
>
>
> --
> View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Opensips-do-not-route-ACK-to-Asterisk-tp5761003p5761003.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>



More information about the Users mailing list