Can you please attach this patch as a file to a bug on jira.freeswitch.org?

Mike

On Jul 7, 2008, at 5:36 PM, Chris Danielson wrote:

FreeSWITCH may or may not need this but I added an auto-record feature into the mod_conference module. Essentially, one can specify within the "conf/autoload_configs/conference.conf.xml" the following attribute:
<param name="auto-record" value="/var/myNFSshare/audio/" />
When this is specified the conference will automatically record the conference->name with an appended ".wav" into that folder. I built this out of necessity for my current implementation. I thought since it is able to be toggled off and on based on specifying the "auto-record" parameter that it might be worthy of inclusion.

Attached is my svn diff.

Kind Regards,
Chris

--
Chris Danielson
Software Consultant and Co-Founder
Web: MaxPowerSoft, LLC
Email: [EMAIL PROTECTED]
Index: mod_conference.c
===================================================================
--- mod_conference.c    (revision 8910)
+++ mod_conference.c    (working copy)
@@ -27,8 +27,8 @@
 * Neal Horman <neal at wanlink dot com>
 * Bret McDanel <trixter at 0xdecafbad dot com>
 * Dale Thatcher <freeswitch at dalethatcher dot com>
+ * Chris Danielson <chris at maxpowersoft dot com>
 *
- *
 * mod_conference.c -- Software Conference Bridge
 *
 */
@@ -230,6 +230,7 @@
        char *caller_id_number;
        char *sound_prefix;
        char *special_announce;
+       char *auto_record;
        uint32_t max_members;
        char *maxmember_sound;
        uint32_t anounce_count;
@@ -880,6 +881,14 @@
        switch_mutex_lock(globals.hash_mutex);
        globals.threads++;
        switch_mutex_unlock(globals.hash_mutex);
+       
+       if (conference->auto_record) {
+ char *rfile = switch_mprintf("%s%s%s", conference->auto_record, conference->name, ".wav");
+               switch_assert(rfile);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Auto recording file: %s\n", rfile);
+               launch_conference_record_thread(conference, rfile);
+               switch_safe_free(rfile);
+       }

while (globals.running && !switch_test_flag(conference, CFLAG_DESTRUCT)) {
                switch_size_t file_sample_len = samples;
@@ -4806,6 +4815,7 @@
        switch_status_t status;
        int comfort_noise_level = 0;
        char *suppress_events = NULL;
+       char *auto_record = NULL;

        /* Validate the conference name */
        if (switch_strlen_zero(name)) {
@@ -4923,6 +4933,8 @@
                        }
} else if (!strcasecmp(var, "suppress-events") && ! switch_strlen_zero(val)) {
                        suppress_events = val;
+ } else if (!strcasecmp(var, "auto-record") && ! switch_strlen_zero(val)) {
+                       auto_record = val;
                }
        }

@@ -5078,6 +5090,10 @@
                clear_eflags(suppress_events, &conference->eflags);
        }

+       if (!switch_strlen_zero(auto_record)) {
+ conference->auto_record = switch_core_strdup(conference->pool, auto_record);
+       }
+       
        /* caller control configuration chores */
if (switch_ivr_digit_stream_parser_new(conference->pool, &conference->dtmf_parser) == SWITCH_STATUS_SUCCESS) {

_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

Reply via email to