term->pool = pool;
term->type = termtype;
term->active_events = NULL;
+ term->mg_ctxt = NULL;
term->profile = profile;
switch_set_flag(term, MGT_ALLOCATED);
free(term->active_events);
term->active_events = NULL;
}
+
+ term->mg_ctxt = NULL;
switch_clear_flag(term, MGT_ALLOCATED);
switch_clear_flag(term, MGT_ACTIVE);
goto error;
}
+ if(!term->mg_ctxt){
+ term->mg_ctxt = mg_ctxt;
+ }
+
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO," Allocated Termination[%p] with term name[%s]\n", (void*)term, term->name);
is_rtp = 0x01;
goto error;
}
+ if(!term->mg_ctxt){
+ term->mg_ctxt = mg_ctxt;
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO," Termination[%s] already in context..rejecting ADD \n", term->name);
+ mg_util_set_err_string(&errTxt, " Term already is in call ");
+ err_code = MGT_MGCP_RSP_CODE_PROT_ERROR;
+ goto error;
+ }
+
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO," Allocated Termination[%p] with term name[%s]\n", (void*)term, term->name);
}
/********************************************************************/
#define MG_INACTIVITY_TMR_RESOLUTION 100 /* mit in ito package is experessed in 10ms steps */
+/* rtp/avp profiles */
+#define MG_RTP_AVP_PROFILE_A_LAW 8
+#define MG_RTP_AVP_PROFILE_U_LAW 0
+
+
typedef enum{
MG_SDP_NONE,
MG_SDP_LOCAL,
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE,"CmSdpU8OrNil: Value = %d \n", (NOTPRSNT != p->val.pres)?p->val.val:-1);
}
-void mgco_print_sdp_media_param(CmSdpMedPar *s)
+void mgco_print_sdp_media_param(CmSdpMedPar *s, mg_termination_t* term, mgco_sdp_types_e sdp_type)
{
int i=0x00;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "***** Media Parameter *********** \n");
for(i=0;i<r->num.val;i++){
mgco_print_CmSdpU8OrNil(r->fmts[i]);
+
+ if(MG_RTP_AVP_PROFILE_A_LAW == r->fmts[i]->val.val){
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, " MG_RTP_AVP_PROFILE_A_LAW: \n");
+ }else if(MG_RTP_AVP_PROFILE_U_LAW == r->fmts[i]->val.val){
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, " MG_RTP_AVP_PROFILE_U_LAW: \n");
+ }
}
}
break;
break;
}
}
- mgco_print_sdp_media_param(&f->par);
+ mgco_print_sdp_media_param(&f->par, term, sdp_type);
}
/*info */
term->pool = pool;
term->type = MG_TERM_TDM;
term->profile = profile;
+ term->mg_ctxt = NULL;
+ term->active_events = NULL;
term->name = switch_core_sprintf(pool, "%s%d", prefix, j);
term->u.tdm.channel = j;
term->u.tdm.span_name = switch_core_strdup(pool, channel_prefix);
} mg_termination_flags;
+struct mg_context_s {
+ uint32_t context_id;
+ mg_termination_t *terminations[MG_CONTEXT_MAX_TERMS];
+ megaco_profile_t *profile;
+ mg_context_t *next;
+ switch_memory_pool_t *pool;
+};
+
struct mg_termination_s {
switch_memory_pool_t *pool;
mg_termination_type_t type;
MgMgcoReqEvtDesc *active_events; /* !< active megaco events */
mg_termination_t *next; /*!< List for physical terminations */
uint32_t flags;
+ mg_context_t* mg_ctxt;
union {
struct {
};
-struct mg_context_s {
- uint32_t context_id;
- mg_termination_t *terminations[MG_CONTEXT_MAX_TERMS];
- megaco_profile_t *profile;
- mg_context_t *next;
- switch_memory_pool_t *pool;
-};
+
#define MG_CONTEXT_MODULO 16
#define MG_MAX_CONTEXTS 32768