[Asterisk-Users] Extension a?

Andrew Kohlsmith akohlsmith-asterisk at benshaw.com
Fri Mar 24 13:01:33 MST 2006


On Friday 24 March 2006 14:10, Time Bandit wrote:
> If your voicemail context is "default" (that is, is what context the
> mailbox is), you have to put the "a" exten in the "default" context.

Pardon?  That's not true at all.

; not a dialplan I'd actually implement, but demonstrates how to use the 'a' 
context:

[foo]
exten => 5551234,1,Set(MAILBOX=5551234)
exten => 5551234,n,SipAddHeader(SIP INFO: foo)
exten => 5551234,n,Dial(SIP/100&SIP/200&SIP/300,24,)
exten => 5551234,n,VoiceMail(5551234 at mycompany)
exten => 5551234,n,Hangup

exten => _XXX,1,Set(MAILBOX=${EXTEN})
exten => _XXX,n,Dial(SIP/${EXTEN},24,)
exten => _XXX,n,VoiceMail(${MAILBOX}@mycompany)
exten => _XXX,n,Hangup

exten => a,1,VoiceMailMain(${MAILBOX}@mycompany)
exten => a,n,Hangup

exten => o,1,Goto(100,1)  ; the operator is extension 100

Here you see how you can have any number of voicemailboxes, all able to jump 
to their own login, within a single context.  If 5551212 is dialed, all three 
phones are rung and, if no answer, the caller is dumped into a general 
mailbox.  If a specific extension is dialed, that specific extension is 
called and the caller is dumped to a specific mailbox if there is no answer.  
If '0' is Dialed, the 'o' context is called, which in this example acts the 
same as if extension 100 was called directly.

Any of these situations can also hit '*' while the voicemail greeting is being 
played and access the administrative menu for the mailbox they called, 
provided they know the passcode.

You do not put 'a' in a [mycompany] context all on its own, you put it in the 
context that your call is currently in.  The @context for voicemail is for 
voicemailboxes; it has absolutely nothing to do with dialplans.

(You'll also notice the use of SipAddHeader -- if the general number is called 
the phones may use this additional SIP header to ring differently (or not at 
all) -- that way they can easily tell if the call is for them specifically, 
or whether it is a general call.)

-A.



More information about the asterisk-users mailing list