SMS Server Tools 3
This site is hosted by Kekekasvi.com
 Menu
Basic information:
Additional information:
Support:
Get SMS Server Tools 3:
Additional Options

 Sponsored links

 Search
Custom Search

 Visitor locations
 
 SMS Server Tools 3 Community
Welcome, Guest. Please login or register. Sun May 19, 2024 20:34
SMSTools3 Community » Help and support Bottom

[changed in 3.1.6] how to read reguler_run file from web application ?

  This topic is locked

Page:  1

Author Post
Member
Registered:
Sep 2009
Location: east java, Indonesia
Operating system name and version: ubuntu 8.04
Version of smsd: 3.1.5
Smsd installed from: sources / package repository / from elsewhere...
Name and model of a modem / phone: sierra 815U
Interface: USB

hi, expert,
I have created web application with PHP and smstools3. smstools3 is great sms gateway. easy and simple. I have a problem when I tried to read my regular_run_statfile from my web aplication. I've changed file mode of reguler_run_statfile with 777, but when smsd refresh and create this file again, this file back to old mode. mode of reguler_run_statfile : -rw-r--r-- 1 root root.

this is my smsd.conf :
devices = GSM1
logfile = /var/log/smsd.log
loglevel = 7
failed = /var/spool/sms/failed
incoming = /var/spool/sms/incoming
report = /var/spool/sms/report
sent = /var/spool/sms/sent
#delaytime = 60

[GSM1]

#init = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
#init = ATE0+CPMS="SM"+CNMI=2,0,0,2,1
device = /dev/ttyUSB3
incoming = yes
outgoing = yes
report = yes
#pin =
baudrate = 115200
regular_run_interval = 60
regular_run_cmd = AT+CUSD=1,"*388#",15
regular_run_statfile = /var/spool/sms/reguler_run_statfile

how to file canreguler_run_statfile be read with a web application?
thanks

regard

farid

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
As you want to just read (not write or append) the file, mode 644 is enough. Probably you have tried to open it with write permission, which will fail.

For example this simple PHP script can read the content of a file:



Member
Registered:
Sep 2009
Location: east java, Indonesia
Topic owner
thanks keke for your answer.
I've changed reguler_run_statfile permission with 644. I have can read this file from web application, but 1 minute later this file can not be read again.
error message on browser :
All content:

Warning: file_get_contents(/var/spool/sms/reguler_run_statfile) [function.file-get-contents]: failed to open stream: Permission denied in /var/www/tesphp/view.php on line 6

when i checked on terminal, file permission have changed into -rw-r-----. how to changed reguler_run_statfile with permission 644 permanently ?

regard

farid

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Ok, I checked this from sources and there is mode 640 used as a fixed value.

You could modify the sources. Edit file smsd.c and find the line:

if ((fd = open(DEVICE.dev_rr_statfile, O_APPEND|O_WRONLY|O_CREAT, 0640)) >= 0)

Change it to:

if ((fd = open(DEVICE.dev_rr_statfile, O_APPEND|O_WRONLY|O_CREAT, 0644)) >= 0)

I will include this fix in the next version.

Member
Registered:
Sep 2009
Location: east java, Indonesia
Topic owner
thanks keke, its work !!!

regard


farid

  This topic is locked

Page:  1

SMSTools3 Community » Help and support Top

 
Time in this board is UTC.  

Privacy Policy   SMS Server Tools 3 Copyright © Keijo Kasvi.