From 6798cd2b5f1a23308b8e480f21721244d134133c Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 2 Jun 2008 23:38:33 +0000 Subject: [PATCH] add mediaReady method git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8744 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/languages/mod_spidermonkey/mod_spidermonkey.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c index 23e7a9fb02..00f5dc1c80 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c @@ -2000,6 +2000,15 @@ static JSBool session_ready(JSContext * cx, JSObject * obj, uintN argc, jsval * 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 @@ static JSFunctionSpec session_methods[] = { {"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},