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

Andreas Sikkema h323 at ramdyne.nl
Thu Dec 5 12:06:55 EST 2019


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?

-- 
Andreas Sikkema



More information about the Users mailing list