[SR-Users] subst + insert_hf issue

Igor Potjevlesch igor.potjevlesch at gmail.com
Fri Jul 3 14:24:07 CEST 2015


Hello Daniel,

 

Thanks for your reply.

 

The doc of msg_apply_changes is scary. 

 

The use of $fn instead of subst would be something to try to solve this
issue? For some cases, I must also change the username part. $fU =
anonymous at anonymous.invalid <mailto:anonymous at anonymous.invalid> " would be
more safety?

 

Regards,

 

Igor.

 

De : sr-users [mailto:sr-users-bounces at lists.sip-router.org] De la part de
Daniel-Constantin Mierla
Envoyé : jeudi 2 juillet 2015 08:39
À : Kamailio (SER) - Users Mailing List
Objet : Re: [SR-Users] subst + insert_hf issue

 

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 <mailto: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/20150703/f0dcf5d1/attachment.html>


More information about the sr-users mailing list