提交 668cb17e authored 作者: João Mesquita's avatar João Mesquita

Make API more sane, since we are going to display lots of other things.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk/scripts/contrib@13758 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 ce1dffed
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
* *
*/ */
#define KHOMP_SYNTAX "khomp [status]" #define KHOMP_SYNTAX "khomp [show]"
/* Our includes */ /* Our includes */
#include "k3lapi.hpp" #include "k3lapi.hpp"
...@@ -123,6 +123,9 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch ...@@ -123,6 +123,9 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id); static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id);
static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig); static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig);
/* My function prototypes */
static void printBoardsInfo(switch_stream_handle_t*);
static void tech_init(private_t *tech_pvt, switch_core_session_t *session) static void tech_init(private_t *tech_pvt, switch_core_session_t *session)
...@@ -642,7 +645,21 @@ SWITCH_STANDARD_API(khomp) ...@@ -642,7 +645,21 @@ SWITCH_STANDARD_API(khomp)
goto done; goto done;
} }
if (argv[0] && !strncasecmp(argv[0], "status", 6)) { if (argv[0] && !strncasecmp(argv[0], "show", 6)) {
printBoardsInfo(stream);
} else {
stream->write_function(stream, "USAGE: %s\n", KHOMP_SYNTAX);
}
done:
switch_safe_free(myarg);
return status;
}
static void printBoardsInfo(switch_stream_handle_t* stream) {
K3L_API_CONFIG apiCfg; K3L_API_CONFIG apiCfg;
stream->write_function(stream," ------------------------------------------------------------------\n"); stream->write_function(stream," ------------------------------------------------------------------\n");
...@@ -741,17 +758,9 @@ SWITCH_STANDARD_API(khomp) ...@@ -741,17 +758,9 @@ SWITCH_STANDARD_API(khomp)
} }
stream->write_function(stream, " ------------------------------------------------------------------\n"); stream->write_function(stream, " ------------------------------------------------------------------\n");
} else {
stream->write_function(stream, "USAGE: %s\n", KHOMP_SYNTAX);
}
done:
switch_safe_free(myarg);
return status;
} }
/* For Emacs: /* For Emacs:
* Local Variables: * Local Variables:
* mode:c * mode:c
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论