fixing cli profile lock issue

This commit is contained in:
Kapil Gupta 2012-08-23 10:10:28 -04:00
parent b0ecdfd1de
commit 15428bdf74
1 changed files with 7 additions and 2 deletions

View File

@ -198,14 +198,15 @@ switch_status_t mg_process_cli_cmd(const char *cmd, switch_stream_handle_t *stre
} }
if(profile){ if(profile){
megaco_profile_release(profile);
if(!strcasecmp(argv[3], "activecalls")){ if(!strcasecmp(argv[3], "activecalls")){
/* mg <mg-profile> show activecalls */ /* mg <mg-profile> show activecalls */
megaco_profile_release(profile);
handle_show_activecalls_cli_cmd(stream, profile); handle_show_activecalls_cli_cmd(stream, profile);
/*******************************************************************/ /*******************************************************************/
}else if(!strcasecmp(argv[3], "alltermstatus")){ }else if(!strcasecmp(argv[3], "alltermstatus")){
/*******************************************************************/ /*******************************************************************/
/* mg <mg-profile> show alltermstatus */ /* mg <mg-profile> show alltermstatus */
megaco_profile_release(profile);
handle_all_term_status_cli_cmd(stream, profile); handle_all_term_status_cli_cmd(stream, profile);
/*******************************************************************/ /*******************************************************************/
}else if(!strcasecmp(argv[3], "termstatus")){ }else if(!strcasecmp(argv[3], "termstatus")){
@ -214,21 +215,25 @@ switch_status_t mg_process_cli_cmd(const char *cmd, switch_stream_handle_t *stre
if (zstr(argv[4])) { if (zstr(argv[4])) {
goto usage; goto usage;
} }
megaco_profile_release(profile);
handle_term_status_cli_cmd(stream, profile, argv[4]); handle_term_status_cli_cmd(stream, profile, argv[4]);
/*******************************************************************/ /*******************************************************************/
}else if(!strcasecmp(argv[3], "stackmem")){ }else if(!strcasecmp(argv[3], "stackmem")){
/*******************************************************************/ /*******************************************************************/
megaco_profile_release(profile);
sng_mg_reg_info_show(); sng_mg_reg_info_show();
/*******************************************************************/ /*******************************************************************/
#ifdef LEAK_TEST #ifdef LEAK_TEST
}else if(!strcasecmp(argv[3], "leak-report")){ }else if(!strcasecmp(argv[3], "leak-report")){
/*******************************************************************/ /*******************************************************************/
megaco_profile_release(profile);
mgPrntLeakReport(); mgPrntLeakReport();
/*******************************************************************/ /*******************************************************************/
#endif #endif
} else { } else {
/*******************************************************************/ /*******************************************************************/
stream->write_function(stream, "-ERR No such profile\n"); stream->write_function(stream, "-ERR No such profile\n");
goto usage;
} }
} }
/**********************************************************************************/ /**********************************************************************************/