[asterisk-users] Debugging dialplan
Steve Edwards
asterisk.org at sedwards.com
Fri May 29 10:59:01 CDT 2015
Please don't top post.
> Am 29. Mai 2015 09:42:55 MESZ, schrieb Luca Bertoncello
> <lucabert at lucabert.de>:
>> Zitat von jg <webaccounts173 at jgoettgens.de>:
>>> Yes, it is called "core set verbose 42", the other options is "core
>>> set debug 42". Enjoy the show!
I know you can specify a level to the verbose application, but is anything
in Asterisk 'hard-coded' for debug or verbose above 6? (And yes, I know
the significance of '42' in pop culture.)
>> OK, thanks, but with this option I can just debug what happens if I
>> call an extension right now... I'd like to have a command to ask
>> Asterisk how it will handle a call...
You can use the 'dialplan' command to get a clue. For example, I have this
context in a dialplan:
; meetme-star-menu
; 1 say private meeting number
; 3 enter private room
; 456 go to the admin menu
[meetme-star-menu](h,s)
exten = i,1, verbose(1,[${EXTEN}@${CONTEXT}!${ANI}])
exten = i,n, goto(enter-room,s,1)
exten = t,1, verbose(1,[${EXTEN}@${CONTEXT}!${ANI}])
exten = t,n, goto(enter-room,s,1)
; say private meeting number
exten = 1,1, verbose(1,[${EXTEN}@${CONTEXT}!${ANI}])
exten = 1,n, saydigits(${PRIVATE-CODE})
exten = 1,n, goto(enter-room,s,1)
; enter private room
exten = 3,1, verbose(1,[${EXTEN}@${CONTEXT}!${ANI}])
exten = 3,n, goto(private-lounge,s,1)
; admin functions
exten = _[456],1, verbose(1,[${EXTEN}@${CONTEXT}!${ANI}])
exten = _[456],n, gotoif($["TRUE" = "${ADMIN}"] ?meetme-star-admin-menu,${EXTEN},1)
exten = _[456],n, goto(enter-room,s,1)
I can ask Asterisk what happens if the caller enters '5' like:
joy10:joy:08:50:18> dialplan show 5 at meetme-star-menu
[ Context 'meetme-star-menu' created by 'pbx_config' ]
'_[456]' => 1. verbose(1,[${EXTEN}@${CONTEXT}!${ANI}]) [pbx_config]
2. gotoif($["TRUE" = "${ADMIN}"] ?meetme-star-admin-menu,${EXTEN},1) [pbx_config]
3. goto(enter-room,s,1) [pbx_config]
If I ask what happens if a caller enters 7, I get:
joy10:joy:08:51:42> dialplan show 7 at meetme-star-menu
There is no existence of 7 at meetme-star-menu extension
In which case, I could ask what Asterisk will do with an invalid
extension:
joy10:joy:08:52:19> dialplan show i at meetme-star-menu
[ Context 'meetme-star-menu' created by 'pbx_config' ]
'i' => 1. verbose(1,[${EXTEN}@${CONTEXT}!${ANI}]) [pbx_config]
2. goto(enter-room,s,1) [pbx_config]
Note the format of my verbose() arguments. It makes it easy to
'cut-n-paste' in a 'dialplan show' command.
--
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000
More information about the asterisk-users
mailing list