]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
wait for state change
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 28 Jun 2010 13:49:24 +0000 (08:49 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 28 Jun 2010 13:49:24 +0000 (08:49 -0500)
src/mod/languages/mod_spidermonkey/mod_spidermonkey.c

index 09af60f9cb746809cd71be690d78d563152b57d2..4f6c7aadc450fc6267dda3968e498533a93226cb 100644 (file)
@@ -2864,6 +2864,7 @@ static JSBool session_construct(JSContext * cx, JSObject * obj, uintN argc, jsva
                                                                         &jss->session, &jss->cause, uuid, 60, NULL, NULL, NULL, NULL, NULL, SOF_NONE, NULL) == SWITCH_STATUS_SUCCESS) {
                                switch_set_flag(jss, S_HUP);
                                switch_channel_set_state(switch_core_session_get_channel(jss->session), CS_SOFT_EXECUTE);
+                               switch_channel_wait_for_state_timeout(switch_core_session_get_channel(jss->session), CS_SOFT_EXECUTE, 5000);
                                *rval = BOOLEAN_TO_JSVAL(JS_TRUE);
                        } else {
                                *rval = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, switch_channel_cause2str(jss->cause)));