playSMS Forum

Possibly a bug!

I might have found a bug in /plugin/gateway/smstools/fn.php

When giving the queue path for smstools, the outgoing folder is not correctly specified in fn.php around line 276
It is
$fn = $plugin_config[‘smstools’][‘queue’] . ‘/’ . $outfile;
but should be:
$fn = $plugin_config[‘smstools’][‘queue’] . ‘/outgoing/’ . $outfile;

No its not. The queue is defined in smsc menu.


I am unsure, because I had trouble with that and after I looked at the code, I could se that was missing.

I am using smstools with the following queues in conf.
outgoing = /var/spool/sms/outgoing
checked = /var/spool/sms/checked
failed = /var/spool/sms/failed
incoming = /var/spool/sms/incoming
sent = /var/spool/sms/sent
report = /var/spool/sms/report
stats = /var/spool/sms/stats

and in playsms smsc I configured the queue to be:

So in playsms smsc it should automatically find the right folder for different processing.
If recieved then /var/spool/sms/incoming
if sending then /var/spool/sms/outgoing

My problem was that if in smsc I configure queue to be:
then folders will get wrong paths:
$plugin_config[‘smstools’][‘default_queue’] . ‘/sent’
$plugin_config[‘smstools’][‘default_queue’] . ‘/failed’
$plugin_config[‘smstools’][‘default_queue’] . '/incoming’

where $plugin_config[‘smstools’][‘default_queue’] is my specified path in smsc menu, right?

if your outgoing spool is /var/spool/sms/outgoing then use that in queue directory option in SMSC config

default queue is configured from gateway menu, not SMSC, and defaulted to /var/spool/sms, not following setting on SMSCs

please try to set the queue directory on SMSC (that added from smstools) to your outgoing spool dir (in your case /var/spool/sms/outgoing and then test


I’ve still have the same error too:

Already changed SMSC (smstools) default queue to /var/spool/sms/outgoing and made playsmsd restart!

- - 2020-09-24 20:06:12 PID5f6cfc34bc586 - L3 smstools_hook_sendsms # enter smsc:smstools smslog_id:13 uid:1 to:351xxxxxxxxx
- - 2020-09-24 20:06:12 PID5f6cfc34bc586 - L3 smstools_hook_sendsms # saving outfile:/var/spool/sms/out.20200924190612.0.1.13 smsc:[smstools]
- - 2020-09-24 20:06:12 PID5f6cfc34bc586 - L2 smstools_hook_sendsms # saved outfile:/var/spool/sms/out.20200924190612.0.1.13 smsc:[smstools]

change the default queue from SMSC option, not the gateway option

the gateway option set default to /var/spool/sms, and to override that you must set on SMSC menu

I think thats what it is in the code:


Hello Anton, thanks for your quick answer!

At smstools config it seems everything right:

and, in config.php at /var/www/html/playsms/plugin/gateway/smstools
here’s a copy

if (!$plugin_config[‘smstools’][‘default_queue’]) {
$plugin_config[‘smstools’][‘default_queue’] = “/var/spool/sms”;

I’ve restarted all the system! Here is the playsms log!

2020-09-25 10:45:47 PID5f6dca5af2364 - L2 sendsms_process # saved smslog_id:16 id:16

    • 2020-09-25 10:45:47 PID5f6dca5af2364 - L3 sendsms # final smslog_id:16 gw:smstools smsc:smstools message:Bom dia! len:14
    • 2020-09-25 10:45:47 PID5f6dca5af2364 - L3 smstools_hook_sendsms # enter smsc:smstools smslog_id:16 uid:1 to:351xxxxxxxxx
    • 2020-09-25 10:45:47 PID5f6dca5af2364 - L3 smstools_hook_sendsms # saving outfile:/var/spool/sms/out.20200925094547.0.1.16 smsc:[smstools]
    • 2020-09-25 10:45:47 PID5f6dca5af2364 - L2 smstools_hook_sendsms # saved outfile:/var/spool/sms/out.20200925094547.0.1.16 smsc:[smstools]
    • 2020-09-25 10:45:47 PID5f6dca5af2364 - L3 dlr # isdlrd:1 smslog_id:16 p_status:0 uid:1
    • 2020-09-25 10:45:47 PID5f6dca5af2364 - L2 simplerate_hook_rate_deduct # enter smslog_id:16

Change the queue dir in SMSC option in gateway menu

I dont have the screenshot but please check gateway menu, theres SMSC tabs or menus

Dont change anything on files


SOLVED! It’s working!
As you said, one thing is the Gateway (/var/spool/sms/) and other thing is SMSC (/var/spool/sms/outgoing/)

Thanks Anton!

Someday I’ll fix that messed up menus :))


1 Like

been strugling with permissions!
Im running a 1.4.3 version, and the playsmsd is started by playsms user, and the whole /var/spool/sms directory is 777.
The sms are coming as playsms user in modem1!
do I need to start the script as www-data or playsms?
The messages are always with orange/pending and not going through!