]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add execute_on_fax_success, execute_on_fax_failure and execute_on_fax_result channel...
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 29 Jun 2011 23:22:57 +0000 (18:22 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 29 Jun 2011 23:22:57 +0000 (18:22 -0500)
src/mod/applications/mod_spandsp/mod_spandsp_fax.c

index 0cfd55c659345d2ba10db8a0f15b8142d8f87891..9b36d03cca5e76b3a987a620bc914c11523bfd55 100644 (file)
@@ -341,6 +341,7 @@ static void phase_e_handler(t30_state_t *s, void *user_data, int result)
                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Fax successfully managed. How ?\n");
                }
                switch_channel_set_variable(channel, "fax_success", "1");
+
        } else {
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Fax processing not successful - result (%d) %s.\n", result,
                                                  t30_completion_code_to_str(result));
@@ -430,6 +431,15 @@ static void phase_e_handler(t30_state_t *s, void *user_data, int result)
                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-remote-station-id", far_ident);
                switch_event_fire(&event);
        }
+
+    switch_channel_execute_on(channel, "execute_on_fax_result");
+
+    if (result == T30_ERR_OK) {
+        switch_channel_execute_on(channel, "execute_on_fax_success");
+    } else {
+        switch_channel_execute_on(channel, "execute_on_fax_failure");
+    }
+
 }
 
 static int t38_tx_packet_handler(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count)