[Freeswitch-svn] [commit] r8744 - freeswitch/trunk/src/mod/languages/mod_spidermonkey
Freeswitch SVN
anthm at freeswitch.org
Mon Jun 2 19:38:34 EDT 2008
Author: anthm
Date: Mon Jun 2 19:38:33 2008
New Revision: 8744
Modified:
freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
Log:
add mediaReady method
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 Mon Jun 2 19:38:33 2008
@@ -2000,6 +2000,15 @@
return JS_TRUE;
}
+static JSBool session_media_ready(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+ struct js_session *jss = JS_GetPrivate(cx, obj);
+
+ *rval = BOOLEAN_TO_JSVAL((jss && jss->session && switch_channel_media_ready(switch_core_session_get_channel(jss->session))) ? JS_TRUE : JS_FALSE);
+
+ return JS_TRUE;
+}
+
static JSBool session_answered(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
{
@@ -2472,6 +2481,7 @@
{"generateXmlCdr", session_cdr, 0},
{"ready", session_ready, 0},
{"answered", session_answered, 0},
+ {"mediaReady", session_media_ready, 0},
{"waitForAnswer", session_wait_for_answer, 0},
{"waitForMedia", session_wait_for_media, 0},
{"getEvent", session_get_event, 0},
More information about the Freeswitch-svn
mailing list