如何使用 Jamaa-Smpp 和 C# 从 SMSC 获取发送报告?

How to get delivery report from SMSC using Jamaa-Smpp and C#?

如何使用 Jamaa-Smpp 和 C# 从 SMSC 获取发送报告?

提前致谢,

我们可以使用 client_MessageDelivered 事件

在 Jamaa-Smpp 中获取送货报告

首先,我们需要使用这段代码:

SmppClient(); client = new SmppClient();
client.MessageDelivered += new EventHandler<MessageEventArgs>(client_MessageDelivered);

其次,我们需要使用这段代码:

 void client_MessageDelivered(object sender, MessageEventArgs e)
    {
        TextMessage msg = e.ShortMessage as TextMessage;
        string msgtext=msg.text;
    }

并且不要忘记将值设置为 SubmitSm.RegisteredDelivery 作为您的工作要求:

//SMSC delivery receipt requested where final delivery outcome is deliver success or failure

SubmitSm.RegisteredDelivery = RegisteredDelivery.DeliveryReceipt;

//SMSC delivery receipt requested where the final delivery outcome is delivery failure

SubmitSm.RegisteredDelivery = RegisteredDelivery.DeliveryReceiptFailure;