diff options
author | George Joseph <george.joseph@fairview5.com> | 2016-03-26 21:33:14 -0600 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2016-03-29 14:35:31 -0500 |
commit | c4064727d208d61dc29721c52f450f67eb22a445 (patch) | |
tree | c026dac0ae8e7b8889c12080672fa5c84b7e13e2 /channels/chan_pjsip.c | |
parent | 03845666da59d3eadf2449b88cf4ed3444db688b (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.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c index cd55400c3..370075d2b 100644 --- a/channels/chan_pjsip.c +++ b/channels/chan_pjsip.c @@ -69,6 +69,7 @@ ASTERISK_REGISTER_FILE() #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 @@ -2468,6 +2469,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())) { @@ -2494,6 +2504,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); |