philippe::niquille | irregular niche market thoughts

compiling & installing kannel (sms gateway)

Dec 21st 2005
26 Comments
respond
trackback
update (21.8.07)
Since this post seems to be so popular, let me advertise a nice alternative to the SMS-Kannel solution. I’ve been using ASPSMS (a small specialized swiss firm) to send local and foreign (international) SMS with great reliability, functionality and reasonable costs. Perhaps it saves you the hassle of installing and configuring Kannel..

I did run into a few problems trying to compile kannel 1.4.0 with MySQL (version 4.1) support for deliver status reporting (DLR). You get an error like make: *** [gw/dlr_mysql.o] Error 1.
The solution is to patch the code to support MySQL version 4.x with this patch (original source). Do the following:

  • patch -p1 < kannel-mysql4.1.patch
  • CFLAGS=”-I/usr/include/mysql” ./configure –with-mysql –with-mysql-dir=/usr –enable-start-stop-daemon
  • make && make bindir=/usr/local install

Be sure to create a valid config file (see the docu for more info).

  • bearerbox -d /etc/kannel.conf
  • smsbox -d /etc/kannel.conf

Test your installation by hiting this url:

http://localhost:13013/cgi-bin/sendsms?username=kannel&password=***&to=079***&text=test&from=test

Things to know:

  • You need a SMSC gateway or a mobile phone to use kannel
  • by not using the -d option you can see all the DEBUG messages, it does help you out in some situations..
  • Use the XML/Post combination instead of the HTTP/GET method for a production system

