BreadCrumbs: Asterisk Dialplan

Asterisk Dialplan

From Luke Jackson

Revision as of 21:51, 30 September 2007; Ljackson (Talk | contribs)
(diff) ←Older revision | Current revision | Newer revision→ (diff)
Jump to: navigation, search

Applications

The underscore informs Asterisk that the notation following it uses wildcards. Wildcards are symbols that can replace one or more, other symbols. In Asterisk, wildcard symbols that are present are listed below:

  • X—Matches any digit from 0 to 9.
  • Z—Matches any digit from 1 to 9.
  • N—Matches any digit from 2 to 9.
  • [15-7]—Matches any digit or range of digits specified. In this case, matches a 1, 5, 6, or 7.
  • . (period)—Wildcard match; matches one or more characters.

For instance, the expression _X will match all one-digit numbers from 0 to 9. _2XXXXXXX will match all numbers beginning with the digit 2 (like our MTNL Mumbai and Delhi landline numbers) and _. will match everything.

A word of caution here—make use of wildcards very judiciously and only after you are certain of the outcome.

Call Forward (WiFi Phones)

Because WiFi phones interperate the inital star as a local command it is not possible to enable features such as call-waiting and call-forwarding from such a devices. Therefore I added this application to the dialplan which simply listens on "double-star" $VARIABLE. Thus a wifi phone user may dial **91 and their cf-busy-forward would be canceled.

[app-cf-busy-off-custom]
exten => **91,1,Answer
exten => **91,n,Wait(1)
exten => **91,n,Macro(user-callerid,)
exten => **91,n,dbDel(CFB/${CALLERID(number)})
exten => **91,n,Playback(call-fwd-on-busy&de-activated)
exten => **91,n,Macro(hangupcall,)
exten => _**91.,1,Answer
exten => _**91.,n,Wait(1)
exten => _**91.,n,Set(fromext=${EXTEN:3})
exten => _**91.,n,dbDel(CFB/${fromext})
exten => _**91.,n,Playback(call-fwd-on-busy&for&extension)
exten => _**91.,n,SayDigits(${fromext})
exten => _**91.,n,Playback(cancelled)
exten => _**91.,n,Macro(hangupcall,)

; end of [app-cf-busy-off-custom]
Personal tools