dtmf overhaul testers wanted

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6952 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2007-12-22 00:32:20 +00:00
1 parent 601f7b6e4a
commit 2931fc9109
33 files changed
+475 -313

No files matched your search

+12 -6
View File
@@ -522,14 +522,14 @@ static switch_status_t channel_waitfor_write(switch_core_session_t *session, int
}
static switch_status_t channel_send_dtmf(switch_core_session_t *session, char *dtmf)
static switch_status_t channel_send_dtmf(switch_core_session_t *session, const switch_dtmf_t *dtmf)
{
private_t *tech_pvt = NULL;
tech_pvt = switch_core_session_get_private(session);
assert(tech_pvt != NULL);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "DTMF ON CALL %s [%s]\n", tech_pvt->call_id, dtmf);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "DTMF ON CALL %s [%c]\n", tech_pvt->call_id, dtmf->digit);
return SWITCH_STATUS_SUCCESS;
}
@@ -1205,15 +1205,21 @@ static switch_status_t engage_device(unsigned int sample_rate, int codec_ms)
static switch_status_t dtmf_call(char **argv, int argc, switch_stream_handle_t *stream)
{
char *dtmf = argv[0];
if (switch_strlen_zero(dtmf)) {
char *dtmf_str = argv[0];
switch_dtmf_t dtmf = {0, SWITCH_DEFAULT_DTMF_DURATION};
if (switch_strlen_zero(dtmf_str)) {
stream->write_function(stream, "No DTMF Supplied!\n");
} else {
switch_mutex_lock(globals.pvt_lock);
if (globals.call_list) {
switch_channel_t *channel = switch_core_session_get_channel(globals.call_list->session);
switch_channel_queue_dtmf(channel, dtmf);
char *p = dtmf_str;
while(p && *p) {
dtmf.digit = *p;
switch_channel_queue_dtmf(channel, &dtmf);
p++;
}
}
switch_mutex_unlock(globals.pvt_lock);
}