Details

    • Type: New Feature New Feature
    • Status: Closed
    • Severity: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Target Release Version/s: None
    • Component/s: Core/ManagerInterface
    • Labels:
      None
    • SVN Revision Number:
      44595
    • Mantis ID:
      5161
    • Regression:
      No

      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

        Activity

        Hide
        jmls added a comment -

        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.

        Show
        jmls added a comment - 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.
        Hide
        jmls added a comment -

        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

        Show
        jmls added a comment - 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
        Hide
        Serge Vecher added a comment -

        julian: prod file on IRC

        Show
        Serge Vecher added a comment - julian: prod file on IRC
        Hide
        Joshua Colp added a comment -

        Put into trunk as of revision 47229. Thanks!

        Show
        Joshua Colp added a comment - Put into trunk as of revision 47229. Thanks!
        Hide
        Digium Subversion added a comment -

        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

        Show
        Digium Subversion added a comment - 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

          People

          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development