]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Let session.destroy() take the cause as a string too
authorMathieu Rene <mrene@avgs.ca>
Tue, 14 Apr 2009 20:30:54 +0000 (20:30 +0000)
committerMathieu Rene <mrene@avgs.ca>
Tue, 14 Apr 2009 20:30:54 +0000 (20:30 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13020 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/languages/mod_spidermonkey/mod_spidermonkey.c

index b5a19b8ff219d0b9d2b49300b832d379d438dc25..76c957778f1468e6b8e954ed863449f615289986 100644 (file)
@@ -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);
                        }
                }