]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fixing channel mapping issue and removing unwanted prints
authorroot <root@mtt2.netborder.lan>
Tue, 7 Aug 2012 13:57:51 +0000 (09:57 -0400)
committerroot <root@mtt2.netborder.lan>
Tue, 7 Aug 2012 13:57:51 +0000 (09:57 -0400)
src/mod/endpoints/mod_media_gateway/media_gateway.c
src/mod/endpoints/mod_media_gateway/media_gateway_cmd_handler.c
src/mod/endpoints/mod_media_gateway/media_gateway_stack.h
src/mod/endpoints/mod_media_gateway/media_gateway_xml.c
src/mod/endpoints/mod_media_gateway/mod_media_gateway.c

index 20e72d1c186dd7a53fc6f0aa3746e4b1eddbea76..52081dbc122fd7f0526f3bf4ee4acbf4a833bb41 100644 (file)
@@ -63,7 +63,7 @@ megaco_profile_t*  megaco_get_profile_by_suId(SuId suId)
                switch_hash_this(hi, &var, NULL, &val);
                profile = (megaco_profile_t *) val;
                if (profile->idx == suId) {
-                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Got profile[%s] associated with suId[%d]\n",profile->name, suId);
+                       //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Got profile[%s] associated with suId[%d]\n",profile->name, suId);
                        found = 0x01;
                        break;
                }
index 61896ce9b9745c0d44c0fb1bcb9199ff3b8206e7..b3661f75e8731125eabdd4d4aff64530fcc1b721 100644 (file)
@@ -1563,6 +1563,7 @@ switch_status_t mg_send_end_of_axn(SuId suId, MgMgcoTransId* transId, MgMgcoCont
        ctxt.cmdStatus.pres = PRSNT_NODEF;
        ctxt.cmdStatus.val  = CH_CMD_STATUS_END_OF_AXN;
 
+#if 0
 #ifdef BIT_64
        switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, 
                        "mg_send_end_of_axn: Sending END_OF_AXN for transId[%d], peerId[%d], context[type = %s, value = %d]\n",
@@ -1572,6 +1573,7 @@ switch_status_t mg_send_end_of_axn(SuId suId, MgMgcoTransId* transId, MgMgcoCont
                        "mg_send_end_of_axn: Sending END_OF_AXN for transId[%lu], peerId[%lu], context[type = %s, value = %lu]\n",
                        transId->val, peerId->val, PRNT_MG_CTXT_TYPE(ctxtId->type.val), ctxtId->val.val);
 
+#endif
 #endif
 
        ret = sng_mgco_send_axn_req(suId, &ctxt);
index 28ff0c2c032233009d6369abdb8d2002e6ab20f5..1c7e8c614c22347fe3f94fe99426c877b80b0bd1 100644 (file)
@@ -193,7 +193,7 @@ switch_status_t mg_build_mgco_err_request(MgMgcoInd  **errcmd,U32  trans_id, MgM
 switch_status_t mg_send_audit_rsp(SuId suId, MgMgcoCommand *req);
 switch_status_t handle_mg_audit_cmd(megaco_profile_t* mg_profile, MgMgcoCommand *auditReq);
 switch_status_t mg_stack_termination_is_in_service(megaco_profile_t* mg_profile, char* term_str, int len);
-void mg_create_tdm_term(megaco_profile_t *profile, const char *tech, const char *channel_prefix, const char *prefix, int j);
+void mg_create_tdm_term(megaco_profile_t *profile, const char *tech, const char *channel_prefix, const char *prefix, int j, int k);
 void mg_util_set_cmd_name_string (MgStr *errTxt, MgMgcoCommand       *cmd);
 switch_status_t mgco_init_ins_service_change(SuId suId);
 
index 44c716152a7aea185ac7145014392ff01553d735..4b242a6b9b79993e5d53c5dc708002a466202ae3 100644 (file)
@@ -103,14 +103,14 @@ switch_status_t config_profile(megaco_profile_t *profile, switch_bool_t reload)
                                                                startchan = atoi(chanmap[0]);
                                                                endchan   = atoi(chanmap[1]);
                                                                for (j = startchan; j <= endchan; j++) {
-                                                                       mg_create_tdm_term(profile, tech, channel_prefix, prefix, j);
+                                                                       mg_create_tdm_term(profile, tech, channel_prefix, prefix, j, j);
                                                                }
                                                        }
                                                }else{
                                                        /* case (i) */ 
                                                        p = channel_map_dup;    
                                                        startchan = endchan = atoi(p);
-                                                       mg_create_tdm_term(profile, tech, channel_prefix, prefix, startchan);
+                                                       mg_create_tdm_term(profile, tech, channel_prefix, prefix, startchan, startchan);
                                                }
                                        }else
                                        {
@@ -123,7 +123,10 @@ switch_status_t config_profile(megaco_profile_t *profile, switch_bool_t reload)
                                                                endchan = atoi(p);
 
                                                                for (j = startchan; j <= endchan; j++) {
-                                                                       mg_create_tdm_term(profile, tech, channel_prefix, prefix, j);
+if (0 == i)
+                                                                       mg_create_tdm_term(profile, tech, channel_prefix, prefix, j, j);
+else
+                                                                       mg_create_tdm_term(profile, tech, channel_prefix, prefix, j, j-1);
                                                                }
                                                        }
                                                }
