[OpenSIPS-Users] uac_replace_from and global (display name) variables

Bogdan-Andrei Iancu bogdan at opensips.org
Thu Dec 5 14:13:27 EST 2019


Hi Andreas,

IF you do not want to have the display name changes, simply do 
uac_replace_from("$ai"), see:
https://opensips.org/html/docs/modules/2.4.x/uac.html#func_uac_replace_from_2

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS Bootcamp Pre-Registration
   https://opensips.org/training/OpenSIPS_Bootcamp/

On 12/5/19 7:06 PM, Andreas Sikkema wrote:
> Hi,
>
> Because of $reasons (customer equipment misbehaving,
> interoperability,etc)I have to change the From header in an
> (apparently) not often used way.
>
> I started wanting to add the URI and display name of the P-Asserted-Id
> header to the From header. The URI is the only part of the
> P-Asserted-Id header available as a global variable. But I would
> rather like the display part of the From header also filled in. In
> this particular case I knew  I could use the display name part of the
> existing From header.
>
> So I had something like this:
>
> ....
> if (..) {
>      uac_replace_from("$fn", "$ai")
> }
>
> but this results in an invalid From header:
>
> From: ""+31123456789"" <sip:+31123456789 at 10.1.1.1>
>
> So I (naively) changed the relevant config line into:
>
> ....
> if (..) {
>      uac_replace_from($fn, "$a"i)
> }
>
> Which results in a syntax error.
>
> If I want to spend a little more time on this I can probably grab the
> display name part from the P-Asserted-Id into a variable and use that,
> but I was surprised that it was this easy to create an invalid From
> header using standard OpenSIPS constructs.
>
> Or am I overlooking something obvious?
>




More information about the Users mailing list