[OpenSIPS-Users] In-Dialog requests with B2B topology hiding

Jeryes . jeryes at voicetechnology.com.br
Fri Feb 22 23:19:20 CET 2013


Hi All,


I am using Opensips 1.8.2 tls, with B2B UserAgent, running the default
scenario "top riding".
The idea of this implementation is just to pass the packages between the
carrier and the PBX, hiding the topology.
I'm facing a problem to process the ACK requests after 200 OK (answer), and
I guess that all the in-dialog requests after first INVITE. The ACK
requests are beeing forwarded
by t_relay() method, but that is not keeping the previous dialog, nether
hiding the topology.
Should I execute b2b_init_request("top hiding") to ACK requests as I do to
INVITE, or the top hiding scenario was supposed to generate the ACK
automaticaly to 200 OK reply, as is described in the
tutorial<http://www.opensips.org/Resources/B2buaTutorial#toc11>:
"Once you ask b2b to handle a call, you *won't see the future in-dialog
request in the normal route*."?

Do someone has an example about how it is supposed to be the processing of
the in-dialog requests with b2b top hiding? Am I doing something wrong in
the script that follows?

Thanks in advance!

Here follows the opensips.cfg:

modparam("b2b_logic", "db_mode", 0)
modparam("b2b_entities", "db_mode", 0)
modparam("b2b_entities", "script_req_route", "b2b_request")
modparam("b2b_entities", "script_reply_route", "b2b_reply")


route[b2b_request]
{
  xlog("b2b_request ($ci)\n");
}


route[b2b_reply]
{
  xlog("b2b_reply ($ci)\n");
}

####### Routing Logic ########
# main request routing logic

route{

        xlog("Processing request [$rm] ...");

        if (!mf_process_maxfwd_header("10"))
        {
                sl_send_reply("483","Too Many Hops");
                exit;
        }

         if($rd == "192.168.191.149") # RURI is myself, replacing by PBX IP
(192.168.194.130)
        {
                xlog("request [$rm]: invalid ru:[$ru] replacing it...");
                avp_printf("$avp(ruri)", "$ru");
                avp_subst("$avp(ruri)", "/sip:(.*@)?(192.168.191.149:6060
)(.*)/sip:$tU at 192.168.194.130\3/");
                $ru = $avp(ruri);
        }

        if( is_method("INVITE") )
        {
            xlog("request [$rm]: invoking b2b_init_request...");

            b2b_init_request("top hiding");
            exit; # do not forward this request, another one will be
generated
        };

        route(1);
}


route[1] {
        # for INVITEs enable some additional helper routes
        if (is_method("INVITE")) {
                t_on_branch("2");
                t_on_reply("2");
                t_on_failure("1");
        }

        if (!t_relay()) {
                sl_reply_error();
        };
        exit;
}

branch_route[2]
{
        xlog("new branch at $ru\n");
}

onreply_route[2]
{
        xlog("incoming reply\n");
}

failure_route[1]
{
     if (t_was_cancelled())
     {
                exit;
     }

}


Here follows the call flow:


204.11.180.165:5080  Carrier
192.168.191.149:6060 Back to Back with top hiding
192.168.194.130:5060 PBX

Carrier to B2B:

U 204.11.180.165:5080 -> 192.168.191.149:6060
INVITE sip:192.168.191.149:6060 SIP/2.0.
v: SIP/2.0/UDP 204.11.180.165:5080
;branch=z9hG4bK-f011bf3ff42d89f43e0b098e2a96b328.
f: "Anonymous" <sip:anonymous at mydomain.com>;tag=3570555794-337860.
t: <sip:15265414613 at ss.mydomain.com>.
i: 15070951-3570555794-337826 at msw1.telengy.net.
CSeq: 1 INVITE.
Max-Forwards: 8.
m: <sip:63f4867320cd99c3582432226e5bc53d at 204.11.180.165:5080;transport=udp>.
Supported: timer.
c: application/sdp.
l: 350.
.
v=0.
o=NexTone-MSW 2147483647 2147483647 IN IP4 204.11.180.165.
s=sip call.
c=IN IP4 204.11.180.165.
t=0 0.
m=audio 64406 RTP/AVP 18 0 8 101.
a=fmtp:18 annexb=no.
a=fmtp:101 0-15.
a=rtpmap:101 telephone-event/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:0 PCMU/8000.
a=rtpmap:18 G729/8000.
a=ptime:20.
a=sendrecv.
a=silenceSupp:off - - - -.
a=setup:actpass.

B2B to Carrier:

