NetXMS Support Forum

English Support => General Support => Topic started by: joxta on May 16, 2016, 08:40:25 PM

Title: SMS getting sent three times using remote agent
Post by: joxta on May 16, 2016, 08:40:25 PM
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.
Title: Re: SMS getting sent three times using remote agent
Post by: Victor Kirhenshtein on May 27, 2016, 10:46:18 AM
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
Title: Re: SMS getting sent three times using remote agent
Post by: joxta on July 01, 2016, 09:00:52 PM
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.
Title: Re: SMS getting sent three times using remote agent
Post by: Victor Kirhenshtein on July 07, 2016, 12:10:28 PM
Hi,

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

Best regards,
Victor
Title: Re: SMS getting sent three times using remote agent
Post by: joxta on July 07, 2016, 05:14:51 PM
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.