mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 01:49:05 +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:
@@ -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