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:firstname.lastname@example.org:5061 SIP/2.0
Via: SIP/2.0/UDP 192.168.4.170:5060;rport;branch=z9hG4bKPjf24942bb-3f6f-45d2-856d-eee6927b8673
CSeq: 4116 INVITE
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
User-Agent: Asterisk PBX 13.7.2
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
– 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?