Hi community,
I’m running Asterisk 13.7.2 with a DAHDI card for incoming calls. When a call comes in and the ANI is blank (private number), I want to set the CALLERID name to “Private Number” (or some other thing).
Currently, the IP Phone shows “asterisk” in the display (probably because the From and/or Contact headers in the invite say so):
INVITE sip:687@192.168.4.87:5061 SIP/2.0
Via: SIP/2.0/UDP 192.168.4.170:5060;rport;branch=z9hG4bKPjf24942bb-3f6f-45d2-856d-eee6927b8673
From: sip:asterisk@119.31.226.70;tag=f9560bd9-5da8-40ee-8c6f-9e533c854aeb
To: sip:687@192.168.4.87
Contact: sip:asterisk@192.168.4.170:5060
Call-ID: fcb85bbd-517c-41f3-8575-5d64b970c21b
CSeq: 4116 INVITE
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 13.7.2
Content-Type: application/sdp
Content-Length: 287
I tried setting the CALLERID like this:
exten => 12345678,1,Verbose(“Incoming private”)
same => n,Set(CALLERID(name)=Private)
same => n,Dial(PJSIP/687)
But the display on the phone keeps saying “asterisk”. If the ANI in the incoming call is not empty, then the Set(CALLERID(name)=Private) line does its job and changes the name correctly.
The output of the verbose log is as follows:
-- Executing [12345678@from_pstn:1] Verbose("DAHDI/i1/-a1", ""Incoming Private"") in new stack
NoOp
– Executing [12345678@from_pstn:2] Set(“DAHDI/i1/-a1”, “CALLERID(name)=Private”) in new stack
– Executing [12345678@from_pstn:3] Dial(“DAHDI/i1/-a1”, “PJSIP/687”) in new stack
Can anyone help me identify why the CALLERID is not changing tha ANI when it’s blank?
Thanks