]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix timeout defaults
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 26 Nov 2008 18:19:59 +0000 (18:19 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 26 Nov 2008 18:19:59 +0000 (18:19 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10542 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/languages/mod_spidermonkey/mod_spidermonkey.c

index dcd27e94c834e2751d9ab5b8709bd7695d599dd2..b56b7ceffc8b633e6be72f9188606fd58c7af724 100644 (file)
@@ -2101,7 +2101,7 @@ static JSBool session_wait_for_media(JSContext * cx, JSObject * obj, uintN argc,
        switch_channel_t *channel;
        switch_time_t started;
        unsigned int elapsed;
-       int32 timeout = 60;
+       int32 timeout = 60000;
        jsrefcount saveDepth;
        jsval ret = JS_TRUE;
 
@@ -2114,7 +2114,11 @@ static JSBool session_wait_for_media(JSContext * cx, JSObject * obj, uintN argc,
 
        if (argc > 0) {
                JS_ValueToInt32(cx, argv[0], &timeout);
+               if (timeout < 1000) {
+                       timeout = 1000;
+               }
        }
+
        if (check_hangup_hook(jss, NULL) != JS_TRUE) {
                return JS_FALSE;
        }
@@ -2146,7 +2150,7 @@ static JSBool session_wait_for_answer(JSContext * cx, JSObject * obj, uintN argc
        switch_channel_t *channel;
        switch_time_t started;
        unsigned int elapsed;
-       int32 timeout = 60;
+       int32 timeout = 60000;
        jsrefcount saveDepth;
        jsval ret = JS_TRUE;
        
@@ -2157,6 +2161,9 @@ static JSBool session_wait_for_answer(JSContext * cx, JSObject * obj, uintN argc
 
        if (argc > 0) {
                JS_ValueToInt32(cx, argv[0], &timeout);
+               if (timeout < 1000) {
+                       timeout = 1000;
+               }
        }
 
        if (check_hangup_hook(jss, NULL) != JS_TRUE) {