[solved] Unable to receive incoming SMS containing single quote ( ' )

The incoming SMS can be received by the daemon, however not appearing in the inbox.
When setting debug level to 4, I can see the problem:

L4 dba__query # q:INSERT INTO playsms_tblRecvSMS (flag_processed,sms_datetime,sms_sender,message,sms_receiver,smsc) VALUES ('1','2020-12-23 15:30:34','+12345678','Let's go','','gammu')

The single quote in the text body is not being escaped properly. I am using Gammu with playSMS.
Any quick fix for this? Thanks!

Hi,

Text printed on log is stripslashed:

And message received before entering recvsms() is addslashed:

tblRecvSMS is holding all incoming SMS to be procecessed by daemon recvsmsd, and then message will be saved in tblSMSIncoming and if matched with some rule it will also be saved in tblSMSInbox.

See reports, perhaps your message was in Sandbox.

anton

Hi, thanks for the reply!

In that case, then I am not too sure what has gone wrong. Only messages with single quote are not going through still.

The log shows everything is okay as well, i guess? I can confirm that those messages with single quote are not in the Sandbox as well. See the log below when receiving a “Let’s go” message from gammu.

- - 2020-12-24 21:34:16 PID5fe4985743b3e - L3 recvsms # isrecvsmsd:1 dt:2020-12-24 21:33:28 sender:+12345678 m:Let's go receiver: smsc:gammu
- - 2020-12-24 21:34:16 PID5fe4985743b3e - L3 gammu_hook_getsmsinbox # sender:+12345678 receiver: dt:2020-12-24 21:33:28 msg:[] smsc:[gammu]
- - 2020-12-24 21:34:17 PID5fe4985743b3e - L3 recvsmsd # id:63 dt:2020-12-24 21:33:28 sender:+12345678 m:Let's go receiver: smsc:gammu
- - 2020-12-24 21:34:17 PID5fe4985743b3e - L3 recvsms_process # dt:2020-12-24 21:33:28 sender:+12345678 m:Let's go receiver: smsc:gammu
- - 2020-12-24 21:34:17 PID5fe4985743b3e - L3 recvsms_process # unhandled datetime:2020-12-24 21:33:28 sender:+12345678 receiver: message:Let's go
- - 2020-12-24 21:34:17 PID5fe4985743b3e - L3 incoming__recvsms_intercept_after # sandbox to user start u:admin dt:2020-12-24 21:33:28 s:+12345678 r: m:[Let's go]
- - 2020-12-24 21:34:17 PID5fe4985743b3e - L2 recvsms_inbox_add # saving sender:+12345678 receiver: target:admin reference_id:
- - 2020-12-24 21:34:17 PID5fe4985743b3e - L3 incoming__recvsms_intercept_after # sandbox to user end u:admin

This issue can also be reproduced using “Simulate incoming SMS”.

Have you checked sandbox ?

Anton

Yes, I have double checked Sandbox, not inside.

I am using the latest stable build 1.4.3 from github.

Hi,

Try these changes:

Replace your core/recvsms/fn.php with this one:
https://raw.githubusercontent.com/antonraharja/playSMS/9325d3c7d9fd4e81a730aa050c497f8f04ff9f87/web/plugin/core/recvsms/fn.php

After replace restart playSMS daemon before test.

anton

Working perfectly now. Thank you Anton.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.