[Freeswitch-users] From header rewrite on B2BUA scenario
Dave Horton
dave at dchorton.com
Fri Jul 8 08:40:47 MSD 2011
I have a scenario where I have FS configured so as to take an incoming call and send it out through a configured gateway. Now this gateway does not require authentication, so in my gateway configuration I have the register param set to false:
<gateway name="gwInternal">
<param name="username" value="foo"/>
<param name="password" value="bar"/>
<param name="realm" value="204.215.65.202"/>
<param name="proxy" value="204.215.65.202"/>
<param name="register" value="false"/>
<param name="context" value="public"/>
</gateway>
Now, even though I am not registering to this gateway, FS requires me to provide a username and password or else I get an error when starting/loading this configuration. So you can see above that I have just put in a username of "foo", just to have something there.
Now I come to the problem. The result of the above configuration is that the From header coming in looks like this:
From: <sip:+15083084809 at 204.215.65.201:5060>;tag=3519088051-756100
and the one that FS creates to send out through this gateway looks like this:
From: "+15083084809" <sip:foo at 204.215.65.202;transport=udp>;tag=Sr6taB8rFgt1H
You can see that it has inserted the username of 'foo' in the user part of the uri of the From header.
The reason that this is a problem is that this INVITE is going out to another remote FS, as it turns out. And when the dialed remote extension off that FS PBX does not pick up it then goes into voicemail, and the username of 'foo' is what is stored as the calling number. So when the user on that remote PBX collects that voicemail and tries to do call return, the FS ends up trying to transfer a call to 'foo', which fails. So call return is not working in the remote FS due to this rewriting of the From header.
Is there a way I can configure my FS to send calls out through a gateway and maintain the user part of the From URI that was received on the incoming call? Or, alternatively, can I configure the voicemail application to look for the caller id field from somewhere else than the user part of the From URI ?
Dave
More information about the FreeSWITCH-users
mailing list