mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-29 14:44:17 +00:00
add syntax to api structures, use them for usage returns, do more checking on valid usage and cleanup some output of api commands.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3001 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
2b53e80e34
commit
c822f94125
6 files changed
+83
-82
No files matched your search
@@ -69,6 +69,7 @@ static const char modname[] = "mod_spidermonkey";
|
||||
static int eval_some_js(char *code, JSContext *cx, JSObject *obj, jsval *rval);
|
||||
static void session_destroy(JSContext *cx, JSObject *obj);
|
||||
static JSBool session_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
|
||||
static switch_api_interface_t js_run_interface;
|
||||
|
||||
static struct {
|
||||
size_t gStackChunkSize;
|
||||
@@ -2675,12 +2676,12 @@ static switch_status_t launch_async(char *text, switch_core_session_t *session,
|
||||
{
|
||||
|
||||
if (switch_strlen_zero(text)) {
|
||||
stream->write_function(stream, "INVALID");
|
||||
stream->write_function(stream, "USAGE: %s\n", js_run_interface.syntax);
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
js_thread_launch(text);
|
||||
stream->write_function(stream, "OK");
|
||||
stream->write_function(stream, "OK\n");
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -2696,7 +2697,7 @@ static switch_api_interface_t js_run_interface = {
|
||||
/*.interface_name */ "jsrun",
|
||||
/*.desc */ "run a script",
|
||||
/*.function */ launch_async,
|
||||
/*.syntax */ NULL,
|
||||
/*.syntax */ "jsrun <script>",
|
||||
/*.next */ NULL
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user