[OpenSIPS-Users] Call forking, branches, Record-routing

Bogdan-Andrei Iancu bogdan at opensips.org
Fri Apr 1 14:04:24 UTC 2022


Oh, so you have traffic both from public and private network, right ? If 
so, you have 2 options:

1) use a single socket, without advertise and use the script advertise 
function depending on the source of the call - see 
set_advertised_address() [1]

2) use 2 sockets, one for public traffic, with advertise and one for the 
internal traffic, without advertise. For each call, control the outbound 
interface via the $socket_out variable [2]

My 2 cents, (1) may be too complicated as the set_advertised_address() 
function as a message level scope, so you need to take care and do it 
for each and every single request of the call. With (2) you need to do 
it only for the initial request (INVITE) as the sockets are remembered 
for the whole duration of the call by the Record Route mechanism.

[1] 
https://www.opensips.org/Documentation/Script-CoreFunctions-3-2#set_advertised_address
[2] https://opensips.org/Documentation/Script-CoreVar-3-2#socket_out

Best Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS eBootcamp 23rd May - 3rd June 2022
   https://opensips.org/training/OpenSIPS_eBootcamp_2022/

On 3/31/22 7:27 PM, Karsten Wemheuer wrote:
> Hi Bogdan-Andrei,
>
> in case of global advertising is active and set to the natted address
> the advertised address is used, but this leads to problems using phones
> in the LAN.
>
> As written in my other post: Without setting the advertise address and
> port, I have a problem with the phones behind NAT. Is it possible to
> manipulate the route before in a branch or something like that?
>
> Regards,
>
> Karsten
>
> Am Donnerstag, dem 31.03.2022 um 18:53 +0300 schrieb Bogdan-Andrei
> Iancu:
>> Hi Karsten,
>>
>> You say the record_route() does not take into consideration the
>> global
>> advertising ??
>>
>> Regards,
>>
>> Bogdan-Andrei Iancu
>>
>> OpenSIPS Founder and Developer
>>     https://www.opensips-solutions.com
>> OpenSIPS eBootcamp 23rd May - 3rd June 2022
>>     https://opensips.org/training/OpenSIPS_eBootcamp_2022/
>>
>> On 3/31/22 6:22 PM, Karsten Wemheuer wrote:
>>> Hi Bogdan-Andrei,
>>>
>>> many thanks for Your help.
>>>
>>> I tried with record_route. It doesn't work for me, as I set
>>> "advertised_address" and "advertised_port" to the natted address of
>>> the
>>> (only) interface. I wasn't able to avoid this. It seemed to be
>>> required
>>> to be able to reflect the path "phone -> proxy -> pbx".
>>>
>>> I removed the "advertised"-stuff and checked again the call with
>>> record_route. Now this seems to work.
>>>
>>> I think, I have to fix the other call flow to avoid the global
>>> setting
>>> of the advertised address and port.
>>>
>>> Best regards,
>>>
>>> Karsten
>>>
>>> Am Donnerstag, dem 31.03.2022 um 17:44 +0300 schrieb Bogdan-Andrei
>>> Iancu:
>>>> Hi Karsten,
>>>>
>>>> See my prev email, just to record_route() before the t_relay()
>>>> for
>>>> the
>>>> initial INVITE. And the loose_route() stuff for whatever
>>>> sequential/in-dialog requests.
>>>>
>>>> Best regards,
>>>>
>>>> Bogdan-Andrei Iancu
>>>>
>>>> OpenSIPS Founder and Developer
>>>>      https://www.opensips-solutions.com
>>>> OpenSIPS eBootcamp 23rd May - 3rd June 2022
>>>>      https://opensips.org/training/OpenSIPS_eBootcamp_2022/
>>>>
>>>> On 3/31/22 2:50 PM, Karsten Wemheuer wrote:
>>>>> Hi*,
>>>>>
>>>>> I have a understanding problem regarding branches and call
>>>>> forking.
>>>>> A call from a PBX is to be routed to phone(s) via OpenSIPS. The
>>>>> phones
>>>>> are registered to OpenSIPs.
>>>>>
>>>>> INVITE --> lookup ----> 1. Destination
>>>>>                       |
>>>>>                       \--> 2. Destination
>>>>>
>>>>> When the call is terminated by the caller, the BYE request
>>>>> shall
>>>>> take
>>>>> the same path. Currently, the BYE is sent from the PBX directly
>>>>> to
>>>>> the
>>>>> Contact URI (which is not reachable by the PBX).
>>>>>
>>>>> Is it possible to use record_route in the branch_route so that
>>>>> different record route headers are used? Or is there another
>>>>> way?
>>>>>
>>>>> Thanks in advance,
>>>>>
>>>>> Karsten
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> 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
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users




More information about the Users mailing list