If the CALLERID variable is not set, outside phone calls will most likely see “Private Caller” or “Unknown” on their phone screens. In this lesson we will set the phone number as the caller ID.
The SIP provider may have specific documentation on what can be included with the CALLERID variable. Some allow names to be passed, other just phone numbers. We will use the SET() application to pass in a value to the variable. To set the caller id number use Set(CALLERID(num)=18145550000) where the phone number is the DID assigned by the SIP provider.
You can also set a name to the CALLERID variable. If you are using Questblue as your provider there is a fee to set the name to a DID, and for that reason we will only be setting the number. If you do want to set a name you could use SET(CALLERID(name)=” Lecture Snippets”) to set caller ID to read Lecture Snippets.
The CALLERID will need to be set before the phone call is DIALED. This will mean that the order of procedures will need to be adjusted in the outbound extension. Modify the dialplan in /etc/asterisk/extension.conf to match the code below in the [phones] context:
exten => _9X.,1,NoOp(Calling Outside Line ${EXTEN:1})
same => n,SET(CALLERID(num)=18145550000)
same => n,Dial(SIP/LectureSnippets/${EXTEN:1})