return SWITCH_STATUS_SUCCESS;
}
+switch_status_t mgco_process_mgc_failure(SuId suId)
+{
+ megaco_profile_t* profile = NULL;
+
+ if(NULL == (profile = megaco_get_profile_by_suId(suId))){
+ return SWITCH_STATUS_FALSE;
+ }
+
+ if(0x01 == profile->peer_active){
+ /* MGC failure during active association , release all on-going calls contexts */
+ megaco_release_all_calls(profile);
+ profile->peer_active = 0x00;
+ }
+
+ return SWITCH_STATUS_SUCCESS;
+}
switch_status_t mgco_init_ins_service_change(SuId suId)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO," SUB Request for ALL context \n");
- /* TODO */
+ megaco_release_all_calls(mg_profile);
/* As of now sending +ve response */
goto response;
void mg_restart_inactivity_timer(megaco_profile_t* profile);
+switch_status_t mgco_process_mgc_failure(SuId suId);
+
/****************************************************************************************************************/
/* MG Stack defines */
{
case LMG_EVENT_ALL_MGC_FAILED:
{
+ //mgco_process_mgc_failure(usta->t.usta.alarmInfo.sapId);
len = len + sprintf(prBuf+len, "ALL MGC Failed ");
break;
}
return SWITCH_STATUS_SUCCESS;
}
+/*****************************************************************************************************************************/
+switch_status_t megaco_release_all_calls(megaco_profile_t* mg_profile)
+{
+ mg_context_t* ctx = NULL;
+ uint32_t context_id = 0x00;
+
+ if(NULL == mg_profile) return SWITCH_STATUS_FALSE;
+
+ for (context_id = 0; context_id < MG_MAX_CONTEXTS; context_id++) {
+ ctx = megaco_get_context(mg_profile, context_id);
+ if(NULL == ctx) continue;
+
+ megaco_context_sub_all_termination(ctx);
+ megaco_release_context(ctx);
+ }
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
/*****************************************************************************************************************************/
switch_status_t megaco_start_all_profiles()
{
switch_status_t megaco_start_all_profiles(void);
switch_status_t megaco_profile_start(const char *profilename);
switch_status_t megaco_profile_destroy(megaco_profile_t **profile);
+switch_status_t megaco_release_all_calls(megaco_profile_t* mg_profile);
uint32_t mg_rtp_request_id(megaco_profile_t *profile);
void mg_rtp_release_id(megaco_profile_t *profile, uint32_t id);