コード例 #1
0
        //</EventsSample>


        //<InlineSample>

        private void client_evDeliverSmInline(object sender, DeliverSm data)
        {
            _composer.AddMessage(data);
            if (_composer.IsLastSegment(data))
            {
                string receivedText = _composer.GetFullMessage(data);
            }
        }
コード例 #2
0
        private void client_evDeliverSm(object sender, DeliverSm data)
        {
            try
            {
                //Check if we received Delivery Receipt
                if (data.MessageType == MessageTypes.SMSCDeliveryReceipt)
                {
                    //Get MessageId of delivered message
                    string       messageId      = data.Receipt.MessageId;
                    MessageState deliveryStatus = data.Receipt.State;
                }
                else
                {
                    // Receive incoming message and try to concatenate all parts
                    if (data.Concatenation != null)
                    {
                        _composer.AddMessage(data);

                        _log.Info("DeliverSm part received : Sequence: {0} SourceAddr: {1} Concatenation ( {2} ) Coding: {3} Text: {4}",
                                  data.Header.Sequence, data.SourceAddress, data.Concatenation, data.DataCoding, _client.EncodingMapper.GetMessageText(data));


                        if (_composer.IsLastSegment(data))
                        {
                            string fullMessage = _composer.GetFullMessage(data);
                            _log.Info("Full message: " + fullMessage);
                        }
                    }
                    else
                    {
                        _log.Info("DeliverSm received : Sequence: {0} SourceAddr : {1} Coding : {2} MessageText : {3}",
                                  data.Header.Sequence, data.SourceAddress, data.DataCoding, _client.EncodingMapper.GetMessageText(data));
                    }
                }
            }
            catch (Exception ex)
            {
                data.Response.Header.Status = CommandStatus.ESME_RX_T_APPN;
                _log.Error("Failed to process DeliverSm", ex);
            }

            // </ReceiveMessage>
        }