Dial function rewrite From and Contact fields in SIP header

Hi there,

I have a question about Dial() function when using it in my dialplan (A calls B, a@bar calls b@bar):

When using for a internal domain call like this:
exten => s,n,Dial(SIP/b,13)

it rewrites From and Contact fields in SIP header with callee sip address (b@bar) :
INVITE sip:b@10.42.0.10:5060;transport=UDP SIP/2.0
From: “B” sip:b@bar;tag=as344b4498
To: sip:b@10.42.0.10:5060;transport=UDP
Contact: sip:b@10.42.0.70:5060

When using exten => s,n,Dial(SIP/b@bar,13) the correct fields are kept:
INVITE sip:a@10.42.0.10:5060;transport=UDP SIP/2.0
From: “A” sip:a@bar;tag=as344b4498
To: sip:b@10.42.0.10:5060;transport=UDP
Contact: sip:a@10.42.0.70:5060

Is this particular options to keep (or edit) original SIP headers with Dial() ?
I just try Dial(SIP/b,13,o(${CALLERID(all)) but it only changes the Name field of From:

Thanks :slight_smile:

The Contact header is completely irrelevant. As long as it has the right domain part, only Asterisk needs to worry about the user part.

My guess is that you have fromuser set in the b section of sip.conf.

1 Like

Thanks for your answer, i only have a fromdomain=bar in my general section of sip.conf.

users section are limited to basic options:
[remote] (!)
type=friend
nat=no
host=dynamic
disallow=all
allow=gsm
allow=ulaw
dtmfmode=rfc2833
canreinvite=no
transport=udp
videosupport=yes
call-limit=1

@david551, you were on the right way : field ‘fromuser’ in postgres realtime DB was set to the username.
After setting it to NULL, From header is correct when dialing.

THANK YOU :slight_smile: