protected override void Parse(ByteBuffer buffer) { if (buffer == null) { throw new ArgumentNullException("buffer"); } const int minBytes = 7; if (buffer.Length < minBytes) { throw new NotEnoughBytesException("BindRequest requires at least 7 bytes for body parameters"); } try { vSystemID = DecodeCString(buffer); vPassword = DecodeCString(buffer); vSystemType = DecodeCString(buffer); vInterfaceVersion = GetByte(buffer); vAddressTon = (TypeOfNumber)GetByte(buffer); vAddressNpi = (NumberingPlanIndicator)GetByte(buffer); vAddressRange = DecodeCString(buffer); } catch (InvalidOperationException ex) { //ByteBuffer.Remove() throws InvalidOperationException exception if called on a empty ByteBuffer instance //Wrap this exception as a NotEnoughBytesException exception throw new NotEnoughBytesException(ex.Message, ex); } if (buffer.Length > 0) //If there are some bytes left { throw new TooManyBytesException(); } }
internal BindRequest(PduHeader header) : base(header) { _vSystemId = ""; _vPassword = ""; _vSystemType = ""; _vAddressTon = TypeOfNumber.International; //International _vAddressNpi = NumberingPlanIndicator.Isdn; //ISDN _vInterfaceVersion = 34; //SMPP 3.4 version _vAddressRange = ""; }
internal BindRequest(PDUHeader header) : base(header) { vSystemID = ""; vPassword = ""; vSystemType = ""; vAddressTon = TypeOfNumber.International; //International vAddressNpi = NumberingPlanIndicator.ISDN; //ISDN vInterfaceVersion = 34; //SMPP 3.4 version vAddressRange = ""; }
public SessionBindInfo() { vHost = ""; vSystemID = ""; vPassword = ""; vSystemType = ""; vInterfaceVersion = InterfaceVersion.v34; vAllowReceive = true; vAllowTransmit = true; vAddressTon = TypeOfNumber.International; vAddressNpi = NumberingPlanIndicator.ISDN; }
public SessionBindInfo() { _vHost = ""; _vSystemId = ""; _vPassword = ""; _vSystemType = ""; _vInterfaceVersion = InterfaceVersion.V34; _vAllowReceive = true; _vAllowTransmit = true; _vAddressTon = TypeOfNumber.International; _vAddressNpi = NumberingPlanIndicator.Isdn; }
internal static SmppAddress Parse(ByteBuffer buffer) { //We require at least 3 bytes for SMPPAddress instance to be craeted if (buffer.Length < 3) { throw new NotEnoughBytesException("SMPPAddress requires at least 3 bytes"); } TypeOfNumber ton = (TypeOfNumber)PDU.GetByte(buffer); NumberingPlanIndicator npi = (NumberingPlanIndicator)PDU.GetByte(buffer); string address = PDU.DecodeCString(buffer); return(new SmppAddress(ton, npi, address)); }
/// <summary> /// Initializes a new instance of <see cref="SmppConnectionProperties"/> /// </summary> public SmppConnectionProperties() { vSystemID = ""; vPassword = ""; vHost = ""; vAddressTon = TypeOfNumber.International; vAddressNpi = NumberingPlanIndicator.ISDN; vInterfaceVersion = InterfaceVersion.v34; vSystemType = ""; vDefaultServiceType = ""; SmscID = ""; vSyncRoot = new object(); }
/// <summary> /// Initializes a new instance of <see cref="SmppConnectionProperties"/> /// </summary> public SmppConnectionProperties() { _vSystemId = ""; _vPassword = ""; _vHost = ""; _vAddressTon = TypeOfNumber.International; _vAddressNpi = NumberingPlanIndicator.Isdn; _vInterfaceVersion = InterfaceVersion.V34; _vSystemType = ""; _vDefaultServiceType = ""; SmscId = ""; _vSyncRoot = new object(); }
private void BindSession(SessionBindInfo bindInfo, int timeOut) { _vTcpIpSession.SessionClosed += TcpIpSessionClosedEventHandler; BindRequest bindReq = bindInfo.CreatePdu(); _vTrans.Send(bindReq); BindResponse bindResp = null; try { bindResp = (BindResponse)_vRespHandler.WaitResponse(bindReq, timeOut); } catch (SmppResponseTimedOutException ex) { throw new SmppBindException(ex); } if (bindResp.Header.ErrorCode != 0) { throw new SmppBindException(bindResp.Header.ErrorCode); } //Copy settings _vSmscId = bindResp.SystemId; _vSystemId = bindInfo.SystemId; _vPassword = bindInfo.Password; _vAddressTon = bindInfo.AddressTon; _vAddressNpi = bindInfo.AddressNpi; //Start timer _vTimer.Start(); _vIsAlive = true; switch (bindReq.Header.CommandType) { case CommandType.BindTransceiver: ChangeState(SmppSessionState.Transceiver); break; case CommandType.BindReceiver: ChangeState(SmppSessionState.Receiver); break; case CommandType.BindTransmitter: ChangeState(SmppSessionState.Transmitter); break; } }
public SmppAddress() { _vTon = TypeOfNumber.International; _vNpi = NumberingPlanIndicator.Isdn; _vAddress = ""; }
protected override void Parse(ByteBuffer buffer) { if (buffer == null) { throw new ArgumentNullException("buffer"); } const int minBytes = 7; if (buffer.Length < minBytes) { throw new NotEnoughBytesException("BindRequest requires at least 7 bytes for body parameters"); } try { vSystemID = DecodeCString(buffer); vPassword = DecodeCString(buffer); vSystemType = DecodeCString(buffer); vInterfaceVersion = GetByte(buffer); vAddressTon = (TypeOfNumber)GetByte(buffer); vAddressNpi = (NumberingPlanIndicator)GetByte(buffer); vAddressRange = DecodeCString(buffer); } catch (InvalidOperationException ex) { //ByteBuffer.Remove() throws InvalidOperationException exception if called on a empty ByteBuffer instance //Wrap this exception as a NotEnoughBytesException exception throw new NotEnoughBytesException(ex.Message,ex); } if (buffer.Length > 0) //If there are some bytes left { throw new TooManyBytesException(); } }
public SmppAddress() { vTon = TypeOfNumber.International; vNpi = NumberingPlanIndicator.ISDN; vAddress = ""; }
public SmppAddress(TypeOfNumber ton, NumberingPlanIndicator npi, string address) { vTon = ton; vNpi = npi; vAddress = address; }