]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fifo_export
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 10 Jan 2014 20:28:07 +0000 (01:28 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 10 Jan 2014 20:28:15 +0000 (01:28 +0500)
src/mod/applications/mod_fifo/mod_fifo.c

index a8b39695de0bfab08531e77c3688fea7e72539fa..1a18f807727490d179168016165d309d9d29898f 100644 (file)
@@ -1307,6 +1307,7 @@ static void *SWITCH_THREAD_FUNC ringall_thread_run(switch_thread_t *thread, void
        struct call_helper *rows[MAX_ROWS] = { 0 };
        int rowcount = 0;
        switch_memory_pool_t *pool;
+       char *export = NULL;
 
        switch_mutex_lock(globals.mutex);
        globals.threads++;
@@ -1473,6 +1474,28 @@ static void *SWITCH_THREAD_FUNC ringall_thread_run(switch_thread_t *thread, void
        switch_event_add_header_string(ovars, SWITCH_STACK_BOTTOM, "fifo_originate_uuid", uuid_str);
 
 
+       if ((export = switch_event_get_header(pop, "variable_fifo_export"))) {
+               int argc;
+               char *argv[100] = { 0 };
+               char *mydata = strdup(export);
+               char *tmp;
+
+               argc = switch_split(mydata, ' ', argv);
+
+               for (x = 0; x < argc; x++) {
+                       char *name = switch_mprintf("variable_%s", argv[x]);
+
+                       if ((tmp = switch_event_get_header(pop, name))) {
+                               switch_event_add_header(ovars, SWITCH_STACK_BOTTOM, argv[x], tmp);
+                       }
+
+                       free(name);
+               }
+
+               switch_safe_free(mydata);
+       }
+
+
        if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) {
                switch_core_session_t *session;
                if (id && (session = switch_core_session_locate(id))) {