提交 8aa07b67 authored 作者: Chris Rienzo's avatar Chris Rienzo 提交者: Andrey Volk

FS-11807 [mod_commands] uuid_recv_dtmf changed to report OK when well formed…

FS-11807 [mod_commands] uuid_recv_dtmf changed to report OK when well formed request is consumed by dmachine or dtmf hook
上级 e7dda1b0
...@@ -6347,11 +6347,10 @@ SWITCH_STANDARD_API(uuid_recv_dtmf_function) ...@@ -6347,11 +6347,10 @@ SWITCH_STANDARD_API(uuid_recv_dtmf_function)
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
if (switch_channel_queue_dtmf_string(switch_core_session_get_channel(psession), dtmf_data) == SWITCH_STATUS_SUCCESS) { if (switch_channel_queue_dtmf_string(switch_core_session_get_channel(psession), dtmf_data) == SWITCH_STATUS_GENERR) {
stream->write_function(stream, "+OK %s received DTMF %s.\n", uuid, dtmf_data); goto usage;
} else {
stream->write_function(stream, "-ERR Operation failed\n");
} }
stream->write_function(stream, "+OK %s received DTMF %s.\n", uuid, dtmf_data);
goto done; goto done;
......
...@@ -570,13 +570,13 @@ SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf_string(switch_channel_ ...@@ -570,13 +570,13 @@ SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf_string(switch_channel_
{ {
char *p; char *p;
switch_dtmf_t dtmf = { 0, switch_core_default_dtmf_duration(0), 0, SWITCH_DTMF_APP }; switch_dtmf_t dtmf = { 0, switch_core_default_dtmf_duration(0), 0, SWITCH_DTMF_APP };
int sent = 0, dur; int sent = 0, dur, bad_input = 0;
char *string; char *string;
int i, argc; int i, argc;
char *argv[256]; char *argv[256];
if (zstr(dtmf_string)) { if (zstr(dtmf_string)) {
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_GENERR;
} }
...@@ -619,12 +619,16 @@ SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf_string(switch_channel_ ...@@ -619,12 +619,16 @@ SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf_string(switch_channel_
switch_channel_get_name(channel), dtmf.digit, dur, dtmf.duration); switch_channel_get_name(channel), dtmf.digit, dur, dtmf.duration);
sent++; sent++;
} }
} else {
bad_input++;
} }
} }
} }
if (sent) {
return sent ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; return SWITCH_STATUS_SUCCESS;
}
return bad_input ? SWITCH_STATUS_GENERR : SWITCH_STATUS_FALSE;
} }
SWITCH_DECLARE(switch_status_t) switch_channel_dequeue_dtmf(switch_channel_t *channel, switch_dtmf_t *dtmf) SWITCH_DECLARE(switch_status_t) switch_channel_dequeue_dtmf(switch_channel_t *channel, switch_dtmf_t *dtmf)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论