/// <summary> /// Sends an SMS message synchronouslly, possibly splitting it on multiple PDUs /// using the specified segmentation & reassembly method. /// </summary> /// <param name="pdu">The pdu.</param> /// <param name="method">The method.</param> /// <returns>The list of messageIds assigned by remote party to each submitted PDU.</returns> public IEnumerable <string> Send(SmppSubmitSm pdu, SmppSarMethod method) { var requests = SmppUtil.SplitLongMessage(pdu, method, GetRandomByte()).Cast <SmppRequest>(); var responses = SendRequests(requests); if (responses.Any(x => (x is SmppGenericNackResp))) { var nack = responses.First(x => x is SmppGenericNackResp); var idx = responses.IndexWhere(x => x == nack); var req = requests.ElementAt(idx); var msg = string.Format("SMPP PDU was rejected by remote party. (error: {0})", nack.CommandStatus); throw new SmppRemoteException(msg, req, nack); } if (responses.Any(x => x.CommandStatus != 0)) { var res = responses.First(x => x.CommandStatus != 0); var idx = responses.IndexWhere(x => x == res); var req = requests.ElementAt(idx); var msg = string.Format("SMPP Request returned an error status. (code: {0})", res.CommandStatus); throw new SmppRemoteException(msg, req, res); } return(responses.OfType <SmppSubmitSmResp>().Select(x => x.MessageId).ToArray()); }
private SMSSeriesId EnqueueSMS(Guid userId, Guid senderNameId, Guid providerId, MessageLcd2 req, string clientId = null, string distributionId = null, string smsId = null, Dictionary <string, string> customParameters = null) { SMSSeriesId result = SMSSeriesId.Empty; DestinationAddress[] dadress; if (req is SmppSubmitMulti) { dadress = (req as SmppSubmitMulti).DestinationAddresses; } else { SmppSubmitSm simple = req as SmppSubmitSm; dadress = new[] { new DestinationAddress(simple.DestinationAddressTon, simple.DestinationAddressNpi, simple.DestinationAddress) }; } var enqueueResult = Context.EnqueueSMS(userId, senderNameId, providerId, clientId, distributionId, smsId, (short?)req.SequenceNumber, req.ServiceType, (short?)req.SourceAddressTon, (short?)req.SourceAddressNpi, req.SourceAddress, req is SmppSubmitMulti ? (short?)(req as SmppSubmitMulti).NumberOfDestinations : 1, req.EsmClass, (short?)req.ProtocolId, (short?)req.PriorityFlag, req.ScheduleDeliveryTime, req.ValidityPeriod, (short?)req.RegisteredDelivery, req.ReplaceIfPresentFlag?(short?)1:(short?)0, (short?)req.DataCoding, req.SmDefaultMessageId, req.SmLength, (req.ShortMessage as byte[]).GetHexString(), _tlvSerializer.Serialize(new Hashtable(req.TlvTable.tlvTable)), _addressSerializer.Serialize(dadress), customParameters == null? null : Tools.Merge(customParameters) ); Guid?baseSmsId = enqueueResult.FirstOrDefault(); byte position = 0; try { position = req.SarSegmentSeqnum; } catch { /*Не выставлена */ } if (baseSmsId != null) { result = new SMSSeriesId() { Id = baseSmsId.Value, ExternalId = smsId, SeriesPosition = position } } ; return(result); } }
public void Can_Fragment_Using_Udh(int length, DataCoding coding, int segmentsNumber) { var message = new String(Enumerable.Repeat('A', length).ToArray()); var submitSm = new SmppSubmitSm() { DataCoding = coding, ShortMessage = message, }; var segments = SmppUtil.SplitLongMessage(submitSm, SmppSarMethod.UserDataHeader, 0x1); Assert.AreEqual(segmentsNumber, segments.Count()); }
public void Send(string orginator, string recipient, string body) { var submit = new SmppSubmitSm { DataCoding = DataCoding.SMSCDefault, DestinationAddress = recipient, DestinationAddressNpi = Pdu.NpiType.ISDN, DestinationAddressTon = Pdu.TonType.International, SourceAddress = orginator, SourceAddressNpi = Pdu.NpiType.Unknown, SourceAddressTon = Pdu.TonType.Alphanumeric, RegisteredDelivery = Pdu.RegisteredDeliveryType.OnSuccessOrFailure, ShortMessage = new GSMEncoding().GetBytes(body) }; _client.SendPdu(submit); }
/// <summary> /// Apply segmentation over a message possibly splitting it on multiple SMPP PDUs. /// </summary> /// <remarks> /// Method may return the passed pdu (modified as needed) as result in case no splitting is required. /// </remarks> /// <param name="pdu">The base pdu to use.</param> /// <param name="method">The segmentation & reasembly method tu use when splitting the message.</param> /// <param name="correlationId">The correlation id to set to each message part.</param> /// <returns>The list of sequence numbers of PDUs sent</returns> public static IEnumerable <SmppSubmitSm> SplitLongMessage(SmppSubmitSm pdu, SmppSarMethod method, byte correlationId) { if (pdu == null) { throw new ArgumentNullException("pdu"); } var result = new List <SmppSubmitSm>(); var data = pdu.MessagePayload != null ? pdu.MessagePayload : pdu.ShortMessage; if (data != null && !(data is string || data is byte[])) { throw new ArgumentException("Short Message must be a string or byte array."); } var bytes = data is string?PduUtil.GetEncodedText(pdu.DataCoding, data as string) : data as byte[]; var maxSegmentLen = GetMaxSegmentLength(pdu.DataCoding, bytes.Length); // Remove/Reset data from PDU.. pdu.ShortMessage = pdu.MessagePayload = null; // Remove sequenceNumber. pdu.SequenceNumber = 0; // Remove UDH header (if set). pdu.EsmClass &= ((byte)~NetworkFeatures.UDHI); // Remove SMPP segmentation properties.. pdu.MoreMessagesToSend = null; pdu.NumberOfMessages = null; pdu.SarTotalSegments = null; pdu.SarMsgRefNumber = null; // Sending as payload means avoiding all the data splitting logic.. (which is great ;)) if (method == SmppSarMethod.SendAsPayload) { pdu.MessagePayload = data; return(new[] { pdu }); } // Else.. let's do segmentation and the other crappy stuff.. var udhref = method == SmppSarMethod.UserDataHeader ? new Nullable <byte>(correlationId) : null; var segments = SplitMessage(bytes, maxSegmentLen, udhref); var totalSegments = segments.Count(); var segno = 0; // If just one segment, send it w/o SAR parameters.. if (totalSegments < 2) { pdu.ShortMessage = data; return(new[] { pdu }); } // Ok, se we need segmentation, let's go ahead an use input PDU as template. var template = pdu.GetEncodedPdu(); // Well save results here.. var results = new List <SmppSubmitSm>(); foreach (var segment in segments) { var packet = new SmppSubmitSm(template); segno++; // Increase sequence number. packet.SequenceNumber = 0; // Remove sequenceNumber. packet.ShortMessage = segment; // Set current segment bytes as short message.. switch (method) { case SmppSarMethod.UserDataHeader: packet.EsmClass |= (byte)NetworkFeatures.UDHI; // Set UDH flag.. break; case SmppSarMethod.UseSmppSegmentation: packet.EsmClass &= ((byte)~NetworkFeatures.UDHI); // Remove UDH header (if set). // Fill-in SMPP segmentation fields.. packet.MoreMessagesToSend = segno != totalSegments; packet.NumberOfMessages = (byte)totalSegments; packet.SarTotalSegments = (byte)totalSegments; packet.SarMsgRefNumber = correlationId; packet.SarSegmentSeqnum = (byte)segno; break; } result.Add(packet); } return(result); }
/// <summary> /// Creates a SubmitSmEventArgs. /// </summary> /// <param name="packet">The PDU that was received.</param> internal SubmitSmEventArgs(SmppSubmitSm packet) : base(packet) { _response = packet; }
static void Main(string[] args) { var client = new SMPPCommunicator(); client.Host = "127.0.0.1"; client.Port = 2775; client.SystemId = "test1"; client.Password = "******"; client.EnquireLinkInterval = 25; client.BindType = AberrantSMPP.Packet.Request.SmppBind.BindingType.BindAsTransceiver; client.NpiType = AberrantSMPP.Packet.Pdu.NpiType.ISDN; client.TonType = AberrantSMPP.Packet.Pdu.TonType.International; client.Version = AberrantSMPP.Packet.Pdu.SmppVersionType.Version3_4; client.OnAlert += (s, e) => Console.WriteLine("Alert: " + e.ResponsePdu); client.OnBind += (s, e) => Console.WriteLine("OnBind: " + e.ResponsePdu); client.OnBindResp += (s, e) => Console.WriteLine("OnBindResp: " + e.ResponsePdu); client.OnCancelSm += (s, e) => Console.WriteLine("OnCancelSm: " + e.ResponsePdu); client.OnCancelSmResp += (s, e) => Console.WriteLine("OnCancelResp: " + e.ResponsePdu); client.OnClose += (s, e) => Console.WriteLine("OnClose: " + e.GetType()); client.OnDataSm += (s, e) => Console.WriteLine("OnDataSm: " + e.ResponsePdu); client.OnDataSmResp += (s, e) => Console.WriteLine("OnDataResp: " + e.ResponsePdu); client.OnDeliverSm += (s, e) => Console.WriteLine("OnDeliverSm: " + e.ResponsePdu); client.OnDeliverSmResp += (s, e) => Console.WriteLine("OnDeliverSmResp: " + e.ResponsePdu); client.OnEnquireLink += (s, e) => Console.WriteLine("OnEnquireLink: " + e.ResponsePdu); client.OnEnquireLinkResp += (s, e) => Console.WriteLine("OnEnquireLinkResp: " + e.ResponsePdu); client.OnError += (s, e) => Console.WriteLine("OnError: " + e.ThrownException.Message); client.OnGenericNack += (s, e) => Console.WriteLine("OnGenericNack: " + e.ResponsePdu); client.OnQuerySm += (s, e) => Console.WriteLine("OnQuerySm: " + e.ResponsePdu); client.OnQuerySmResp += (s, e) => Console.WriteLine("OnQuerySmResp: " + e.ResponsePdu); client.OnReplaceSm += (s, e) => Console.WriteLine("OnReplaceSm: " + e.ResponsePdu); client.OnReplaceSmResp += (s, e) => Console.WriteLine("OnReplaceSmResp: " + e.ResponsePdu); client.OnSubmitMulti += (s, e) => Console.WriteLine("OnSubmitMulti: " + e.ResponsePdu); client.OnSubmitMultiResp += (s, e) => Console.WriteLine("OnSubmitMultiResp: " + e.ResponsePdu); client.OnSubmitSm += (s, e) => Console.WriteLine("OnSubmitSm: " + e.ResponsePdu); client.OnSubmitSmResp += new SMPPCommunicator.SubmitSmRespEventHandler(client_OnSubmitSmResp); client.OnUnbind += (s, e) => Console.WriteLine("OnUnbind: " + e.ResponsePdu); client.OnUnboundResp += (s, e) => Console.WriteLine("OnUnboundResp: " + e.ResponsePdu); client.Bind(); //var txt = new String('a', 200); //var txt = "X de mas de 160 caractereñ.. @€34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890ABCDEFGHIJKL987654321"; var txt = @"X de mas de 160 caractereñ.. @€abcdefghijklmnopqrstxyz!!!0987654321-ABCDE"; #if true var req = new SmppSubmitSm() { //var req = new SmppDataSm() { AlertOnMsgDelivery = 0x1, DataCoding = DataCoding.UCS2, SourceAddress = "WOP", DestinationAddress = "+34667484721", //DestinationAddress = "+34692471323", //DestinationAddress = "+34915550000", ValidityPeriod = "000000235959000R", // R == Time Relative to SMSC's time. //EsmClass = ... LanguageIndicator = LanguageIndicator.Unspecified, //PayloadType = Pdu.PayloadTypeType.WDPMessage, MessagePayload = new byte[] { 0x0A, 0x0A }, #if true ShortMessage = txt, #else ShortMessage = new byte[] { Encoding.ASCII.GetBytes("A")[0], Encoding.ASCII.GetBytes("U")[0], 0x20, // A 0x20, 0x24, // Currency 0x20, 0x1b, 0x65, // Euro symbol 0x20, 0x2d, // - 0x20, 0x1b, 0x3d, // tilde (~) 0x20, 0x7d, // ñ 0x20, 0x09 // Cedilla }, #endif //MsValidity = Pdu.MsValidityType.StoreIndefinitely, //NumberOfMessages PriorityFlag = Pdu.PriorityType.Highest, //PrivacyIndicator = Pdu.PrivacyType.Nonrestricted RegisteredDelivery = //Pdu.RegisteredDeliveryType.OnSuccessOrFailure, (Pdu.RegisteredDeliveryType) 0x1e, }; #else var req = new SmppDataSm() { //var req = new SmppDataSm() { AlertOnMsgDelivery = 0x1, DataCoding = Pdu.DataCodingType.Latin1, SourceAddress = "EVICERTIA", DestinationAddress = "+34667484721", //DestinationAddress = "+34915550000", //EsmClass = ... LanguageIndicator = Pdu.LanguageType.Spanish, //PayloadType = Pdu.PayloadTypeType.WDPMessage, MessagePayload = new byte[] { 0x0A, 0x0A }, //MsValidity = Pdu.MsValidityType.StoreIndefinitely, //NumberOfMessages //PrivacyIndicator = Pdu.PrivacyType.Nonrestricted RegisteredDelivery = //Pdu.RegisteredDeliveryType.OnSuccessOrFailure, (Pdu.RegisteredDeliveryType) 0x1e, SetDpf = Pdu.DpfResultType.DPFSet, }; #endif //AberrantSMPP.Utility.PduUtil.SetMessagePayload(req, req.MessagePayload); client.SendPdu(req); while (true) { foreach (var id in SentMessages) { //var q = new SmppQuerySm() { MessageId = id }; //client.SendPdu(q); } System.Threading.Thread.Sleep(1000); } }
private static void Gateway(string user, string pass) { var client = new SmppCommunicator(); client.Host = "smpp.smsgateway.com"; client.Port = 8445; client.SystemId = user; client.Password = pass; client.EnquireLinkInterval = 25; client.BindType = SmppBind.BindingType.BindAsTransceiver; client.NpiType = Pdu.NpiType.Isdn; client.TonType = Pdu.TonType.International; client.Version = Pdu.SmppVersionType.Version34; client.UseSsl = true; client.OnAlert += (s, e) => Console.WriteLine("Alert: " + e.ResponsePdu); client.OnBind += (s, e) => Console.WriteLine("OnBind: " + e.ResponsePdu); client.OnBindResp += (s, e) => Console.WriteLine("OnBindResp: " + e.ResponsePdu); client.OnCancelSm += (s, e) => Console.WriteLine("OnCancelSm: " + e.ResponsePdu); client.OnCancelSmResp += (s, e) => Console.WriteLine("OnCancelResp: " + e.ResponsePdu); client.OnClose += (s, e) => Console.WriteLine("OnClose: " + e.GetType()); client.OnDataSm += (s, e) => Console.WriteLine("OnDataSm: " + e.ResponsePdu); client.OnDataSmResp += (s, e) => Console.WriteLine("OnDataResp: " + e.ResponsePdu); client.OnDeliverSm += (s, e) => Console.WriteLine("OnDeliverSm: " + e.ResponsePdu); client.OnDeliverSmResp += (s, e) => Console.WriteLine("OnDeliverSmResp: " + e.ResponsePdu); client.OnEnquireLink += (s, e) => Console.WriteLine("OnEnquireLink: " + e.ResponsePdu); client.OnEnquireLinkResp += (s, e) => Console.WriteLine("OnEnquireLinkResp: " + e.ResponsePdu); client.OnError += (s, e) => Console.WriteLine("OnError: " + e.ThrownException.Message); client.OnGenericNack += (s, e) => Console.WriteLine("OnGenericNack: " + e.ResponsePdu); client.OnQuerySm += (s, e) => Console.WriteLine("OnQuerySm: " + e.ResponsePdu); client.OnQuerySmResp += (s, e) => Console.WriteLine("OnQuerySmResp: " + e.ResponsePdu); client.OnReplaceSm += (s, e) => Console.WriteLine("OnReplaceSm: " + e.ResponsePdu); client.OnReplaceSmResp += (s, e) => Console.WriteLine("OnReplaceSmResp: " + e.ResponsePdu); client.OnSubmitMulti += (s, e) => Console.WriteLine("OnSubmitMulti: " + e.ResponsePdu); client.OnSubmitMultiResp += (s, e) => Console.WriteLine("OnSubmitMultiResp: " + e.ResponsePdu); client.OnSubmitSm += (s, e) => Console.WriteLine("OnSubmitSm: " + e.ResponsePdu); client.OnSubmitSmResp += client_OnSubmitSmResp; client.OnUnbind += (s, e) => Console.WriteLine("OnUnbind: " + e.ResponsePdu); client.OnUnboundResp += (s, e) => Console.WriteLine("OnUnboundResp: " + e.ResponsePdu); client.Bind(); var txt = @"Lorem ipsum dolor sit amet, nonumy iisque appetere usu te. His liber dolores expetenda ea, ut usu harum percipitur, invenire voluptaria sed an. Ut quis nominavi qui, vim at alienum intellegat. In mel purto suscipiantur, at odio adolescens sea. Duo ludus animal ea, eum torquatos reformidans eu, sale dolores urbanitas at est."; MessageCoding coding; // split the text, get the byte arrays byte[][] byteMessagesArray = SmsMessageHelper.SplitMessage(txt, out coding); // esm_class parameter must be set if we are sending a contactenated message var esmClass = (byte)(byteMessagesArray.Length > 1 ? 0x40 : 0x0); // submit all messages for (int i = 0; i < byteMessagesArray.Length; i++) { var req = new SmppSubmitSm() { DataCoding = DataCoding.OctetUnspecifiedA,// we are sending binary data. despite what the original text was SourceAddress = "34915550000", DestinationAddress = "61437600343", ShortMessage = byteMessagesArray[i], LanguageIndicator = LanguageIndicator.English, RegisteredDelivery = Pdu.RegisteredDeliveryType.OnSuccessOrFailure, EsmClass = esmClass, ValidityPeriod = "000000235959000R", // R == Time Relative to SMSC's time. PriorityFlag = Pdu.PriorityType.Highest, }; Console.WriteLine("Sending message...: " + txt); client.SendPdu(req); } client.Unbind(); }
public SmppSubmitSmResp StoreMessage(SmppSubmitSm packet) { throw new NotImplementedException(); }
public List <SMSSeriesId> SendSms(Guid userId, string senderName, List <string> addresses, string message, bool transliterate = false, bool alertOnDelivery = false, bool registredDelivery = true, bool replaceIfPresent = true, string callbackNumber = null, string callbackNumberDisplay = null, Pdu.PriorityType priority = Pdu.PriorityType.Level2, Pdu.PrivacyType privacy = Pdu.PrivacyType.Nonrestricted, string clientId = null, string distributionId = null, string smsId = null, DateTime?deliveryTime = null, TimeSpan?validalityPeriod = null, ushort smsSignal = 0, ushort sourcePort = 0, ushort userMessageReference = 0, Dictionary <string, string> customParameters = null) { if (validalityPeriod == null) { validalityPeriod = TimeSpan.FromMinutes(10); } List <SMSSeriesId> result = new List <SMSSeriesId>(); //Здесь будет получение провайдера для данного пользователя, исходя из имени отправителя, требуемого качества канала, жизни поставщика, статуса пользователя, клиента bool useRussian = true; //--------------------------------------------------------- SenderNames sName = Context.GetSenderNames(userId).Where(sn => sn.Name == senderName).OrderByDescending(sn => sn.Providers.ChannelBrandwidth).FirstOrDefault(); if (sName != null) { //--------------------------------------------------------- //--Конфигурация провайдера, должна покрыть некоторые опции---- ProviderConfiguration configuration = _providerConfigurationSerializer.Deserialize <ProviderConfiguration>(sName.Providers.Configuration); Pdu.SmppVersionType smppVersion = configuration.SupportedSMPPVersions.First(); Pdu.PayloadTypeType payloadType = configuration.PayloadType; TonNpiPair outNumbering = sName.Name.IsDigital()? configuration.SourceNumberings.Where(sn => sn.Ton == Pdu.TonType.International).First(): outNumbering = configuration.SourceNumberings.Where(sn => sn.Ton == Pdu.TonType.Alphanumeric).First(); TonNpiPair destinationNumbering = configuration.DestinationNumberings .Where(dn => dn.Ton == Pdu.TonType.International).First(); //------------------------------------------------------------- string[] messages; if (!message.ContainsNonASCII() || transliterate) { if (transliterate) { message = message.Unidecode(); } if (configuration.Support7Bit) { if (message.Length > SMS_7BIT_LENGTH) { messages = message.SplitByLength(SMS_7BIT_CONCAT_LENGTH); } else { messages = message.SplitByLength(SMS_7BIT_LENGTH); } } else { if (message.Length > SMS_8BIT_LENGTH) { messages = message.SplitByLength(SMS_8BIT_CONCAT_LENGTH); } else { messages = message.SplitByLength(SMS_8BIT_LENGTH); } } useRussian = false; } else { if (message.Length > SMS_UNICODE_LENGTH) { messages = message.SplitByLength(SMS_UNICODE_CONCAT_LENGTH); } else { messages = message.SplitByLength(SMS_UNICODE_LENGTH); } } bool concatenated = messages.Length > 1; if (concatenated) { concatRefNum = concatRefNum.CycleInc(); } for (byte i = 0; i < messages.Length; ++i) { MessageLcd2 req; if (addresses.Count > 1) { req = new SmppSubmitMulti(); } else { req = new SmppSubmitSm(); } byte[] bMessage; if (configuration.Support7Bit && !useRussian) { bMessage = new GSMEncoding().GetBytes(messages[i]); if (configuration.Need7BitPacking) { bMessage = GSMEncoding.Encode7Bit(bMessage, concatenated ? 5 : 0); } } else if (!useRussian) { bMessage = Encoding.ASCII.GetBytes(messages[i]); } else { bMessage = Encoding.UTF8.GetBytes(messages[i].Endian2UTF()); } if (useRussian) { req.DataCoding = RoaminSMPP.Packet.Pdu.DataCodingType.Unicode; } else { req.DataCoding = Pdu.DataCodingType.SMSCDefault; } req.AlertOnMsgDelivery = Convert.ToByte(alertOnDelivery); if (useRussian) { req.LanguageIndicator = Pdu.LanguageType.UCS2_16Bit; } else if (configuration.Support7Bit) { req.LanguageIndicator = Pdu.LanguageType.GSM7BitDefaultAlphabet; } else { req.LanguageIndicator = Pdu.LanguageType.Unspecified; } req.PayloadType = payloadType; req.PriorityFlag = priority; req.PrivacyIndicator = privacy; req.ProtocolId = smppVersion; req.RegisteredDelivery = registredDelivery? Pdu.RegisteredDeliveryType.OnSuccessOrFailure: Pdu.RegisteredDeliveryType.None; req.ReplaceIfPresentFlag = replaceIfPresent; req.ScheduleDeliveryTime = deliveryTime == null ? null : deliveryTime.Value.GetDateString(configuration.TimeShift); req.SmsSignal = smsSignal; req.SourceAddress = sName.Name; req.SourceAddressTon = outNumbering.Ton; req.SourceAddressNpi = outNumbering.Npi; req.SourceAddressSubunit = RoaminSMPP.Packet.Pdu.AddressSubunitType.MobileEquipment; req.SourcePort = sourcePort; req.UserMessageReference = userMessageReference; req.ValidityPeriod = validalityPeriod == null ? null : validalityPeriod.Value.GetDateString(); if (!string.IsNullOrEmpty(callbackNumber)) { req.CallbackNum = callbackNumber; if (string.IsNullOrEmpty(callbackNumberDisplay)) { req.CallbackNumAtag = callbackNumberDisplay; } req.CallbackNumPresInd = 1; } if (concatenated) { //Добавляем EI UDH для сочленяемых сообщений byte[] concatBytes = new byte[6]; concatBytes[0] = 5; concatBytes[1] = 0; concatBytes[2] = 3; concatBytes[3] = concatRefNum; concatBytes[4] = (byte)messages.Length; concatBytes[5] = (byte)(i + 1); byte[] resulting = new byte[bMessage.Length + concatBytes.Length]; concatBytes.CopyTo(resulting, 0); bMessage.CopyTo(resulting, concatBytes.Length); bMessage = resulting; } req.ShortMessage = bMessage; if (req is SmppSubmitSm) { SmppSubmitSm simple = req as SmppSubmitSm; simple.DestinationAddress = addresses[0]; simple.DestinationAddressTon = destinationNumbering.Ton; simple.DestinationAddressNpi = destinationNumbering.Npi; } if (req is SmppSubmitMulti) { SmppSubmitMulti complex = req as SmppSubmitMulti; complex.DestinationAddresses = addresses.Select ( address => new DestinationAddress(destinationNumbering.Ton, destinationNumbering.Npi, address) ).ToArray(); } if (concatenated && !string.IsNullOrEmpty(callbackNumber)) { req.EsmClass = 195; } else if (concatenated) { req.EsmClass = 67; } else if (!string.IsNullOrEmpty(callbackNumber)) { req.EsmClass = 131; } else { req.EsmClass = 3; } SMSSeriesId id = EnqueueSMS(userId, sName.Id, sName.ProviderId, req, clientId, distributionId, smsId, customParameters); if (!id.Equals(SMSSeriesId.Empty)) { result.Add(id); } } } return(result); }
/// <summary> /// Creates a SubmitSmEventArgs. /// </summary> /// <param name="packet">The PDU that was received.</param> internal SubmitSmEventArgs(SmppSubmitSm packet) : base(packet) { SubmitSmPdu = packet; }