[Home]

Summary:ASTERISK-05025: [patch][post 1.4] Manager Event Hook
Reporter:Anthony Minessale (anthm)Labels:
Date Opened:2005-09-08 10:51:41Date Closed:2008-01-15 17:10:35.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/ManagerInterface
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) manager.diff
( 1) manager-updated
Description:This is a way to register your own function to be called whenever something calls manager_event() making it possible
to gateway events to other systems without hacking the manager The backend takes the liberty of consolidating the
varargs printf like expression into 1 string.

/* this is your custom function */
static int verbose_manager_event(int category, char *event, char *body)
{
   ast_verbose("Manager EVENT\n%s\n", body);
   return 0;
}

/* This is the container where the function is stored in manager's scope */
static struct manager_custom_hook my_hook = {
   .file = "app_myapp",
   .helper = verbose_manager_event
};

/* this is how you register it */
int load_module(void)
{
    add_manager_hook(&my_hook);
}

/* this is how you un-register it */
int unload_module(void)
{
    del_manager_hook(&my_hook);
}



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

Disclaimer On File
anthmct@yahoo.com
Comments:By: opsys (opsys) 2005-12-30 17:45:04.000-0600

HOUSEKEEPING:

Close?

By: Russell Bryant (russell) 2006-01-02 00:42:56.000-0600

No.  It is still in the queue waiting for review.  There is absolutely no reason this should be closed.

By: Matt O'Gorman (mogorman) 2006-01-31 17:36:58.000-0600

updated so it goes against trunk.  any thoughts on issue, code looks fine to me

By: Olle Johansson (oej) 2006-03-03 05:21:34.000-0600

Opened branch " /team/oej/amieventhook-561/" for this issue. Added documentation in bug tracker to doxygen.

By: Olle Johansson (oej) 2006-03-03 05:32:52.000-0600

Added to test-this-branch

By: Olle Johansson (oej) 2006-05-17 02:56:21

is this patch made obsolete or is it still working in regards to Mark's changes to the manager API?

By: Serge Vecher (serge-v) 2006-06-28 14:15:12

This needs somebody's feedback.

By: jmls (jmls) 2006-10-06 12:39:44

took the liberty of updating against latest trunk (r44595). Disclaimer already on file.

manager.diff is this latest patch



By: jmls (jmls) 2006-10-09 09:09:57

could someone either get this into trunk or close it before someone else (rizzo!) changes manager.c again. I've just checked - this patch still applies against the latest trunk.

Thanks.

By: jmls (jmls) 2006-10-31 11:06:29.000-0600

ping. can we either apply this or close it ? I for one would find it useful, as we could use it to hook into and send jabber messages whenever an event is generated

By: Serge Vecher (serge-v) 2006-11-06 09:58:38.000-0600

julian: prod file on IRC ;)

By: Joshua C. Colp (jcolp) 2006-11-06 11:06:15.000-0600

Put into trunk as of revision 47229. Thanks!

By: Digium Subversion (svnbot) 2008-01-15 17:10:35.000-0600

Repository: asterisk
Revision: 11712

_U  team/oej/amieventhook-561/
U   team/oej/amieventhook-561/include/asterisk/manager.h
U   team/oej/amieventhook-561/manager.c

------------------------------------------------------------------------
r11712 | oej | 2008-01-15 17:10:35 -0600 (Tue, 15 Jan 2008) | 2 lines

Adding anthm's patch from ASTERISK-5025 with some small documentation changes

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=11712