提交 cffe95a9 authored 作者: kapil's avatar kapil

adding "xmlstatus" CLI command to dump MEGACO Stack data

上级 bac3b3bd
......@@ -114,6 +114,7 @@ switch_status_t sng_mgco_stop(const char* profilename);
switch_status_t sng_mgco_stack_shutdown(void);
int sng_mgco_mg_get_status(int elemId, MgMngmt* cfm, int mg_cfg_idx);
switch_status_t megaco_profile_status(switch_stream_handle_t *stream, const char* profilename);
switch_status_t megaco_profile_xmlstatus(switch_stream_handle_t *stream, const char* profilename);
/*****************************************************************************************************/
......
......@@ -225,6 +225,8 @@ switch_status_t sng_parse_mg_peer_profile(switch_xml_t mg_peer_profile)
}
}
strcpy((char*)&megaco_globals.g_mg_cfg.mgPeer.peers[i].name[0], prof_name);
megaco_globals.g_mg_cfg.mgPeer.total_peer++;
return SWITCH_STATUS_SUCCESS;
}
......
......@@ -16,7 +16,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_megaco_shutdown);
SWITCH_MODULE_DEFINITION(mod_megaco, mod_megaco_load, mod_megaco_shutdown, NULL);
#define MEGACO_FUNCTION_SYNTAX "profile [name] [start | stop] [status]"
#define MEGACO_FUNCTION_SYNTAX "profile [name] [start | stop] [status] [xmlstatus]"
SWITCH_STANDARD_API(megaco_function)
{
int argc;
......@@ -63,7 +63,15 @@ SWITCH_STANDARD_API(megaco_function)
} else {
stream->write_function(stream, "-ERR No such profile\n");
}
}else if(!strcmp(argv[2], "xmlstatus")) {
megaco_profile_t *profile = megaco_profile_locate(argv[1]);
if (profile) {
megaco_profile_xmlstatus(stream, profile->name);
} else {
stream->write_function(stream, "-ERR No such profile\n");
}
}
}
goto done;
......@@ -123,6 +131,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_megaco_load)
switch_console_set_complete("add megaco profile ::megaco::list_profiles start");
switch_console_set_complete("add megaco profile ::megaco::list_profiles stop");
switch_console_set_complete("add megaco profile ::megaco::list_profiles status");
switch_console_set_complete("add megaco profile ::megaco::list_profiles xmlstatus");
switch_console_add_complete_func("::megaco::list_profiles", list_profiles);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论