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); }
/// <summary> /// Gets a single Uap based on the response bytes. /// </summary> /// <param name="response">The response.</param> /// <returns>The Uap corresponding to the bytes.</returns> private static UapBase GetUap(byte[] response) { UapBase.CommandIdType commandID = UapBase.DecodeCommandId(response); UapBase packet; switch (commandID) { case UapBase.CommandIdType.Bind: packet = new UapBind(response); break; case UapBase.CommandIdType.BindResp: packet = new UapBindResp(response); break; case UapBase.CommandIdType.Unbind: packet = new UapUnbind(response); break; case UapBase.CommandIdType.UnbindResp: packet = new UapUnbindResp(response); break; case UapBase.CommandIdType.EnquireLink: packet = new UapEnquireLink(response); break; case UapBase.CommandIdType.EnquireLinkResp: packet = new UapEnquireLinkResp(response); break; case UapBase.CommandIdType.Begin: packet = new UapBegin(response); break; case UapBase.CommandIdType.Continue: packet = new UapContinue(response); break; case UapBase.CommandIdType.End: packet = new UapEnd(response); break; case UapBase.CommandIdType.Abort: packet = new UapAbort(response); break; case UapBase.CommandIdType.Switch: packet = new UapSwitch(response); break; case UapBase.CommandIdType.Chargeind: packet = new UapChargeind(response); break; case UapBase.CommandIdType.ChargeindResp: packet = new UapChargeindResp(response); break; case UapBase.CommandIdType.SwitchBegin: packet = new UapSwitchBegin(response); break; case UapBase.CommandIdType.None: default: packet = null; break; } return(packet); }