Luca Bertoncello
2016-Apr-21 19:34 UTC
[asterisk-users] AMI: check if the user has a Mailbox
Hi list! On an Asterisk-Server I have some users. Just two of them have a Mailbox. I want to write a little Web interface to manage many things and I'd like to have a menu point for the voicemail, but just if the user has a Mailbox. I found the AMI-Command MailboxStatus, but it does not return what I need, since it returns 0 if the user has a Mailbox but no messages and if the user has no Mailbox... Could someone suggest me a way to get this information? Thanks a lot! Luca Bertoncello (lucabert at lucabert.de)
I don't think you are going to be able to get that information using the AMI. You should be able to figure it out though by looking at the voicemail directory structure in /var/spool/asterisk/voicemail/<context>/<exten #> or in your database if you're using real time. It's probably just as easy to write a script that will look for the proper directory as it is to write a script to query the AMI. Regards; John V. -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Luca Bertoncello Sent: Thursday, April 21, 2016 3:35 PM To: Asterisk Users Subject: [asterisk-users] AMI: check if the user has a Mailbox Hi list! On an Asterisk-Server I have some users. Just two of them have a Mailbox. I want to write a little Web interface to manage many things and I'd like to have a menu point for the voicemail, but just if the user has a Mailbox. I found the AMI-Command MailboxStatus, but it does not return what I need, since it returns 0 if the user has a Mailbox but no messages and if the user has no Mailbox... Could someone suggest me a way to get this information? Thanks a lot! Luca Bertoncello (lucabert at lucabert.de) -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Telium Technical Support
2016-Apr-21 21:43 UTC
[asterisk-users] AMI: check if the user has a Mailbox
I don't think the directory check method is reliable; a user can have a mailbox but if no messages have been left then the directory structure may not exist. Through the AMI you can show peer/user information and I believe it shows you the mailbox associated with user/peer. -Raj- -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Tech Support Sent: Thursday, April 21, 2016 4:23 PM To: 'Asterisk Users Mailing List - Non-Commercial Discussion' Subject: Re: [asterisk-users] AMI: check if the user has a Mailbox I don't think you are going to be able to get that information using the AMI. You should be able to figure it out though by looking at the voicemail directory structure in /var/spool/asterisk/voicemail/<context>/<exten #> or in your database if you're using real time. It's probably just as easy to write a script that will look for the proper directory as it is to write a script to query the AMI. Regards; John V. -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Luca Bertoncello Sent: Thursday, April 21, 2016 3:35 PM To: Asterisk Users Subject: [asterisk-users] AMI: check if the user has a Mailbox Hi list! On an Asterisk-Server I have some users. Just two of them have a Mailbox. I want to write a little Web interface to manage many things and I'd like to have a menu point for the voicemail, but just if the user has a Mailbox. I found the AMI-Command MailboxStatus, but it does not return what I need, since it returns 0 if the user has a Mailbox but no messages and if the user has no Mailbox... Could someone suggest me a way to get this information? Thanks a lot! Luca Bertoncello (lucabert at lucabert.de) -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Hi Luca Would greping for the existence of the mailbox number in /etc/voicemail.conf do the trick? Pete> On 22/04/2016, at 7:34 am, Luca Bertoncello <lucabert at lucabert.de> wrote: > > Hi list! > > On an Asterisk-Server I have some users. Just two of them have a Mailbox. > I want to write a little Web interface to manage many things and I'd like to > have a menu point for the voicemail, but just if the user has a Mailbox. > > I found the AMI-Command MailboxStatus, but it does not return what I need, > since it returns 0 if the user has a Mailbox but no messages and if the user > has no Mailbox... > > Could someone suggest me a way to get this information? > > Thanks a lot! > Luca Bertoncello-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20160422/d9fa41b0/attachment.html>
On Thu, Apr 21, 2016 at 09:34:47PM +0200, Luca Bertoncello wrote:> On an Asterisk-Server I have some users. Just two of them have a Mailbox. > I want to write a little Web interface to manage many things and I'd like to > have a menu point for the voicemail, but just if the user has a Mailbox.Action: Getvar Variable: VM_INFO(222,exists) -- Stefan Tichy ( asterisk3 at pi4tel dot de )