[Home]

Summary:ASTERISK-07893: [patch] Getting machine readable voicemail.conf information (email, extension) through manager interface
Reporter:Tony Zhao (tony zhao)Labels:
Date Opened:2006-10-06 18:00:44Date Closed:2007-07-11 19:59:05
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Applications/app_voicemail
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20070524__bug8112.diff.txt
( 1) diff.out
( 2) diff44828app_voicmail.out
( 3) foo
( 4) svndiff_app_voicemail.txt
Description:Minor feature to extend the current capability of 'voicemail list users' through the manager interface.  This feature allows nearly all of the information in the 'ast_vm_user' structure to be retrieved.

This is useful in intergrating applications that uses the Asterisk manager interface realtime and require lookups to match extensions to unique email addresses.  The email addresses can then be used to index tables in a database to pull out user desired features for a specific extensions such as timeout times, silent times, and call forwarding.


****** ADDITIONAL INFORMATION ******

The new cli command produces a machine parsable format separated by ';' delimiters

*CLI>voicemail list users all
;default;;;;New User;;general;;100;;;;0
;default;;root@localhost;;Example Mailbox;;1234;;100;;;;0
;other;;root@localhost;;Company2 User;;1234;;100;;;;0
Comments:By: Tilghman Lesher (tilghman) 2006-10-07 02:13:21

If you're using realtime, why not just get the data directly from the database, instead of going through this extra step?

By: Tony Zhao (tony zhao) 2006-10-09 12:04:20

There are several reasons for this:

1. One cannot access all the information from the cli in Asterisk, sometimes this is needed.

2. The information can be stored on multiple servers all in flat files.  In other words, in a small self-contained enviornment, using databases may not be the most approporaite method.

3. There should be a level of abstraction ebtween the manager and the database.  The manager interface should not care about what databases the information are stored in and how to access them.

**For out current application, we are currently not using databases.

By: Tilghman Lesher (tilghman) 2006-10-09 15:15:54

1.  You used the word "realtime" in your description, which, for Asterisk, means the realtime database implementation.  I am removing that from the description, since you obviously did not mean that.

2.  The patch you submitted is backwards.

3.  You submitted a patch for the CLI, while mentioning that the interface is for the Manager.  Please resubmit your patch using the Manager interface.

4.  Note that we prefer all interfaces for the CLI to be human readable, not built in a way to allow for simple machine parsing.

5.  Do NOT expose the voicemail passwords through the Manager interface.  This alone would be a reason for rejecting your patch.  The problem with this is that the Manager data flows across the wire in the clear, allowing a passive attack to gain access to voicemail boxes.

By: Serge Vecher (serge-v) 2006-10-09 15:34:43

additionally, since this is a new feature, the patch will need to be against the trunk, not the release branches (1.2.x and 1.4.x). Thanks.

By: Tony Zhao (tony zhao) 2006-10-10 13:25:31

Attached new patch diff44828app_voicemail.out against trunk version 44828


1. You used the word "realtime" in your description, which, for Asterisk, means the realtime database implementation. I am removing that from the description, since you obviously did not mean that.

Ok, sorry for the confusion

2. The patch you submitted is backwards.

Changed

3. You submitted a patch for the CLI, while mentioning that the interface is for the Manager. Please resubmit your patch using the Manager interface.

What I meant is that using action: command one can exeute this CLI command.  Again sorry for the confusion.

4. Note that we prefer all interfaces for the CLI to be human readable, not built in a way to allow for simple machine parsing.

Tried my best.  Too many fields to display it in a nice format.  Just added heading and used comman separated format.

5. Do NOT expose the voicemail passwords through the Manager interface. This alone would be a reason for rejecting your patch. The problem with this is that the Manager data flows across the wire in the clear, allowing a passive attack to gain access to voicemail boxes.

Not exposed

Thanks

By: Tony Zhao (tony zhao) 2006-10-10 13:51:23

Also I just wanted to mention we changed it this way to minimize the impact on your code.  However if you prefer for us to write a Manager command it can be done (if all CLI commands must be human friendly).
Allowing machine parsing capability in CLI commands already exist in some portions of the application.

The problem with the displaying all the fields in a user friendly manner is that due to the large number of items to display it will be hard to read no matter what.

Thanks again for your consideration!

Tony

By: Olle Johansson (oej) 2006-10-29 14:30:55.000-0600

I agree with Corydon76 that we would prefer a proper manager command.

CLI commands are for humans and not for machine parsing. Manager is for machine-to-machine interaction.

Looking forward to that patch!

By: jmls (jmls) 2006-11-19 13:28:23.000-0600

Tony Zhao: where you able to create a patch that uses a manager command instead of a cli ? Would you be able to upload a patch against trunk ? Thanks

By: Tony Zhao (tony zhao) 2006-11-20 16:17:12.000-0600

Patch that added a manager command "ListAllVoicemailUsers" that shows all the voicemail user info except for the password.

Revision: 47867
latest asterisk 1.4 trunk

By: Tilghman Lesher (tilghman) 2007-01-16 02:32:28.000-0600

1) You are open-coding ast_app_messagecount().  Please use the API function instead of recoding it.
2) Output field names should be have their first character capitalized.
3) You should use the standard "Response: Follows" prior to sending results and another header to indicate the results are complete.
4) There is no need to log a NOTICE for the output of the Manager command.

By: Matthew Nicholson (mnicholson) 2007-05-24 11:09:30

I like 20070524__bug8112.diff.txt.  I would make it possible to get only 1 context.

By: Joshua C. Colp (jcolp) 2007-05-24 15:51:28

Put into trunk as of revision 66028.