|
|
SMS Server Tools 3 Community |
Welcome, Guest. The forum is currently read-only, but will open soon. |
Thu Mar 13, 2025 17:04 |
Page: 1
Keywords: Mode: All keywords (AND) |
Fri Apr 03, 2020 14:40
|
jmpatagonia: resolved , problem on folder permissions!!!!
|
Fri Apr 03, 2020 13:36
|
jmpatagonia: Operating system >Ubuntu 10.04 LTS
Smstools3 version 3.1.3
Installed from apt-get
Modem Huawey E220
Hello I have a problem, the smstool3 work propertly, but the evenhandler not start never.
Receip, and send SMS work fine, but the eventhandler never start, on the log I dont see any call to evenhandler.
For the start a make a simple script "evenhandler" that do a echo "test" > /tmp/file.txt
lines on smsd.conf
eventhandler = /smsgateway/smstools3/scripts/smsevent
Can activate any log, trace, debug ??
Regards.
|
Thu Nov 01, 2012 17:03
|
jmpatagonia: ubuntu 10.04, on Sun V250, a sparc platform
Smsd v3.1.3
HUAWEI
Interface : USB
I have a problem: when i try tou se the eventhandler option, dont work, the problem is that the smsd dont call the script.
I start the smsd with the param eventhandler and empy value for the file, and error ocuur, later start the smsd with a eventhandler and a value of a valid script, and start. But when send o recive message , the smsd never call my script. To probe that I remove my script, later to start the eventhandler, and nothing happend on the log, send and recive and no call to my script.
smsd.conf
devices = GSM1
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
eventhandler = /smsgateway/smstools3/scripts/evento_accion2
loglevel = 7
alarmlevel = 4
delaytime = 10
errorsleeptime = 10
blocktime = 3600
receive_before_send = no
Ragards
|
Wed Dec 09, 2009 13:12
|
jmpatagonia: Hello keke
First I change the memory_start to 0 and the error 321 dissapear , thanks.
Second: I do the following:
Put a "echo hello "at the top of my scripts regular_run and eventhandler and this work fine, when each regular_run run the echo message work.
So I think that my script sql not work propertly. Start working at the beginning, but later stop. May I recreate this script on the DB side.
For the momment I have no plan to upgrade to version 3.1.6, I think this is not necessary for the momment, whats you think about ?
Other question: When query the database to pick up a message and create a file to send SMS where I have put my file to send, in checked folder or outgoing folder ?
Regards
Juan Manuel.
|
Mon Dec 07, 2009 14:35
|
jmpatagonia: keke thanks for reply soo fast
This is a copy of my smsd.conf
root@klingon:/smsgateway/smstools3/scripts# cat /etc/smsd.conf
# Example smsd.conf. Read the manual for a description
# This sample configuration is no more updated.
# See the manual for all possible configuration settings.
devices = GSM1
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
loglevel = 7
alarmlevel = 4
delaytime = 10
errorsleeptime = 10
blocktime = 3600
receive_before_send = no
autosplit = 3
eventhandler = /smsgateway/smstools3/scripts/oracle_insert
stats = /smsgateway/smstools3/stats
pidfile="/var/run/smsd.pid"
regular_run = /smsgateway/smstools3/scripts/regular_run_new
regular_run_interval = 30
[GSM1]
init = AT+CPMS="SM","SM","SM"
device = /dev/ttyUSB0
incoming = yes
mode = new
baudrate = 19200
rtscts = yes
cs_convert = yes
report = no
memory_start = 1
This is a extract of the log /var/log/smsd.log
2009-12-07 11:22:11,6, GSM1: Checking device for incoming SMS
2009-12-07 11:22:11,6, GSM1: Checking if modem is ready
2009-12-07 11:22:11,7, GSM1: -> AT
2009-12-07 11:22:11,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:12,7, GSM1: <- OK
2009-12-07 11:22:12,6, GSM1: Pre-initializing modem
2009-12-07 11:22:12,7, GSM1: -> ATE0+CMEE=1
2009-12-07 11:22:12,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:12,7, GSM1: <- OK
2009-12-07 11:22:12,6, GSM1: Initializing modem
2009-12-07 11:22:12,7, GSM1: -> AT+CPMS="SM","SM","SM"
2009-12-07 11:22:12,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:12,7, GSM1: <- +CPMS: 1,35,1,35,1,35 OK
2009-12-07 11:22:12,6, GSM1: Checking if Modem is registered to the network
2009-12-07 11:22:12,7, GSM1: -> AT+CREG?
2009-12-07 11:22:12,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:13,7, GSM1: <- +CREG: 0,1 OK
2009-12-07 11:22:13,6, GSM1: Modem is registered to the network
2009-12-07 11:22:13,6, GSM1: Selecting PDU mode
2009-12-07 11:22:13,7, GSM1: -> AT+CMGF=0
2009-12-07 11:22:13,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:13,7, GSM1: <- OK
2009-12-07 11:22:13,6, GSM1: Checking memory size
2009-12-07 11:22:13,7, GSM1: -> AT+CPMS?
2009-12-07 11:22:13,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:13,7, GSM1: <- +CPMS: "SM",1,35,"SM",1,35,"SM",1,35 OK
2009-12-07 11:22:13,6, GSM1: Used memory is 1 of 35
2009-12-07 11:22:13,6, GSM1: Trying to get stored message 1
2009-12-07 11:22:13,7, GSM1: -> AT+CMGR=1
2009-12-07 11:22:13,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:14,7, GSM1: <- OK
2009-12-07 11:22:14,6, GSM1: Trying to get stored message 2
2009-12-07 11:22:14,7, GSM1: -> AT+CMGR=2
2009-12-07 11:22:14,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:14,7, GSM1: <- OK
2009-12-07 11:22:14,6, GSM1: Trying to get stored message 3
2009-12-07 11:22:14,7, GSM1: -> AT+CMGR=3
2009-12-07 11:22:14,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:14,7, GSM1: <- OK
2009-12-07 11:22:14,6, GSM1: Trying to get stored message 4
2009-12-07 11:22:14,7, GSM1: -> AT+CMGR=4
2009-12-07 11:22:14,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:15,7, GSM1: <- OK
2009-12-07 11:22:15,6, GSM1: Trying to get stored message 5
2009-12-07 11:22:15,7, GSM1: -> AT+CMGR=5
2009-12-07 11:22:15,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:15,7, GSM1: <- OK
2009-12-07 11:22:15,6, GSM1: Trying to get stored message 6
2009-12-07 11:22:15,7, GSM1: -> AT+CMGR=6
2009-12-07 11:22:15,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:15,7, GSM1: <- OK
2009-12-07 11:22:15,6, GSM1: Trying to get stored message 7
2009-12-07 11:22:15,7, GSM1: -> AT+CMGR=7
2009-12-07 11:22:15,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:15,7, GSM1: <- OK
2009-12-07 11:22:15,6, GSM1: Trying to get stored message 8
2009-12-07 11:22:15,7, GSM1: -> AT+CMGR=8
2009-12-07 11:22:15,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:16,7, GSM1: <- OK
2009-12-07 11:22:16,6, GSM1: Trying to get stored message 9
2009-12-07 11:22:16,7, GSM1: -> AT+CMGR=9
2009-12-07 11:22:16,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:16,7, GSM1: <- OK
2009-12-07 11:22:16,6, GSM1: Trying to get stored message 10
2009-12-07 11:22:16,7, GSM1: -> AT+CMGR=10
2009-12-07 11:22:16,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:16,7, GSM1: <- OK
2009-12-07 11:22:16,6, GSM1: Trying to get stored message 11
2009-12-07 11:22:16,7, GSM1: -> AT+CMGR=11
2009-12-07 11:22:16,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:17,7, GSM1: <- OK
2009-12-07 11:22:17,6, GSM1: Trying to get stored message 12
2009-12-07 11:22:17,7, GSM1: -> AT+CMGR=12
2009-12-07 11:22:17,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:17,7, GSM1: <- OK
2009-12-07 11:22:17,6, GSM1: Trying to get stored message 13
2009-12-07 11:22:17,7, GSM1: -> AT+CMGR=13
2009-12-07 11:22:17,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:17,7, GSM1: <- OK
2009-12-07 11:22:17,6, GSM1: Trying to get stored message 14
2009-12-07 11:22:17,7, GSM1: -> AT+CMGR=14
2009-12-07 11:22:17,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:18,7, GSM1: <- OK
2009-12-07 11:22:18,6, GSM1: Trying to get stored message 15
2009-12-07 11:22:18,7, GSM1: -> AT+CMGR=15
2009-12-07 11:22:18,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:18,7, GSM1: <- OK
2009-12-07 11:22:18,6, GSM1: Trying to get stored message 16
2009-12-07 11:22:18,7, GSM1: -> AT+CMGR=16
2009-12-07 11:22:18,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:18,7, GSM1: <- OK
2009-12-07 11:22:18,6, GSM1: Trying to get stored message 17
2009-12-07 11:22:18,7, GSM1: -> AT+CMGR=17
2009-12-07 11:22:18,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:19,7, GSM1: <- OK
2009-12-07 11:22:19,6, GSM1: Trying to get stored message 18
2009-12-07 11:22:19,7, GSM1: -> AT+CMGR=18
2009-12-07 11:22:19,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:19,7, GSM1: <- OK
2009-12-07 11:22:19,6, GSM1: Trying to get stored message 19
2009-12-07 11:22:19,7, GSM1: -> AT+CMGR=19
2009-12-07 11:22:19,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:19,7, GSM1: <- OK
2009-12-07 11:22:19,6, GSM1: Trying to get stored message 20
2009-12-07 11:22:19,7, GSM1: -> AT+CMGR=20
2009-12-07 11:22:19,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:20,7, GSM1: <- OK
2009-12-07 11:22:20,6, GSM1: Trying to get stored message 21
2009-12-07 11:22:20,7, GSM1: -> AT+CMGR=21
2009-12-07 11:22:20,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:20,7, GSM1: <- OK
2009-12-07 11:22:20,6, GSM1: Trying to get stored message 22
2009-12-07 11:22:20,7, GSM1: -> AT+CMGR=22
2009-12-07 11:22:20,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:20,7, GSM1: <- OK
2009-12-07 11:22:20,6, GSM1: Trying to get stored message 23
2009-12-07 11:22:20,7, GSM1: -> AT+CMGR=23
2009-12-07 11:22:20,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:20,7, GSM1: <- OK
2009-12-07 11:22:20,6, GSM1: Trying to get stored message 24
2009-12-07 11:22:20,7, GSM1: -> AT+CMGR=24
2009-12-07 11:22:20,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:21,7, GSM1: <- OK
2009-12-07 11:22:21,6, GSM1: Trying to get stored message 25
2009-12-07 11:22:21,7, GSM1: -> AT+CMGR=25
2009-12-07 11:22:21,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:21,7, GSM1: <- OK
2009-12-07 11:22:21,6, GSM1: Trying to get stored message 26
2009-12-07 11:22:21,7, GSM1: -> AT+CMGR=26
2009-12-07 11:22:21,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:21,7, GSM1: <- OK
2009-12-07 11:22:21,6, GSM1: Trying to get stored message 27
2009-12-07 11:22:21,7, GSM1: -> AT+CMGR=27
2009-12-07 11:22:21,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:22,7, GSM1: <- OK
2009-12-07 11:22:22,6, GSM1: Trying to get stored message 28
2009-12-07 11:22:22,7, GSM1: -> AT+CMGR=28
2009-12-07 11:22:22,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:22,7, GSM1: <- OK
2009-12-07 11:22:22,6, GSM1: Trying to get stored message 29
2009-12-07 11:22:22,7, GSM1: -> AT+CMGR=29
2009-12-07 11:22:22,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:22,7, GSM1: <- OK
2009-12-07 11:22:22,6, GSM1: Trying to get stored message 30
2009-12-07 11:22:22,7, GSM1: -> AT+CMGR=30
2009-12-07 11:22:22,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:23,7, GSM1: <- OK
2009-12-07 11:22:23,6, GSM1: Trying to get stored message 31
2009-12-07 11:22:23,7, GSM1: -> AT+CMGR=31
2009-12-07 11:22:23,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:23,7, GSM1: <- OK
2009-12-07 11:22:23,6, GSM1: Trying to get stored message 32
2009-12-07 11:22:23,7, GSM1: -> AT+CMGR=32
2009-12-07 11:22:23,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:23,7, GSM1: <- OK
2009-12-07 11:22:23,6, GSM1: Trying to get stored message 33
2009-12-07 11:22:23,7, GSM1: -> AT+CMGR=33
2009-12-07 11:22:23,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:24,7, GSM1: <- OK
2009-12-07 11:22:24,6, GSM1: Trying to get stored message 34
2009-12-07 11:22:24,7, GSM1: -> AT+CMGR=34
2009-12-07 11:22:24,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:24,7, GSM1: <- OK
2009-12-07 11:22:24,6, GSM1: Trying to get stored message 35
2009-12-07 11:22:24,7, GSM1: -> AT+CMGR=35
2009-12-07 11:22:24,7, GSM1: Command is sent, waiting for the answer
2009-12-07 11:22:24,7, GSM1: <- +CMS ERROR: 321
2009-12-07 11:22:24,7, GSM1: Explanation: Invalid memory index
2009-12-07 11:22:24,6, GSM1: No SMS received (reading interrupted)
2009-12-07 11:22:31,6, smsd: Running a regular_run.
2009-12-07 11:22:34,6, GSM1: Checking device for incoming SMS
This is a copy of the script, look that the script go to Oracle database and pick up a message if found on the table SQL_TABLE_COLA.
#!/bin/bash
# Nombre:
# Fecha Creacion:
# Fecha Ultima Modificacion: --
# Autor: Juan Manuel Perrote
# Objetivo: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Uso: Automatizado
# Comentario 1 : --
# Usuario que ejecuta : root
# Maquina :
# Historia: --
################################################
#variables de conexion a la BD
SQL_INSTANCIA=PROD
SQL_USER=smsuser
SQL_PASSWORD="enviar"
SQL_TABLE_COLA=tb_sms_cola
SQL_TABLE_stats=tb_sms_estadistica
date1="$(which date)"
formail1="$(which formail)"
ls1="$(which ls)"
cat1="$(which cat)"
echo1="$(which echo)"
path_scripts=/smsgateway/smstools3/stats
################################################
# Parametros de conexion a la BD
SQL_ARGS=" -S $SQL_USER/$SQL_PASSWORD@$SQL_INSTANCIA"
########################################################################################
#Actualizacion de estadisticas
file=`$ls1 -la $path_scripts | grep counter | awk ' { print $8 } '`
contador=`$cat1 $path_scripts/$file | awk ' { print $2 } '`
DATE=`$date1 +"%d%m%Y%H%M%S"`
#Actualizar registro en la base de datos
$echo1 "update $SQL_TABLE_stats set cantidad_sms = $contador, fecha = to_date('$DATE','DD/MM/RRRR HH24:MI:SS') ;" | $ORACLE_HOME/sqlplus/sqlplus $SQL_ARGS
################################################
#Leer cola de la BD , enviar el sms limpiar cola
registros=`$echo1 "select count(*) from $SQL_TABLE_COLA;" | /clienteoracle/sqlplus/sqlplus $SQL_ARGS`
if [ $registros -ne 0 ];then
for (( i = 1 ; i <= $registros; i++ ))
do
#selecciono siempre el primer registro a leer y borrar
idcola=`$echo1 "select min(idcola) from $SQL_TABLE_COLA where fecha = (select min(fecha) from $SQL_TABLE_COLA);" | /clienteoracle/sqlplus/sqlplus $SQL_ARGS`
mensaje=`$echo1 "select mensaje from $SQL_TABLE_COLA where idcola = (select min(idcola) from $SQL_TABLE_COLA where fecha = (select min(fecha) from $SQL_TABLE_COLA));" | /clienteoracle/sqlplus/sqlplus $SQL_ARGS`
To=`$echo1 "select para from $SQL_TABLE_COLA where idcola = (select min(idcola) from $SQL_TABLE_COLA where fecha = (select min(fecha) from $SQL_TABLE_COLA));" | /clienteoracle/sqlplus/sqlplus $SQL_ARGS`
#####crear archivo sms para enviar#####
Para=`$echo1 $To`
TEXTO=`$echo1 $mensaje`
FILENAME=`mktemp /var/spool/sms/outgoing/sms_salidaXXXXXX`
$echo1 "To: $Para" >$FILENAME
$echo1 "" >> $FILENAME
$echo1 "$TEXTO" >>$FILENAME
######################################
#borrar el primer registro leido de la cola y continuar con el siguiente
$echo1 "delete from $SQL_TABLE_COLA where idcola = $idcola;" | /clienteoracle/sqlplus/sqlplus $SQL_ARGS
done
fi
When smstools3 run a regular_run (looking the log) and do nothing I run a regular_run manually and the script work fine, all messages on the table are pick up and send.
Regards
Juan Manuel.
|
Mon Dec 07, 2009 12:23
|
jmpatagonia: Operating system name and version: Ubuntu 8.04 Server
Version of smsd: Version 3.1.3
Smsd installed from: sources
Name and model of a modem / phone: Bus 001 Device 003: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem
Interface: USB
Hello I have installed SMStools3 and work fine, but now I start using some scripts for regularrun and Eventhandler too, but this scripts stop to work while smstools3 still working.
They are scripts of sql that connect to oracle database to pick up some sms to send.
When start smstools3 the scripts work fine, but later stop to work. If I run the script manually they work fine. When regularrun fail Smstools3 send and recive fine. On the smstolls3 log I can find the line "smsd: Running a regular_run" but scrtipt is not run.
So my conclusion is that smstools3 stop working scripts regular_run and Eventhandler.
Can any help me? , regards juan manuel.
|
Page: 1
Time in this board is UTC.
|
|
|
 |
|
 |
|