[Asterisk-Users] anyone use mailboxexists?
Jeremy Jones
jjones at westcomllc.com
Fri Jun 18 07:57:51 MST 2004
Michael,
> From the docs, it looks like MailboxExists() will add 101 to the
> priority if the box *does* exist and goes to the next priority if not.
I think the "show application mailboxexists" documentation is wrong. I
believe it's the other way around. It does exits? Jump to next
priority. It doesn't? Jump to n+101. Here's my extension macro (sift
out the forwarding stuff if you don't like that), and it works:
[macro-stdexten]
exten=s,1,MailboxExists(${MACRO_EXTEN:3}@${MACRO_CONTEXT}) ;If
mailbox exists continue at 2, otherwise goto 102
exten=s,2,NoOp ;Filler
exten=s,3,NoOp ;Filler
exten=s,4,NoOp ;Filler
exten=s,5,NoOp ;Filler
exten=s,6,DBget(temp=CFIM/${ARG1}) ;Get
CFIM key, if not existing, goto 107
exten=s,7,Dial(${TRUNK}/9${temp})
;Unconditional forward
exten=s,8,NoOp ;Filler
exten=s,9,Dial(${ARG2},25,rtT) ;Dial device for
25 seconds, goto 10 if busy, goto 110 if unavailable
exten=s,10,NoOp ;Filler
exten=s,11,DBget(temp=CFBS/${ARG1}) ;Get
CFBS key, if not existing, goto 112
exten=s,12,Dial(${TRUNK}/9${temp}) ;Forward
on busy or unavailable
exten=s,102,DBget(temp=CFIM/${ARG1}) ;Get CFIM key,
if not existing, goto 203
exten=s,103,Dial(${TRUNK}/9${temp})
;Unconditional forward
exten=s,104,Dial(${ARG2},120,rtT) ;Dial
device for 120 seconds, goto 105 if busy, goto 205 if unavailable
exten=s,105,DBget(temp=CFBS/${ARG1}) ;Get CFBS key,
if not existing, goto 206
exten=s,106,Dial(${TRUNK}/9${temp}) ;Forward
on busy or unavailable
exten=s,107,Goto(s,9) ;Goto 9
exten=s,110,Voicemail(u${MACRO_EXTEN:3}@${MACRO_CONTEXT}) ;To VM
if unavailable
exten=s,111,Hangup ;Hang up
the channel when vm exits
exten=s,112,Voicemail(b${MACRO_EXTEN:3}@${MACRO_CONTEXT}) ;To VM
if busy
exten=s,113,Hangup ;Hang up
the channel when vm exits
exten=s,203,Goto(s,104) ;Goto
104 for accounts w/out vm
exten=s,205,Busy() ;Busy
signal if busy & no vm
exten=s,206,Busy() ;Busy
signal if no answer in 2 min & no vm
It's a little ugly w/all those NoOps, but I think I need those to get
the priorities right.
Jeremy Jones
More information about the asterisk-users
mailing list