From/Contact header modified by incoming call


I’m using a SIP trunk from my provider which sends the DID number via X-Number SIP header.

Following is placed in extensions.conf to forward the extension to a specific phone internally:

[code]exten => s,1,Set(DialedNumber=${SIP_HEADER(X-Number)})
exten => s,n,NoOp(Dialednumber: ${DialedNumber})
exten => s,n,Goto(${DialedNumber},1)

exten => 8000999,1,Dial(SIP/999,60)
exten => 8000999,n,Hangup()

Which perfectly works fine.

Only problem is now that on the IP phones the calls are displayed with the correct calling number as textual interpretation, but with the dialed extensions as the originating number.

Asterisk seems to replace the From/Contact headers when forwarding internally:

Original header from invite:

From: "800009300" <sip:800009300@212.x.x.x:5061>;tag=as3eec8f2e To: <sip:8000999@212.x.x.x:5060>

And the header sent to the phone is:

From: "800009300" <sip:8000999@>;tag=as747d0078 To: <sip:999@> Contact: <sip:8000999@>

So "From: “800009300"” is correct, but sip:8000999@ is now the dialed extension.
Is there a way to force asterisk not to change “From/Contact” header?

thanx in advance

Asterisk will treat From: as callerid and pass it through, unless you select some other source of callerid, or you force the fromuser on the outgoing leg.

The question is not how to force it to do this, but rather what have you done to override that behaviour.

Hmm…you were right (o;

Didn’t expect that “fromuser” in sip.conf could cause that.
Removed it on all phones and it works now :wink: