Dialplan using MailboxExists and shared mailbox

Hi,

I have a situation where multiple SIP clients share the same mailbox, i.e. users 101, 102 and 103 are all configured with mailbox “100@default”.

I also one central macro for local SIP calling so that the actions taken when a call is received are consistent. This presents a problem however.

Say that extension 103 wants to call extension 101. Extension 101 doesn’t answer the phone and it needs to go to voicemail. The only information I’ve been able to pass to the Macro is the number to call, i.e. SIP/101. At the point where it needs to go to voicemail, I first want to check that the mailbox exists… but I can only use “101” to check which is obviously not going to work because the mailbox is shared and is numbered 100.

Of course this works fine when users are locally picking up voicemail by using VoiceMail() because the mailbox line is configured in sip.conf, but is there any way to perform a lookup of user configuration options from sip.conf during a dialplan? Or is there a more elegant way to use shared mailboxes when you can’t read the sip.conf?

Thanks in advance

Chris

[quote]The only information I’ve been able to pass to the Macro is the number to call, i.e. SIP/101.[/quote] Why you can pass as many varibles in the macro as you want, so for example you pass SIP/100 and 101 as another variable then that ${ARG2} is what you test the vmail with

Ian

Hi Ian,

[quote=“ianplain”][quote]The only information I’ve been able to pass to the Macro is the number to call, i.e. SIP/101.[/quote] Why you can pass as many varibles in the macro as you want, so for example you pass SIP/100 and 101 as another variable then that ${ARG2} is what you test the vmail with

Ian[/quote]

Thanks for this, but how can I (within the dialplan) get the SIP user’s mailbox ID?

Say the user dials “500” and my dialplan says :-

Macro(SIPCall, ${EXTEN})

and the macro then says :-

exten => s,1,Dial(SIP/${ARG1}, 30, tr)

how can I lookup in the sip.conf to work out what the mailbox ID of ${ARG1} is?

Ok…

What you will need to do is store the mailbox number in the astdb.

do for example you have a family VMBOX with the key being the extension and the value being the mailbox

Then when the call enters the macro you do a look up if the key or value is empty you set the channel varible VMBOX to ${ARG1} other wise its set to the DB value. then you do the mailbox exists on ${VMBOX}

Ian