Discussion:
[SR-Users] Replacing the From header user part.
v***@advaitamtech.com
2017-09-14 14:37:56 UTC
Permalink
Hi All,

Am trying to replace the user part of From header with own user name in kamailio.cfg

I tried to assign directly,

Eg: $fU = "abcd"

Sometime when I receive From header as ' "12345" <***@1.1.1.1>;tag=xxxx '. In this case it works as ' "12345" <***@1.1.1.1>;tag=xxxx ' .

So i tried using replace_all() function. But this ended up adding extra characters(in my case "abcd") infront of content_type header. I dont know why.
Can someone please help me out in replacing the from header in this case?


Thanks,
Vivek
Alex Balashov
2017-09-14 14:39:00 UTC
Permalink
This is a job for uac_replace_from() in the uac module.
Post by v***@advaitamtech.com
Hi All,
Am trying to replace the user part of From header with own user name in kamailio.cfg
I tried to assign directly,
Eg: $fU = "abcd"
Sometime when I receive From header as ' "12345"
So i tried using replace_all() function. But this ended up adding extra
characters(in my case "abcd") infront of content_type header. I dont
know why.
Can someone please help me out in replacing the from header in this case?
Thanks,
Vivek
-- Alex

--
Sent via mobile, please forgive typos and brevity.

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-***@lists.kamailio.org
https://lists.kamailio
v***@advaitamtech.com
2017-09-15 06:59:53 UTC
Permalink
I got the solution for this. Should have used $fn.

Thanks,
Vivek


-----Original Message-----
From: "***@advaitamtech.com" <***@advaitamtech.com>
Sent: Thursday, 14 September, 2017 8:07pm
To: sr-***@lists.kamailio.org
Subject: Replacing the From header user part.



Hi All,

Am trying to replace the user part of From header with own user name in kamailio.cfg

I tried to assign directly,

Eg: $fU = "abcd"

Sometime when I receive From header as ' "12345" <***@1.1.1.1>;tag=xxxx '. In this case it works as ' "12345" <***@1.1.1.1>;tag=xxxx ' .

So i tried using replace_all() function. But this ended up adding extra characters(in my case "abcd") infront of content_type header. I dont know why.
Can someone please help me out in replacing the from header in this case?


Thanks,
Vivek

Loading...