Satya
Satya

Reputation: 8881

kannel not forwarding messages to URL

My kannel.conf is :

group = core
admin-port = X
smsbox-port = Y
admin-password = Z
log-file = "/usr/local/kannel/log/clientA/kannel.log"
log-level = 0
box-deny-ip = "*.*.*.*"
box-allow-ip = "127.0.0.1"
access-log = "/usr/local/kannel/log/clientA/Access.log"
store-type = file
store-file = "/usr/local/kannel/log/clientA/clientA.store"

###############################################################

group = smsc
smsc = smpp
smsc-id = clientA
host =A.B.C.D
port = 9081
throughput = 2
wait-ack = 600
smsc-username = myuser
smsc-password = mypass
keepalive=30
system-type =
transceiver-mode = 1
enquire-link-interval = 1200
source-addr-ton = 0
source-addr-npi = 1
dest-addr-ton = 1
dest-addr-npi = 1
max-pending-submits = 3

#################################################################

group = smsbox
smsbox-id = smsbox82
bearerbox-host = localhost
sendsms-port = portSend
global-sender = XXXXXXX
mo-recode = true
log-file = "/usr/local/kannel/log/clientA/smsbox.log"
log-level = 0
access-log = "/usr/local/kannel/log/clientA/Access.log"

###################################################################
group = sendsms-user
username = myu
password = myp
max-messages = 3
concatenation = true

##################################################################

group = sms-service
keyword = default
get-url = "http://localhost:80/insdb.php?sender=%p&receiver=%r&smsid=%I"

I have apache running on port 80 and the URL when individually called inserts messages in DB, however, when a message is sent to the App , it never reaches DB, and I do not see any error in logs explaining this.

Any thoughts where am I missing ?

Thanks

Upvotes: 0

Views: 3718

Answers (1)

Izabel
Izabel

Reputation: 191

If you need to save all SMS messages that arrived to kannel, than you need to add sms-service group into kannel.conf, so add something like this:

group = sms-service
keyword = default
get-url="http://127.0.0.1/save?sender=%p&text=%a&receiver=%P"

This will cause that , for all received messages, there will be executed the get-url where your application (apache etc) should be able to save message details to DB.

You should check kannel documentation for detailed info about available placeholders, I used only some of them (sender, receiver, text of message).

BR, Izabel

Upvotes: 1

Related Questions