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)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Delivery Failure\n"); DUMP_EVENT(event); send_report(event, "Failure"); return; } else if ( check_failure && switch_false(check_failure) ) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SMS Delivery Success\n"); send_report(event, "Success"); 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"); send_report(event, "Accepted"); return; } switch_core_chat_send(dest_proto, event); }
SWITCH_DECLARE(int)Event::chat_send(const char *dest_proto) { if (zstr(dest_proto)) { dest_proto = switch_event_get_header(event, "dest_proto"); } return (int) switch_core_chat_send(dest_proto, event); }
static void event_handler(switch_event_t *event) { const char *dest_proto = switch_event_get_header(event, "dest_proto"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "skip_global_process", "true"); switch_core_chat_send(dest_proto, event); }