Marius Kaizerman
asked on
Asterisk - incoming caller id
Hi,
Running Asterisk 1.8.11, two trunks connected.
When receiveing calls, the caller id shown is the trunk's DID number, and not the
real caller number.
The provider says that he sends the caller id information in the sip header, and when looking at the console while receiving a call, I can see it there.
The question is - how can I get the caller id from the sip header and make it appear on the extensions, as it should be ?
Thanks,
Marius.
Running Asterisk 1.8.11, two trunks connected.
When receiveing calls, the caller id shown is the trunk's DID number, and not the
real caller number.
The provider says that he sends the caller id information in the sip header, and when looking at the console while receiving a call, I can see it there.
The question is - how can I get the caller id from the sip header and make it appear on the extensions, as it should be ?
Thanks,
Marius.
ASKER
Hi,
The ISO is AsteriskNow 2.0.2 32bit, FreePBX 2.10.0rc1-1 and Cisco 504G phones (although it's the same issue with softphones either).
What I need is a way to get the caller id info from the sip header and and set it to whatever extension is getting the call.
Thanks.
The ISO is AsteriskNow 2.0.2 32bit, FreePBX 2.10.0rc1-1 and Cisco 504G phones (although it's the same issue with softphones either).
What I need is a way to get the caller id info from the sip header and and set it to whatever extension is getting the call.
Thanks.
If you can see the callerid on the console then there must be a dialplan error causing it to be overridden. Or maybe what you are seeing is not actually the callerid.
Can you capture the SIP INVITE header. The callerid can be provided in the FROM header but also in the Remote-Party-ID or the P-Asserted-ID header. If either of these additional headers are provided you can get asterisk to recognize and trust them.
Can you capture the SIP INVITE header. The callerid can be provided in the FROM header but also in the Remote-Party-ID or the P-Asserted-ID header. If either of these additional headers are provided you can get asterisk to recognize and trust them.
ASKER
Hi,
Thanks for the answer and sorry for the delay in my reply, I wanted to do some research in order to supply enough information.
So, here's my findings:
On an INCOMING call, this is the what I see (only the relevant part showed):
Executing [s@custom-get-did-from-hea der:1] Goto("SIP/call-out-00000a9 2", "from-trunk,73862,1") in new stack
-- Goto (from-trunk,73862,1)
-- Executing [73862@from-trunk:1] Set("SIP/call-out-00000a92 ", "__FROM_DID=73862") in new stack
-- Executing [73862@from-trunk:2] Gosub("SIP/call-out-00000a 92", "app-blacklist-check,s,1() ") in new stack
-- Executing [s@app-blacklist-check:1] GotoIf("SIP/call-out-00000 a92", "0?blacklisted") in new stack
-- Executing [s@app-blacklist-check:2] Set("SIP/call-out-00000a92 ", "CALLED_BLACKLIST=1") in new stack
-- Executing [s@app-blacklist-check:3] Return("SIP/call-out-00000 a92", "") in new stack
-- Executing [73862@from-trunk:3] Set("SIP/call-out-00000a92 ", "__REC_POLICY_MODE=always" ) in new stack
-- Executing [73862@from-trunk:4] Set("SIP/call-out-00000a92 ", "CDR(did)=73862") in new stack
-- Executing [73862@from-trunk:5] ExecIf("SIP/call-out-00000 a92", "1 ?Set(CALLERID(name)=XYXYXY XYXYXY)") in new stack
If you'll look at the last line - XYXYXYXYXYXY (which I changed from the real phone number) represents the CALLER ID, and this number is shown, no matter who calls in. This is of course not the real caller id of the caller, but the MY phone number.
When activating SIP DEBUG, I also see the headers, and here lies the REAL caller id of the caller:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 1.2.2.1;branch=z9hG4bK174a .81214903. 0;received =1.2.2.1;r port=5060
Via: SIP/2.0/UDP 1.2.2.1:5060;branch=z9hG4b K4a5fb90c; rport=5060
Record-Route: <sip:1.2.2.1;lr=on;ftag=as 01f8b69e>
From: "+123456789" <sip:+123456789@sip.provid er.com>;ta g=as01f8b6 9e
To: <sip:73862@1.2.2.1>;tag=as 2e44bb48
Call-ID: 19960d8b578c715a17895bdc08 9c631e@sip .provider. com
CSeq: 102 INVITE
erver: FPBX-2.10.0rc1(1.8.11)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: <sip:s@10.0.11.2:5060>
Content-Type: application/sdp
Content-Length: 258
If you'll look at the line beginning with "FROM", the number "123456789" (which I've changed from the real number) is the REAL caller id.
My question is how can I see the number in this field as caller id ?
Thanks,
Marius/
Thanks for the answer and sorry for the delay in my reply, I wanted to do some research in order to supply enough information.
So, here's my findings:
On an INCOMING call, this is the what I see (only the relevant part showed):
Executing [s@custom-get-did-from-hea
-- Goto (from-trunk,73862,1)
-- Executing [73862@from-trunk:1] Set("SIP/call-out-00000a92
-- Executing [73862@from-trunk:2] Gosub("SIP/call-out-00000a
-- Executing [s@app-blacklist-check:1] GotoIf("SIP/call-out-00000
-- Executing [s@app-blacklist-check:2] Set("SIP/call-out-00000a92
-- Executing [s@app-blacklist-check:3] Return("SIP/call-out-00000
-- Executing [73862@from-trunk:3] Set("SIP/call-out-00000a92
-- Executing [73862@from-trunk:4] Set("SIP/call-out-00000a92
-- Executing [73862@from-trunk:5] ExecIf("SIP/call-out-00000
If you'll look at the last line - XYXYXYXYXYXY (which I changed from the real phone number) represents the CALLER ID, and this number is shown, no matter who calls in. This is of course not the real caller id of the caller, but the MY phone number.
When activating SIP DEBUG, I also see the headers, and here lies the REAL caller id of the caller:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 1.2.2.1;branch=z9hG4bK174a
Via: SIP/2.0/UDP 1.2.2.1:5060;branch=z9hG4b
Record-Route: <sip:1.2.2.1;lr=on;ftag=as
From: "+123456789" <sip:+123456789@sip.provid
To: <sip:73862@1.2.2.1>;tag=as
Call-ID: 19960d8b578c715a17895bdc08
CSeq: 102 INVITE
erver: FPBX-2.10.0rc1(1.8.11)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: <sip:s@10.0.11.2:5060>
Content-Type: application/sdp
Content-Length: 258
If you'll look at the line beginning with "FROM", the number "123456789" (which I've changed from the real number) is the REAL caller id.
My question is how can I see the number in this field as caller id ?
Thanks,
Marius/
You are setting CALLERID(name) but you should be setting CALLERID(number)
ASKER
Hi,
How can I fix that ?
Thanks,
Marius.
How can I fix that ?
Thanks,
Marius.
The correct callerid should be set automatically when he call comes in. Have you tried adding something like the following to the dialplan to help debug.
Noop(callerid is ${CALLERID(number)})
You might also wish to ask your provider if hey support the remote-party-id sip header as you can then set trustrpid= in sip.conf to get asterisk to accept it. It works better for transferring the callerid name, number, and presentation.
Noop(callerid is ${CALLERID(number)})
You might also wish to ask your provider if hey support the remote-party-id sip header as you can then set trustrpid= in sip.conf to get asterisk to accept it. It works better for transferring the callerid name, number, and presentation.
ASKER
I've just tried:
Noop(callerid is ${CALLERID(number)})
And now I'm getting in addition to the name also this line:
-- Executing [s@macro-user-callerid:25] Set("SIP/call-out-00000000 ", "CALLERID(number)=XYXYXYXY XY") in new stack
the XYXYXYXYXY which represents the caller id is still my number and NOT the the real caller number. It is the same number shown in the CALLERID(name) field.
Regarding the remote-party-id - yes, they do support it.
And I do have trustrpid=yes and sendrpid=yes in sip.conf, but it's not helping.
Noop(callerid is ${CALLERID(number)})
And now I'm getting in addition to the name also this line:
-- Executing [s@macro-user-callerid:25]
the XYXYXYXYXY which represents the caller id is still my number and NOT the the real caller number. It is the same number shown in the CALLERID(name) field.
Regarding the remote-party-id - yes, they do support it.
And I do have trustrpid=yes and sendrpid=yes in sip.conf, but it's not helping.
Can you post the contents of sip.conf for the trunk link (remove any passwords). You need to make sure the callerid is not specified there.
ASKER
Two trunks:
[call-out]
disallow=all
type=peer
username=removed
fromuser=removed
secret=removed
host=sip.provider.com
port=6060
context=custom-get-did-fro m-header
;context=from-trunk
qualify=yes
insecure=invite,port
allow=g729
trustrpid=yes
sendrpid=yes
[call-out_copy_2]
disallow=all
username=removed
type=friend
secret=removed
port=6060
insecure=invite,port
host=sip.provider.com
fromuser=removed
allow=g729
qualify=yes
trusrpid=yes
sendrpid=yes
context=from-trunk-sip-cal l-out_copy _2
[call-out]
disallow=all
type=peer
username=removed
fromuser=removed
secret=removed
host=sip.provider.com
port=6060
context=custom-get-did-fro
;context=from-trunk
qualify=yes
insecure=invite,port
allow=g729
trustrpid=yes
sendrpid=yes
[call-out_copy_2]
disallow=all
username=removed
type=friend
secret=removed
port=6060
insecure=invite,port
host=sip.provider.com
fromuser=removed
allow=g729
qualify=yes
trusrpid=yes
sendrpid=yes
context=from-trunk-sip-cal
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What ISO did you build from, FreePBX version and what phones are you using ?