]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4984 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 7 Jan 2013 17:06:55 +0000 (11:06 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 7 Jan 2013 17:06:55 +0000 (11:06 -0600)
src/mod/applications/mod_spandsp/mod_spandsp_dsp.c
src/mod/applications/mod_spandsp/mod_spandsp_fax.c

index 43b739ff3940523b98fb9b89697b429ba14c4787..906d7787e6e6427b031ecbfd2d76db028166ab51 100644 (file)
@@ -789,10 +789,15 @@ static switch_bool_t callprogress_detector_process_buffer(switch_media_bug_t *bu
                tone_detector_process_buffer(detector, frame->data, frame->samples, &detected_tone);
                if (detected_tone) {
                        switch_event_t *event = NULL;
+                       switch_channel_t *channel = NULL;
                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "DETECTED TONE: %s\n", detected_tone);
                        if (switch_event_create(&event, SWITCH_EVENT_DETECTED_TONE) == SWITCH_STATUS_SUCCESS) {
                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Detected-Tone", detected_tone);
                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Unique-ID", switch_core_session_get_uuid(session));
+
+                               channel = switch_core_session_get_channel(session);
+                               if (channel) switch_channel_event_set_data(channel, event);
+
                                switch_event_fire(&event);
                        }
                }
index 51dcc6ba572cf968118610c7ada37a2ed28972d4..fa5069eb096c09e41c2180e08ddc4eb8d10c64da 100644 (file)
@@ -2108,7 +2108,16 @@ static switch_bool_t tone_detect_callback(switch_media_bug_t *bug, void *user_da
 
                                if (switch_event_create(&event, SWITCH_EVENT_DETECTED_TONE) == SWITCH_STATUS_SUCCESS) {
                                        switch_event_t *dup;
+                                       switch_core_session_t *session = NULL;
+                                       switch_channel_t *channel = NULL;
+
                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Detected-Fax-Tone", "true");
+
+                                       session = switch_core_media_bug_get_session(bug);
+                                       if (session) {
+                                           channel = switch_core_session_get_channel(session);
+                                           if (channel) switch_channel_event_set_data(channel, event);
+                                       }
                                
                                        if (switch_event_dup(&dup, event) == SWITCH_STATUS_SUCCESS) {
                                                switch_event_fire(&dup);