OnMessageReceived is not working properly

Added by milindsaraswala almost 7 years ago

Hi,

I am evaluating your Messaging Tool Kit Core Library. As per your advice I make Windows Service. Application will work like this when message received I am inserting record to SQL Server database. At every 10 sec I am checking database for new record, if arrived then I am processing that message and sending back to the same number.

Now problem is that first time when message arrive above scenario is working very good but on next time when I send message it did not fire MessageReceived event and not inserting record the the database. Can you suggest me what can be the problem. I am attaching the file for more info.


Replies (12)

RE: OnMessageReceived is not working properly - Added by admin almost 7 years ago

Hi,

Please set config.LogLevel to verbose, test it again, and send us the log file.

RE: OnMessageReceived is not working properly - Added by zahidmahmood almost 7 years ago

first connect your gateway then applied other settings like

mobileGateway.EnableNewMessageNotification(MessageNotification.ReceivedMessage Or MessageNotification.StatusReport)
mobileGateway.PollNewMessages = False
mobileGateway.Configuration.DeleteReceivedMessage = True
Diagnostics.EventLog.WriteEntry("AljaleaSMSGateway", "Message settings are applied", EventLogEntryType.Information)

the code is working now

RE: OnMessageReceived is not working properly - Added by milindsaraswala almost 7 years ago

hi admin,

I don't know what magic it has done. Nothing change just I add code config.LogLevel to verbose and tested and it is working like charm. But I will try to test more and if anything happens wrong I will let you know.

RE: OnMessageReceived is not working properly - Added by zahidmahmood almost 7 years ago

please first configuring your device then applied message notification like this

Dim subscribers As Subscriber() = mobileGateway.Subscribers
MessageBox.Show("SMSGateway", "Connected to Gateway successfully")

mobileGateway.EnableNewMessageNotification(MessageNotification.StatusReport)
mobileGateway.PollNewMessages = True
mobileGateway.Configuration.DeleteReceivedMessage = True
MessageBox.Show("SMSGateway", "Message settings are applied")

RE: OnMessageReceived is not working properly - Added by milindsaraswala almost 7 years ago

Hi admin,

As I told we will check and tell you if problem comes.Now I got the problem I make application where every 5 min will check windows service and if it stopp it will send message as per logic it is sending 2 message but actually by your DLL it is more than 2 message. it like sending 10-15 message though we don't gave send sms command

I am attaching application and also log file. Kindly reply it.

RE: OnMessageReceived is not working properly - Added by milindsaraswala almost 7 years ago

This is same problem with another device. It should send only 2 message but it send more than 1 message. Attaching log file with this. I already send 2 replies with 2 different log files. Kindly give the answer as soon as possible.

messagingtoolkit_201003.log - Another log file with new device (69 kB)

RE: OnMessageReceived is not working properly - Added by milindsaraswala almost 7 years ago

This is same problem with another device. It should send only 2 message but it send more than 1 message. Attaching log file with this. I already send 2 replies with 2 different log files. Kindly give the answer as soon as possible.

messagingtoolkit_201003.log - Another log file with new device (69 kB)

RE: OnMessageReceived is not working properly - Added by admin almost 7 years ago

Hi,

Please try with the attached dll.

If you put Send sms in a loop like this, then you should use the "SendToQueue" feature for better performance

While reader.Read()
SendSMS(reader("PhoneNumber"), reader("Message"), reader("MessageID"))
End While

Modem is a serial device and SMS can only be sent 1 by 1. For the attached dll, we have make the sending a synchronized block.

However, if you do not want your app to block, consider using SendToQueue feature

RE: OnMessageReceived is not working properly - Added by milindsaraswala almost 7 years ago

Thanks for you kind reply I will use now SendToQue Method in my application. I have small question SendToQue method in how much time it send message.

RE: OnMessageReceived is not working properly - Added by admin almost 7 years ago

When you call SendToQueue, message is put into a priority message queue and the method returns immediately.

You can set the message priority. Higher priority messages are dequeue faster for sending.

There is a background thread that will do the dequeue and send out the messages through the modem 1 by 1, and raises message sending, sending failed and sent events.

Have a look at the demo code also.

RE: OnMessageReceived is not working properly - Added by milindsaraswala almost 7 years ago

Thanks admin,

I am highly appreciate your replies. As you there is no such support from any other vendor for SMS Service. I have some query like I wanted to ask

  1. Which hardware will most appropriate with your DLL
  2. My intention for asking above what that as if I will Receive SMS more than 1 at a same time than application is firing only 1 OnMessageRecevied Event and rest messages it will ignore other messages.

Can you advice me on that.

RE: OnMessageReceived is not working properly - Added by admin almost 7 years ago

Hi,

The library has been tested using Siemen Mc35i, Falcom, a few model of Nokia, Sony and Motorola phones.

However, receiving SMS through trigger (using +CMT, or +CMTI AT commands) are sometimes not reliable based on our testing. If there is flux of incoming SMS, for some received SMS, the +CMT or +CMTI indicator is not fired by the modem.

In this case, you can try to change to receive incoming SMS through polling, and after receiving the SMS, you can remove the SMS from the SIM or phone by setting delete after receive property to true.

(1-12/12)