mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-17 17:22:21 +00:00
MODLANG-159 and MODLANG-162
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16909 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
e0287faa91
commit
f50067022b
@ -169,11 +169,16 @@ static JSBool teletone_add_tone(JSContext * cx, JSObject * obj, uintN argc, jsva
|
|||||||
struct teletone_obj *tto = JS_GetPrivate(cx, obj);
|
struct teletone_obj *tto = JS_GetPrivate(cx, obj);
|
||||||
if (argc > 2) {
|
if (argc > 2) {
|
||||||
int x;
|
int x;
|
||||||
|
int nMax = argc;
|
||||||
char *fval;
|
char *fval;
|
||||||
char *map_str;
|
char *map_str;
|
||||||
map_str = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
|
map_str = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
|
||||||
|
|
||||||
for (x = 1; x < TELETONE_MAX_TONES; x++) {
|
if ( TELETONE_MAX_TONES < nMax ) {
|
||||||
|
nMax = TELETONE_MAX_TONES;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (x = 1; x < nMax; x++) {
|
||||||
fval = JS_GetStringBytes(JS_ValueToString(cx, argv[x]));
|
fval = JS_GetStringBytes(JS_ValueToString(cx, argv[x]));
|
||||||
tto->ts.TONES[(int) *map_str].freqs[x - 1] = strtod(fval, NULL);
|
tto->ts.TONES[(int) *map_str].freqs[x - 1] = strtod(fval, NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user