提交 cc37e56c authored 作者: Anthony Minessale's avatar Anthony Minessale

fix timeout defaults

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10542 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 ffacfddf
...@@ -2101,7 +2101,7 @@ static JSBool session_wait_for_media(JSContext * cx, JSObject * obj, uintN argc, ...@@ -2101,7 +2101,7 @@ static JSBool session_wait_for_media(JSContext * cx, JSObject * obj, uintN argc,
switch_channel_t *channel; switch_channel_t *channel;
switch_time_t started; switch_time_t started;
unsigned int elapsed; unsigned int elapsed;
int32 timeout = 60; int32 timeout = 60000;
jsrefcount saveDepth; jsrefcount saveDepth;
jsval ret = JS_TRUE; jsval ret = JS_TRUE;
...@@ -2114,7 +2114,11 @@ static JSBool session_wait_for_media(JSContext * cx, JSObject * obj, uintN argc, ...@@ -2114,7 +2114,11 @@ static JSBool session_wait_for_media(JSContext * cx, JSObject * obj, uintN argc,
if (argc > 0) { if (argc > 0) {
JS_ValueToInt32(cx, argv[0], &timeout); JS_ValueToInt32(cx, argv[0], &timeout);
if (timeout < 1000) {
timeout = 1000;
}
} }
if (check_hangup_hook(jss, NULL) != JS_TRUE) { if (check_hangup_hook(jss, NULL) != JS_TRUE) {
return JS_FALSE; return JS_FALSE;
} }
...@@ -2146,7 +2150,7 @@ static JSBool session_wait_for_answer(JSContext * cx, JSObject * obj, uintN argc ...@@ -2146,7 +2150,7 @@ static JSBool session_wait_for_answer(JSContext * cx, JSObject * obj, uintN argc
switch_channel_t *channel; switch_channel_t *channel;
switch_time_t started; switch_time_t started;
unsigned int elapsed; unsigned int elapsed;
int32 timeout = 60; int32 timeout = 60000;
jsrefcount saveDepth; jsrefcount saveDepth;
jsval ret = JS_TRUE; jsval ret = JS_TRUE;
...@@ -2157,6 +2161,9 @@ static JSBool session_wait_for_answer(JSContext * cx, JSObject * obj, uintN argc ...@@ -2157,6 +2161,9 @@ static JSBool session_wait_for_answer(JSContext * cx, JSObject * obj, uintN argc
if (argc > 0) { if (argc > 0) {
JS_ValueToInt32(cx, argv[0], &timeout); JS_ValueToInt32(cx, argv[0], &timeout);
if (timeout < 1000) {
timeout = 1000;
}
} }
if (check_hangup_hook(jss, NULL) != JS_TRUE) { if (check_hangup_hook(jss, NULL) != JS_TRUE) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论