I got a SPA-3102 with a pre-configured setup to a VoIP provider. When there is a incoming call, the telephone connected to it shows the correct Caller’s name and number.
Now I try to setup this as a SIP trunk in my Asterisk box. But I can’t manage to let the Asterisk get the correct Caller name and number. (The other SIP trunks works fine though).
To trouble shooting, I had these lines:
[from-trunk]
exten => xxxxxx5333,1,NoOp(SIP HEADER FROM = ${SIP_HEADER(FROM)})
exten => xxxxxx5333,n,NoOp(SIP HEADER TO = ${SIP_HEADER(TO)})
exten => xxxxxx5333,n,NoOp(>>>>>>>>>>>The CallerName is ${CALLERID(name)})
exten => xxxxxx5333,n,NoOp(>>>>>>>>>>>The CallerNumber is ${CALLERID(num)})
.......
in my sip.conf
[VSP1]
username=xxxxxx5333
authuser=xxxxxx5333
type=friend
secret=password
insecure=port,invite
canreinvite=yes
host=my.vsp.com
context=from-trunk
callerid="My Name" <xxxxxx5333>
When i make a test call, I always got ${CALLERID(num)}=xxxxxx5333 and ${CALLERID(name)}=“My Name”(these are defined in sip.conf as callerid). It doesn’t show the caller’s name and number!
But I can clearly see in the SIP INVITE From Header, there is
From: "NameOfTheCaller"sip:6042885555@208.xxx.xxx.xxx;tag=11014dd0-13c4-4bc9285-bbaf206-7eaf7ad0
(tcpdump also proved this header information has been received)
So my question here is: Where does Asterisk get CallerID number from? Does it get from the SIP INVITE? Why my context can’t show the proper caller information?
Right now I am using a work around to CUT out the CALLERID(num) and CALLERID(name). But that doesn’t work very well. The wrong info ends up at CDR.
BTW, I am using Asterisk 1.4.29.
Please help. Thanks.