Example #1
0
        private void ResetChnl(short wChnlNo)
        {
            D160A.StopPlay(wChnlNo);
            D160A.StartPlaySignal(wChnlNo, (int)SigType.SIG_STOP);
            //  if (Lines[ChannelID].State == CHANNEL_STATE.CH_WELCOME || Lines[ChannelID].State == CHANNEL_STATE.CH_PASSWORD || Lines[ChannelID].State == CHANNEL_STATE.CH_SELECT)
            if ((Lines[wChnlNo].State == CHANNEL_STATE.CH_WELCOME) || (Lines[wChnlNo].State == CHANNEL_STATE.CH_ACCOUNT) || (Lines[wChnlNo].State == CHANNEL_STATE.CH_PASSWORD) || (Lines[wChnlNo].State == CHANNEL_STATE.CH_SELECT1) || (Lines[wChnlNo].State == CHANNEL_STATE.CH_OFFHOOK))
            {
                D160A.StopPlayFile(wChnlNo);//停止播放文件
            }
            else if (Lines[wChnlNo].State == CHANNEL_STATE.CH_PLAYRESULT)
            {
                D160A.StopIndexPlayFile(wChnlNo);
            }
            else if (Lines[wChnlNo].State == CHANNEL_STATE.CH_ACCOUNT1)//操作被叫通道流
            {
                D160A.FeedPower(wChnlNo);
            }
            else if (Lines[wChnlNo].State == CHANNEL_STATE.CH_ACCOUNT3) //操作
            {
                D160A.ClearLink(wChnlNo, Dtmf[wChnlNo]);
            }                                          //拆分通道通路

            //外线
            if (Lines[wChnlNo].nType == CHANNEL_TYPE.Trunk)
            {
                //检测信号
                D160A.StartSigCheck(wChnlNo);
                //外线挂机
                D160A.HangUp(wChnlNo);
                D160A.Sig_ResetCheck(wChnlNo);
            }
            if (Lines[wChnlNo].nType == CHANNEL_TYPE.User)
            {
                D160A.FeedPower(wChnlNo);
            }
            bUser[wChnlNo]             = true;
            SigCheck[wChnlNo]          = (short)1;
            sWitCh[wChnlNo]            = (short)-1;
            Dtmf[wChnlNo]              = (short)-1;
            Lines[wChnlNo].Dtmf        = "";
            Lines[wChnlNo].CallerID    = "";
            Lines[wChnlNo].nTimeElapse = 0;
            //Lines[wChnlNo].State = CHANNEL_STATE.CH_FREE(0);//空闲
            Lines[wChnlNo].State = (CHANNEL_STATE)(0);
        }