Tip : Restrict call by matching caller id
This quick tip will show you how, in asterisk dialplan, you can restrict calls to a specific match of caller id.
Usually, in a dialplan, extensions will match the called number. Like in the following example :
[default]
exten => _514XXXXXXX,1,Noop( CALLS TO NUMBER ${EXTEN} FROM ${CALLERID(all)} )
exten => _514XXXXXXX,n,Dial(Zap/g1/${EXTEN})
This means that anyone that reach an extension starting with 514 and followed by 10 digits will be send to Zap/g1
If you want this extension to be restrict to a specific caller id or match also a caller id pattern (eg: starting with 418 and followed by 10 digits, your dialplan should be like
[default]
exten => _514XXXXXXX/_418XXXXXXX,1,Noop( CALLS TO NUMBER ${EXTEN} FROM ${CALLERID(all)} )
exten => _514XXXXXXX/_418XXXXXXX,n,Dial(Zap/g1/${EXTEN})
Comments
Leave a Reply