[OpenSIPS-Users] Question regarding b2b_bridge function

Bogdan-Andrei Iancu bogdan at opensips.org
Mon Jun 6 16:07:29 CEST 2016


Hi Ping,

My bad - in Call-ID and TO tag you have the B2B _entity_ ID, while you 
need the B2B _logic_ ID .....which is not part of the signaling at all .

Now, in script, where do you need the b2b logic ID ? after creating the 
B2B session (after b2b_init() ) ? Or ?

Regards,

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

On 06.06.2016 11:46, Ping Han wrote:
> Thanks, Bogdan,
>
> I have done a few testing. It seems only the value of the param works 
> for this function. However, it does not look like the callid and the 
> to-tag.
> Is it possible to get the param value in the Opensips config?
>
> Please see the test results below.
>
> ---------------------------------
> [root at opensips-02 ~]# opensipsctl fifo b2be_list
> dlg:: 37 param=237.0 state=5 last_invite_cseq=1 last_method=0 
> last_reply_code=200 db_flag=2
>         ruri:: sip:2401012350 at 10.216.235.38:5060 
> <http://sip:2401012350@10.216.235.38:5060>
>         callid:: NjEyZWEyOTEwZmVlZDIzOTViMTc3YjJiMmJmY2RjODI.
>         from:: "Tropo test" uri=sip:2401012350 at 10.216.235.115:5060 
> <http://sip:2401012350@10.216.235.115:5060> tag=1e53cf61
>         to:: "2401012350" uri=sip:2401012350 at 10.216.235.115:5060 
> <http://sip:2401012350@10.216.235.115:5060> tag=B2B.297.37
>         cseq::  caller=1 callee=1
>         route_set:: 
>  caller=<sip:10.216.235.72;lr;ftag=1e53cf61>,<sip:10.216.235.115;lr;ftag=1e53cf61>
>         contact::  caller=sip:2401012350 at 10.203.1.196:22238 
> <http://sip:2401012350@10.203.1.196:22238> 
> callee=sip:10.216.235.72:5060 <http://10.216.235.72:5060>
>         send_sock:: 10.216.235.72
> dlg:: 6715348 param=237.0 state=5 last_invite_cseq=2 last_method=4 
> db_flag=2
>         callid:: B2B.237.6715348
>         from:: "Tropo test" uri=sip:2401012350 at 10.216.235.115:5060 
> <http://sip:2401012350@10.216.235.115:5060> 
> tag=44623c403b25fd7905bfa7a7325b2b8f
>         to::  uri=sip:dialog at 10.216.235.38:5060 
> <http://sip:dialog@10.216.235.38:5060> tag=40711690
>         cseq::  caller=2 callee=1
>         contact::  caller=sip:10.216.235.72:5060 
> <http://10.216.235.72:5060> callee=sip:10.216.235.38:5060 
> <http://10.216.235.38:5060>
>         send_sock:: 10.216.235.72
>         LEGS::
>                 leg:: 0 tag=40711690 cseq=2 
> contact=sip:10.216.235.38:5060 <http://10.216.235.38:5060>
>
> [root at opensips-02 ~]# opensipsctl fifo b2b_bridge 237.6715348 
> sip:123 at 10.203.1.196 <mailto:sip%3A123 at 10.203.1.196>  (this is the 
> callid with out the "B2B" prefix)
> 500 command 'b2b_bridge' failed
>
> [root at opensips-02 ~]# opensipsctl fifo b2b_bridge 297.37 
> sip:123 at 10.203.1.196 <mailto:sip%3A123 at 10.203.1.196>  (this is the To-tag)
> 500 command 'b2b_bridge' failed
>
> [root at opensips-02 ~]# opensipsctl fifo b2b_bridge 237.0 
> sip:123 at 10.203.1.196 <mailto:sip%3A123 at 10.203.1.196> (this is the 
> value of param, only this works)
>
> ---------------------------------
>
> Regards,
> Ping
>
>
> On Fri, Jun 3, 2016 at 6:54 PM, Bogdan-Andrei Iancu 
> <bogdan at opensips.org <mailto:bogdan at opensips.org>> wrote:
>
>     Hi Ping,
>
>     b2b_bridge_request() is a script function:
>     http://www.opensips.org/html/docs/modules/2.1.x/b2b_logic.html#id294094
>
>     I pointed to this function as you mentioned (on my question) that
>     you want to do the bridging from script level.
>
>     Indeed, the equivalent MI function is b2b_bridge:
>     http://www.opensips.org/html/docs/modules/2.1.x/b2b_logic.html#id294210
>
>     If you want to get that "1020.30", you can get it from Call-ID or
>     To tag, where you have B2B.1020.30 (so you have to strip that B2B
>     prefix).
>
>     Regards,
>
>     Bogdan-Andrei Iancu
>     OpenSIPS Founder and Developer
>     http://www.opensips-solutions.com
>
>     On 03.06.2016 06:27, Ping Han wrote:
>>     Thanks, Bogdan,
>>
>>     It seems the function you mentioned is the internal function
>>      "1.4.2 b2b_bridge_request(b2bl_key,entity_no)".
>>
>>     Actually the function that I am trying to use is the "b2b_bridge"
>>     (Exported MI Functions). It is defined as below
>>     ----------------------------------
>>     http://www.opensips.org/html/docs/modules/2.1.x/b2b_logic.html#id294210
>>
>>
>>     1.5.2.  b2b_bridge
>>
>>     Example: opensipsctl b2b_bridge 1020.30 sip:alice at opensips.org
>>     <mailto:sip:alice at opensips.org>
>>     ----------------------------------
>>
>>     In the example "1020.30" is the "dialog-id". This is the
>>     parameter that I am not sure how to easily access in the Opensips
>>     config.
>>
>>     What I am trying to do is to get the value and deliver to the
>>     next hop via a custom SIP header. When the next hop tries to
>>     transfer the call to a new destination. It can run the b2b_bridge
>>     command straight away with the "dialog-id" without rechieving the
>>     value from the Opensips database (from b2b_logic or b2b_entities
>>     tables).
>>
>>     Any advice will be appreciated.
>>
>>     Thanks,
>>     Ping
>>
>>
>>     On Thu, Jun 2, 2016 at 5:35 PM, Bogdan-Andrei Iancu
>>     <bogdan at opensips.org <mailto:bogdan at opensips.org>> wrote:
>>
>>         Hi Ping,
>>
>>         In script, in a b2b route, you can look at the callid or TO
>>         tag (depending on the direction) to get the key :
>>         http://www.opensips.org/html/docs/modules/2.2.x/b2b_logic.html#id294094
>>
>>         The B2B uses that key as Call-ID when acting as UAC and as To
>>         tag when acting as UAS. You can run a SIP capture to see the
>>         traffic.
>>
>>         Regards,
>>
>>         Bogdan-Andrei Iancu
>>         OpenSIPS Founder and Developer
>>         http://www.opensips-solutions.com
>>
>>         On 02.06.2016 05:13, Ping Han wrote:
>>>         Hi Bogdan,
>>>
>>>         Thanks for the information.
>>>
>>>         I need the value in the Opensips cfg.
>>>
>>>         I understand that I can query the b2b_logic or b2b_entities
>>>         tables to get the value in Opensips config. Apart from that
>>>         could you tell me other way to easily access the value in
>>>         Opensips config?
>>>
>>>         Thanks,
>>>         Ping
>>>
>>>
>>>
>>>         On Wed, Jun 1, 2016 at 5:13 PM, Bogdan-Andrei Iancu
>>>         <bogdan at opensips.org <mailto:bogdan at opensips.org>> wrote:
>>>
>>>             Hi Ping,
>>>
>>>             Indeed, my bad - the docs are not updated, as that param
>>>             was disabled long time ago (4 years ago):
>>>             https://sourceforge.net/p/opensips/bugs/502/
>>>
>>>             Still, there are available option. But the question is :
>>>             do you need that value in OpenSIPS cfg or outside
>>>             OpenSIPS ? as there are different way to get the ID.
>>>
>>>             Regards,
>>>
>>>             Bogdan-Andrei Iancu
>>>             OpenSIPS Founder and Developer
>>>             http://www.opensips-solutions.com
>>>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20160606/9e27f0a2/attachment-0001.htm>


More information about the Users mailing list