Asterisk
  1. Asterisk
  2. ASTERISK-1261

[patch] Update monitor app to exec custom script when channel closes

    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/General
    • Labels:
      None
    • Mantis ID:
      1268
    • Regression:
      No

      Description

      Update monitor app to:

      a) have an option to exec a custom script with the individual file legs or soxmixed file as paramers once the monitor resource releases the files.

      b) Ensure that all parameters are available to the monitor aplication from the manager interface.

                • ADDITIONAL INFORMATION ******

      My primary reason for wanting to do this, is the ability to issue a monitor command on a channel from the administrator interface and have the file e-mailed to a specified address once the call is done and the soxmix option executes.

      A more general approach in my mind is to exec a script or executable that is specified to the monitor app or administrative command. The scipt would get executed once the recording files are safely closed, and would receive the names of the recorded or mixed file(s) as command line parameters.

      I can see value here for not only e-mailing the files, but mpeg'ing them off line (non blocking) or archiving them and inserting info into an archiving database.

      I hope to be working on this in the next few weeks. But if someone is just chomping at the bit to do something like this or in process, please let me know.

        Activity

        Hide
        scrubb added a comment -

        Ok, Ok.
        The patch to res_monitor is very simple. Just execs anything in the channel variable MONITOR_EXEC. No manager interface ,no command arguments, nothing. Simple.

        This also patches manager.c and creates a very simple "Setvar" command that will set a channel variable on a channel.

        Hows it look Mark?

        Show
        scrubb added a comment - Ok, Ok. The patch to res_monitor is very simple. Just execs anything in the channel variable MONITOR_EXEC. No manager interface ,no command arguments, nothing. Simple. This also patches manager.c and creates a very simple "Setvar" command that will set a channel variable on a channel. Hows it look Mark?
        Hide
        scrubb added a comment -

        Version 5 of the patch:
        Ok, Mark and I worked this out. Here's how this feature works:

        the "m" flag means to "mix" the recording legs when done with recording. NOTHING is executed unless there is an "m" flag.
        If MONITOR_EXEC is not set then the files are mixed with soxmix and the leg files are deleted
        If MONITOR_EXEC is set then whatever is in it is run in place of soxmix and the leg files are NOT deleted.
        In either case the executed program is handed 3 filenames, the in leg, out leg, and the name of the target file to mix them into.

        In order to allow this feature to be controllable via the manager interface the "m" flag is settable via the manager interface.

        This patch also adds SetVar and GetVar functions to manager.c so not only can the MONITOR_EXEC variable be set from the manager interface, but so can any other variable.

        I still do not have the facilities to test this beyond compile and load. I am working on getting my test lab back. Please take time to review and test this patch.

        Show
        scrubb added a comment - Version 5 of the patch: Ok, Mark and I worked this out. Here's how this feature works: the "m" flag means to "mix" the recording legs when done with recording. NOTHING is executed unless there is an "m" flag. If MONITOR_EXEC is not set then the files are mixed with soxmix and the leg files are deleted If MONITOR_EXEC is set then whatever is in it is run in place of soxmix and the leg files are NOT deleted. In either case the executed program is handed 3 filenames, the in leg, out leg, and the name of the target file to mix them into. In order to allow this feature to be controllable via the manager interface the "m" flag is settable via the manager interface. This patch also adds SetVar and GetVar functions to manager.c so not only can the MONITOR_EXEC variable be set from the manager interface, but so can any other variable. I still do not have the facilities to test this beyond compile and load. I am working on getting my test lab back. Please take time to review and test this patch.
        Hide
        Mark Spencer added a comment -

        Added to CVS with minor modifications.

        Show
        Mark Spencer added a comment - Added to CVS with minor modifications.
        Hide
        jamieg added a comment -

        Reminder sent to markster, scrubb

        Hi, Jamieg here back to test this patch. Been away for a while. I see considerable work has been done since. However, I am having problems applying the patch again. Fresh CVS update, "patch < mopnitor5.patch" and... no go.
        "can't find file to patch at input line 8"
        Have looked the the patch and stumped as to why I have these problems. Commands appriciated.

        Show
        jamieg added a comment - Reminder sent to markster, scrubb Hi, Jamieg here back to test this patch. Been away for a while. I see considerable work has been done since. However, I am having problems applying the patch again. Fresh CVS update, "patch < mopnitor5.patch" and... no go. "can't find file to patch at input line 8" Have looked the the patch and stumped as to why I have these problems. Commands appriciated.
        Hide
        Digium Subversion added a comment -

        Repository: asterisk
        Revision: 3137

        U trunk/manager.c
        U trunk/res/res_monitor.c

        ------------------------------------------------------------------------
        r3137 | markster | 2008-01-15 14:57:10 -0600 (Tue, 15 Jan 2008) | 2 lines

        Make monitor merge application settable via variable, allow setting of variables via manager interface, allow mix flag to be set via manager (bug ASTERISK-1261)

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

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

        Show
        Digium Subversion added a comment - Repository: asterisk Revision: 3137 U trunk/manager.c U trunk/res/res_monitor.c ------------------------------------------------------------------------ r3137 | markster | 2008-01-15 14:57:10 -0600 (Tue, 15 Jan 2008) | 2 lines Make monitor merge application settable via variable, allow setting of variables via manager interface, allow mix flag to be set via manager (bug ASTERISK-1261 ) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=3137

          People

          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development