@@ -197,7 +200,7 @@ done:
 }
 
 /****************************************************************************************************************************/
-void mg_create_tdm_term(megaco_profile_t *profile, const char *tech, const char *channel_prefix, const char *prefix, int chan_num)
+void mg_create_tdm_term(megaco_profile_t *profile, const char *tech, const char *channel_prefix, const char *prefix, int chan_num, int tdm_chan_num)
 {
        mg_termination_t *term;
        switch_memory_pool_t *pool;
@@ -211,7 +214,7 @@ void mg_create_tdm_term(megaco_profile_t *profile, const char *tech, const char
        term->tech = switch_core_strdup(pool, tech);
        term->active_events = NULL;
        term->name = switch_core_sprintf(pool, "%s%d", prefix, chan_num);
-       term->u.tdm.channel = chan_num;
+       term->u.tdm.channel = tdm_chan_num;
        term->u.tdm.span_name = switch_core_strdup(pool, channel_prefix);
        switch_set_flag(term, MG_OUT_OF_SERVICE);
 
index 698efc0798a80a46ff3469913520440714156acd..771732d680661e9113f21ee6642bed9ee80d5690 100644 (file)
@@ -526,8 +526,8 @@ void handle_mgco_cmd_ind(Pst *pst, SuId suId, MgMgcoCommand* cmd)
        inc_context = &cmd->contextId;
     memcpy(&out_ctxt, inc_context,sizeof(MgMgcoContextId));
 
-    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, 
-                   "%s: Received Command Type[%s] \n", __PRETTY_FUNCTION__, PRNT_MG_CMD_TYPE(cmd->cmdType.val));
+    /*switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, 
+                   "%s: Received Command Type[%s] \n", __PRETTY_FUNCTION__, PRNT_MG_CMD_TYPE(cmd->cmdType.val));*/
 
     /*get mg profile associated with SuId */
     if(NULL == (mg_profile = megaco_get_profile_by_suId(suId))){
@@ -591,8 +591,8 @@ void handle_mgco_cmd_ind(Pst *pst, SuId suId, MgMgcoCommand* cmd)
                }
        }
 
-       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, 
-                               "Termination-Id received..value[%s] type[%d] \n", termId->name.lcl.val, termId->type.val);
+       /*switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, 
+                               "Termination-Id received..value[%s] type[%d] \n", termId->name.lcl.val, termId->type.val);*/
 
        /*If term type is other then check if that term is configured with us..for term type CHOOSE/ALL , no need to check */
        /* check is only if command is not AUDIT */