# Kannel: SMS Gateway. How to configure?

## Oschtan

Like everything runs, but does not send sms.

File kannel.conf

```
include="/etc/kannel/modem.conf"

group = core

admin-port = 13000

admin-password = mypass

admin-deny-ip = "*.*.*.*"

admin-allow-ip = "127.0.0.1"

log-file = "/var/log/kannel.log"

log-level = 0

access-log = "access.log"

smsbox-port = 13001

box-deny-ip = "*.*.*.*"

box-allow-ip = "127.0.0.1"

group = smsc

smsc = at

smsc-id = huawei_e620

port = 13013

modemtype = huawei_e620

device = /dev/ttyUSB2

my-number = +7913XXXXXXX

connect-allow-ip = "127.0.0.1;Y.Y.Y.Y"

sim-buffering = true

keepalive = 5

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = "0123456789 +-"

global-sender = 7913XXXXXXX

log-file = "smsbox.log"

log-level = 0

access-log = "access.log"

group = sendsms-user

username = user

password = mypass

user-deny-ip = "*.*.*.*"

user-allow-ip = "127.0.0.1"

max-messages = 4

concatenation = true
```

modem.conf

```
group = modems

id = huawei_e620

name = "Huawei E620"

detect-string = "huawei"

init-string = "AT+CFUN=1"

message-storage = "ME"

need-sleep = true

speed = 460800

no-pin = true

reset-string = "AT+CFUN=1"
```

On request http://localhost:13013/cgi-bin/sendsms?username=user&password=mypass&to=7913YYYYYYY&text=Hello+world Long hovering in the browser and the message in the log smsbox: 

```
 2010-03-20 01:04:38 [12458] [2] DEBUG: HTTP: Creating HTTPClient for `127.0.0.1'.

2010-03-20 01:04:38 [12458] [2] DEBUG: HTTP: Created HTTPClient area 0x74a620.

2010-03-20 01:04:38 [12458] [3] INFO: smsbox: Got HTTP request </cgi-bin/sendsms> from <127.0.0.1>

2010-03-20 01:04:38 [12458] [3] INFO: sendsms used by <user>

2010-03-20 01:04:38 [12458] [3] INFO: sendsms sender:<user:7913XXXXXXX> (127.0.0.1) to:<7913YYYYYYY> msg:<Hello world>

2010-03-20 01:04:38 [12458] [3] DEBUG: Stored UUID 16e12572-3937-4431-8e2c-c47385c8b893

2010-03-20 01:04:38 [12458] [3] DEBUG: message length 11, sending 1 messages

2010-03-20 01:04:38 [12458] [3] DEBUG: Status: 202 Answer: <Sent.>

2010-03-20 01:04:38 [12458] [3] DEBUG: Delayed reply - wait for bearerbox 
```

I can not make. Modem Huawei E1550. GPRS / UMTS (udev rule added) - work through kppp. 13000,13001,13013 ports are open. What to do? General purpose to create SMS-Gateway. I want to send SMS, receive SMS and folded into the base MySQL (for this apparently have to create a user). Access to the server you want to implement a browser. Maybe should choose another suitable for this purpose software?

----------

## massimo

I'm new to kannel too but I wonder if the configuration file is syntactically correct since there is an empty line:

```

[...]

access-log = "access.log"

smsbox-port = 13001 

[...]

```

which you should remove first. Restart the services and try again.

----------

## Oschtan

Sending sms from address sms.mts.ru now leads to such tragic consequences. Search for solutions on the Internet has not led to desired results. Help please!

```
2010-04-15 03:40:32 [20318] [4] DEBUG: AT2[huawei_e620]: <-- ^RSSI:13

2010-04-15 03:40:33 [20318] [4] DEBUG: AT2[huawei_e620]: <-- +CMT: ,45

2010-04-15 03:40:33 [20318] [4] DEBUG: AT2[huawei_e620]: <-- 07919761980622F00412D0F3F6DCD5A6CF5DF23A0000014051000403611A309B2D76ABC51449A80E84ABB962319C4B26CBB962391A

2010-04-15 03:40:33 [20318] [4] DEBUG: AT2[huawei_e620]: received message from SMSC: +79168960220

2010-04-15 03:40:33 [20318] [4] DEBUG: AT2[huawei_e620]: Alphanumeric sender <sms.mts.ru>

2010-04-15 03:40:33 [20318] [4] DEBUG: AT2[huawei_e620]: User data length read as (26)

2010-04-15 03:40:33 [20318] [4] DEBUG: AT2[huawei_e620]: Udh decoding done len=26 udhi=0 udhlen=0 udh=''

2010-04-15 03:40:33 [20318] [4] PANIC: gwlib/gw-rwlock.c:137: gw_rwlock_rdlock: Assertion `lock != NULL' failed.

2010-04-15 03:40:33 [20318] [4] PANIC: /usr/sbin/bearerbox(gw_panic+0x154) [0x47f674]

2010-04-15 03:40:33 [20318] [4] PANIC: /usr/sbin/bearerbox(gw_rwlock_rdlock+0x54) [0x476534]

2010-04-15 03:40:33 [20318] [4] PANIC: /usr/sbin/bearerbox(route_incoming_to_boxc+0x4b) [0x4123ab]

2010-04-15 03:40:33 [20318] [4] PANIC: /usr/sbin/bearerbox(bb_smscconn_receive+0x908) [0x418988]

2010-04-15 03:40:33 [20318] [4] PANIC: /usr/sbin/bearerbox() [0x426abb]

2010-04-15 03:40:33 [20318] [4] PANIC: /usr/sbin/bearerbox() [0x428f5e]

2010-04-15 03:40:33 [20318] [4] PANIC: /usr/sbin/bearerbox() [0x4774ee]

2010-04-15 03:40:33 [20318] [4] PANIC: /lib/libpthread.so.0(+0x6a04) [0x7fc1c55fda04]

2010-04-15 03:40:33 [20318] [4] PANIC: /lib/libc.so.6(clone+0x6d) [0x7fc1c401f98d]
```

My config 

```
include="/etc/kannel/modem.conf"

group = core

admin-port = 13001

admin-password = opxudoew

admin-deny-ip = "*.*.*.*"

admin-allow-ip = "127.0.0.1"

log-level = 0

group = smsc

smsc = at

smsc-id = huawei_e620

port = 13013

modemtype = huawei_e620

device = /dev/ttyUSB2

my-number = +7913XXXXXXX

connect-allow-ip = "127.0.0.1;x.x.x.x"

sim-buffering = true

keepalive = 4

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = "0123456789 +-"

global-sender = +7913XXXXXXX

log-level = 0

group = sendsms-user

username = user

password = *****

user-deny-ip = "*.*.*.*"

user-allow-ip = "127.0.0.1;x.x.x.x"

max-messages = 4

concatenation = true

group = sms-service

keyword = default

text = "No service specified"

group = mysql-connection

id = mydlr

host = localhost

username = user

password = ****

database = dlr

max-connections = 1

 

group = dlr-db

id = mydlr

table = dlr

field-smsc = smsc

field-timestamp = msgtime

field-destination = dest

field-source = clip

field-service = code

field-url = url

field-mask = mask

field-status = status

field-boxc-id = boxcid
```

----------

## Oschtan

This is a bug kannel. All is solved using the current version (current-snapshot).

----------

