SMS getting sent three times using remote agent

Started by joxta, May 16, 2016, 08:40:25 PM

Previous topic - Next topic

joxta

Hi,
I have SMS working with my NetXMS installation, but it sends the SMS message three times everytime it sends something (including manually sending from the menu in the console).
It only seems to do this when the SMS modem is on a remote server, using nxagent.sms on the NetXMS server. If I connect the modem directly to the NetXMS server and use generic.sms, it only sends one message via SMS.

Is this a bug? I've tried looking at the agent log with debugging on, and it very clearly sends the message 3 times, but I don't know why.
I can also confirm this is the case with both v1.2.17 and v2.0.3
It's not exactly a deal breaker, but is using my SMS credit three times faster than it should be doing.

All of this is on Windows OS, and all using Huawei E160 modems (I have two different ones).

Thanks,
Mark.

Victor Kirhenshtein

Hi,

server will re-send SMS if driver returns failure. You should see messages like "Failed to send SMS (will retry)" in server's log on debug level 3 and higher. Because SMS is actually sent, most likely agent for some reason cannot get final OK from modem and so considers SMS sending as failure. You can confirm this by setting debug level on agent to 5 and looking for lines starting with text "SMS:".

Best regards,
Victor

joxta

Hi,

I've finally had a chance to investigate a bit further.
The log from the agent sending the SMS is as follows:

[01-Jul-2016 18:43:07.563] [DEBUG] SMS: initialize for port="COM4:9600:8:N:1:T", speed=9600, data=8, parity=NONE, stop=1
[01-Jul-2016 18:43:07.579] [DEBUG] SMS: port opened
[01-Jul-2016 18:43:09.719] [DEBUG] SMS: ReadToOK: readToMark returned 0
[01-Jul-2016 18:43:11.829] [DEBUG] SMS: ATZ sent, got OK
[01-Jul-2016 18:43:13.938] [DEBUG] SMS: ATE0 sent, got OK
[01-Jul-2016 18:47:10.070] [DEBUG] SMS: send to {XXXXXXXXXX}: {test2}
[01-Jul-2016 18:47:12.742] [DEBUG] SMS: ReadToOK: readToMark returned 0
[01-Jul-2016 18:47:14.851] [DEBUG] SMS: ATZ sent, got OK
[01-Jul-2016 18:47:16.960] [DEBUG] SMS: ATE0 sent, got OK
[01-Jul-2016 18:47:19.085] [DEBUG] SMS: AT+CMGF=1 sent, got OK
[01-Jul-2016 18:47:40.084] [DEBUG] SMS: send to {XXXXXXXXXX}: {test2}
[01-Jul-2016 18:47:51.318] [DEBUG] SMS: AT+CMGS + message body sent, got OK
[01-Jul-2016 18:47:53.964] [DEBUG] SMS: ReadToOK: readToMark returned 0
[01-Jul-2016 18:47:56.088] [DEBUG] SMS: ATZ sent, got OK
[01-Jul-2016 18:47:58.198] [DEBUG] SMS: ATE0 sent, got OK
[01-Jul-2016 18:48:00.307] [DEBUG] SMS: AT+CMGF=1 sent, got OK
[01-Jul-2016 18:48:10.119] [DEBUG] SMS: send to {XXXXXXXXXX}: {test2}
[01-Jul-2016 18:48:32.524] [DEBUG] SMS: AT+CMGS + message body sent, got OK
[01-Jul-2016 18:48:35.201] [DEBUG] SMS: ReadToOK: readToMark returned 0
[01-Jul-2016 18:48:37.326] [DEBUG] SMS: ATZ sent, got OK
[01-Jul-2016 18:48:39.436] [DEBUG] SMS: ATE0 sent, got OK
[01-Jul-2016 18:48:41.560] [DEBUG] SMS: AT+CMGF=1 sent, got OK
[01-Jul-2016 18:49:13.778] [DEBUG] SMS: AT+CMGS + message body sent, got OK


To the untrained eye, that looks like the agent is receiving the final OK from the modem, but not until after the server has asked the agent to try again. Is that what is happening? Is there any way to increase the time the server waits for acknowledgement before trying attempt 2 (and 3) ?

Thanks in advance,
Mark.

Victor Kirhenshtein

Hi,

you may try to increase value of server configuration parameter AgentCommandTimeout (it is in milliseconds).

Best regards,
Victor

joxta

Hi Victor,

I've tried changing the server configuration setting AgentCommandTimeout as you suggested, but it doesn't seem to make any difference.

No matter what I set that value to, the server still says the sending SMS failed and requests a second try (and then a third) after 30 seconds. The success appears approximately 41 seconds after the send request.