[SR-Users] subst + insert_hf issue
Daniel-Constantin Mierla
miconda at gmail.com
Thu Jul 2 08:38:45 CEST 2015
Hello,
if you just want to update the dispay name in From header, you can use:
$fn = "Anonymous";
To avoid conflicts in replacements, use mag_apply_changes() after first
changes -- in your case, after subst(...) -- read carefully the docs for
msg_apply_changes() to understand its impact and limitations.
Cheers,
Daniel
On 01/07/15 17:34, Igor Potjevlesch wrote:
>
> Hello,
>
>
>
> I'm doing a subst on the From header for some particular cases, like
> this one: subst('/^(From|f):(.*)<sip:(.*)@/\1: "Anonymous" <sip:\3@/g');
>
>
>
> In the same route (REQUEST_ROUTE called "INVITE"), I do the following:
> insert_hf("X-CarrierName: $avp(s:carrier_id)\r\n");
>
>
>
> For many User-Agent, the X-CarrierName header is inserted after the @
> into the user part of the From. So the From: looks like this:
>
>
>
> From:"Anonymous" <sip:0123456789 at X-CarrierName: ABCDE\r\n
>
>
>
> The domain name part of the From is on the next line:
>
>
>
> <domain>:5060>;tag=3fdce0-a658bfa-13c4-50029-55941ccd-5eab9369-55941ccd\r\n
>
>
>
> I can't reproduce.
>
>
>
> The only potential explanation is that this impact the User-Agent that
> have the From at the top of the headers.
>
>
>
> If someone know what could going wrong here.
>
>
>
> Regards,
>
>
>
> Igor
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150702/87b2a0c6/attachment.html>
More information about the sr-users
mailing list