Esempio n. 1
0
        private void SendErrorBackToUser(UapMessageBase dpacket)
        {
            // 发送错误提示信息
            UapMessageBase uap;

            if (this.SendBackServiceType == "USSRR")
            {
                uap = new UapContinue();
            }
            else if (this.SendBackServiceType.StartsWith("REL"))
            {
                uap = new UapEnd();
            }
            else
            {
                return;
            }
            uap.UssdVersion = dpacket.UssdVersion;
            uap.UssdOpType  = UapBase.UssdOpTypeEnum.Request;
            uap.MsIsdn      = dpacket.MsIsdn;
            uap.ServiceCode = dpacket.ServiceCode;
            uap.CodeScheme  = 0x44;
            uap.UssdContent = this.SendBackShortMessage;

            // 发送至日志服务器
            this.OnSendToLogServer(uap);

            this.SendUap(uap);
        }
Esempio n. 2
0
        /// <summary>
        /// </summary>
        /// <remarks>
        /// -------0-------+-------1-------+------2------+-------3---------
        ///               Min             Max          NoRep
        ///    处理全部        处理PSSRR      回发所有       所有均舍弃
        ///                    回发其他
        /// Min = MinQueueLength
        /// Max = MaxQueueLength
        /// NoRep = NoReplyQueueLength
        /// </remarks>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void QueuePool_OnLevelArrived(object sender, LevelArrivedEventArgs <UapBase> e)
        {
            UapMessageBase dpacket = (e.Packet as UapMessageBase);

            if (e.Packet != null)
            {
                switch (e.LevelNumber)
                {
                case 1:
                    if (dpacket is UapBegin)
                    {
                        e.CancelEnqueue = true;
                        this.SendErrorBackToUser(dpacket);
                    }
                    break;

                case 2:
                    e.CancelEnqueue = true;
                    this.SendErrorBackToUser(dpacket);
                    break;

                case 3:
                    e.CancelEnqueue = true;
                    break;

                default:
                    break;
                }
            }
        }