[commit] r7343 - freeswitch/trunk/src/mod/languages/mod_spidermonkey
Author: anthm Date: Thu Jan 24 09:05:52 2008 New Revision: 7343 Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c Log: disable garbage collector on originate and waitfor_* funcs in js Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c (original) +++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c Thu Jan 24 09:05:52 2008 @@ -2070,6 +2070,7 @@ switch_time_t started; unsigned int elapsed; int32 timeout = 60; + jsrefcount saveDepth; METHOD_SANITY_CHECK(); @@ -2082,6 +2083,7 @@ JS_ValueToInt32(cx, argv[0], &timeout); } + saveDepth = JS_SuspendRequest(cx); for (;;) { if (((elapsed = (unsigned int) ((switch_timestamp_now() - started) / 1000)) > (switch_time_t) timeout) || switch_channel_get_state(channel) >= CS_HANGUP) { @@ -2097,6 +2099,7 @@ switch_yield(1000); } + JS_ResumeRequest(cx, saveDepth); return JS_TRUE; } @@ -2109,6 +2112,7 @@ switch_time_t started; unsigned int elapsed; int32 timeout = 60; + jsrefcount saveDepth; METHOD_SANITY_CHECK(); @@ -2121,6 +2125,7 @@ JS_ValueToInt32(cx, argv[0], &timeout); } + saveDepth = JS_SuspendRequest(cx); for (;;) { if (((elapsed = (unsigned int) ((switch_timestamp_now() - started) / 1000)) > (switch_time_t) timeout) || switch_channel_get_state(channel) >= CS_HANGUP) { @@ -2135,6 +2140,7 @@ switch_yield(1000); } + JS_ResumeRequest(cx, saveDepth); return JS_TRUE; } @@ -2797,7 +2803,9 @@ const char *username = NULL; char *to = NULL; char *tmp; - + jsrefcount saveDepth; + switch_status_t status; + *rval = BOOLEAN_TO_JSVAL(JS_FALSE); if (JS_ValueToObject(cx, argv[0], &session_obj)) { @@ -2847,8 +2855,11 @@ caller_profile = switch_caller_profile_new(pool,username, dialplan, cid_name, cid_num, network_addr, ani, aniii, rdnis, modname, context, dest); - if (switch_ivr_originate(session, &peer_session, &jss->cause, dest, to ? atoi(to) : 60, NULL, NULL, NULL, caller_profile, SOF_NONE) - != SWITCH_STATUS_SUCCESS) { + saveDepth = JS_SuspendRequest(cx); + status = switch_ivr_originate(session, &peer_session, &jss->cause, dest, to ? atoi(to) : 60, NULL, NULL, NULL, caller_profile, SOF_NONE); + JS_ResumeRequest(cx, saveDepth); + + if (status != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot Create Outgoing Channel! [%s]\n", dest); goto done; }
participants (1)
-
Freeswitch SVN