Introduction
In this guide, we give examples to describe how to change Caller ID for calls from E1 to SIP.
- When 4XXX calls in, change the caller ID to 1234XXX.
- When 6XXXX calls in, change the caller ID to 9876XXXX.
- For other numbers, change the caller ID to 123456789.
Steps to Change Caller ID
- Go to your TE to set three Routes for these three rules:
- Login Yeastar TE gateway via SSH.
- Edit the configuration file extensions.conf.
- Search route 4XXX by typing “/4XXX” on your keyboard. If the first result is not the one you want, type "n" to find the next one until you find it.
- You will find the three rules as below.
- Copy the 3 rules to your notepad and add the following contents in red.
[macro-Routein_4XXX] exten = s,1,Set(CDR(userfield)=Inbound) exten = s,n,Set(CALLERID(num)=123${CALLERID(num)}) exten = s,n,GotoIf(${DB_EXISTS(blacklist/${CALLERID(num)})}?Blacklist-Handle,s,1) exten = s,n,Set(TRUNKDID=${IF($[${ARG2}=s]?${CALLERID(name)}:${ARG2})}) exten = s,n,Goto(Routeout_4XXX,${ARG2},1) exten = s,102,Goto(Blacklist-Handle,s,1) [macro-Routein_6XXXX] exten = s,1,Set(CDR(userfield)=Inbound) exten = s,n,Set(CALLERID(num)=987${CALLERID(num)}) exten = s,n,GotoIf(${DB_EXISTS(blacklist/${CALLERID(num)})}?Blacklist-Handle,s,1) exten = s,n,Set(TRUNKDID=${IF($[${ARG2}=s]?${CALLERID(name)}:${ARG2})}) exten = s,n,Goto(Routeout_6XXXX,${ARG2},1) exten = s,102,Goto(Blacklist-Handle,s,1) [macro-Routein_Others] exten = s,1,Set(CDR(userfield)=Inbound) exten = s,n,Set(CALLERID(num)=123456789) exten = s,n,GotoIf(${DB_EXISTS(blacklist/${CALLERID(num)})}?Blacklist-Handle,s,1) exten = s,n,Set(TRUNKDID=${IF($[${ARG2}=s]?${CALLERID(name)}:${ARG2})}) exten = s,n,Goto(Routeout_Others,${ARG2},1) exten = s,102,Goto(Blacklist-Handle,s,1)
- Press the Esc key to exit the modified mode. Type ":q!" to quit and not save this configuration file.
- Create a custom configuration file under path: /persistent/custom-cfg/
Enter command ” vi /persistent/custom-cfg/extensions_custom.conf ” to creat a new custom file. - Paste the contents in the configuration file. If you can’t edit or input any word, you could enter “ i ” to swap to Modified mode.
- Press to Esc key to exit and swap to Command mode. Enter “:wq” to save and quit the custom file.
- Then enter command “ mypbxconf ”&” asterisk –rx ”module reload” ” to reload all configuration files.
4 Comments