U 192.168.191.149:6060 -> 204.11.180.165:5080
SIP/2.0 100 Trying.
v: SIP/2.0/UDP 204.11.180.165:5080
;branch=z9hG4bK-f011bf3ff42d89f43e0b098e2a96b328.
f: "Anonymous" <sip:anonymous at mydomain.com>;tag=3570555794-337860.
t: <sip:15265414613 at ss.mydomain.com>.
i: 15070951-3570555794-337826 at msw1.telengy.net.
CSeq: 1 INVITE.
Server: OpenSIPS (1.8.2-notls (i386/linux)).
Content-Length: 0.
.

B2B to PBX:

U 192.168.191.149:6060 -> 192.168.194.130:5060
INVITE sip:15265414613 at 192.168.194.130 SIP/2.0.
Via: SIP/2.0/UDP 192.168.191.149:6060;branch=z9hG4bK7a57.11f29ff4.0.
To: sip:15265414613 at 192.168.194.130.
From: "Anonymous" <sip:anonymous at mydomain.com
>;tag=57660343c1c69a5eae367f3fe08408b3.
CSeq: 2 INVITE.
Call-ID: B2B.29.3219810.
Max-Forwards: 70.
Content-Length: 350.
User-Agent: OpenSIPS (1.8.2-notls (i386/linux)).
c: application/sdp.
Supported: timer.
Contact: <sip:192.168.191.149:6060>.
Content-Type: application/sdp.
.
v=0.
o=NexTone-MSW 2147483647 2147483647 IN IP4 204.11.180.165.
s=sip call.
c=IN IP4 204.11.180.165.
t=0 0.
m=audio 64406 RTP/AVP 18 0 8 101.
a=fmtp:18 annexb=no.
a=fmtp:101 0-15.
a=rtpmap:101 telephone-event/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:0 PCMU/8000.
a=rtpmap:18 G729/8000.
a=ptime:20.
a=sendrecv.
a=silenceSupp:off - - - -.
a=setup:actpass.


PBX to B2B:

U 192.168.194.130:5060 -> 192.168.191.149:6060
SIP/2.0 100 Trying.
Via: SIP/2.0/UDP 192.168.191.149:6060
;rport=6060;branch=z9hG4bK7a57.11f29ff4.0.
To: <sip:15265414613 at 192.168.194.130>.
From: "Anonymous" <sip:anonymous at mydomain.com
>;tag=57660343c1c69a5eae367f3fe08408b3.
CSeq: 2 INVITE.
Call-ID: B2B.29.3219810.
Content-Length: 0.
.

PBX to B2B:

U 192.168.194.130:5060 -> 192.168.191.149:6060
SIP/2.0 180 Ringing.
Via: SIP/2.0/UDP 192.168.191.149:6060
;rport=6060;branch=z9hG4bK7a57.11f29ff4.0.
To: <sip:15265414613 at 192.168.194.130>;tag=user-agent-6009.
From: "Anonymous" <sip:anonymous at mydomain.com
>;tag=57660343c1c69a5eae367f3fe08408b3.
CSeq: 2 INVITE.
Call-ID: B2B.29.3219810.
Contact: <sip:15265414613 at domain2.tst2.vt.local>.
Content-Length: 0.
.


B2B to Carrier:

U 192.168.191.149:6060 -> 204.11.180.165:5080
SIP/2.0 180 Ringing.
v: SIP/2.0/UDP 204.11.180.165:5080
;branch=z9hG4bK-f011bf3ff42d89f43e0b098e2a96b328.
f: "Anonymous" <sip:anonymous at mydomain.com>;tag=3570555794-337860.
t: <sip:15265414613 at ss.mydomain.com>;tag=B2B.470.299.
i: 15070951-3570555794-337826 at msw1.telengy.net.
CSeq: 1 INVITE.
To: <sip:15265414613 at 192.168.194.130>;tag=user-agent-6009.
Contact: <sip:192.168.191.149:6060>.
Server: OpenSIPS (1.8.2-notls (i386/linux)).
Content-Length: 0.
.

PBX to B2B:

U 192.168.194.130:5060 -> 192.168.191.149:6060
SIP/2.0 200 OK.
Record-Route:
<sip:192.168.194.130;lr;ftag=57660343c1c69a5eae367f3fe08408b3>.
Via: SIP/2.0/UDP 192.168.191.149:6060
;rport=6060;branch=z9hG4bK7a57.11f29ff4.0.
To: <sip:15265414613 at 192.168.194.130>;tag=user-agent-6009.
From: "Anonymous" <sip:anonymous at mydomain.com
>;tag=57660343c1c69a5eae367f3fe08408b3.
CSeq: 2 INVITE.
Call-ID: B2B.29.3219810.
Contact: <sip:15265414613 at 192.168.192.32:5050>.
Content-Type: application/sdp.
Content-Length: 224.
.
v=0.
o=NexTone-MSW 17 2147483649 IN IP4 204.11.180.165.
s=sip call.
c=IN IP4 192.168.192.32.
t=0 0.
m=audio 47086 RTP/AVP 18 101.
a=rtpmap:18 G729/8000/1
a=fmtp:18 annexb=no.
a=rtpmap:101 telephone-event/8000/1.
a=sendrecv.
.

