summaryrefslogtreecommitdiff
path: root/channels/chan_pjsip.c
diff options
context:
space:
mode:
authorGeorge Joseph <george.joseph@fairview5.com>2016-03-26 21:33:14 -0600
committerJoshua Colp <jcolp@digium.com>2016-03-29 14:35:17 -0500
commitc7eb18d8655272c7e1bdecce176891e99c140795 (patch)
tree2f3994c9f87ddc428ab3f5129530f94d7dc3a187 /channels/chan_pjsip.c
parente595f02f83137cf92dd2a7f2567a73d6a88a2ff2 (diff)
chan_pjsip: Add 'pjsip show channelstats'
Added the ability to show channel statistics to chan_pjsip (cli_functions.c) Moved the existing 'pjsip show channel(s)' functionality from pjsip_configuration to cli_functions.c. The stats needed chan_pjsip's private header so it made sense to move the existing channel commands as well. Now using stasis_cache_dump to get the channel snapshots rather than retrieving all endpoints, then getting each one's channel snapshots. Much more efficient. Change-Id: I03b114522126d27434030b285bf6d531ddd79869
Diffstat (limited to 'channels/chan_pjsip.c')
-rw-r--r--channels/chan_pjsip.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c
index 07887afd8..f081bd899 100644
--- a/channels/chan_pjsip.c
+++ b/channels/chan_pjsip.c
@@ -69,6 +69,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "pjsip/include/chan_pjsip.h"
#include "pjsip/include/dialplan_functions.h"
+#include "pjsip/include/cli_functions.h"
AST_THREADSTORAGE(uniqueid_threadbuf);
#define UNIQUEID_BUFSIZE 256
@@ -2419,6 +2420,15 @@ static int load_module(void)
goto end;
}
+ if (pjsip_channel_cli_register()) {
+ ast_log(LOG_ERROR, "Unable to register PJSIP Channel CLI\n");
+ ast_sip_session_unregister_supplement(&chan_pjsip_ack_supplement);
+ ast_sip_session_unregister_supplement(&pbx_start_supplement);
+ ast_sip_session_unregister_supplement(&chan_pjsip_supplement);
+ ast_sip_session_unregister_supplement(&call_pickup_supplement);
+ goto end;
+ }
+
/* since endpoints are loaded before the channel driver their device
states get set to 'invalid', so they need to be updated */
if ((endpoints = ast_sip_get_endpoints())) {
@@ -2445,6 +2455,8 @@ static int unload_module(void)
ao2_cleanup(pjsip_uids_onhold);
pjsip_uids_onhold = NULL;
+ pjsip_channel_cli_unregister();
+
ast_sip_session_unregister_supplement(&chan_pjsip_supplement);
ast_sip_session_unregister_supplement(&pbx_start_supplement);
ast_sip_session_unregister_supplement(&chan_pjsip_ack_supplement);