mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-05 06:58:57 +00:00
[mod_dptools] Fix dead nested assignments.
This commit is contained in:
parent
c062f85e16
commit
688984f8b9
@ -115,7 +115,6 @@ 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_core_session_t *session = (switch_core_session_t *) match->user_data;
|
||||||
switch_channel_t *channel;
|
switch_channel_t *channel;
|
||||||
switch_event_t *event;
|
switch_event_t *event;
|
||||||
switch_status_t status;
|
|
||||||
switch_core_session_t *use_session = session;
|
switch_core_session_t *use_session = session;
|
||||||
|
|
||||||
if (switch_ivr_dmachine_get_target(match->dmachine) == DIGIT_TARGET_PEER) {
|
if (switch_ivr_dmachine_get_target(match->dmachine) == DIGIT_TARGET_PEER) {
|
||||||
@ -135,7 +134,7 @@ static switch_status_t digit_nomatch_action_callback(switch_ivr_dmachine_match_t
|
|||||||
if (switch_event_create_plain(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) {
|
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);
|
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "digits", match->match_digits);
|
||||||
|
|
||||||
if ((status = switch_core_session_queue_event(use_session, &event)) != SWITCH_STATUS_SUCCESS) {
|
if (switch_core_session_queue_event(use_session, &event) != SWITCH_STATUS_SUCCESS) {
|
||||||
switch_event_destroy(&event);
|
switch_event_destroy(&event);
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(use_session), SWITCH_LOG_WARNING, "%s event queue failure.\n",
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(use_session), SWITCH_LOG_WARNING, "%s event queue failure.\n",
|
||||||
switch_core_session_get_name(use_session));
|
switch_core_session_get_name(use_session));
|
||||||
@ -157,7 +156,6 @@ static switch_status_t digit_action_callback(switch_ivr_dmachine_match_t *match)
|
|||||||
{
|
{
|
||||||
struct action_binding *act = (struct action_binding *) match->user_data;
|
struct action_binding *act = (struct action_binding *) match->user_data;
|
||||||
switch_event_t *event;
|
switch_event_t *event;
|
||||||
switch_status_t status;
|
|
||||||
int exec = 0;
|
int exec = 0;
|
||||||
int api = 0;
|
int api = 0;
|
||||||
char *string = NULL;
|
char *string = NULL;
|
||||||
@ -218,7 +216,7 @@ static switch_status_t digit_action_callback(switch_ivr_dmachine_match_t *match)
|
|||||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute", exec == 1 ? "non-blocking" : "blocking");
|
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute", exec == 1 ? "non-blocking" : "blocking");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((status = switch_core_session_queue_event(use_session, &event)) != SWITCH_STATUS_SUCCESS) {
|
if (switch_core_session_queue_event(use_session, &event) != SWITCH_STATUS_SUCCESS) {
|
||||||
switch_event_destroy(&event);
|
switch_event_destroy(&event);
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(use_session), SWITCH_LOG_WARNING, "%s event queue failure.\n",
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(use_session), SWITCH_LOG_WARNING, "%s event queue failure.\n",
|
||||||
switch_core_session_get_name(use_session));
|
switch_core_session_get_name(use_session));
|
||||||
@ -651,11 +649,10 @@ SWITCH_STANDARD_APP(keepalive_function)
|
|||||||
SWITCH_STANDARD_APP(exe_function)
|
SWITCH_STANDARD_APP(exe_function)
|
||||||
{
|
{
|
||||||
char *argv[4] = { 0 };
|
char *argv[4] = { 0 };
|
||||||
int argc;
|
|
||||||
char *lbuf = NULL;
|
char *lbuf = NULL;
|
||||||
|
|
||||||
if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
|
if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
|
||||||
&& (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
|
&& switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) {
|
||||||
switch_core_session_execute_exten(session, argv[0], argv[1], argv[2]);
|
switch_core_session_execute_exten(session, argv[0], argv[1], argv[2]);
|
||||||
} else {
|
} else {
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: %s\n", EXE_SYNTAX);
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: %s\n", EXE_SYNTAX);
|
||||||
@ -695,11 +692,10 @@ SWITCH_STANDARD_APP(rename_function)
|
|||||||
SWITCH_STANDARD_APP(transfer_vars_function)
|
SWITCH_STANDARD_APP(transfer_vars_function)
|
||||||
{
|
{
|
||||||
char *argv[1] = { 0 };
|
char *argv[1] = { 0 };
|
||||||
int argc;
|
|
||||||
char *lbuf = NULL;
|
char *lbuf = NULL;
|
||||||
|
|
||||||
if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
|
if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
|
||||||
&& (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) {
|
&& switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))) >= 1) {
|
||||||
switch_core_session_t *nsession = NULL;
|
switch_core_session_t *nsession = NULL;
|
||||||
|
|
||||||
switch_core_session_get_partner(session, &nsession);
|
switch_core_session_get_partner(session, &nsession);
|
||||||
@ -717,11 +713,10 @@ SWITCH_STANDARD_APP(transfer_vars_function)
|
|||||||
SWITCH_STANDARD_APP(soft_hold_function)
|
SWITCH_STANDARD_APP(soft_hold_function)
|
||||||
{
|
{
|
||||||
char *argv[3] = { 0 };
|
char *argv[3] = { 0 };
|
||||||
int argc;
|
|
||||||
char *lbuf = NULL;
|
char *lbuf = NULL;
|
||||||
|
|
||||||
if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
|
if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
|
||||||
&& (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) {
|
&& switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))) >= 1) {
|
||||||
switch_ivr_soft_hold(session, argv[0], argv[1], argv[2]);
|
switch_ivr_soft_hold(session, argv[0], argv[1], argv[2]);
|
||||||
} else {
|
} else {
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: %s\n", SOFT_HOLD_SYNTAX);
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: %s\n", SOFT_HOLD_SYNTAX);
|
||||||
@ -774,11 +769,10 @@ SWITCH_STANDARD_APP(dtmf_unbind_function)
|
|||||||
SWITCH_STANDARD_APP(dtmf_bind_function)
|
SWITCH_STANDARD_APP(dtmf_bind_function)
|
||||||
{
|
{
|
||||||
char *argv[4] = { 0 };
|
char *argv[4] = { 0 };
|
||||||
int argc;
|
|
||||||
char *lbuf = NULL;
|
char *lbuf = NULL;
|
||||||
|
|
||||||
if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
|
if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
|
||||||
&& (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) == 4) {
|
&& switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))) == 4) {
|
||||||
int kval = switch_dtmftoi(argv[0]);
|
int kval = switch_dtmftoi(argv[0]);
|
||||||
switch_bind_flag_t bind_flags = 0;
|
switch_bind_flag_t bind_flags = 0;
|
||||||
|
|
||||||
@ -849,14 +843,13 @@ SWITCH_STANDARD_APP(dtmf_bind_function)
|
|||||||
#define INTERCEPT_SYNTAX "[-bleg] <uuid>"
|
#define INTERCEPT_SYNTAX "[-bleg] <uuid>"
|
||||||
SWITCH_STANDARD_APP(intercept_function)
|
SWITCH_STANDARD_APP(intercept_function)
|
||||||
{
|
{
|
||||||
int argc;
|
|
||||||
char *argv[4] = { 0 };
|
char *argv[4] = { 0 };
|
||||||
char *mydata;
|
char *mydata;
|
||||||
char *uuid;
|
char *uuid;
|
||||||
switch_bool_t bleg = SWITCH_FALSE;
|
switch_bool_t bleg = SWITCH_FALSE;
|
||||||
|
|
||||||
if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
|
if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
|
||||||
if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) {
|
if (switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))) >= 1) {
|
||||||
if (!strcasecmp(argv[0], "-bleg")) {
|
if (!strcasecmp(argv[0], "-bleg")) {
|
||||||
if (argv[1]) {
|
if (argv[1]) {
|
||||||
uuid = argv[1];
|
uuid = argv[1];
|
||||||
@ -1196,14 +1189,13 @@ SWITCH_STANDARD_APP(flush_dtmf_function)
|
|||||||
|
|
||||||
SWITCH_STANDARD_APP(transfer_function)
|
SWITCH_STANDARD_APP(transfer_function)
|
||||||
{
|
{
|
||||||
int argc;
|
|
||||||
char *argv[4] = { 0 };
|
char *argv[4] = { 0 };
|
||||||
char *mydata;
|
char *mydata;
|
||||||
int bleg = 0, both = 0;
|
int bleg = 0, both = 0;
|
||||||
|
|
||||||
|
|
||||||
if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
|
if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
|
||||||
if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) {
|
if (switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))) >= 1) {
|
||||||
bleg = !strcasecmp(argv[0], "-bleg");
|
bleg = !strcasecmp(argv[0], "-bleg");
|
||||||
both = !strcasecmp(argv[0], "-both");
|
both = !strcasecmp(argv[0], "-both");
|
||||||
|
|
||||||
@ -1233,12 +1225,11 @@ SWITCH_STANDARD_APP(transfer_function)
|
|||||||
|
|
||||||
SWITCH_STANDARD_APP(sched_transfer_function)
|
SWITCH_STANDARD_APP(sched_transfer_function)
|
||||||
{
|
{
|
||||||
int argc;
|
|
||||||
char *argv[4] = { 0 };
|
char *argv[4] = { 0 };
|
||||||
char *mydata;
|
char *mydata;
|
||||||
|
|
||||||
if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
|
if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
|
||||||
if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 2) {
|
if (switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))) >= 2) {
|
||||||
time_t when;
|
time_t when;
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
char ids[80] = "";
|
char ids[80] = "";
|
||||||
@ -1260,12 +1251,11 @@ SWITCH_STANDARD_APP(sched_transfer_function)
|
|||||||
|
|
||||||
SWITCH_STANDARD_APP(sched_hangup_function)
|
SWITCH_STANDARD_APP(sched_hangup_function)
|
||||||
{
|
{
|
||||||
int argc;
|
|
||||||
char *argv[5] = { 0 };
|
char *argv[5] = { 0 };
|
||||||
char *mydata;
|
char *mydata;
|
||||||
|
|
||||||
if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
|
if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
|
||||||
if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) {
|
if (switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))) >= 1) {
|
||||||
time_t when;
|
time_t when;
|
||||||
switch_call_cause_t cause = SWITCH_CAUSE_ALLOTTED_TIMEOUT;
|
switch_call_cause_t cause = SWITCH_CAUSE_ALLOTTED_TIMEOUT;
|
||||||
switch_bool_t bleg = SWITCH_FALSE;
|
switch_bool_t bleg = SWITCH_FALSE;
|
||||||
@ -1298,12 +1288,11 @@ SWITCH_STANDARD_APP(sched_hangup_function)
|
|||||||
|
|
||||||
SWITCH_STANDARD_APP(sched_broadcast_function)
|
SWITCH_STANDARD_APP(sched_broadcast_function)
|
||||||
{
|
{
|
||||||
int argc;
|
|
||||||
char *argv[6] = { 0 };
|
char *argv[6] = { 0 };
|
||||||
char *mydata;
|
char *mydata;
|
||||||
|
|
||||||
if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
|
if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
|
||||||
if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 2) {
|
if (switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))) >= 2) {
|
||||||
time_t when;
|
time_t when;
|
||||||
switch_media_flag_t flags = SMF_NONE;
|
switch_media_flag_t flags = SMF_NONE;
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
@ -1992,11 +1981,10 @@ SWITCH_STANDARD_APP(privacy_function)
|
|||||||
SWITCH_STANDARD_APP(strftime_function)
|
SWITCH_STANDARD_APP(strftime_function)
|
||||||
{
|
{
|
||||||
char *argv[2] = { 0 };
|
char *argv[2] = { 0 };
|
||||||
int argc;
|
|
||||||
char *lbuf;
|
char *lbuf;
|
||||||
|
|
||||||
if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
|
if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
|
||||||
&& (argc = switch_separate_string(lbuf, '=', argv, (sizeof(argv) / sizeof(argv[0])))) > 1) {
|
&& switch_separate_string(lbuf, '=', argv, (sizeof(argv) / sizeof(argv[0]))) > 1) {
|
||||||
switch_size_t retsize;
|
switch_size_t retsize;
|
||||||
switch_time_exp_t tm;
|
switch_time_exp_t tm;
|
||||||
char date[80] = "";
|
char date[80] = "";
|
||||||
@ -2135,10 +2123,9 @@ SWITCH_STANDARD_API(presence_api_function)
|
|||||||
SWITCH_STANDARD_API(chat_api_function)
|
SWITCH_STANDARD_API(chat_api_function)
|
||||||
{
|
{
|
||||||
char *lbuf = NULL, *argv[5];
|
char *lbuf = NULL, *argv[5];
|
||||||
int argc = 0;
|
|
||||||
|
|
||||||
if (!zstr(cmd) && (lbuf = strdup(cmd))
|
if (!zstr(cmd) && (lbuf = strdup(cmd))
|
||||||
&& (argc = switch_separate_string(lbuf, '|', argv, (sizeof(argv) / sizeof(argv[0])))) >= 4) {
|
&& switch_separate_string(lbuf, '|', argv, (sizeof(argv) / sizeof(argv[0]))) >= 4) {
|
||||||
|
|
||||||
if (switch_core_chat_send_args(argv[0], "global", argv[1], argv[2], "", argv[3], !zstr(argv[4]) ? argv[4] : NULL, "", SWITCH_TRUE) == SWITCH_STATUS_SUCCESS) {
|
if (switch_core_chat_send_args(argv[0], "global", argv[1], argv[2], "", argv[3], !zstr(argv[4]) ? argv[4] : NULL, "", SWITCH_TRUE) == SWITCH_STATUS_SUCCESS) {
|
||||||
stream->write_function(stream, "Sent");
|
stream->write_function(stream, "Sent");
|
||||||
@ -2270,7 +2257,6 @@ SWITCH_STANDARD_APP(bgsystem_session_function)
|
|||||||
SWITCH_STANDARD_APP(tone_detect_session_function)
|
SWITCH_STANDARD_APP(tone_detect_session_function)
|
||||||
{
|
{
|
||||||
char *argv[7] = { 0 };
|
char *argv[7] = { 0 };
|
||||||
int argc;
|
|
||||||
char *mydata = NULL;
|
char *mydata = NULL;
|
||||||
time_t to = 0;
|
time_t to = 0;
|
||||||
int hits = 0;
|
int hits = 0;
|
||||||
@ -2281,7 +2267,7 @@ SWITCH_STANDARD_APP(tone_detect_session_function)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((argc = switch_separate_string(mydata, ' ', argv, sizeof(argv) / sizeof(argv[0]))) < 2) {
|
if (switch_separate_string(mydata, ' ', argv, sizeof(argv) / sizeof(argv[0])) < 2) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "INVALID ARGS!\n");
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "INVALID ARGS!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -3226,14 +3212,13 @@ SWITCH_STANDARD_APP(stop_displace_session_function)
|
|||||||
SWITCH_STANDARD_APP(capture_function)
|
SWITCH_STANDARD_APP(capture_function)
|
||||||
{
|
{
|
||||||
char *argv[3] = { 0 };
|
char *argv[3] = { 0 };
|
||||||
int argc;
|
|
||||||
switch_regex_t *re = NULL;
|
switch_regex_t *re = NULL;
|
||||||
int ovector[30] = {0};
|
int ovector[30] = {0};
|
||||||
char *lbuf;
|
char *lbuf;
|
||||||
int proceed;
|
int proceed;
|
||||||
|
|
||||||
if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
|
if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
|
||||||
&& (argc = switch_separate_string(lbuf, '|', argv, (sizeof(argv) / sizeof(argv[0])))) == 3) {
|
&& switch_separate_string(lbuf, '|', argv, (sizeof(argv) / sizeof(argv[0]))) == 3) {
|
||||||
if ((proceed = switch_regex_perform(argv[1], argv[2], &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {
|
if ((proceed = switch_regex_perform(argv[1], argv[2], &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {
|
||||||
switch_capture_regex(re, proceed, argv[1], ovector, argv[0], switch_regex_set_var_callback, session);
|
switch_capture_regex(re, proceed, argv[1], ovector, argv[0], switch_regex_set_var_callback, session);
|
||||||
}
|
}
|
||||||
@ -4587,11 +4572,10 @@ SWITCH_STANDARD_APP(wait_for_silence_function)
|
|||||||
{
|
{
|
||||||
char *argv[5] = { 0 };
|
char *argv[5] = { 0 };
|
||||||
uint32_t thresh, silence_hits, listen_hits, timeout_ms = 0;
|
uint32_t thresh, silence_hits, listen_hits, timeout_ms = 0;
|
||||||
int argc;
|
|
||||||
char *lbuf = NULL;
|
char *lbuf = NULL;
|
||||||
|
|
||||||
if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
|
if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
|
||||||
&& (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 4) {
|
&& switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))) >= 4) {
|
||||||
thresh = atoi(argv[0]);
|
thresh = atoi(argv[0]);
|
||||||
silence_hits = atoi(argv[1]);
|
silence_hits = atoi(argv[1]);
|
||||||
listen_hits = atoi(argv[2]);
|
listen_hits = atoi(argv[2]);
|
||||||
@ -4615,11 +4599,10 @@ SWITCH_STANDARD_APP(detect_audio_function)
|
|||||||
{
|
{
|
||||||
char *argv[4] = { 0 };
|
char *argv[4] = { 0 };
|
||||||
uint32_t thresh, audio_hits, timeout_ms = 0;
|
uint32_t thresh, audio_hits, timeout_ms = 0;
|
||||||
int argc;
|
|
||||||
char *lbuf = NULL;
|
char *lbuf = NULL;
|
||||||
|
|
||||||
if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
|
if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
|
||||||
&& (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 3) {
|
&& switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))) >= 3) {
|
||||||
thresh = atoi(argv[0]);
|
thresh = atoi(argv[0]);
|
||||||
audio_hits = atoi(argv[1]);
|
audio_hits = atoi(argv[1]);
|
||||||
timeout_ms = atoi(argv[2]);
|
timeout_ms = atoi(argv[2]);
|
||||||
@ -4639,11 +4622,10 @@ SWITCH_STANDARD_APP(detect_silence_function)
|
|||||||
{
|
{
|
||||||
char *argv[4] = { 0 };
|
char *argv[4] = { 0 };
|
||||||
uint32_t thresh, silence_hits, timeout_ms = 0;
|
uint32_t thresh, silence_hits, timeout_ms = 0;
|
||||||
int argc;
|
|
||||||
char *lbuf = NULL;
|
char *lbuf = NULL;
|
||||||
|
|
||||||
if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
|
if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
|
||||||
&& (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 3) {
|
&& switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))) >= 3) {
|
||||||
thresh = atoi(argv[0]);
|
thresh = atoi(argv[0]);
|
||||||
silence_hits = atoi(argv[1]);
|
silence_hits = atoi(argv[1]);
|
||||||
timeout_ms = atoi(argv[2]);
|
timeout_ms = atoi(argv[2]);
|
||||||
@ -5070,11 +5052,12 @@ static switch_status_t next_file(switch_file_handle_t *handle)
|
|||||||
if (context->file && switch_test_flag(handle, SWITCH_FILE_DATA_SHORT)) { /* TODO handle other data type flags */
|
if (context->file && switch_test_flag(handle, SWITCH_FILE_DATA_SHORT)) { /* TODO handle other data type flags */
|
||||||
switch_size_t len;
|
switch_size_t len;
|
||||||
uint16_t buf[SWITCH_RECOMMENDED_BUFFER_SIZE] = { 0 };
|
uint16_t buf[SWITCH_RECOMMENDED_BUFFER_SIZE] = { 0 };
|
||||||
switch_status_t stat;
|
|
||||||
switch_file_handle_t fh = { 0 };
|
switch_file_handle_t fh = { 0 };
|
||||||
|
|
||||||
if ((stat = switch_core_file_open(&fh, context->file, handle->channels, handle->samplerate,
|
if (switch_core_file_open(&fh, context->file, handle->channels, handle->samplerate,
|
||||||
SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL)) == SWITCH_STATUS_SUCCESS) {
|
SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL) == SWITCH_STATUS_SUCCESS) {
|
||||||
|
switch_status_t stat;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
len = SWITCH_RECOMMENDED_BUFFER_SIZE / handle->channels;
|
len = SWITCH_RECOMMENDED_BUFFER_SIZE / handle->channels;
|
||||||
if ((stat = switch_core_file_read(&fh, buf, &len)) == SWITCH_STATUS_SUCCESS) {
|
if ((stat = switch_core_file_read(&fh, buf, &len)) == SWITCH_STATUS_SUCCESS) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user