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
This commit is contained in:
Mathieu Rene 2009-04-14 20:30:54 +00:00
parent d406399afe
commit b814ad0de4
1 changed files with 3 additions and 0 deletions

View File

@ -2233,6 +2233,9 @@ static JSBool session_detach(JSContext * cx, JSObject * obj, uintN argc, jsval *
int32 i = 0; int32 i = 0;
JS_ValueToInt32(cx, argv[0], &i); JS_ValueToInt32(cx, argv[0], &i);
cause = i; cause = i;
} else {
const char *cause_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
cause = switch_channel_str2cause(cause_name);
} }
} }