[with reference to following
DMASOFTLAB Radius Manager 4.0.4/4.1.x SMS Notification Configuration
Recently I configured KANNEL (again) for a client in KARBALA/IRAQ. The OS was UBUNTU 12.04.When we run the Bearerbox and SMSBOX manually in terminal, KANNEL HTTP API works fine. But when the box is restarted, SMS goes in QUEUE.
Result for manually executed bearerbox and smsbox in terminal (separate terminal for each command) like
bearerbox -v 0 /etc/kannel/kannel.conf
smsbox -v 0 /etc/kannel/kannel.conf
Sms via web works fine.
But when the system is rebooted , and I tried to send SMS , all messages were going in QUEUE and following message appear on browser.
3: Queued for later delivery
All kannel related services were starting properly, like bearerbox, smsbox etc. As showed below …
root@rm:~# ps aux |grep kannel kannel 2964 0.0 0.0 7424 720 ? Ss 09:47 0:00 /usr/sbin/run_kannel_box --pidfile /var/run/kannel/kannel_bearerbox.pid --no-extra-args /usr/sbin/bearerbox -v 4 -- /etc/kannel/kannel.conf kannel 2966 0.0 0.2 82652 2784 ? Sl 09:47 0:00 /usr/sbin/bearerbox -v 4 -- /etc/kannel/kannel.conf kannel 2975 0.0 0.0 7424 720 ? Ss 09:47 0:00 /usr/sbin/run_kannel_box --pidfile /var/run/kannel/kannel_wapbox.pid --no-extra-args /usr/sbin/wapbox -v 4 -- /etc/kannel/kannel.conf kannel 2978 0.0 0.0 7424 724 ? Ss 09:47 0:00 /usr/sbin/run_kannel_box --pidfile /var/run/kannel/kannel_smsbox.pid --no-extra-args /usr/sbin/smsbox -v 4 -- /etc/kannel/kannel.conf kannel 2980 0.0 0.2 65948 2644 ? Sl 09:47 0:00 /usr/sbin/smsbox -v 4 -- /etc/kannel/kannel.conf root 2993 0.0 0.0 3328 876 pts/2 S+ 09:47 0:00 grep --color=auto kannel
After checking the bearerbox.log, I saw following error
tail -f /var/log/kannel/bearerbox.log *************************************************************************************** 2014-11-21 10:41:55 [1912] [6] INFO: AT2[/dev/ttyACM0]: opening device 2014-11-21 10:41:55 [1912] [6] ERROR: AT2[/dev/ttyACM0]: open failed! ERRNO=13 2014-11-21 10:41:55 [1912] [6] ERROR: System error 13: Permission denied 2014-11-21 10:41:55 [1912] [6] ERROR: AT2[/dev/ttyACM0]: at2_device_thread: open_at2_device failed. 2014-11-21 10:41:55 [1912] [6] ERROR: System error 13: Permission denied 2014-11-21 10:41:55 [1912] [6] ERROR: AT2[/dev/ttyACM0]: Couldn't connect (retrying in 10 seconds). ***************************************************************************************
With the help of kannel users mailing list, I found that KANNEL user must be allowed to write access /dev/ttyACM0 (or your modem device name).
For ubuntu, simply add the user KANNEL to DIALOUT group.
usermod -a -G dialout kannel chown kannel /dev/ttyACM0
Also remove the comment sign from START_SMSBOX in /etc/default/kannel so that smsbox may also start on system boot.
Alhamdolillah Problem Solved!
I am sharing this info because it took around 1 days of head banging with the wall, and I surely dont want anyone else to stuck in the same situation (if the issue is same)
Sample of config files
root@rm:/etc/kannel# cat /etc/default/kannel START_WAPBOX=1 START_SMSBOX=1
my /etc/kannel/kannel.conf FILE
cat /etc/kannel/kannel.conf
# Syed Jahanzaib # https://aacable.wordpress.com # aacable [at] hotmail.com group = core admin-port = 13000 smsbox-port = 13001 admin-password = zaibadmin status-password = zaibstatus log-file = "/var/log/kannel/bearerbox.log" log-level = 0 box-deny-ip = "*.*.*.*" box-allow-ip = "127.0.0.1" group = smsc smsc = at modemtype = teltonika device = /dev/ttyACM0 # Change above port to match your port, it could ACM1 or USB0, if you dont set it correctly, it will not work and you will get error in logs that unable to connect to device) speed = 19200 my-number = 0333302100000 # (put your sim number, not necessary) # for teltonkia only, if you are using other brand you may need to get there INIT strings group = modems id = teltonika name = "Teltonika E12" detect-string = "Undefined" enable-mms = true init-string = "AT+CNMI=2,2,0,1,1" speed = 115200 # for Huawei USB/GSM modem e155 i guess, remove hashes from below lines if u r using this model. #group = modems #id = huawei #name = "Huawei" #detect-string = "huawei" #enable-mms = true #init-string = "ATZ" #init-string = "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0" group = smsbox bearerbox-host = localhost sendsms-port = 13013 global-sender = 13013 sendsms-chars = "0123456789 +-" log-file = "/var/log/kannel/smsbox.log" log-level = 0 access-log = "/var/log/kannel/access.log" group = sendsms-user username = kannel password = kannel concatenation = true max-messages = 3 group = sms-service keyword = default get-url = "http://localhost/kannel/receivesms.php?sender=%p&text=%b" accept-x-kannel-headers = true max-messages = 3 concatenation = true catch-all = true
🙂
Regard’s
Syed Jahanzaib