Asterisk tweeks and tricks

Ever need the caller ID on you SIP phone to prefix 9 to the inbound phone number so that you can select it from your CID calls to call back? Here is how to do it on ASTERISK or Trixbox:

Open the /etc/asterisk/extensions_custom.conf

add the following line to the confiuration:

[from-pstn-custom]
; fix a “9” as prefix for inbound calls
exten => _X.,1,Set(CALLERID(all)=${CALLERID(name)} <9${CALLERID(num)}>)

Save the configuration and restart the asterisk service or via asterisk console. Now call from an outside line and you should have your SIP phones caller ID show a prefixed 9 in front of the phone number.

Some changes to not here. You can use other numbers other then a 9. If the source of the call comes from a different context other then PSTN you must use that context. An example is if you wanted all calls coming from a custom queue to have a prefix extension you might use the context [from-internal-custom].

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.