return SWITCH_STATUS_SUCCESS;
}
+switch_status_t megaco_peer_profile_destroy(mg_peer_profile_t **profile)
+{
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Stopping peer profile: %s\n", (*profile)->name);
+
+ switch_core_hash_delete_wrlock(megaco_globals.peer_profile_hash, (*profile)->name, megaco_globals.peer_profile_rwlock);
+
+ mg_peer_config_cleanup(*profile);
+
+ switch_core_destroy_memory_pool(&(*profile)->pool);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Stopped peer profile: %s\n", (*profile)->name);
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
/* For Emacs:
* Local Variables:
* mode:c
return SWITCH_STATUS_SUCCESS;
}
+/****************************************************************************************************************************/
+switch_status_t mg_peer_config_cleanup(mg_peer_profile_t* profile)
+{
+ switch_xml_config_item_t *instructions = (profile ? get_peer_instructions(profile) : NULL);
+ switch_xml_config_cleanup(instructions);
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
/****************************************************************************************************************************/
static switch_xml_config_item_t *get_peer_instructions(mg_peer_profile_t *profile) {
switch_xml_config_item_t *dup;
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_media_gateway_shutdown)
{
+ void *val = NULL;
+ const void *key = NULL;
+ switch_ssize_t keylen;
+ switch_hash_index_t *hi = NULL;
+ megaco_profile_t* profile = NULL;
+ mg_peer_profile_t* peer_profile = NULL;
+
+ /* destroy all the mg profiles */
+ while ((hi = switch_hash_first(NULL, megaco_globals.profile_hash))) {
+ switch_hash_this(hi, &key, &keylen, &val);
+ profile = (megaco_profile_t *) val;
+ megaco_profile_destroy(&profile);
+ profile = NULL;
+ }
+
+ hi = NULL;
+ key = NULL;
+ val = NULL;
+ /* destroy all the mg peer profiles */
+ while ((hi = switch_hash_first(NULL, megaco_globals.peer_profile_hash))) {
+ switch_hash_this(hi, &key, &keylen, &val);
+ peer_profile = (mg_peer_profile_t *) val;
+ megaco_peer_profile_destroy(&peer_profile);
+ peer_profile = NULL;
+ }
+
sng_mgco_stack_shutdown();
return SWITCH_STATUS_SUCCESS;
}
if (s->attrSet.numComp.pres) {
for (mediaId = 0; mediaId < s->attrSet.numComp.val; mediaId++) {
- CmSdpAttr *a = s->attrSet.attr[mediaId];
+ /*CmSdpAttr *a = s->attrSet.attr[mediaId];*/
}
/* Loop over command list */
for (cmdIter=0; cmdIter < (actnReq->cl.num.val); cmdIter++) {
MgMgcoCommandReq *cmdReq = actnReq->cl.cmds[cmdIter];
- MgMgcoTermId *termId = NULLP;
+ /*MgMgcoTermId *termId = NULLP;*/
/* The reply we'll send */
- MgMgcoCommand mgCmd = {0};
+ MgMgcoCommand mgCmd;
+ memset(&mgCmd, 0, sizeof(mgCmd));
mgCmd.peerId = msg->lcl.id;
mgCmd.transId = transId;
mgCmd.u.mgCmdInd[0] = cmdReq;
}
case MGT_MODIFY:
{
- MgMgcoAmmReq *addReq = &cmdReq->cmd.u.mod;
+ /*MgMgcoAmmReq *addReq = &cmdReq->cmd.u.mod;*/
break;
}
case MGT_MOVE:
{
- MgMgcoAmmReq *addReq = &cmdReq->cmd.u.move;
+ /*MgMgcoAmmReq *addReq = &cmdReq->cmd.u.move;*/
break;
}
case MGT_SUB:
{
- MgMgcoSubAudReq *addReq = &cmdReq->cmd.u.sub;
+ /*MgMgcoSubAudReq *addReq = &cmdReq->cmd.u.sub;*/
}
case MGT_SVCCHG:
case MGT_NTFY: