mfaridmailbox wrote
1) how do we know the IMEI number of the modem from smstools3 ? what files should be read?
When smsd is starting, it tries to read
IMSI from the modem using a command
AT+CIMI. This response is reported on the log using
IMSI: title. If this command is not supported, smsd tries to read IMEI using
AT+CGSN command. In this case IMEI is reported using the same title, IMSI:. Usually, when AT+CIMI is supported, IMSI is reported as it is and IMEI is reported using a title
CGSN:. There is no file where those codes are easily readable, you can extract the data from the log file.
mfaridmailbox wrote
2) I want the web applications that have been made to recognize only one type of smstools version only. so that my application can not be hijacked. have you any idea ?
Please explain "one type of smstools", I did not understand what you meant with it
.
You can of course protect you application using .htaccess, or something else, like a key in the URL.
If you want that only
your application can create valid outgoing files for smstools, you could modify the name of
To: header:
- Define a checkhandler in the smsd.conf.
- In the checkhandler, remove all To: headers which are existing, as they are invalid, and
- rename all
ProtectedTo: headers to
To: headers. This can be done using
formail.
- Continue as usual.
With this kind of change, your application will write destination numbers using
ProtectedTo: header which is secret and hijackers do not know it. Checkhandler will modify the header and files created by hijackers are going to failed because there is no destination defined.
mfaridmailbox wrote
3. How do I view the running status of sms3 from web application ? what files should be read?
You must compile smsd with statistics enabled and stats directory defined. You can then read status with:
$result = file_get_contents("/var/log/smstools/smsd_stats/status");The result is, for example:
Status: 09-11-27 11:59:45, irii--------
SONERA: 09-11-27 11:59:36, Idle, 1234, 1, 123, ssi: -63 dBm, ber: < 0.2 %
ELISA: 09-11-27 11:59:44, Receiving, 2345, 0, 234, ssi: -77 dBm, ber: < 0.2 %
DNA: 09-11-27 11:59:35, Idle, 3456, 0, 345, ssi: -73 dBm, ber: < 0.2 %
SAUNALAHTI: 09-11-27 11:59:35, Idle, 4567, 0, 456, ssi: -77 dBm, ber: < 0.2 %