[SR-Users] Rewrite From domain
Daniel-Constantin Mierla
miconda at gmail.com
Tue Dec 13 13:50:52 CET 2016
Hello,
as alternative to assigning to $fd, you can use uac_replace_from()
exported by uac module.
The best place to do updates to headers for outgoing traffic is in a
branch_route block.
Cheers,
Daniel
On 13/12/2016 12:05, Gonzalo Gasca Meza wrote:
>
> Hi all,
>
> I'm using Kamailio to forward calls between 2 Service Providers and I
> need to rewrite the From header "domain" URI.
>
> Example:
>
> From: "+18888888888" <sip:+18888888888 at sip.sp1.com
> <mailto:sip%3A%2B18888888888 at sip.sp1.com>> to
>
> From: "+18888888888" <sip:+18888888888@*sip.sp2.com
> <http://sip.sp2.com>*>
>
> *Call flow:*
>
> Phone A --- > SP1 ---> sip ----> (kamailio) SP2 --(LOCATION)-> Phone B
>
> When Phone A calls SP2 PhoneB, it contains original sip domain from
> sp1. (sip.sp1.com <http://sip.sp1.com>) hence user in SP2 can see call
> comes from SP1. I would like to rewrite the From domain field in this
> conditions:
>
> a) Calls comes from "sip.sp1.com <http://sip.sp1.com>" AND
>
> b) Call is being routed to PhoneB.
>
> Right now Im using the following code to find user and send call to B.
>
> #!ifdef WITH_ALIASDB
>
> # search in DB-based aliases
>
> xlog("L_INFO","alias_db_lookup: Call received. $rU\n");
>
> if(alias_db_lookup("dbaliases")) {
>
> route(SIPOUT);
>
> }
>
> #!endif
>
>
> I found this in documentation:
>
>
> $fd - From URI domain
>
> if($hdr(From)=~"sip.sp1\.com") {
> ...
> }
>
> But not sure where is the best place to overwrite the From URI domain
> header.
>
> Thanks
>
>
>
> _______________________________________________
> 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
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20161213/847989e2/attachment.html>
More information about the sr-users
mailing list