如何使用Jamaa-Smpp和C#从SMSC获取交付报告?
提前致谢,
答案 0 :(得分:1)
我们可以使用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;