mohsen4727
پنج شنبه 16 اردیبهشت 1395, 11:39 صبح
سلام من برای دریافت پیغام delivary report در رویداد message recevied کد زیر را نوشتم ولی با پیغام message service error 321 در دستور DecodedShortMessage msg = comm.ReadMessage(loc.Index, loc.Storage) مواجه شدم
private void comm_MessageReceived(object sender, GsmComm.GsmCommunication.MessageReceivedEventArgs e)
{
try
{
IMessageIndicationObject obj = e.IndicationObject;
//Get status report for this condition
if (obj is MemoryLocation)
{
MemoryLocation loc = (MemoryLocation)obj;
Output(string.Format("New message received in storage \"{0}\", index {1}.",
loc.Storage, loc.Index));
Output("");
DecodedShortMessage msg = comm.ReadMessage(loc.Index, loc.Storage);
if (((SmsPdu)msg.Data) is SmsStatusReportPdu)
{
SmsStatusReportPdu data = (SmsStatusReportPdu)msg.Data;
Output("rec msg ref #: " + data.MessageReference);
}
Output(msg.Status.ToString());
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
private void comm_MessageReceived(object sender, GsmComm.GsmCommunication.MessageReceivedEventArgs e)
{
try
{
IMessageIndicationObject obj = e.IndicationObject;
//Get status report for this condition
if (obj is MemoryLocation)
{
MemoryLocation loc = (MemoryLocation)obj;
Output(string.Format("New message received in storage \"{0}\", index {1}.",
loc.Storage, loc.Index));
Output("");
DecodedShortMessage msg = comm.ReadMessage(loc.Index, loc.Storage);
if (((SmsPdu)msg.Data) is SmsStatusReportPdu)
{
SmsStatusReportPdu data = (SmsStatusReportPdu)msg.Data;
Output("rec msg ref #: " + data.MessageReference);
}
Output(msg.Status.ToString());
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}