From 671e935d349b8cbafe0272bcef3f4b50ba4a18d0 Mon Sep 17 00:00:00 2001 From: William King Date: Sun, 25 Nov 2012 18:11:04 -0800 Subject: [PATCH] FS-4872: --resolve In the case of an event injected sms message that doesn't enable blocking mode the event would be queued up indefinately. --- src/mod/applications/mod_sms/mod_sms.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mod/applications/mod_sms/mod_sms.c b/src/mod/applications/mod_sms/mod_sms.c index 15d0de6233..9fd1d896da 100644 --- a/src/mod/applications/mod_sms/mod_sms.c +++ b/src/mod/applications/mod_sms/mod_sms.c @@ -43,6 +43,8 @@ static void event_handler(switch_event_t *event) { const char *dest_proto = switch_event_get_header(event, "dest_proto"); const char *check_failure = switch_event_get_header(event, "Delivery-Failure"); + const char *check_nonblocking = switch_event_get_header(event, "Nonblocking-Delivery"); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "skip_global_process", "true"); if (switch_true(check_failure)) { @@ -54,6 +56,9 @@ static void event_handler(switch_event_t *event) } else if ( check_failure && switch_false(check_failure) ) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SMS Delivery Success\n"); return; + } else if ( check_nonblocking && switch_true(check_nonblocking) ) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SMS Delivery assumed successful due to being sent in non-blocking manner\n"); + return; } switch_core_chat_send(dest_proto, event);