From: Anthony Minessale Date: Fri, 8 Oct 2010 22:45:40 +0000 (-0500) Subject: add event data X-Git-Tag: v1.2-rc1~291^2~7^2~8^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37298f56bd85e16922b774cf6fc2a48c88b880d7;p=thirdparty%2Ffreeswitch.git add event data --- diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index f444f63cb2..06f545928d 100755 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -108,10 +108,22 @@ static switch_status_t digit_nomatch_action_callback(switch_ivr_dmachine_match_t switch_core_session_t *session = (switch_core_session_t *) match->user_data; switch_channel_t *channel = switch_core_session_get_channel(session); char str[DMACHINE_MAX_DIGIT_LEN + 2]; + switch_event_t *event; + switch_status_t status; switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Digit NOT match binding [%s]\n", switch_channel_get_name(channel), match->match_digits); + if (switch_event_create_plain(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "digits", match->match_digits); + + if ((status = switch_core_session_queue_event(session, &event)) != SWITCH_STATUS_SUCCESS) { + switch_event_destroy(&event); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s event queue faiure.\n", + switch_core_session_get_name(session)); + } + } + /* send it back around flagged to skip the dmachine */ switch_snprintf(str, sizeof(str), "!%s", match->match_digits); @@ -139,6 +151,7 @@ static switch_status_t digit_action_callback(switch_ivr_dmachine_match_t *match) } switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, string, act->value); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "digits", match->match_digits); if (exec) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute", exec == 2 ? "non-blocking" : "blocking");