26 Comments

  1. yuda

    how can i configure kannel with mysql, i always get MySQL client libraries

    -lmysqlclient -lz -lcrypt -lnsl -lm

    -lmysqlclient no

    please

  2. Could you please give me some more information about your error message? I can’t quite figure out your problem..

  3. hi phill.

    i’m try step by step install kannel :
    1. download kannel & patch kannel [OK]
    2. install MySQL 4.1.x + Apache/PHP 5.0 [OK]
    3. install kannel
    $patch -p1
    $bearerbox -d /etc/kannel.conf
    $smsbox -d /etc/kannel.conf

    Now, im try test
    $bearbox
    #error#
    bearerbox
    2006-04-24 17:34:03 [8452] [0] INFO: Debug_lvl = -1, log_file = , log_lvl = 0
    2006-04-24 17:34:03 [8452] [0] ERROR: fopen failed: couldn’t open `kannel.conf’
    2006-04-24 17:34:03 [8452] [0] ERROR: System error 2: No such file or directory
    2006-04-24 17:34:03 [8452] [0] PANIC: Failed to load main configuration file `kannel.conf’. Aborting!
    2006-04-24 17:34:03 [8452] [0] PANIC: bearerbox(gw_panic+0×16b) [0x80cf86a]
    2006-04-24 17:34:03 [8452] [0] PANIC: bearerbox(cfg_read+0×61) [0x80bafaf]
    2006-04-24 17:34:03 [8452] [0] PANIC: bearerbox(main+0×12e) [0x8052ad9]
    2006-04-24 17:34:03 [8452] [0] PANIC: /lib/libc.so.6(__libc_start_main+0xc6) [0x5d2de6]
    2006-04-24 17:34:03 [8452] [0] PANIC: bearerbox [0x8051b6d]

    let me know..

  4. Obviously your kannel.conf file is missing! I think you’ll find a default one either in your source dir, /usr/local/etc, /etc or wherever you installed kannel. Did you specify any special paths with ./configure?

  5. i’m try install again:
    $CFLAGS=”-I/usr/include/mysql” ./configure –with-prefix=/usr/local \
    –with-mysql –with-mysql-dir=/usr –enable-start-stop-daemon
    $make && make bindir=/usr/local install
    $ls /etc/kannel.conf
    /etc/kannel.conf
    # check bearbox
    $/usr/local/sbin/bearerbox -v 3 /etc/kannel.conf
    # log

    2006-04-25 09:28:21 [11062] [7] INFO: AT2[asl]: AT SMSC successfully opened.

    Ok, phil..thank you.. is running…

  6. Hey buddy! I’m glad you were able to compile it. What does your application look like behind kannel? Just wondering :-)

  7. i’m use kannel + playsms for SMS Autorespond and Dayli Report Oil in Vessels.

    sms outgoing is OK. But, this time i cannot received SMS from any number phone. this a playsms issue not kannel.

    any idea ?
    I’m from indonesia

  8. If I wasn’t already a father, It’d tell you you could have my first born. Darn, I’ve been hitting my head against this and not even the official kannel website says anything about this …. the closest I came to finding out about the patch was through Mbuni’s installation notes, but then I wasn’t able to find any patch. Thanks a lot man. You saved our day!

  9. rama

    my smsc is not working ….i am unable to make a binary fil of smsc …please tell me how can we make a binary of smsc file in kannel…

  10. Ramashanker Sharma

    hello please help me …
    ihave configure ,complie and run the gateway-1.4.0 of kannel,but i am unable to send mymesage using this …from a diffrent port message can come ,,,but it is not going ,,,please help me

  11. roy ashoya

    hi,
    gud work guyz, keep it up.

  12. abukh

    I need someone help me to install and configure kannel step by step.please

    thank you .

  13. mohammed ali

    i am running kannel on my windows xp system with cygwin and am using a nokia 30 series modem as a smsc. but every time i run my bearer box i get the permission denied while accesing my modem error. The following is the configuration file that i am using…

    group = core
    admin-port = 13000
    admin-password = bar
    admin-allow-ip = “*.*.*.*”
    smsbox-port = 13001
    box-allow-ip = “*.*.*.*”
    http-proxy-host = localhost

    group = smsc
    smsc = at
    modemtype = auto
    device = /dev/ttyS0
    speed = 115200
    my-number = +919840867117
    sms-center = +919840011003

    group = smsbox
    bearerbox-host = localhost

  14. sanjeet

    hi to all…
    i have installed kannel successfully on fedora core6 …but not able to run it……
    i am posting content of the kannel.conf file:

    # Default kannel configuration file
    group = core
    admin-port = 13000
    admin-password = changemenow
    status-password = changemetoo
    admin-deny-ip = “*.*.*.*”
    admin-allow-ip = “127.0.0.1″
    smsbox-port = 13001
    wapbox-port = 13002
    box-deny-ip = “*.*.*.*”
    box-allow-ip = “127.0.0.1″
    wdp-interface-name = “*”
    log-file = “/var/log/kannel/bearerbox.log”
    log-level = 1

    please help me …what other stpes should be followed

  15. Mouhamed

    hi all!
    it’s the first time i come in to internet for finding solution.
    So i’ve intalled kannel on fedora core 4 with the command “yum install kannel”.it did it completly,but at the end i haven’t folders like
    /etc/kannel (it doesn’t exit).
    nb:i’m a begginer in kannel

  16. I can’t able to install it in my system…plsss help me…Looking forward….

    Don Lapre Albert
    webmaster@absolutewebdesignz.com
    http://www.absolutewebdesignz.com

  17. Jaffer

    i want sample java program to post a XML to Kannel.

  18. Tommy

    Hello to all,
    I am told to install and configure kannel smpp gateway for my company. But I don’t know where to start from. I am working on Linux 7.3 machine. Can someone help me?

  19. SonFz

    Hi Phil.
    I do as you said but i can not find the file /etc/kennel.conf
    Please help.

  20. Lbash

    Hi

    Thanks every one for the good work, I have kannel and playsms running on Redhat, all is fine except one thing, the incoming sms are not stored/saved on the Inbox. playsms_tblSMSIncoming table is empty even though i have successfully send sms and receive a response.

    ms

  21. KK

    Is there any Free SMSCs available for testing the kannel setup ?

  22. Hi,

    Do u have any kannel configuration for Nokia FCT.

    i m using following configuration in gateway.conf file.

    group = smsc
    smsc = at2
    speed = 9600
    modemtype = Nokia
    smsc-id = MAS V-2.03.08
    device = “/dev/com1″
    allowed-prefix = ” 91;9198;9199;9192;9193;9194;9196;98;92;93;94;96;99;098;092;093;094;096;099″

    group = modems
    id = Nokia
    name = Nokia
    detect-string = “Nokia”

    Please suggest if i m doing any mistake.
    My FCT is Nokia 32 Model.

    And my bearer box returning the following…

    C:\gateway>echo off
    2008-04-10 12:16:44 [0] INFO: Debug_lvl = 0, log_file = , log_lvl = 0
    2008-04-10 12:16:44 [0] WARNING: DLR: using default ‘internal’ for storage type.

    2008-04-10 12:16:44 [0] DEBUG: Kannel bearerbox version `1.2.1′.
    System CYGWIN_NT-5.1, release 1.5.5(0.94/3/2), version 2003-09-20 16:31, machine
    i686.
    Hostname DREAMSOL, IP 192.168.1.2.
    Libxml version 20423.
    Using OpenSSL 0.9.6h 5 Dec 2002.
    Using native malloc.

    2008-04-10 12:16:44 [0] INFO: Added logfile `massbbox.log’ with level `0′.
    2008-04-10 12:16:44 [0] INFO: Started access logfile `access.log’.
    2008-04-10 12:16:44 [0] DEBUG: HTTP: Opening server at port 13000.
    2008-04-10 12:16:44 [0] DEBUG: Started thread 1 (gwlib/fdset.c:poller)
    2008-04-10 12:16:44 [0] DEBUG: Started thread 2 (gwlib/http.c:server_thread)
    2008-04-10 12:16:44 [0] DEBUG: Started thread 3 (gw/bb_http.c:httpadmin_run)
    2008-04-10 12:16:44 [0] DEBUG: starting smsbox connection module
    2008-04-10 12:16:44 [0] DEBUG: Started thread 4 (gw/bb_boxc.c:smsboxc_run)
    2008-04-10 12:16:44 [0] INFO: AT2[MAS V-2.03.08]: configuration shows modemtype

    2008-04-10 12:16:44 [0] DEBUG: AT2[MAS V-2.03.08]: Reading modem definitions fro
    m
    2008-04-10 12:16:44 [0] DEBUG: AT2[MAS V-2.03.08]: Found modems in config
    2008-04-10 12:16:44 [0] INFO: AT2[MAS V-2.03.08]: read modem definition for
    2008-04-10 12:16:44 [0] DEBUG: Started thread 5 (gw/smsc/smsc_at2.c:at2_device_t
    hread)
    2008-04-10 12:16:44 [5] INFO: AT2[MAS V-2.03.08]: opening device
    2008-04-10 12:16:44 [6] DEBUG: sms_router: time to sleepmscconn.c:sms_router)

    2008-04-10 12:16:44 [0] INFO: —————————————-
    2008-04-10 12:16:44 [0] INFO: Kannel bearerbox II version 1.2.1 starting
    2008-04-10 12:16:44 [0] INFO: MAIN: Start-up done, entering mainloop
    2008-04-10 12:16:44 [0] DEBUG: AT2[MAS V-2.03.08]: start called
    2008-04-10 12:16:44 [6] DEBUG: sms_router: list_len = 0
    2008-04-10 12:16:44 [5] DEBUG: AT2[MAS V-2.03.08]: device opened
    2008-04-10 12:16:44 [5] INFO: AT2[MAS V-2.03.08]: init device
    2008-04-10 12:16:44 [5] INFO: AT2[MAS V-2.03.08]: speed set to 9600
    2008-04-10 12:16:44 [5] DEBUG: AT2[MAS V-2.03.08]: –> AT^M

    This stuck here and not sends any SMS.

  23. imene

    good morning,

    Please can you help me?

    I m a student in an engeniring university and i work with kannel for sending SMS but the problem in in the running of boxes.
    In the guide user i should write “./bearerbox -v 1 [conffile]” but when i replace conffile with bearerbox.c it dont work and also with bearerbox.h .

    So what can i do?

    thank you a lot

  24. I am a postGraduate Student in Computer Science and i want to use kannel for my project. Can someone send me a working configuration script for USB Samba (Falcom) Edge GPRS Modem (MC75). I have been trying for months until i am about to prefer Gnokii but the gnokii smsd cannot receive but can send through the same modem. Please assist

  25. guy

    slt Kiplagat,
    je travaille avec kannel pour mon projet et si t’as pas changĂ© de gateway , fais moi signe pour que je te file ma config qui marche tres bien avec le modem falcom samba 55

Leave a Reply