[Home]

Summary:ASTERISK-18634: Create VM_INFO() dialplan function to gather information about a mailbox
Reporter:Kris Shaw (shawkris)Labels:
Date Opened:2011-09-26 19:19:25Date Closed:2011-12-06 14:31:16.000-0600
Priority:TrivialRegression?No
Status:Closed/CompleteComponents:Applications/app_voicemail
Versions:1.8.7.0 Frequency of
Occurrence
Related
Issues:
Environment:Asterisk 1.8.7Attachments:( 0) vminfo-1.patch
( 1) vminfo-2.patch
( 2) vminfo-3.patch
Description:I couldn't see an easy way to get the email address of a voicemail user, so I added a function that can be called from the dialplan:

exten => 602,1,NoOp(${MAILBOX_EMAIL(1234@invalid)})
exten => 602,2,NoOp(${MAILBOX_EMAIL(1234@default)})
Executing [602@from-internal:1] NoOp("SIP/3004-00000000", "") in new stack
Executing [602@from-internal:2] NoOp("SIP/3004-00000000", "root@localhost") in new stack
Comments:By: Clod Patry (junky) 2011-09-26 19:22:50.836-0500

What about a more generic function like VM_INFO, that could also returns the SMS info also?
Something similar to CONFBRIDGE_INFO().


By: Kris Shaw (shawkris) 2011-09-26 19:40:43.212-0500

So that you would call something like ${VM_INFO(1234@default,email)} or ${VM_INFO(1234@default,sms)} ?

By: Clod Patry (junky) 2011-09-27 21:50:45.142-0500

After a discussion with a friend (thanks Dominique), VM_INFO could also supports:
- password
- name
- email
- pager
- new_msg
- old_msg
where new_msg and old_msg are this current new/old messages.

whatcha think?


By: Kris Shaw (shawkris) 2011-09-28 12:49:31.188-0500

I think you are right - it needs to be a more general function. I think the coding to achieve this is beyond what I can do - e.g. there might be locking implications with message counting. I'm happy for this case to be closed, and perhaps re-opened in the future if I feel I can make progress.

By: Leif Madsen (lmadsen) 2011-10-03 15:23:04.414-0500

Thanks for the submission!

I'm going to acknowledge this issue, but as Clod has pointed out, we won't be able to accept this as-is. A more general function will need to be created which contains this data. For now it could probably just contain the code you've provided (which essentially means renaming the function you've provided). Then you'd just add some TODO notes in the code about what could be provided and how it might be structured (in terms of commands to be passed etc).

We could then take this to the asterisk-dev mailing list and see if we could get some developers to expand this function and get it ready for Asterisk 11.

By: Leif Madsen (lmadsen) 2011-10-03 15:49:02.277-0500

Huh, and ya, you'll need to attach a patch here ;)

By: Leif Madsen (lmadsen) 2011-10-03 15:49:25.346-0500

In feedback until patch attached.

By: Kris Shaw (shawkris) 2011-10-13 17:06:25.010-0500

Patch for generic VM_INFO function attached. Function handles email, pager, password and fullname attributes. Tested with mailboxes defined in voicemail.conf, but not from a databasae source.

By: Kris Shaw (shawkris) 2011-10-18 19:03:48.464-0500

Updated patch to include new_msg and old_msg information. However, after thinking about it, it would be better if the VMCOUNT functionality was incorporated, so you could could do something like VM_INFO(1234@default,msg_count,Inbox).

By: Kris Shaw (shawkris) 2011-10-21 19:13:11.098-0500

Removed new_msg and old_msg and introduced a count attribute. This will default to the INBOX (new messages) but other folders can be specified. This is similar to the VMCOUNT function. I've also incorporated the MAILBOX_EXISTS functionaility.

By: Leif Madsen (lmadsen) 2011-11-02 13:42:43.085-0500

At this point I suggest you move this to reviewboard. If all the testing and functionality works, then it's time to get this reviewed. If we can get someone to give it a ship it, then we can get it committed. This appears to be a self contained dialplan function, so should be relatively simple to get put into Asterisk.

By: Clod Patry (junky) 2011-11-02 15:40:31.754-0500

Good idea Leif.

I wanna discuss few stuff with Matt Jordan regarding this ticket.


By: Kris Shaw (shawkris) 2011-11-03 18:42:48.930-0500

Is there anything I need to do?