]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
adding TUCL enable/disable logging
authorKapil Gupta <kgupta@sangoma.com>
Thu, 6 Sep 2012 16:56:57 +0000 (12:56 -0400)
committerKapil Gupta <kgupta@sangoma.com>
Thu, 6 Sep 2012 16:56:57 +0000 (12:56 -0400)
src/mod/endpoints/mod_media_gateway/media_gateway_stack.c

index 8a300ff97e5c535d9c53e82c293dccc592561058..4030104c237a9b2ccc3b85523c9a2cb5d91bc34b 100644 (file)
@@ -33,6 +33,7 @@ int sng_mgco_mg_shutdown();
 int sng_mgco_mg_ssap_stop(int sapId);
 int sng_mgco_mg_tpt_server_stop(megaco_profile_t* profile);
 int sng_mgco_mg_app_ssap_stop(int idx);
+int mg_tucl_debug(int action);
 
 switch_status_t sng_mgco_stack_gen_cfg();
 
@@ -581,13 +582,15 @@ int mg_enable_logging()
        memset(&mgMngmt, 0, sizeof(mgMngmt));
        cntrl = &mgMngmt.t.cntrl;
 
+       mg_tucl_debug(AENA);
+
        /* initalize the post structure */
        smPstInit(&pst);
 
        /* insert the destination Entity */
        pst.dstEnt = ENTMG;
        mgMngmt.hdr.msgType         = TCFG;
-       mgMngmt.hdr.entId.ent       = ENTHI;
+       mgMngmt.hdr.entId.ent       = ENTMG;
        mgMngmt.hdr.entId.inst      = S_INST;
        mgMngmt.hdr.elmId.elmnt     = STGEN;
 
@@ -608,13 +611,15 @@ int mg_disable_logging()
        memset(&mgMngmt, 0, sizeof(mgMngmt));
        cntrl = &mgMngmt.t.cntrl;
 
+       mg_tucl_debug(ADISIMM);
+
        /* initalize the post structure */
        smPstInit(&pst);
 
        /* insert the destination Entity */
        pst.dstEnt = ENTMG;
        mgMngmt.hdr.msgType         = TCFG;
-       mgMngmt.hdr.entId.ent       = ENTHI;
+       mgMngmt.hdr.entId.ent       = ENTMG;
        mgMngmt.hdr.entId.inst      = S_INST;
        mgMngmt.hdr.elmId.elmnt     = STGEN;
 
@@ -625,6 +630,38 @@ int mg_disable_logging()
        return(sng_cntrl_mg(&pst, &mgMngmt));
 }
 
+/******************************************************************************/
+int mg_tucl_debug(int action)
+{
+       Pst pst;
+       HiMngmt cntrl;  
+
+       memset((U8 *)&pst, 0, sizeof(Pst));
+       memset((U8 *)&cntrl, 0, sizeof(HiMngmt));
+
+       smPstInit(&pst);
+
+       pst.dstEnt = ENTHI;
+
+       /* prepare header */
+       cntrl.hdr.msgType     = TCNTRL;         /* message type */
+       cntrl.hdr.entId.ent   = ENTHI;          /* entity */
+       cntrl.hdr.entId.inst  = 0;              /* instance */
+       cntrl.hdr.elmId.elmnt = STGEN;       /* General */
+
+       cntrl.hdr.response.selector    = 0;
+       cntrl.hdr.response.prior       = PRIOR0;
+       cntrl.hdr.response.route       = RTESPEC;
+       cntrl.hdr.response.mem.region  = S_REG;
+       cntrl.hdr.response.mem.pool    = S_POOL;
+
+       cntrl.t.cntrl.action    = action;
+       cntrl.t.cntrl.subAction = SADBG;
+       cntrl.t.cntrl.ctlType.hiDbg.dbgMask = 0xFFFF;
+
+       return (sng_cntrl_tucl (&pst, &cntrl));
+}
+
 /******************************************************************************/
 int mgco_tucl_gen_config(void)
 {