Showing posts with label kannel. Show all posts
Showing posts with label kannel. Show all posts

Wednesday, November 16, 2022

Kannel : Multiple SMSC with MT Load Balancing

 Just had the time to try setting up load balancing for MT.

Turns out I just had to replicate my SMSC and use the second USB modem device. smsc-id set the same, then used in sendsms-user as default-smsc.

Browsing the status shows duplicate SMSCs. Sending automatically load balanced.

Now to test for flawless continuous operation....

Friday, November 11, 2022

Ubuntu 20 : Kannel : Cannot start with store-file failing System error 13

Tried Kannel on an Ubuntu 20 SBC and got this error when testing the store-file

2022-11-11 00:47:47 [1337] [0] INFO: Cannot open any store file, starting a new one
2022-11-11 00:47:47 [1337] [0] ERROR: Failed to open '/etc/kannel/store' for writing, cannot create store-file
2022-11-11 00:47:47 [1337] [0] ERROR: System error 13: Permission denied
2022-11-11 00:47:47 [1337] [0] PANIC: Cannot start with store-file failing

Doesn't get resolved through usermod, my installation is under root.

Solution was to move the store file to a folder accessible to Kannel, so I placed it in the log file for now.

store-type = file
store-location = "/var/log/kannel/store"

That works.

Thursday, September 02, 2021

Kannel : Persist Queue to Preserve MT SMS Even After System Restart

To persist your MT SMS queue add store-type and store-location settings in the core group of  your kannel.conf

group = core

...

store-type = file

store-location = "/etc/kannel/store"

Also, make sure your store-location folder is owned by kannel.tl

Friday, July 26, 2019

Ubuntu 18 : Kannel : Sendsms failed : Connection refused

accessing the sendsms function returns "failed: Connection refused."

a telnet to the smsbox port has a similar response, which means no service is accessible on that port
allowing the port on the firewall still returns the same status

tail on the bearer box log shows:
INFO: ----------------------------------------
INFO: Kannel bearerbox II version 1.4.4 starting
INFO: MAIN: Start-up done, entering mainloop
INFO: AT2[xxxxxxxxxxx]: Logging in
INFO: AT2[xxxxxxxxxxx]: init device
INFO: AT2[xxxxxxxxxxx]: speed set to 115200
INFO: AT2[xxxxxxxxxxx]: Phase 2+ is supported
INFO: AT2[xxxxxxxxxxx]: AT SMSC successfully opened.

compared to a working installation, it's missing a "INFO: Client connected from <127 .0.0.1="">" message. hmmm... something is not running. looks like the smsbox is not starting by default.

modify /etc/defaults/kannel to enable smsbox
#START_WAPBOX=1
START_SMSBOX=1

restarting the service now shows:
INFO: ----------------------------------------
INFO: Kannel bearerbox II version 1.4.4 starting
INFO: MAIN: Start-up done, entering mainloop
INFO: AT2[xxxxxxxxxxx]: Logging in
INFO: AT2[xxxxxxxxxxx]: init device
INFO: AT2[xxxxxxxxxxx]: speed set to 115200
INFO: AT2[xxxxxxxxxxx]: Phase 2+ is supported
INFO: AT2[xxxxxxxxxxx]: AT SMSC successfully opened.
INFO: Client connected from <127 .0.0.1="">

a telnet test to the smsbox port connects!
sendsms works!</127></127>

Ubuntu 16 : Kannel : System error 13

got an error 13 when running kannel service

AT2[xxxxxxxxxxx]: open failed!
ERRNO=13 ERROR: System error 13: Permission denied

to resolve, add kannel to dialout group

usermod -a -G dialout kannel


Thursday, October 03, 2013

kannel on linux: gw_gethostbyname error

newly installed kannel gets:
2013-09-05 11:37:26 [11994] [0] ERROR: Error while gw_gethostbyname occurs.
2013-09-05 11:37:26 [11994] [0] ERROR: System error 1: Operation not permitted
2013-09-05 11:37:26 [11994] [0] ERROR: Can't find out official hostname for this host, using `<hostname>' instead.


to resolve, add hostname in /etc/hosts file.

Thursday, January 24, 2013

kannel: config file for zte usb stick

my config entry for a zte (mf627) usb stick in kannel

group = modems
id = ZTE
name = "ZTE"
detect-string = "ZTE"

group = smsc
smsc = at
smsc-id = xxxxxxxxxxx
sms-center = "+xxxxxxx"
allowed-smsc-id = xxxxxxxxxxx
modemtype = ZTE
device = /dev/ttyUSB2
speed = 9600
connect-allow-ip = "127.0.0.1"
validityperiod = 167
keepalive = 10

kannel: cms error

if you get cms error 300 smsc unknown

add smsc-center = "+xxxxxxx" in your smsc group

if you get cms error 500 maybe full

load up your sim :D

Wednesday, February 29, 2012

kannel: send to a different port

to send to a different port, include udh variable in the request string

udh=%06%05%04%2D%BF%32%D5

* 06 means "hey read the following 6 bytes"
* 05 is the format for numbers, in this case hexadecimal numbers
* 04 will tell the UDH that each port is represented using 4 character
* 0B84 is the destination port in hexadecimal, 2948 (decimal representation)
* 23F0 is the source port in hexadecimal, 9200 (decimal representation) or 23F0 (hexadecimal representation).

(source: http://mobiforge.com/developing/story/binary-sms-sending-rich-content-devices-using-sms)

*make sure to send requests in upper case format

ex.
http://192.168.1.15:13013/cgi-bin/sendsms?username=<username>&password=<password>&from=<number>&to=%2B<number>&text=<string>&udh=%06%05%04%2D%BF%32%D5

udh=%23%05%04%2D%BF%32%D5 ---> 13013 - 32d5

Tuesday, October 11, 2011

kannel: multiple modem configuration

in your kannel.conf

#modem 1
group = smsc
smsc = at
smsc-id = a
denied-smsc-id = b
modemtype = teltonika
device = /dev/gsm/Serial0
log-level = 0

#modem 2
group = smsc
smsc = at
smsc-id = b
denied-smsc-id = a
modemtype = teltonika
device = /dev/gsm/USB0
log-level = 0

SSH : No matching host key type found. Their offer: ssh-rsa,ssh-dss

Got this while connecting to my mikrotik router via ssh   Unable to negotiate with <ip address> port <ssh port>: no matching hos...