Duplicate Messages

Added by admin 31 days ago

when two messages are received simultaneously the
library raises the MessageReceived event three times; two of them correspond
to each "real" message and for the third one, the content of the message and
the phone numbers are null (For MessageReceivedEventArgs e,
e.Message.Content and e.Message.PhoneNumber are null).

Actually it's weird that in some other cases, only two events are raised,
one for a real message and the null content message. I believe it may depend
on the time difference between each message.

We are sending the SMS with a time difference of around 1 or 2 seconds and
we are using a modem that's pretty standard (An Enfora board).

Also, we've noticed that the library seems to stop working after this, the
application needs to be restarted. We've noticed that also even if the
application is still having communication with the modem we cannot send a
message (the MessageSendingFailed event is raised). About these two cases,
I'm making some tests to make sure that it's not a problem due to the
application having errors because of the duplicate events but the one error
that we've made sure is happening on the library is the duplicate event.


Replies

RE: Duplicate Messages - Added by admin 14 days ago

Hi,

We are looking at the code and notice the following

mobileGateway.EnableMessageNotifications();
mobileGateway.PollNewMessages = true;

The 1st line cause it to check new message by indication, and 2nd line check new message by polling. This will cause inconsistency.

Could you modify it to be like the followings and try again.

Use this

// Status report through message indication
mobileGateway.EnableNewMessageNotification(MessageNotification.StatusReport);

// New received message by polling
mobileGateway.PollNewMessages = true;

If you do not need to receive status report, comment out the 1st line for status report.

You can refer to sample code for more details.

Thanks
Regards
admin