[OpenSIPS-Users] B2B and "404 Not here"

Anton Zagorskiy a.zagorskiy at oyster-telecom.ru
Wed Jan 19 12:05:11 CET 2011


Hi, Bogdan.

Please take a look - it is very small openSIPS cfg that cause described
situation.
When callee ends a call with this cfg a '404' is sending from line marked #
Here
It seems that BYE request is processing twice - one time in B2B (with to-tag
and 'route' header), second time in openSIPS (with to-tag but 'route'
header).

What I missed in the config?

route
{
        xlog("*** route ->  M=$rm R-URI=$ru F=$fu T=$tu SRC=[$si:$sp]
ID=$ci\n");

        if (has_totag())
        {
            if (loose_route())
            {
                    if (is_method("INVITE"))
                        record_route();

                route(1);
            }
            else
            {
                if (is_method("ACK"))
                {
                    if (t_check_trans())
                        t_relay();

                    exit;
                };

                sl_send_reply("404", "Not here"); # Here
            };
            exit;
        }


        if (loose_route())
        {
            xlog("L_ERR", "*** [ROUTE] : Attempt to route with preloaded
Routes [$fu/$tu/$ru/$ci]\n");

            if (!is_method("ACK"))
                sl_send_reply("403", "Preload Route denied");

            exit;
        };

        if (!is_method("REGISTER|MESSAGE"))
            record_route();

        alias_db_lookup("dbaliases");


        if (is_method("INVITE"))
        {
            if (src_ip != myself)
            {
                b2b_init_request("top hiding");
                exit;
            };

            if (!dp_translate("0", "$ru/$ru"))
            {
                sl_send_reply("405", "Error DP");
                exit;
            };

            if (!lookup("location", "m"))
            {
                sl_send_reply("405", "Error");
			exit;
		};

            route(1);
            exit;
        };


        if (is_method("REGISTER"))
        {
            if (!save("location"))
                sl_reply_error();

            exit;
        };
}



route[1]
{
    if (!t_relay())
    {
        sl_reply_error();
        exit;
    };
}





WBR, Anton Zagorskiy
VoIP Developer, Oyster Telecom
Phone.: +7 812 601-0666
Fax: +7 812 601-0593
a.zagorskiy at oyster-telecom.ru
www.oyster-telecom.ru



> -----Original Message-----
> From: users-bounces at lists.opensips.org [mailto:users-
> bounces at lists.opensips.org] On Behalf Of Anton Zagorskiy
> Sent: Wednesday, January 19, 2011 1:22 PM
> To: 'OpenSIPS users mailling list'
> Subject: Re: [OpenSIPS-Users] B2B and "404 Not here"
> 
> Bogdan, you are right!
> I sent 404 from script because of BYE, that was sent from B2B to
> openSIPS is
> has_totag() but not loose_route()
> 
> 
> > -----Original Message-----
> > From: users-bounces at lists.opensips.org [mailto:users-
> > bounces at lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu
> > Sent: Wednesday, January 19, 2011 1:02 PM
> > To: OpenSIPS users mailling list
> > Subject: Re: [OpenSIPS-Users] B2B and "404 Not here"
> >
> > Hi Anton,
> >
> > it seams that your opensips proxy generates the 404 - replies are not
> > by
> > default sent, so it must have been sent from script. I suspect your
> > sequential requests are not properly handled and it hits the
> > lookup(location) (which is for initial requests).
> >
> > Regards,
> > Bogdan
> >
> > Anton Zagorskiy wrote:
> > > Hi Bogdan.
> > >
> > > I fixed the B2B loop, but openSIPS still replies 404.
> > >
> > > Please see on fragments on my SIP trace:
> > >
> > > SIP flow: UA1 (192.168.0.1) -> openSIPS(B2B) (192.168.0.10) ->
> > AudioCodes
> > > mediant (192.168.0.20) -> UA2 (somewhere)
> > >
> > > 1. UA1 -> openSIPS : INVITE
> > > Via: SIP/2.0/UDP 192.168.0.1:5060;branch=z9hG4bK-5d365510
> > > From: "100" <sip:100 at mydomain.com>;tag=c8163c00327d8790o0
> > > Call-ID: 1e2e8c0-6deac1d0 at 92.255.16.121
> > >
> > >
> > > 2. openSIPS -> openSIPS B2B : INVITE
> > > Via: SIP/2.0/UDP 192.168.0.10;branch=z9hG4bKd30e.9c8687a6.0
> > > From: <sip:100 at mydomain.com>;tag=c53818ff531edab4595cc700e8d1209d
> > > Call-ID: B2B.154.4874498
> > >
> > >
> > > 3. openSIPS B2B -> Mediant : INVITE
> > > Record-Route:
> > >
> >
> <sip:192.168.0.10;lr=on;ftag=c53818ff531edab4595cc700e8d1209d;did=c61.b
> > 305b6
> > > 97>
> > > Via: SIP/2.0/UDP 192.168.0.10;branch=z9hG4bKd30e.ac8687a6.0
> > > Via: SIP/2.0/UDP 192.168.0.10;branch=z9hG4bKd30e.9c8687a6.0
> > > From: <sip:100 at mydomain.com>;tag=c53818ff531edab4595cc700e8d1209d
> > > Call-ID: B2B.154.4874498
> > >
> > > After negotiation:
> > >
> > > 4. Mediant -> openSIPS B2B : OK
> > > Via: SIP/2.0/UDP 192.168.0.10;branch=z9hG4bKd30e.ac8687a6.0
> > > Via: SIP/2.0/UDP 192.168.0.10;branch=z9hG4bKd30e.9c8687a6.0
> > > From: <sip:100 at mydomain.com>;tag=c53818ff531edab4595cc700e8d1209d
> > > To: sip:xxx at mydomain.com;tag=1c904270116
> > > Call-ID: B2B.154.4874498
> > >
> > >
> > > 5. openSIPS B2B -> openSIPS : OK
> > > Via: SIP/2.0/UDP 192.168.0.10;branch=z9hG4bKd30e.9c8687a6.0
> > > From: <sip:100 at mydomain.com>;tag=c53818ff531edab4595cc700e8d1209d
> > > To: sip:xxx at mydomain.com;tag=1c904270116
> > > Call-ID: B2B.154.4874498
> > >
> > >
> > >
> > >
> > > And BYE:
> > >
> > > 5. Medaint -> openSIPS B2B : BYE
> > > Request-Line: BYE sip:192.168.0.10:5060;transport=udp SIP/2.0
> > > Via: SIP/2.0/UDP 192.168.0.20;branch=z9hG4bKac1061035722
> > > From: sip:xxx at mydomain.com;tag=1c904270116
> > > To: <sip:100 at mydomain.com>;tag=c53818ff531edab4595cc700e8d1209d
> > > Call-ID: B2B.154.4874498
> > >
> > >
> > > 6. openSIPS B2B -> openSIPS : BYE
> > > Request-Line: BYE
> > >
> >
> sip:192.168.0.1;lr=on;ftag=c53818ff531edab4595cc700e8d1209d;did=c61.b30
> > 5b697
> > > SIP/2.0
> > > Via: SIP/2.0/UDP 192.168.0.10;branch=z9hG4bK3a1c.42ce8c57.0
> > > Via: SIP/2.0/UDP 192.168.0.20;branch=z9hG4bKac1061035722
> > > From: sip:xxx at mydomain.com;tag=1c904270116
> > > To: <sip:100 at mydomain.com>;tag=c53818ff531edab4595cc700e8d1209d
> > > Call-ID: B2B.154.4874498
> > >
> > >
> > > And, openSIPS replies to B2B '404'
> > >
> > >
> > > I see 2 potential moments:
> > > 1) I'm changing 'From' field on stage 2.
> > > 2) On stage 3 a field 'Contact' is "Contact:
> > > <sip:192.168.0.10:5060;transport=udp>" althought I defined
> > > "modparam("b2b_logic", "server_address", "sip:sa at 192.168.0.10")"
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > WBR, Anton Zagorskiy
> > > VoIP Developer, Oyster Telecom
> > > Phone.: +7 812 601-0666
> > > Fax: +7 812 601-0593
> > > a.zagorskiy at oyster-telecom.ru
> > > www.oyster-telecom.ru
> > >
> > >
> > >
> > >
> > >> -----Original Message-----
> > >> From: users-bounces at lists.opensips.org [mailto:users-
> > >> bounces at lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu
> > >> Sent: Tuesday, January 18, 2011 3:57 PM
> > >> To: OpenSIPS users mailling list
> > >> Subject: Re: [OpenSIPS-Users] B2B and "404 Not here"
> > >>
> > >> Hi Anton,
> > >>
> > >> The ERROR line you have here are not essential - they simply say
> > that
> > >> the warning (optional) hdr was not added. Not an actual error.
> > >>
> > >> Can you check doing a capture at net level who is generating the
> 404
> > >> reply? from opensips script, for final callee ?
> > >>
> > >> Regards,
> > >> Bogdan
> > >>
> > >>
> > >> Anton Zagorskiy wrote:
> > >>
> > >>> Hi.
> > >>>
> > >>> While using B2B when callee ends an established call openSIPS
> > replies
> > >>>
> > >> '404
> > >>
> > >>> Not Here' and goes to the infinitive loop..
> > >>>
> > >>> Here is a part of a log:
> > >>> Jan 17 19:01:25 softswitch [softswitch][9329]: *** route ->
> M=BYE
> > >>> Jan 17 19:01:25 softswitch [softswitch][9329]:
> > >>>
> > >> DBG:maxfwd:is_maxfwd_present:
> > >>
> > >>> value = 32
> > >>> Jan 17 19:01:25 softswitch [softswitch][9329]:
> > >>>
> > >> DBG:maxfwd:is_maxfwd_lt:
> > >>
> > >>> value = 31
> > >>> Jan 17 19:01:25 softswitch [softswitch][9329]: DBG:uri:has_totag:
> > >>>
> > >> totag
> > >>
> > >>> found
> > >>> Jan 17 19:01:25 softswitch [softswitch][9329]:
> > >>>
> > >> DBG:core:parse_headers:
> > >>
> > >>> flags=200
> > >>> Jan 17 19:01:25 softswitch [softswitch][9329]:
> > >>>
> > >> DBG:rr:find_first_route: No
> > >>
> > >>> Route headers found
> > >>> Jan 17 19:01:25 softswitch [softswitch][9329]:
> DBG:rr:loose_route:
> > >>>
> > >> There is
> > >>
> > >>> no Route HF
> > >>> Jan 17 19:01:25 softswitch [softswitch][9329]:
> > >>>
> > >> DBG:core:parse_headers:
> > >>
> > >>> flags=ffffffffffffffff
> > >>> Jan 17 19:01:25 softswitch [softswitch][9329]:
> > >>>
> > >> DBG:core:check_ip_address:
> > >>
> > >>> params 192.168.0.2, 192.168.0.2, 0
> > >>> Jan 17 19:01:25 softswitch [softswitch][9329]:
> > >>>
> > >> ERROR:core:warning_builder:
> > >>
> > >>> buffer size exceeded
> > >>> *** Jan 17 19:01:25 softswitch [softswitch][9329]:
> > >>> WARNING:core:build_res_buf_from_sip_req: warning skipped -- too
> big
> > >>> Jan 17 19:01:25 softswitch [softswitch][9329]:
> > >>>
> > >> DBG:sl:run_sl_callbacks:
> > >>
> > >>> callback id 0 entered
> > >>> Jan 17 19:01:25 softswitch [softswitch][9329]:
> > >>> DBG:siptrace:trace_sl_onreply_out: trace off...
> > >>> Jan 17 19:01:25 softswitch [softswitch][9330]:
> DBG:core:parse_msg:
> > >>>
> > >> SIP Reply
> > >>
> > >>> (status):
> > >>> Jan 17 19:01:25 softswitch [softswitch][9329]:
> > >>>
> > >> DBG:core:destroy_avp_list:
> > >>
> > >>> destroying list (nil)
> > >>> Jan 17 19:01:25 softswitch [softswitch][9329]:
> > DBG:core:receive_msg:
> > >>> cleaning up
> > >>> Jan 17 19:01:25 softswitch [softswitch][9330]:
> DBG:core:parse_msg:
> > >>>
> > >> version:
> > >>
> > >>> <SIP/2.0>
> > >>> Jan 17 19:01:25 softswitch [softswitch][9330]:
> DBG:core:parse_msg:
> > >>>
> > >> status:
> > >>
> > >>> <404>
> > >>> Jan 17 19:01:25 softswitch [softswitch][9330]:
> DBG:core:parse_msg:
> > >>>
> > >> reason:
> > >>
> > >>> <Not here>
> > >>> Jan 17 19:01:25 softswitch [softswitch][9330]:
> > >>>
> > >> DBG:core:parse_headers:
> > >>
> > >>> flags=2
> > >>>
> > >>>
> > >>> While debugging at line marked *** I see that warning_len is 0
> > >>>
> > >>>
> > >>> Any suggestions?
> > >>>
> > >>>
> > >>>
> > >>> WBR, Anton Zagorskiy
> > >>> VoIP Developer, Oyster Telecom
> > >>> Phone.: +7 812 601-0666
> > >>> Fax: +7 812 601-0593
> > >>> a.zagorskiy at oyster-telecom.ru
> > >>> www.oyster-telecom.ru
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>> _______________________________________________
> > >>> Users mailing list
> > >>> Users at lists.opensips.org
> > >>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> > >>>
> > >>>
> > >>>
> > >> --
> > >> Bogdan-Andrei Iancu
> > >> OpenSIPS Event - expo, conf, social, bootcamp
> > >> 2 - 4 February 2011, ITExpo, Miami,  USA
> > >> OpenSIPS solutions and "know-how"
> > >>
> > >>
> > >> _______________________________________________
> > >> 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
> > >
> > >
> >
> >
> > --
> > Bogdan-Andrei Iancu
> > OpenSIPS Event - expo, conf, social, bootcamp
> > 2 - 4 February 2011, ITExpo, Miami,  USA
> > OpenSIPS solutions and "know-how"
> >
> >
> > _______________________________________________
> > 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




More information about the Users mailing list