How to Add 0 on Incoming Caller ID

In MyPBX, you can format the incoming caller ID by modifying the configuration file via SSH. Before log in MyPBX via SSH, please enable SSH on MyPBX web GUI (System > Network Preferences > LAN Settings > Enable SSH).

In this guide, we show you how to add digit 0 on incoming caller ID for the BRI trunks.

STEP 1  Create an inbound route, name it “BRI”.

STEP 2  Login MyPBX via SSH. Edit the extensions.conf file by typing the command:


root@IPPBX:~# vi /etc/asterisk/extensions.conf


STEP 3 Quick search the BRI inbound route by tying:


followed by the Enter key. Type n till the cursor move to [macro-incoming_BRI].

STEP 4 Add the following sentence:



exten = s,1,Set(CDR(userfield)=Inbound)

exten = s,n,Set(CALLERID(num)=${IF($[${LEN(${CALLERID(num)})} < 10]?0${CALLERID(num)}:${CALLERID(num)})})

exten = s,n,GotoIf(${DB_EXISTS(blacklist/${CALLERID(num)})}?Blacklist-Handle,s,1)

exten = s,n,FindForMobile(${CALLERID(num)})

exten = s,n,GotoIf($[${LEN(${MobileToExten})}>1]?mobile-exten-match,${MobileToExten},1)

exten = s,n,Set(TRUNKDID=${IF($[${ARG2}=s]?${CALLERID(name)}:${ARG2})})

exten = s,n,GotoByTimeCondition(default,Always-Hangup,s,1,,Always-Hangup,s,1,,Always-Hangup,s,1,)

exten = s,102,Goto(Blacklist-Handle,s,1)


The added sentence means if the length of incoming CallerID is less than 9 (1 to 9), a digit 0 will be appended before this CallerID. For example, an incoming number that is presented like this: 123456 will be shown as 0123456.

Have more questions? Submit a request


  • 1

    All right, work fine, for save forever, we setting this in


    Edited by Jose A. Ortega Cancho GG6
Please sign in to leave a comment.