[OpenSIPS-Devel] [ opensips-Bugs-3556910 ] B2B and preloaded routes. Again.

SourceForge.net noreply at sourceforge.net
Tue Aug 14 17:51:52 CEST 2012


Bugs item #3556910, was opened at 2012-08-13 04:06
Message generated for change (Comment added) made by nikbyte
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3556910&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: 1.8.x
Status: Open
Resolution: Invalid
Priority: 5
Private: No
Submitted By: Nick Altmann (nikbyte)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: B2B and preloaded routes. Again.

Initial Comment:
Requests with preloaded routes like this (one or two per request):
Route: <sip:my_domain.com:5060;lr>
b2b doesn't accept as b2b session.

Previously we hack it to accept preloaded routes with self ip, but what to do with self domain? Any hacks?

The code, responsible for detection:
        if(msg->route)
        {
                LM_DBG("Found route headers\n");
                route_hdr = msg->route;
                /* we accept Route hdrs only if preloaded route with out IPs */
                if (parse_rr(route_hdr) < 0) {
                        LM_ERR("failed to parse Route HF\n");
                        return -1;
                }
                rt = (rr_t*)route_hdr->parsed;
                /* check if first route is local*/
                if ( parse_uri(rt->nameaddr.uri.s,rt->nameaddr.uri.len,&puri)!=0 ) {
                        LM_ERR("Route uri is not valid <%.*s>\n",
                                rt->nameaddr.uri.len,rt->nameaddr.uri.s);
                        return -1;
                }
                if (check_self( &puri.host, puri.port_no?puri.port_no:SIP_PORT,
                puri.proto?puri.proto:PROTO_UDP)!= 1 ) {
                        LM_DBG("First Route uri is not mine\n");
                        return 1;  /* not for b2b */
                }
                /* check if second route is local*/
                rt = rt->next;
                if (rt==NULL) {
                        if (msg->route->sibling) {
                                route_hdr = msg->route->sibling;
                                if (parse_rr(route_hdr) < 0) {
                                        LM_ERR("failed to parse second Route HF\n");
                                        return -1;
                                }
                                rt = (rr_t*)route_hdr->parsed;
                        }
                }


----------------------------------------------------------------------

Comment By: Nick Altmann (nikbyte)
Date: 2012-08-14 08:51

Message:
Thank you. I'll try to enable domain module and write here later.

----------------------------------------------------------------------

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2012-08-14 08:49

Message:
Hi Nick,

have you either added "my_domain.com" as alias , either placed it into
"domain" module ?

The check_self() looks into both aliases and domain module.

Regards,
Bogdan

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3556910&group_id=232389



More information about the Devel mailing list