コード例 #1
0
        //删除PRI承载信道
        private static bool DeleteT1Channel(int PRIID)
        {
            bool b = false;
            List<DB_Talk.Model.m_PRIChannel> lst = new List<DB_Talk.Model.m_PRIChannel>();
            GetT1Channels(out lst);
            lst = lst.Where(w => w.PRIID == PRIID).ToList();

            if (lst != null && lst.Count > 0)
            {
                foreach (DB_Talk.Model.m_PRIChannel m in lst)
                {
                    MBoxSDK.ConfigSDK.tagT1 tagT1 = new MBoxSDK.ConfigSDK.tagT1();
                    tagT1.priID = m.PRIID;            //中继号
                    tagT1.machineID = 1;                  //机身号,必须是1
                    tagT1.slotID = 3;                     //槽位号,必须是3
                    tagT1.e1Port = m.i_E1Port;        //E1口,从1开始
                    tagT1.linkID = m.i_LinkID;        //链接ID,如果与对端的E1口的某条link进行通信,需要把linkID设置成和对端同样的ID
                    //tagT1.channelType = 1;                //1: bothway(1)	2: outgoing(2) 3: incoming(3)
                    //tagT1.configureStatus = 1;
                    //tagT1.operationStatus = 1;
                    tagT1.E1bundle = m.i_ChannelNumber;                   //表示第几个信道,第16个信道不作为承载信道
                    b = MBoxSDK.ConfigSDK.MBOX_DeleteT1Channel(Global.Params.BoxHandle, tagT1);
                    if (!b) return false;
                }
            }
            return true;
            //for (int i = 1; i <= 31; i++)
            //{
            //    if (i == 16) continue;
            //    MBoxSDK.ConfigSDK.tagT1 tagT1 = new MBoxSDK.ConfigSDK.tagT1();
            //    tagT1.priID = model.PRIID;            //中继号
            //    tagT1.machineID = 1;                  //机身号,必须是1
            //    tagT1.slotID = 3;                     //槽位号,必须是3
            //    tagT1.e1Port = model.i_E1Port;        //E1口,从1开始
            //    tagT1.linkID = model.i_LinkID;        //链接ID,如果与对端的E1口的某条link进行通信,需要把linkID设置成和对端同样的ID
            //    //tagT1.channelType = 1;                //1: bothway(1)	2: outgoing(2) 3: incoming(3)
            //    //tagT1.configureStatus = 1;
            //    //tagT1.operationStatus = 1;
            //    tagT1.E1bundle = i;                   //表示第几个信道,第16个信道不作为承载信道
            //    b = b & MBoxSDK.ConfigSDK.MBOX_DeleteT1Channel(Global.Params.BoxHandle, tagT1);
            //}
            
        }
コード例 #2
0
        //增加PRI承载信道
        private static bool CreateT1Channel(DB_Talk.Model.m_PRIChannel model)
        {
            bool b = false;
            for (int i = 1; i <= 31; i++)
            {
                if (i == 16) continue;
                MBoxSDK.ConfigSDK.tagT1 tagT1 = new MBoxSDK.ConfigSDK.tagT1();
                tagT1.priID = model.PRIID;                      //中继号
                tagT1.machineID = 1;                  //机身号,必须是1
                tagT1.slotID = 3;                     //槽位号,必须是3
                tagT1.e1Port = model.i_E1Port;                     //E1口,从1开始
                tagT1.linkID = model.i_LinkID;                     //链接ID,如果与对端的E1口的某条link进行通信,需要把linkID设置成和对端同样的ID
                //tagT1.channelType = 1;                //1: bothway(1)	2: outgoing(2) 3: incoming(3)
                //tagT1.configureStatus = 1;
                //tagT1.operationStatus = 1;
                tagT1.E1bundle = i;                   //表示第几个信道,第16个信道不作为承载信道
                b= MBoxSDK.ConfigSDK.MBOX_CreateT1Channel(Global.Params.BoxHandle, tagT1);
                if (!b) return false;
            }
            return true;

        }