[Home]

Summary:ASTERISK-22556: [patch] MailboxCount & ExtensionState commands - request multiple mailboxes/extensions
Reporter:Mike Ser (mser@netweave.com)Labels:patch
Date Opened:2013-09-18 16:08:19Date Closed:
Priority:MajorRegression?
Status:Open/NewComponents:Core/ManagerInterface/NewFeature
Versions:1.8.23.1 13.18.4 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) managerPatch3
Description:We use asterisk gui & initial loading can take forever with large installations (100+ extensions,) as each extension requires two AMI requests to send and receive the ExtensionState & MailboxStatus commands.  I have modified these commands in manager.c to accept a comma delimited list of extensions and build a reply for the entire list.  

I also have made modifications to asterisk gui to take advantage of this feature and load all the ExtensionState's and MailboxStatus' with a single command which executes very quickly, which I will be glad to submit if these changes are accepted.

In addition the asterisk gui can now refresh the extension status very well, where in the past it required a separate javascipt setInterval for each extension, which for large installations performed so poorly that we had commented it out.

I don't see where on this form I can attach the code changes.  I did fill out a license agreement.  Perhaps it hasn't been approved?  It's actually a trivial change IMHO.  


Comments:By: Matt Jordan (mjordan) 2013-09-18 16:35:49.676-0500

It's under "More Actions -> Attach Files".

Please note that any new features have to be written against Asterisk trunk, not Asterisk 1.8.

By: Mike Ser (mser@netweave.com) 2013-09-19 16:58:29.008-0500

main/manager.c

By: Mike Ser (mser@netweave.com) 2013-09-19 16:59:51.434-0500

thank you Matt.  I downloaded the trunk source, merged my changes and compiled it successfully.  Attachment provided of svn diff manager.c

By: Matt Jordan (mjordan) 2013-09-26 14:48:43.150-0500

A few comments on the patch you provided:

# It appears to still be written against Asterisk 1.8. While it may merge with trunk (today), it's probably a good idea to provide a diff that was made against the existing Asterisk trunk.
# In Asterisk trunk, there is a different mechanism that is preferred for raising events that directly accessing {{ast_manager_event}}. In general, you should be publishing messages to the Stasis message bus, not to AMI directly. That lets all consumers of Stasis know of the mailbox changes. Luckily, {{app_voicemail}} already wraps this up in {{queue_mwi_event}} - you should be calling that instead of directly raising the events.
# Remove the debug log messages:
{noformat}
ast_log(LOG_NOTICE, "HTTP Mailbox Multi \n");
{noformat}


By: Mike Ser (mser@netweave.com) 2013-09-30 21:02:43.023-0500

main/manager.c enhancements

By: Mike Ser (mser@netweave.com) 2013-09-30 21:02:49.510-0500

Matt,

1. my apologies.  I did download the trunk and redid the changes and then somehow posted the 1.8 patch.  Trunk patch attached.

2.  I don't know what you are talking about.  I'm using the same calls as in the original source; I'm just expecting additional user input and processing it.  I'm not aware I'm raising events in my code enhancements.  Please advise.

3. debug messages removed.

By: Matt Jordan (mjordan) 2013-10-27 14:12:30.501-0500

Disregard my second comment. I looked at the patch again and - since this is an AMI event sent in response to an AMI action - the Stasis message bus is not really appropriate here.

As a final comment for the patch, you should update the XML documentation for those AMI actions so that they note that they can accept multiple entries.

By: Mike Ser (mser@netweave.com) 2013-10-28 11:06:39.058-0500

will disregard second comment.  changing XML Doc.  where is that? or does that just get driven by the comments above the function which I should update too.  sorry i'm a newbie on this.  just point me in the right direction.

By: Matt Jordan (mjordan) 2013-10-28 11:44:29.672-0500

No problems - Asterisk uses XML defined in the source files to produce documentation for the CLI and the Asterisk wiki. You can find the XML documentation for the affected Manager actions at the top of {{manager.c}}. Look for:

{noformat}
<manager name="ExtensionState" language="en_US">
{noformat}

and

{noformat}
<manager name="MailboxStatus" language="en_US">
{noformat}

respectively.

Note that the DTD that defines the allowed schema is located in {{doc/appdocsxml.dtd}}.

By: Mike Ser (mser@netweave.com) 2013-10-29 12:16:11.863-0500

svn diff changes to manager.c, rev 3, add xml comment changes