[OpenSIPS-Users] Dynamic Contact Hostname

Mark Farmer farmorg at gmail.com
Tue Mar 17 12:16:20 EST 2020


In case it helps someone else, i got it working by removing the Contact
header & reconstructing it:

if (is_from_gw("2")) {
                remove_hf("Contact","g");
                insert_hf("Contact: <sip:$fU@
$var(fqdn):5061;did=$DLG_did>\r\n");
        }

Mark.


On Mon, 16 Mar 2020 at 13:40, Mark Farmer <farmorg at gmail.com> wrote:

> Hi Ben, thanks for the suggestion.
> Doesn't seem to be working for me sadly. This is my code - xlog() confirms
> that the variable is available and all of the other functions are doing as
> they should.
> This is OpenSIPS 2.4.7
>
> ...
> $var(fqdn) ="my.fqdn";
> ...
>  } else if (is_from_gw("2")) {
>                         xlog("CUSTOM_LOG: Call goes to Microsoft $rd");
>                         uac_replace_from("sip:$fU@$var(fqdn)");
>                         xlog("CUSTOM_LOG: SIP From: Set to sip:$fU@
> $var(fqdn)");
>                         uac_replace_to("sip:$rU@$rd");
>                         xlog("CUSTOM_LOG: SIP To: Set to sip:$rU@$rd");
>                         xlog("CUSTOM_LOG: Setting advertised address to
> $var(fqdn)");
>                         topology_hiding("UC");
>                         set_advertised_address("$var(fqdn)");
>                         if(remove_hf("P-Asserted-Identity")) {
>                                 insert_hf("P-Asserted-Identity: $fU
> <sip:$fU@$var(fqdn)>\r\n");
>                                 xlog("CUSTOM_LOG: Changed PAI Header on
> Outbound Call...");
>                         }
>                 }
> ...
>
> Mark.
>
>
> On Mon, 16 Mar 2020 at 13:04, Ben Newlin <Ben.Newlin at genesys.com> wrote:
>
>> Have you tried using set_advertised_address **after** engaging
>> topology_hiding? We do this and it works fine for us.
>>
>>
>>
>> Ben Newlin
>>
>>
>>
>> *From: *Users <users-bounces at lists.opensips.org> on behalf of Mark
>> Farmer <farmorg at gmail.com>
>> *Reply-To: *OpenSIPS users mailling list <users at lists.opensips.org>
>> *Date: *Monday, March 16, 2020 at 8:29 AM
>> *To: *OpenSIPS users mailling list <users at lists.opensips.org>
>> *Subject: *[OpenSIPS-Users] Dynamic Contact Hostname
>>
>>
>>
>> Hi everyone
>>
>>
>>
>> I am looking for a way to control the hostname part of the contact
>> header. Reading the documentation I think set_advertised_address() is what
>> I need but if I call set_advertised_address("FQDN") followed by
>> topology_hiding("UC") the contact header is incorrect.
>>
>>
>>
>> If I set 'listen=tls:XXX.XXX.XXX.XXX:5061 as FQDN:5061' and only call
>> topology_hiding("UC") then the contact header hostname is set to FQDN.
>>
>>
>>
>> How can I control this?
>>
>>
>>
>> Many thanks!
>>
>> Mark.
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>
>
> --
> Mark Farmer
> farmorg at gmail.com
>


-- 
Mark Farmer
farmorg at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20200317/8bd2e53b/attachment-0001.html>


More information about the Users mailing list