|
|
SMS Server Tools 3 Community |
Welcome, Guest. The forum is currently read-only, but will open soon. |
Fri Aug 29, 2025 15:52 |
Page: 1
Keywords: Mode: All keywords (AND) |
Wed May 20, 2020 06:43
|
kontrolsson: Hi, yes, thank You for attention and reply! :)
|
Sat Jan 13, 2018 17:22
|
kontrolsson: is this enough?
# tail -f /var/log/smsd.log
2018-01-13 20:23:17,7, GSM1: -> AT+CGMR
2018-01-13 20:23:17,7, GSM1: <- +CGMR: N103.10.02.11.p1, 2017/05/13 16:42
OK
2018-01-13 20:23:17,7, GSM1: # New message indications, list of supported modes:
2018-01-13 20:23:17,7, GSM1: -> AT+CNMI=?
2018-01-13 20:23:17,7, GSM1: <- ERROR
2018-01-13 20:23:17,7, GSM1: # New message indications, current settings:
2018-01-13 20:23:17,7, GSM1: -> AT+CNMI?
2018-01-13 20:23:18,7, GSM1: <- ERROR
2018-01-13 20:23:18,7, GSM1: # Preferred message storage, list of supported mem's:
2018-01-13 20:23:18,7, GSM1: -> AT+CPMS=?
2018-01-13 20:23:18,7, GSM1: <- +CPMS: ("SM", "ME", "SM_P", "ME_P", "MT"), ("SM", "ME", "SM_P", "ME_P", "MT"), ("SM", "ME", "SM_P", "ME_P", "MT")
OK
2018-01-13 20:23:18,7, GSM1: # Phonebook storage, available mem's:
2018-01-13 20:23:18,7, GSM1: -> AT+CPBS=?
2018-01-13 20:23:18,7, GSM1: <- +CPBS: ("ME","SM","LD","MC","RC","FD","DC","ON")
OK
2018-01-13 20:23:18,7, GSM1: # List messages, list of supported stat's:
2018-01-13 20:23:18,7, GSM1: -> AT+CMGL=?
2018-01-13 20:23:18,7, GSM1: <- ERROR
2018-01-13 20:23:18,7, GSM1: # Delete message, list of supported values:
2018-01-13 20:23:18,7, GSM1: -> AT+CMGD=?
2018-01-13 20:23:18,7, GSM1: <- +CMGD: (1-30), (0-4)
OK
2018-01-13 20:23:18,7, GSM1: # Phone activity status, list of supported stat's:
2018-01-13 20:23:18,7, GSM1: -> AT+CPAS=?
2018-01-13 20:23:18,7, GSM1: <- ERROR
2018-01-13 20:23:18,7, GSM1: # TE character set, list of supported charset's:
2018-01-13 20:23:18,7, GSM1: -> AT+CSCS=?
2018-01-13 20:23:18,7, GSM1: <- +CSCS: ("IRA", "GSM", "HEX", "PCCP437", "8859-1", "UCS2", "UCS2_0X81")
OK
2018-01-13 20:23:18,7, GSM1: # TE character set, current setting:
2018-01-13 20:23:18,7, GSM1: -> AT+CSCS?
2018-01-13 20:23:18,7, GSM1: <- +CSCS: "IRA"
OK
2018-01-13 20:23:18,7, GSM1: ## End of device details
2018-01-13 20:23:18,6, GSM1: Checking memory size
2018-01-13 20:23:18,7, GSM1: -> AT+CPMS?
2018-01-13 20:23:18,7, GSM1: Command is sent, waiting for the answer. (5)
2018-01-13 20:23:18,7, GSM1: <- +CPMS: "SM", 0, 30, "SM", 0, 30, "SM", 0, 30 OK
2018-01-13 20:23:18,6, GSM1: Used memory is 0 of 30
2018-01-13 20:23:18,6, GSM1: No SMS received
|
Sat Jan 13, 2018 17:00
|
kontrolsson: Please use the modem setting report_device_details = yes, restart smsd and show those details from the log.
Found couple of errors:
2018-01-13 19:59:29,7, GSM1: # New message indications, list of supported modes:
2018-01-13 19:59:29,7, GSM1: -> AT+CNMI=?
2018-01-13 19:59:29,7, GSM1: <- ERROR
2018-01-13 19:59:29,7, GSM1: # New message indications, current settings:
2018-01-13 19:59:29,7, GSM1: -> AT+CNMI?
2018-01-13 19:59:29,7, GSM1: <- ERROR
Do you have a manual of AT commands for this device?
Found it just day ago, I'll try to find answer there? thank You
|
Sat Jan 13, 2018 16:43
|
kontrolsson: But the delivery report still do not come. Could You point me where i am wrong?
smsd.conf:
{some vars skipped}
report = /var/spool/sms/reports
incoming = /var/spool/sms/incoming
eventhandler = /usr/local/smsd/eh.sh
receive_before_send = yes
[GSM1]
device = /dev/ttyUSB2
incoming = yes
pin = ignore
report=yes
primary_memory = SM
baudrate = 115200
1.sms:
To: 79042144111
Report:yes
Hi Friends.
|
Sat Jan 13, 2018 16:33
|
kontrolsson: self-reply:
everything is simple, CME ERROR 21 means operator's SMS reject because of no money on balance.
I suggest to place it into FAQ :)
|
Sat Jan 13, 2018 15:49
|
kontrolsson: Right now I'm trying to ride a Nokia 105 (idVendor=0421, idProduct=069a) , AFAIU it is finnish-chinese collaboration product based on a Mediatek chip. Still can't catch REPORT events from it and suddenly phone stopped to send messages, saying:
2018-01-13 18:40:07,7, GSM1: -> 0031000B9{...some text skipped....}00B
2018-01-13 18:40:07,7, GSM1: Command is sent, waiting for the answer. (60)
2018-01-13 18:40:10,7, GSM1: <- +CME ERROR: 21 (Invalid index)
2018-01-13 18:40:10,3, GSM1: The modem answer was not OK: +CME ERROR: 21 (Invalid index
could You advise what can be a reason of CME ERROR 21 ? AFAIR i met it on Huawei modems but it was couple years ago and I don't remember how did I cure it %) Could it be caused by text to binary traslation or it is device memory handling error?
|
Thu Jan 11, 2018 22:47
|
kontrolsson: Yes, it works fine with USB-sticks , I have practical experience with 8 farms @ Debian 8 (with 63 modems on each farm), but now the purpose is changed - need to change modem to mobile phone.
|
Thu Jan 11, 2018 20:33
|
kontrolsson: Hello, could You advise couple of cheap GSM phones with traditional micro-USB port to send SMS with smstools?
Does somebody have experience with Nokia 105 SS + smstools ?
Thank You.
|
Mon Jul 04, 2016 12:16
|
kontrolsson: Hello.
Practical daily usage of smsd+set of USB-modems (19 items) shows, that /dev/ttyUSB1 can point to different modem after this modem has been reinserted or inserted into another USB hole at motherboard (usb-hub). Also, 2-port USB-device MODEM_A can occupy /devttyUSB3 and /dev/ttyUSB5 instead of /dev/ttyUSB0+/dev/ttyUSB1.
As a result, we have strong ravel in smsd.conf. Also, keep in mind, that Huawei 3G USB modems have 1 hardware port but 2 software (/dev/ttyUSB) ports.
The only reliable way to uniquely define modem in OS - is its IMEI. Other ways (e.g. udev+ATTRS{serial}) are not reliable and depend on capability of modem to show its serial number. We will create another virtual device with its personal number, a /dev/modemx (which actually is a symlink to /dev/ttyUSBy , interested for us) and set this /dev/modemx as a "device" parameter in section [GSMx] in smsd.conf . List of "IMEI-to-logical name" relations is stored in /etc/udev/rules.d/IDS.lst in following format:
862454021030222 00 modem0
862454021030222 01 modem1
862454021077769 00 modem2
862454021077769 01 modem3
Here is sample of how to link modem to its IMEI and define obtained device in smsd.conf permanently.
We use udev mechanism to catch event of device's insertion/removal:
/etc/udev/rules.d/50.modems.rules:
KERNEL=="ttyUSB*" ACTION=="remove" , RUN+="/etc/udev/rules.d/eventer.sh remove"
KERNEL=="ttyUSB*" ACTION=="add" , RUN+="/etc/udev/rules.d/eventer.sh add"
As we see, during insertion|removal event, OS calls /etc/udev/rules.d/eventer.sh with parameters "add" or "remove". Of couse, this parameter can be replaced with $ACTION environment variable, but let it stay like this. Except $ACTION, udev sets many env vars during insertion|removal, which provide many info about connected device, and eventer.sh user some of them.
Here is eventer.sh , who logs into /etc/udev/rules.d/eventer.log for better debugging. Keep in mind, that udev launches 2 eventer.sh according to number of /dev/ttyUSB's appeared in OS during insertion (for Huawei modem):
#!/bin/bash
dt=`date`
echo $dt Device $DEVNAME, Maker is $ID_VENDOR_FROM_DATABASE was $1 >> /etc/udev/rules.d/eventer.log #simple example of using env vars, pointed to device, provided by udev
if [ "$1" == "add" -a "$SUBSYSTEM" == "tty" ] # if exactly modem has been inserted , not usb-drive etc. To find it out , we take 2 env vars, which have been set just by udev engine. You can take "$ACTION" var instead of $1
then
iam=`whoami`
echo "We do it all under user $iam" >> /etc/udev/rules.d/eventer.log
echo Modem insertion detected >> /etc/udev/rules.d/eventer.log
echo Finding out IMEI for $DEVNAME >> /etc/udev/rules.d/eventer.log
#debug chmod 777 $DEVNAME #you may want to do it or not, it's optional
echo ---Calling "/etc/udev/rules.d/poll_modem.py $DEVNAME | grep IMEI | cut -d " " -f 2 | tr -d \\r\\n" >> /etc/udev/rules.d/eventer.log #here we call special Python script who communicates to modem and asks for IMEI via AT-coomands (listed below)
imei=`/etc/udev/rules.d/poll_modem.py $DEVNAME | grep IMEI | cut -d " " -f 2 | tr -d "\r"`
# is modem didn't answer instantly - we keep trying to poll it
if [ -z $imei ]
then
echo "---IMEI was not found, retry 1..." >> /etc/udev/rules.d/eventer.log
imei=`/etc/udev/rules.d/poll_modem.py $DEVNAME | grep IMEI | cut -d " " -f 2 | tr -d "\r"`
fi
if [ -z $imei ]
then
echo "---IMEI was not found, retry 2..." >> /etc/udev/rules.d/eventer.log
imei=`/etc/udev/rules.d/poll_modem.py $DEVNAME | grep IMEI | cut -d " " -f 2 | tr -d "\r"`
fi
if [ -z $imei ]
then
echo "---IMEI was not found, retry 3..." >> /etc/udev/rules.d/eventer.log
imei=`/etc/udev/rules.d/poll_modem.py $DEVNAME | grep IMEI | cut -d " " -f 2 | tr -d "\r"`
fi
if [ -z $imei ]
then
dt=`date`
echo "$dt +++ERROR+++ IMEI was not found, i give up. Please reinsert modem $ID_VENDOR_FROM_DATABASE. Exit." >> /etc/udev/rules.d/eventer.log
exit
fi
echo "Found IMEI $imei for $DEVNAME">> /etc/udev/rules.d/eventer.log
# as said before, 1 Huawei USB-modem has 2 virtual modems. I use first to send sms via smsd, and second is to get helpful info about modem's life. First one has ID_USB_INTERFACE_NUM=00, second one - ID_USB_INTERFACE_NUM=01. Here I call 00 and 01 "a role".
echo "Finding out role of $DEVNAME (main/help)..." >> /etc/udev/rules.d/eventer.log
echo "---ID_USB_INTERFACE_NUM for $DEVNAME is $ID_USB_INTERFACE_NUM" >> /etc/udev/rules.d/eventer.log
#now we try to make symlink for device
echo "Trying to find device alias for $imei (subdevice $ID_USB_INTERFACE_NUM) in /etc/udev/rules.d/IDS.lst" >> /etc/udev/rules.d/eventer.log
#grepping IDS.lst for IMEI and "role":
alias=`grep $imei /etc/udev/rules.d/IDS.lst | grep $ID_USB_INTERFACE_NUM | cut -d " " -f 3`
if [ -z $alias ]
then
dt=`date`
echo "$dt +++ERROR+++ No record for $imei and $ID_USB_INTERFACE_NUM was found in /etc/udev/rules.d/IDS.lst, check it. Exit." >> /etc/udev/rules.d/eventer.log
exit
fi
echo "Found alias - $alias" >> /etc/udev/rules.d/eventer.log
#set symlink in OS
echo "Setting alias in OS..." >> /etc/udev/rules.d/eventer.log
echo "---Executing ln -s $DEVNAME /dev/$alias" >> /etc/udev/rules.d/eventer.log
ln -s $DEVNAME /dev/$alias
echo "Done. All finished. Exit." >> /etc/udev/rules.d/eventer.log
fi
###action if modem is removed. We need to remove earlier created symlinks
if [ "$1" == "remove" -a "$SUBSYSTEM" == "tty" ]
then
dt=`date`
echo "$dt $DEVNAME Device has been removed" >> /etc/udev/rules.d/eventer.log
dt=`date`
echo "$dt $DEVNAME Finding symlink for this device and removing it (them)..." >> /etc/udev/rules.d/eventer.log
ls -l /dev/modem* | tr "\n" ";" | sed -e s/";"/";\n"/g | grep "$DEVNAME;" | ls -l /dev/modem* | tr "\n" ";" | sed -e s/";"/";\n"/g | grep "$DEVNAME;" | cut -d "/" -f 2,3 | cut -d " " -f 1 | sed -e s/"dev"/"\/dev"/g | xargs rm
dt=`date`
echo "$dt $DEVNAME Removing done." >> /etc/udev/rules.d/eventer.log
fi
Important part of this process is a Python script which polls modem, sending there ATI command and reading output with IMEI. Python has been selected after trying:
* bash+minicom - failed. (minicom -D /dev/ttyUSB0 -S poll.min -C /tmp/result.txt writes empty
/tmp/result.txt)
* bash+socat - failed. unpredictable output.
* php - failed. (php_dio.so extension unstable works in my PHP 5.4-5.6)
don't forget to install pyserial module.
poll_modem.py:
#!/usr/bin/python
import serial
import sys
#print 'Num of parameters passed '+str(len(sys.argv))
if len(sys.argv) < 2:
print('No modem path specified. Use '+sys.argv[0]+' /dev/ttyUSBx')
print('Exit')
sys.exit()
#print 'Polling '+sys.argv[1]
try:
ser = serial.Serial(sys.argv[1],9600,dsrdtr=True,rtscts=True) #Mandatorily set dsrdtr=True,rtscts=True. In case of unsetting them, You can get successfull polling /dev/ttyUSB0, but failed /dev/ttyUSB1
except:
sys.exit("ERROR. Unable to open "+sys.argv[1]+' at speed 115200')
#print ser.isOpen()
ser.write("ATI1\r")
response = ser.read(100)
print response
ser.close()
Now, as a result, we can 1 000 times reinsert modem with IMEI 1111111 into different holes in M/B or USB-hub, reboot server 10000 times - device with IMEI 1111111 will always be /dev/modem1
|
Wed Jun 08, 2016 15:31
|
kontrolsson: Hello, as promised - here is code part for handle multipart messages and get delivery report for each part in /var/spool/sms/reports. Maybe somebody finds it useful.
//input data:
//mysql table sms_turn contains sms message with record id ("id_turn" field), phone and body.
//mysql table sms_state_final contains splitted sms message (split algoritm is made on 3rd party, not here): 1 part = 1 record
//records here are linked thru id: sms_turn.id_turn links to sms_state_final.id_sms
//$spoolpath is set to /var/spool/sms/queue
//directory /var/spool/sms/queue contains dirs GSM1 GSM2 GSM3... - the same as modem names in smsd.conf
//(c) Dmitry L, Alexander Sh.
//sms-file template:
//To: +79092345555
//Modem: GSM2
//UDH: true
//UDH-DATA: 05 00 03 5F 02 01
//IMSI: 250202101644965
//Menya zovut E-Type! Na zdorovye!!!
//main program started
function RandomString() { //sms-filename generator
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randstring = '';
for ($i = 0; $i < 20; $i++) {
$randstring = $randstring . $characters[rand(0, strlen($characters) - 1)];
}
return $randstring;
}
//!sms-filename generator
//for multi-modem station you need to write sub-routine here which chooses modem for sending.
//Pay attention, that if you have multipart message - all parts must go thru the same modem.
//as a result, $selectedroute must have value with modem name from smsd.conf
echo " Modem chosen:" . $selectedroute . "\n";
echo "Found " . $partscount . " parts of message with id_turn=" . $currentsmsid . "\n";
//sms-file forming 1
$ipart = 1;
$udhstringwspaces = "";
// we decided not to set MSG indicator more than FF, because len of UDH must be 5, not more (for russian operators)
//so 1 multi-part sms must have the same ID (4th byte in UDH header) as all its children parts
$udhpartid = strtoupper(dechex(rand(1, 255)));
while ($row = $resultpc->fetch_assoc()) { //ipart
if ($partscount > 1) {
$filename = $queuerootpath . "/" . $selectedroute . "/" . RandomString();
} else {
//Hindussian code on
$filename = $spoolpath . "/" . RandomString();
$filename = $queuerootpath . "/" . $selectedroute . "/" . RandomString();
//Hindussian code off
}
echo " Writing sms-file" . $filename . " for record with id_state=" . $row["id_state"] . "\n";
echo " Modem chosen:" . $selectedroute . "\n";
$fp = fopen($filename, "wt");
fwrite($fp, "To: +" . $currentphone . "\n");
fwrite($fp, "Report: yes\n");
fwrite($fp, "X-turn-msgid: " . $currentsmsid . "\n");
fwrite($fp, "X-state-partid: " . $row["id_state"] . "\n");
if ($partscount > 1) { //do not put UDH if we process 1-segment (not multisegment) sms
echo " As it is multi-segment sms - we put UDH.\n";
fwrite($fp, "UDH: true\n");
//UDH forming
//UDH forming
//$udhpartid=strtoupper(dechex($row["id_sms"]));
$udhpartscount = strtoupper(dechex($partscount));
$udhipart = strtoupper(dechex($row["part_no"]));
if ((strlen($udhpartid) % 2 != 0) || (strlen($udhpartid) == 1)) {
$udhpartid = '0' . $udhpartid;
}
if ((strlen($udhpartscount) % 2 != 0) || (strlen($udhpartscount) == 1)) {
$udhpartscount = '0' . $udhpartscount;
}
if ((strlen($udhipart) % 2 != 0) || (strlen($udhipart) == 1)) {
$udhipart = '0' . $udhipart;
}
$len2 = dechex(intval(strlen($udhpartid . $udhpartscount . $udhipart) / 2));
if ((strlen($len2) % 2 != 0) || (strlen($len2) == 1)) {
$len2 = '0' . $len2;
}
$lentot = dechex(intval(strlen("00" . $len2 . $udhpartid . $udhpartscount . $udhipart) / 2));
if ((strlen($lentot) % 2 != 0) || (strlen($lentot) == 1)) {
$lentot = '0' . $lentot;
}
$udhstring = $lentot . "00" . $len2 . $udhpartid . $udhpartscount . $udhipart;
echo " Unformatted UDH string is " . $udhstring;
for ($i2 = 0; $i2 < strlen($udhstring); $i2++) { //formatting UDH with spaces
$udhstringwspaces = $udhstringwspaces . $udhstring[$i2];
if (($i2 + 1) % 2 == 0) {
$udhstringwspaces = $udhstringwspaces . " ";
}
} //!formatting UDH with spaces, needed practically
echo ", or human-readable " . $udhstringwspaces . "\n";
fwrite($fp, "UDH-DATA: " . $udhstringwspaces . "\n");
//!UDH forming
//!UDH forming
}
//for non-latin sms, you have to write routine which finds out encoding and puts in into sms-file
//for example, you can use standard php mb_detect_encoding() function
//as a result, you must have in $msgenc variable a value of obtained encoding, UCS or Latin
echo " Writing into SMS file header Alphabet: " . $msgenc . "\n";
fwrite($fp, "Alphabet: " . $msgenc . "\n\n");
//write encoded in appropriate encoding text into sms-file
fwrite($fp, $text);
//!write encoded in appropriate encoding text into sms-file
if (!fclose($fp)) {
echo "!!! ERROR during save sms-file, exiting";
exit;
}
$ipart++;
$udhstringwspaces = "";
} //while ipart
//! sms-file forming
} //of WHILE of Processing 1 line from array
echo "Done genetaring sms-files.\n";
//don't forget to clear all file and query handles and close all unused connctions
//main program stops
|
Tue May 24, 2016 16:58
|
kontrolsson: Modems never use outgoing directory, it is only handled by the main spooler.
yes, i was mistaken in message, i meant "checked" dir.
And tell please, will it be critically erroneous if i put such sms-file:
To: +79042144580
Report: yes
UDH: true
UDH-DATA: 05 00 03 4D 02 01
Alphabet: Latin
text here text here text here text here text here text here
directly into /var/spool/sms/queues/GSM1 ? As we see, It has no message_id header, is it important? For example , messages sent by this way, in "sent" directory already have "message_id" header.
|
Tue May 24, 2016 09:27
|
kontrolsson: Operating system name and version: Centos 7 x86_64
Version of smsd: 3.1.15
Smsd installed from: sources
Name and model of a modem / phone: MTS 423s (Huawei E3531s)
Interface: USB
Could You tell if it is some workaround for situation except modifying source of smsd:
devices = GSM* 1-7
outgoing = /var/spool/sms/outgoing
checked = /var/spool/sms/checked
incoming = /var/spool/sms/incoming
failed = /var/spool/sms/failed
sent = /var/spool/sms/sent
report = /var/spool/sms/reports
logfile = /var/log/smsd.log
infofile = /var/run/smstools/smsd.working
pidfile = /var/run/smstools/smsd.pid
stats = /var/log/smstools/smsd_stats
loglevel = 7
receive_before_send = yes
autosplit = 3
eventhandler = /var/www/sms/data/farm/engine/statuser.php
errorsleeptime = 2
[queues]
GSM1 = /var/spool/sms/queues/GSM1
GSM2 = /var/spool/sms/queues/GSM2
GSM3 = /var/spool/sms/queues/GSM3
GSM4 = /var/spool/sms/queues/GSM4
GSM5 = /var/spool/sms/queues/GSM5
GSM6 = /var/spool/sms/queues/GSM6
GSM7 = /var/spool/sms/queues/GSM7
[GSM1]
init = ATZ
device = /dev/modem0
smsc = 79042140000
baudrate = 115200
primary_memory = SM
report = yes
incoming = yes
outgoing = no
queues=modemname
#sections GSM2-8 are similar
After restart smsd I get:
Queues are used, but GSM1 is not served by any modem. Modem GSM1 have outgoing disabled.
How to start smsd but disable outgoing on separate modem? I've tried:
1. Remove GSM1 from [queues] and remove queues=modemname from [GSM1]. Result is "Queues are used, but GSM1 has no queue(s) defined."
2. Remove GSM1 from [queues] and add outgoing=yes to [GSM1]. Result is "Queues are used, but GSM1 has no queue(s) defined."
3. Remove GSM1 from [queues] and add queues=modemname to [GSM1]. Obvously, fail - Queue GSM1 not found for device GSM1.
4. Set GSM1 = /var/spool/sms/queues/fakeGSM1 (exists, but always empty) and outgoing=yes. In this case, IMHO, GSM1 will look into /var/spool/sms/outgoing (as it is set in header of config) and take sms-files from there and send them because he has outgoing=yes.
5. Do not enumerate GSM1 in "devices" variable in header and remove GSM1 from queues. But it will completely remove modem from engine and disable incoming sms on it.
How to work around? To disable sms-sending via GSM1, keep queues in configuration and start smsd without errors without modifying source of smsd:?
Thank You in advance.
|
Tue May 24, 2016 09:06
|
kontrolsson: Keke, i made multipart processing on php, but have no time to beautify sample source and put it here. Maybe in couple of days , i'll try.
|
Fri May 13, 2016 21:07
|
kontrolsson: I have thought about UDH too, I'll try to write here my sample code about it if I can win it, maybe somebody needs it.
|
Wed May 11, 2016 19:55
|
kontrolsson: Operating system name and version: Centos 7 x86_64
Version of smsd: 3.1.15
Smsd installed from: sources
Name and model of a modem / phone: MTS 423s (Huawei E3531s)
Interface: USB
How to run eventhander after every part of long multipart message is sent? Now it is executed after last part is sent.
|
Mon Apr 18, 2016 17:03
|
|
Mon Apr 18, 2016 16:54
|
kontrolsson: Operating system name and version: Centos 7 x86_64
Version of smsd: Version 3.1.15
Smsd installed from: sources
Name and model of a modem / phone: MTS 423s (Huawei E3531s)
Interface: USB
Tell please, what causes delay after CMS ERROR 302? Modem or it is artificially inside code (I didn't found the last one)? And how to minimize it?
2016-04-18 19:50:38,7, GSM2: -> AT+CMGR=10
2016-04-18 19:50:38,7, GSM2: Command is sent, waiting for the answer
2016-04-18 19:50:38,7, GSM2: <- +CMS ERROR: 500 (Unknown error)
2016-04-18 19:50:38,6, GSM2: Changing memory
2016-04-18 19:50:38,7, GSM2: -> AT+CPMS="SR"
2016-04-18 19:50:38,7, GSM2: Command is sent, waiting for the answer
2016-04-18 19:50:39,7, GSM2: <- +CMS ERROR: 302 (Operation not allowed)
2016-04-18 19:50:39,3, GSM2: The modem said ERROR while trying to change memory to SR
<...................delay...............>
2016-04-18 19:50:49,6, GSM2: Checking device for incoming SMS
2016-04-18 19:50:49,6, GSM2: Checking if modem is ready
2016-04-18 19:50:49,7, GSM2: -> AT
2016-04-18 19:50:49,7, GSM2: Command is sent, waiting for the ans
|
Tue Apr 12, 2016 19:02
|
kontrolsson: there is one more variant of solution i have, but if given solution will be OK - so ok :)
|
Tue Apr 12, 2016 09:20
|
kontrolsson: TMM, it is possible to do this way:
devices = GSM* 1-2
outgoing = /var/spool/sms/outgoing
checked = /var/spool/sms/checked
incoming = /var/spool/sms/incoming
failed = /var/spool/sms/failed
sent = /var/spool/sms/sent
logfile = /var/log/smsd.log
infofile = /var/run/smstools/smsd.working
pidfile = /var/run/smstools/smsd.pid
stats = /var/log/smstools/smsd_stats
loglevel = 7
receive_before_send = no
autosplit = 3
report=/var/spool/sms/reports
[GSM1]
init=ATE0
device = /dev/modem0
smsc = 79042140000
baudrate = 9600
primary_memory = SM
secondary_memory = SR
report=no
incoming=no
[GSM2]
init=ATE0
device = /dev/modem1
smsc = 79042140000
baudrate = 9600
primary_memory = SM
secondary_memory = SR
report=yes
incoming=yes
in sms-file in foder /var/spool/sms/outgoing set route like this:
To: +79042144580
Modem: GSM2
Report: yes
Alphabet: UCS
Hello,friends!
so , theoretically, such sms with strictly set modem: variable must go to world via GSM2 only.
|
Tue Apr 12, 2016 05:01
|
kontrolsson: Good day, You had 1 modem on server and now connected another one without disconnecting first one?
|
Mon Apr 11, 2016 13:58
|
kontrolsson: Operating system name and version: Centos 7 x86_64
Version of smsd: Version 3.1.15
Smsd installed from: sources
Name and model of a modem / phone: MTS 423s (Huawei E3531s)
Interface: USB
Good day, could You help me with multi-modem config?
I have server with 4 equal modems (in config are 8 described, but really 4 are inserted). Practically I got aggregate time of 4 sms send is 14 sec. Send time of 1 separate sms is 4-6 sec. How to reach aggregate time 4-6 sec spent for sending 4 sms?
my smsd.conf:
devices = GSM* 1-8
outgoing = /var/spool/sms/outgoing
checked = /var/spool/sms/checked
incoming = /var/spool/sms/incoming
logfile = /var/log/smsd.log
infofile = /var/run/smstools/smsd.working
pidfile = /var/run/smstools/smsd.pid
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
stats = /var/log/smstools/smsd_stats
loglevel = 7
receive_before_send = no
autosplit = 3
report=/var/spool/sms/reports
eventhandler=/var/www/html/statuser.php
[queues]
main = /var/spool/sms/queue
[GSM1]
queues=main
init=ATE0
device = /dev/modem0
smsc = 79042140000
baudrate = 9600
primary_memory = SM
secondary_memory = SR
report=yes
incoming=yes
[sections GSM2..8] are equal, only "device =" is changed to appropriate.
my top status:
ps ax | grep sms
18809 ? Ss 0:00 /usr/local/bin/smsd -n MAINPROCESS -p/var/run/smsd.pid -i/var/run/smsd.working -l/var/log/smsd.log
18811 ? S 0:00 /usr/local/bin/smsd -n GSM1_______ -p/var/run/smsd.pid -i/var/run/smsd.working -l/var/log/smsd.log
18812 ? R 0:00 /usr/local/bin/smsd -n GSM2_______ -p/var/run/smsd.pid -i/var/run/smsd.working -l/var/log/smsd.log
18813 ? S 0:00 /usr/local/bin/smsd -n GSM3_______ -p/var/run/smsd.pid -i/var/run/smsd.working -l/var/log/smsd.log
18814 ? S 0:00 /usr/local/bin/smsd -n GSM4_______ -p/var/run/smsd.pid -i/var/run/smsd.working -l/var/log/smsd.log
18815 ? S 0:00 /usr/local/bin/smsd -n GSM5_______ -p/var/run/smsd.pid -i/var/run/smsd.working -l/var/log/smsd.log
18816 ? S 0:00 /usr/local/bin/smsd -n GSM6_______ -p/var/run/smsd.pid -i/var/run/smsd.working -l/var/log/smsd.log
18817 ? R 0:00 /usr/local/bin/smsd -n GSM7_______ -p/var/run/smsd.pid -i/var/run/smsd.working -l/var/log/smsd.log
18818 ? S 0:00 /usr/local/bin/smsd -n GSM8_______ -p/var/run/smsd.pid -i/var/run/smsd.working -l/var/log/smsd.log
my 4 sms sending log:
tail -f /var/log/smsd.log | grep "queue\|SMS sent"
2016-04-11 16:26:36,6, GSM4: I have to send 1 short message for /var/spool/sms/queue/BzUdswa5xL9eKrMRMK0e
2016-04-11 16:26:42,6, GSM8: I have to send 1 short message for /var/spool/sms/queue/deC7M97SsgcvRkqfbmR5
2016-04-11 16:26:42,5, GSM4: SMS sent, Message_id: 133, To: 790421445XX, sending time 6 sec.
2016-04-11 16:26:43,6, GSM4: Moved file /var/spool/sms/queue/BzUdswa5xL9eKrMRMK0e to /var/spool/sms/sent/BzUdswa5xL9eKrMRMK0e
2016-04-11 16:26:43,6, GSM4: I have to send 1 short message for /var/spool/sms/queue/k3B7VnRVCUixGUAT47Lc
2016-04-11 16:26:43,6, GSM7: I have to send 1 short message for /var/spool/sms/queue/mUMC2caxS78r1mUyx05i
2016-04-11 16:26:45,5, GSM4: SMS sent, Message_id: 134, To: 790365415XX, sending time 2 sec.
2016-04-11 16:26:45,6, GSM4: Moved file /var/spool/sms/queue/k3B7VnRVCUixGUAT47Lc to /var/spool/sms/sent/k3B7VnRVCUixGUAT47Lc
2016-04-11 16:26:48,5, GSM8: SMS sent, Message_id: 102, To: 795186390XX, sending time 6 sec.
2016-04-11 16:26:48,6, GSM8: Moved file /var/spool/sms/queue/deC7M97SsgcvRkqfbmR5 to /var/spool/sms/sent/deC7M97SsgcvRkqfbmR5
2016-04-11 16:26:50,5, GSM7: SMS sent, Message_id: 112, To: 792045377XX, sending time 7 sec.
2016-04-11 16:26:50,6, GSM7: Moved file /var/spool/sms/queue/mUMC2caxS78r1mUyx05i to /var/spool/sms/sent/mUMC2caxS78r1mUyx05i
|
Thu Mar 17, 2016 06:30
|
kontrolsson: Operating system name and version: Debian Lenny x86
Version of smsd: 3.1.15
Smsd installed from: sources
Name and model of a modem / phone: ZTE (model number is unable to find)
Interface: USB
As far as i have understood from here, there are 2 ways to send message via USB modem:
1. using AT+CMGS соmmand, when a sms text and number are pushed straight into modem.
2. using AT+CMSS, when text and number are placed into modem internal memory and, after that, message can be sent using pointer to its index in storage.
So questions are:
1. Which way of these two is faster for sending bulk sms sendings if i need to send set of inequal texts? Use +CMGS or use sequence of [+CMGW, +CMSS, +CMGD] ?
2. During +MGS usage i got 4-12 sec delay (here is 12 sec delay). What is delay caused by?
2016-03-17 02:58:43,7, GSM1: -> 0031000B919740124485F00008FF27043F04400438043204350442043E043A002D043F0435044204430448043E043A002000325C620A.
2016-03-17 02:58:43,7, GSM1: Command is sent, waiting for the answer
2016-03-17 02:58:54,7, GSM1: <- +CMGS: 14 OK
|
Page: 1
Time in this board is UTC.
|
|
|
 |
|
 |
|