/**********************************************************************************/
goto usage;
}
+/**********************************************************************************/
+ }else if (!strcmp(argv[0], "logging")) {
+/**********************************************************************************/
+ if (zstr(argv[1])) {
+ goto usage;
+ }
+ /******************************************************************/
+ if(!strcasecmp(argv[1], "enable")){
+ mg_enable_logging();
+ /******************************************************************/
+ }else if(!strcasecmp(argv[1], "disable")){
+ /******************************************************************/
+ mg_disable_logging();
+ /******************************************************************/
+ } else {
+ /******************************************************************/
+ goto usage;
+ }
+/**********************************************************************************/
+ }else {
+/**********************************************************************************/
+ goto usage;
}
+/**********************************************************************************/
goto done;
usage:
- stream->write_function(stream, "-ERR Usage: "MEGACO_FUNCTION_SYNTAX"\n");
+ stream->write_function(stream, "-ERR Usage: \n""\t"MEGACO_CLI_SYNTAX" \n \t"MEGACO_FUNCTION_SYNTAX"\n \t" MEGACO_LOGGING_CLI_SYNTAX "\n");
done:
switch_safe_free(dup);
int mgco_tucl_gen_config(void);
int mgco_mu_ssap_config(int idx);
int mgco_mg_tsap_config(megaco_profile_t* profile);
-int mgco_mg_enble_debug(void);
int mgco_mg_ssap_config(megaco_profile_t* profile);
int mgco_mg_peer_config(megaco_profile_t* profile);
int mgco_mg_tpt_server_config(megaco_profile_t* profile);
}
/******************************************************************************/
-int mgco_mg_enble_debug()
+int mg_enable_logging()
{
MgMngmt mgMngmt;
Pst pst; /* Post for layer manager */
return(sng_cntrl_mg(&pst, &mgMngmt));
}
+/******************************************************************************/
+int mg_disable_logging()
+{
+ MgMngmt mgMngmt;
+ Pst pst; /* Post for layer manager */
+ MgCntrl* cntrl;
+
+ memset(&mgMngmt, 0, sizeof(mgMngmt));
+ cntrl = &mgMngmt.t.cntrl;
+
+ /* initalize the post structure */
+ smPstInit(&pst);
+
+ /* insert the destination Entity */
+ pst.dstEnt = ENTMG;
+ mgMngmt.hdr.msgType = TCFG;
+ mgMngmt.hdr.entId.ent = ENTHI;
+ mgMngmt.hdr.entId.inst = S_INST;
+ mgMngmt.hdr.elmId.elmnt = STGEN;
+
+ cntrl->action = ADISIMM;
+ cntrl->subAction = SADBG;
+ cntrl->s.dbg.genDbgMask = 0xfffffdff;
+
+ return(sng_cntrl_mg(&pst, &mgMngmt));
+}
+
/******************************************************************************/
int mgco_tucl_gen_config(void)
{
void handle_mgco_audit_cfm(Pst *pst, SuId suId, MgMgtAudit* audit, Reason reason);
void handle_mg_alarm(Pst *pst, MgMngmt *sta);
void handle_tucl_alarm(Pst *pst, HiMngmt *sta);
+int mg_enable_logging(void);
+int mg_disable_logging(void);
switch_status_t sng_mgco_cfg(megaco_profile_t* profile);
switch_console_set_complete("add megaco profile ::megaco::list_profiles status");
switch_console_set_complete("add megaco profile ::megaco::list_profiles xmlstatus");
switch_console_set_complete("add megaco profile ::megaco::list_profiles peerxmlstatus");
+ switch_console_set_complete("add megaco logging ::megaco::list_profiles enable");
+ switch_console_set_complete("add megaco logging ::megaco::list_profiles disable");
switch_console_add_complete_func("::megaco::list_profiles", list_profiles);
#define MG_MAX_PEERS 5
+#define MEGACO_CLI_SYNTAX "profile|logging"
+#define MEGACO_LOGGING_CLI_SYNTAX "logging [enable|disable]"
#define MEGACO_FUNCTION_SYNTAX "profile [name] [start | stop] [status] [xmlstatus] [peerxmlstatus]"
struct megaco_globals {