B2B to Carrier:

U 192.168.191.149:6060 -> 204.11.180.165:5080
SIP/2.0 200 OK.
v: SIP/2.0/UDP 204.11.180.165:5080
;branch=z9hG4bK-f011bf3ff42d89f43e0b098e2a96b328.
f: "Anonymous" <sip:anonymous at mydomain.com>;tag=3570555794-337860.
t: <sip:15265414613 at ss.mydomain.com>;tag=B2B.470.299.
i: 15070951-3570555794-337826 at msw1.telengy.net.
CSeq: 1 INVITE.
Content-Type: application/sdp.
To: <sip:15265414613 at 192.168.194.130>;tag=user-agent-6009.
Contact: <sip:192.168.191.149:6060>.
Server: OpenSIPS (1.8.2-notls (i386/linux)).
Content-Length: 224.
.
v=0.
o=NexTone-MSW 17 2147483649 IN IP4 204.11.180.165.
s=sip call.
c=IN IP4 192.168.192.32.
t=0 0.
m=audio 47086 RTP/AVP 18 101.
a=rtpmap:18 G729/8000/1
a=fmtp:18 annexb=no.
a=rtpmap:101 telephone-event/8000/1.
a=sendrecv.


Carrier to B2B (ACK):

U 204.11.180.165:5080 -> 192.168.191.149:6060
ACK sip:192.168.191.149:6060 SIP/2.0.
v: SIP/2.0/UDP 204.11.180.165:5080
;branch=z9hG4bK-76e2b629b35210415cfed24dec30ea42.
f: "Anonymous" <sip:anonymous at mydomain.com>;tag=3570555794-337860.
t: <sip:15265414613 at ss.mydomain.com>;tag=user-agent-6009.
i: 15070951-3570555794-337826 at msw1.telengy.net.
CSeq: 1 ACK.
Max-Forwards: 8.
m: <sip:5dc9157c0a5b6eabfab89b1ddd6ebdff at 204.11.180.165:5080;transport=udp>.
l: 0.
.

B2B to PBX (routed by t_relay):

U 192.168.191.149:6060 -> 192.168.194.130:5060
ACK sip:15265414613 at 192.168.194.130 SIP/2.0.
Via: SIP/2.0/UDP 192.168.191.149:6060
;branch=z9hG4bK-76e2b629b35210415cfed24dec30ea42.
v: SIP/2.0/UDP 204.11.180.165:5080
;branch=z9hG4bK-76e2b629b35210415cfed24dec30ea42.
f: "Anonymous" <sip:anonymous at mydomain.com>;tag=3570555794-337860.
t: <sip:15265414613 at ss.mydomain.com>;tag=user-agent-6009.
i: 15070951-3570555794-337826 at msw1.telengy.net.
CSeq: 1 ACK.
Max-Forwards: 7.
m: <sip:5dc9157c0a5b6eabfab89b1ddd6ebdff at 204.11.180.165:5080;transport=udp>.
l: 0.
.

PBX to B2B (Retransmition of 200 OK)

U 192.168.194.130:5060 -> 192.168.191.149:6060
SIP/2.0 200 OK.
Record-Route:
<sip:192.168.194.130;lr;ftag=57660343c1c69a5eae367f3fe08408b3>.
Via: SIP/2.0/UDP 192.168.191.149:6060
;rport=6060;branch=z9hG4bK7a57.11f29ff4.0.
To: <sip:15265414613 at 192.168.194.130>;tag=user-agent-6009.
From: "Anonymous" <sip:anonymous at mydomain.com
>;tag=57660343c1c69a5eae367f3fe08408b3.
CSeq: 2 INVITE.
Call-ID: B2B.29.3219810.
Contact: <sip:15265414613 at 192.168.192.32:5050>.
Content-Type: application/sdp.
Content-Length: 224.
.
v=0.
o=NexTone-MSW 17 2147483649 IN IP4 204.11.180.165.
s=sip call.
c=IN IP4 192.168.192.32.
t=0 0.
m=audio 47086 RTP/AVP 18 101.
a=rtpmap:18 G729/8000/1
a=fmtp:18 annexb=no.
a=rtpmap:101 telephone-event/8000/1.
a=sendrecv.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20130222/86e8b7d9/attachment-0001.htm>


More information about the Users mailing list