[ZBX-9394] SMS sending is broken in 2.4, at least for Teltonika modems Created: 2015 Mar 12 Updated: 2017 May 30 Resolved: 2015 Mar 27 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Server (S) |
Affects Version/s: | 2.4.4 |
Fix Version/s: | 2.4.5rc1, 2.5.0 |
Type: | Incident report | Priority: | Critical |
Reporter: | Filipp Sudanov (Inactive) | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | regression, sms | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Issue Links: |
|
Description |
Before 2.4, multi line action messages were sent to modem separated by LF (\n). In 2.4 they are sent with CR LF (\r\n) line breaks. This breaks SMS sending, at least for Teltonika GSM modem. If it gets multiline alert message, separated by CR LF, it issues another > prompt instead of saying {{+CMGS: }}. Surprisingly GSM standard says that carrige return should be used within SMS message (http://www.etsi.org/deliver/etsi_gts/07/0705/05.03.00_60/gsmts_0705v050300p.pdf p. 56) |
Comments |
Comment by Aleksandrs Saveljevs [ 2015 Mar 25 ] |
Here is the description of the problem. When we send a message, say, "There\r\nis a\r\nproblem.\r\n", we do it in a single call to write(), and then we immediately follow it with ^Z (the end-of-message character). As far as I observed the behavior of the Teltonika modem, it seems to read until the first '\r' character and discards everything after it. So it reads '\r' and issues the "> " prompt correctly as per the quoted specification. However, "\nis a\r\nproblem.\r\n^Z" is all lost and therefore the modem sits waiting for further input, which we do not provide. The solution remains to be decided upon, but in any case, it should CR-aware: either it should remove all CR characters or call write() separately for each line, expecting "> " prompt in return. This depends on whether CR characters really serve as line separators in SMS messages, or their sole purpose is to elicit prompts from the modem. |
Comment by Aleksandrs Saveljevs [ 2015 Mar 25 ] |
Experiments show that CR characters are sent in the SMS. However, it depends on the phone whether they are shown as a line break or not (i.e., whether LF is required). |
Comment by Aleksandrs Saveljevs [ 2015 Mar 25 ] |
Taking into account the above and the fact that most of our alert messages will have CR LF line endings (they are stored that way in the database), it seems to be a good idea to remove CR characters from SMS messages before sending them. This will make them a bit shorter and avoid problems with those "> " prompts. Besides, issues like ZBX-6583 call for a different implementation of SMS sending - either encoding Unicode characters in UCS-2 or the like, or using PDU mode instead of text mode. The latter seems to be required also for |
Comment by Aleksandrs Saveljevs [ 2015 Mar 25 ] |
Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-9394 . |
Comment by Alexander Vladishev [ 2015 Mar 27 ] |
(1) Take a look at my changes in r52903. asaveljevs Looks good. CLOSED. |
Comment by Aleksandrs Saveljevs [ 2015 Mar 27 ] |
Fixed in pre-2.4.5 r52915, pre-2.5.0 (trunk) r52916. |
Comment by Oleksii Zagorskyi [ 2015 Mar 29 ] |
Shouldn't we document it? |
Comment by Oleksii Zagorskyi [ 2015 Mar 29 ] |
ahh, that was a regression, indeed - no needs to document on whatsnew245 |