From b814ad0de4b46e4d4dd4c9204771967dd79e349f Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Tue, 14 Apr 2009 20:30:54 +0000 Subject: [PATCH] Let session.destroy() take the cause as a string too git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13020 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/languages/mod_spidermonkey/mod_spidermonkey.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c index b5a19b8ff2..76c957778f 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c @@ -2233,6 +2233,9 @@ static JSBool session_detach(JSContext * cx, JSObject * obj, uintN argc, jsval * int32 i = 0; JS_ValueToInt32(cx, argv[0], &i); cause = i; + } else { + const char *cause_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0])); + cause = switch_channel_str2cause(cause_name); } }