]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
adding more stats counters
authorKapil Gupta <kgupta@sangoma.com>
Fri, 24 Aug 2012 21:21:44 +0000 (17:21 -0400)
committerKapil Gupta <kgupta@sangoma.com>
Fri, 24 Aug 2012 21:21:44 +0000 (17:21 -0400)
src/mod/endpoints/mod_media_gateway/media_gateway_cli.c
src/mod/endpoints/mod_media_gateway/mod_media_gateway.c
src/mod/endpoints/mod_media_gateway/mod_media_gateway.h

index 00670be0c4fc9a0c19f3534ed97b886590404c89..3a740a6f25d3a2920912c58d64afe349bf78d61a 100644 (file)
@@ -906,6 +906,10 @@ switch_status_t handle_show_stats(switch_stream_handle_t *stream, megaco_profile
                        mg_profile->mg_stats->total_num_of_term_activation_failed_error); 
        stream->write_function(stream, "Total Number of Term not found in context  error  = %d \n", 
                        mg_profile->mg_stats->total_num_of_no_term_ctxt_error); 
+       stream->write_function(stream, "Total Number of Term not in service error  = %d \n", 
+                       mg_profile->mg_stats->total_num_of_term_not_in_service_error); 
+       stream->write_function(stream, "Total Number of unknown context error  = %d \n", 
+                       mg_profile->mg_stats->total_num_of_unknown_ctxt_error); 
 
 
 
index 57d2fa62861a5a29e45527cba44797cbe19f273e..d6d600f456ec42a03eff21981919b4b954697d46 100644 (file)
@@ -559,6 +559,7 @@ void handle_mgco_cmd_ind(Pst *pst, SuId suId, MgMgcoCommand* cmd)
                if(SWITCH_STATUS_FALSE == mg_stack_termination_is_in_service(mg_profile, (char*)termId->name.lcl.val, termId->name.lcl.len)){
                        MG_MEM_COPY(&prnt_buf, termId->name.lcl.val, sizeof(U8) * termId->name.lcl.len);
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Termination[%s] not in service \n",(strlen(prnt_buf))?prnt_buf:"NULL");
+                       mg_profile->mg_stats->total_num_of_term_not_in_service_error++;
                        mg_util_set_term_string(&errTxt, termId);
                        err_code = MGT_MGCO_RSP_CODE_UNKNOWN_TERM_ID;
                        goto error;
@@ -789,7 +790,8 @@ void handle_mgco_cmd_ind(Pst *pst, SuId suId, MgMgcoCommand* cmd)
     goto done;
 
 ctxt_error:
-       err_code = MGT_MGCO_RSP_CODE_UNKNOWN_CTXT;
+    mg_profile->mg_stats->total_num_of_unknown_ctxt_error++;
+    err_code = MGT_MGCO_RSP_CODE_UNKNOWN_CTXT;
 
 error:
        if (SWITCH_STATUS_SUCCESS == 
index ab039108fc684157059578169cce0ba05ad30918..a8438cc10972bd66a3b536617812c2637f16760d 100644 (file)
@@ -76,6 +76,8 @@ typedef struct mg_stats_s{
        uint32_t  total_num_of_add_term_failed_error;
        uint32_t  total_num_of_term_activation_failed_error;
        uint32_t  total_num_of_no_term_ctxt_error;
+       uint32_t  total_num_of_term_not_in_service_error;
+       uint32_t  total_num_of_unknown_ctxt_error;
 }mg_stats_t;