mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 12:42:02 +00:00
fix dtmf code
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7125 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -4125,7 +4125,7 @@ SWITCH_STANDARD_APP(conference_function)
|
||||
status = switch_ivr_collect_digits_count(session,
|
||||
buf,
|
||||
sizeof(pin_buf) - strlen(pin_buf),
|
||||
strlen(conference->pin) - strlen(pin_buf), "#", &term, 10000);
|
||||
strlen(conference->pin) - strlen(pin_buf), "#", &term, 10000, 0, 0);
|
||||
}
|
||||
|
||||
pin_valid = (status == SWITCH_STATUS_SUCCESS && strcmp(pin_buf, conference->pin) == 0);
|
||||
|
||||
@@ -367,7 +367,7 @@ SWITCH_STANDARD_APP(rss_function)
|
||||
switch_size_t blen = sizeof(cmd) - strlen(cmd);
|
||||
|
||||
cp = cmd + blen;
|
||||
switch_ivr_collect_digits_count(session, cp, blen, blen, "#", &term, 5000);
|
||||
switch_ivr_collect_digits_count(session, cp, blen, blen, "#", &term, 5000, 0, 0);
|
||||
}
|
||||
|
||||
x = atoi(cmd) - 1;
|
||||
|
||||
@@ -826,7 +826,7 @@ static switch_status_t vm_macro_get(switch_core_session_t *session,
|
||||
maxlen = buflen -1;
|
||||
}
|
||||
if (bslen < maxlen) {
|
||||
status = switch_ivr_collect_digits_count(session, buf + bslen, buflen, maxlen - bslen, term_chars, terminator_key, timeout);
|
||||
status = switch_ivr_collect_digits_count(session, buf + bslen, buflen, maxlen - bslen, term_chars, terminator_key, timeout, 0, 0);
|
||||
}
|
||||
|
||||
return status;
|
||||
|
||||
@@ -1928,7 +1928,7 @@ static JSBool session_get_digits(JSContext * cx, JSObject * obj, uintN argc, jsv
|
||||
struct js_session *jss = JS_GetPrivate(cx, obj);
|
||||
char *terminators = NULL;
|
||||
char buf[513] = { 0 };
|
||||
int32 digits = 0, timeout = 5000;
|
||||
int32 digits = 0, timeout = 5000, digit_timeout = 0, abs_timeout = 0;
|
||||
switch_channel_t *channel;
|
||||
|
||||
METHOD_SANITY_CHECK();
|
||||
@@ -1950,12 +1950,21 @@ static JSBool session_get_digits(JSContext * cx, JSObject * obj, uintN argc, jsv
|
||||
if (argc > 1) {
|
||||
terminators = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
|
||||
}
|
||||
|
||||
if (argc > 2) {
|
||||
JS_ValueToInt32(cx, argv[2], &timeout);
|
||||
}
|
||||
|
||||
if (argc > 3) {
|
||||
JS_ValueToInt32(cx, argv[3], &digit_timeout);
|
||||
}
|
||||
|
||||
switch_ivr_collect_digits_count(jss->session, buf, sizeof(buf), digits, terminators, &term, timeout);
|
||||
if (argc > 4) {
|
||||
JS_ValueToInt32(cx, argv[4], &abs_timeout);
|
||||
}
|
||||
|
||||
|
||||
switch_ivr_collect_digits_count(jss->session, buf, sizeof(buf), digits, terminators, &term, timeout, digit_timeout, abs_timeout);
|
||||
*rval = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, buf));
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user