Modify Contact-Header on Transfer

Hello,

i want to use the Transfer-Command on an incoming call to transfer it to another external number. The provider supports this scenario, but told me, that the public ip of the asterisk is in the Contact Transfer Header, but there should be the Gateway of the Provider.

For example, asterisk generates following Header:

Contact: Transfer sip:012345@public-ip-from-asterisk

and this should be

Contact: Transfer sip:012345@gateway-from-provider

I tried to use SIPAddHeader but as i can see within sip debug on this only works with the Dial-Command. Is there any other solution to modify this together with the transfer?

Any help would be great!

Transfer takes a full URI, except that sip: is replaced by SIP/ It sounds like you have failed to include the domain part in that URI.

david55, thanks alot! i didn’t know, that i can insert a complete uri there, now the header looks like it should!

i used something like this:

exten => s,n,Transfer(SIP/number@gateway_of_provider.de)