Dear All,

My name is Ninad. I already configured kannel sms gateway. I am able to
send sms using my configuration. Right now I am facing issue while
receiving sms. basically i want to create sms to email facility. The
received sms has been emailed to a particular mail-id.
Below is the configuration & logs. Please guide me to resolve this.


Kannel Config file:-


****************************************************************************************************

# Default kannel configuration file
group = core
admin-port = 13000
admin-password = xxxx
admin-allow-ip = "*.*.*.*"
smsbox-port = 13001
box-allow-ip = "*.*.*.*"
wdp-interface-name = "*"
log-file = "/var/log/kannel/bearerbox.log"
log-level = 0
access-log = "/var/log/kannel/kannel.access"
unified-prefix = "+91;+0091"

#--------------- SMSC ---------------
group = smsc
smsc-id = CC
smsc = at
modemtype = auto
device = /dev/ttyS0
speed = 9600
keepalive = 60
sim-buffering = true

#----------------- SMSCbox------------
group = smsbox
bearerbox-host = xx.xx.xx.xx
sendsms-port = 13131
#sendsms-interface = "xx.xx.xx.xx"
sendsms-chars = "0123456789 +-"
access-log = "/var/log/kannel/kannel.access.smsbox"
log-file = "/var/log/kannel/smsbox.log"
log-level = 0
global-sender = +919422099997

#--------------SMS-Service--------------
group = sms-service
catch-all = yes
keyword = www
get-url = "http://xx.xx.xx.xx/sms?phone=%p&text=%a";
accept-x-kannel-headers = true
max-messages = 10
concatenation = true
accepted-smsc = CC
footer = "CC IITB"
exec="/etc/smstomail.cgi %p %P %di"

#--------------Sendsms-user----------------
group = sendsms-user
username = xxxx
password = xxxx
concatenation= true
max-messages = 10
user-allow-ip = "*.*.*.*"

#------------------------------------------
include = "/usr/local/kannel/modems.conf"

****************************************************************************************************



Modem.conf:-

****************************************************************************************************
group = modems
id = pulraj
name = “pulraj”
detect-string = “PULRAJ GSM-P3”
speed = 9600
init-string = “AT+CNMI=2,2,0,1,0;+CMEE=1″

****************************************************************************************************



smstomail.cgi:-

****************************************************************************************************
#!/usr/bin/python

MAIL_SENDER = "kannel"
MAIL_RECEIVER = "root@localhost"

import cgi, os, string

class Vars:
    def __init__(self):
        self._dict = cgi.FieldStorage()

    def __getitem__(self, key):
        return self._dict[key].value

def smstomail():
    print "Content-Type: text/plain"
    print ""

    v = Vars()

    f = os.popen("/usr/sbin/sendmail -oi %s" % MAIL_RECEIVER, "w")
    #f = os.popen("/bin/mail -s sms" % MAIL_RECEIVER, "w")
    f.write("From: %s\nTo: %s\nSubject: SMS message from %s\n\n%s:\n%s\n" %
            (MAIL_SENDER, MAIL_RECEIVER, v["from"], v["to"], v["text"]))
    f.close()

    print "Sent via mail to receiver."

if __name__ == "__main__":
    smstomail()


****************************************************************************************************



bearerbox.log:-

****************************************************************************************************

2011-12-13 16:59:11 [539] [6] DEBUG: AT2[CC]: <-- +CMT: ,40
2011-12-13 16:59:11 [539] [6] DEBUG: AT2[CC]: <--
07911949249499790410D0426ACB66A3C5643000001121316195702215CEB43B4C6EE57039580E169BC56E3A7A794E07
2011-12-13 16:59:11 [539] [6] DEBUG: AT2[CC]: received message from SMSC:
+919442499997
2011-12-13 16:59:11 [539] [6] DEBUG: AT2[CC]: Alphanumeric sender
<BT-664120>
2011-12-13 16:59:11 [539] [6] DEBUG: AT2[CC]: User data length read as (21)
2011-12-13 16:59:11 [539] [6] DEBUG: AT2[CC]: Udh decoding done len=21
udhi=0 udhlen=0 udh=''
2011-12-13 16:59:11 [539] [6] DEBUG: AT2[CC]: --> AT+CNMA^M
2011-12-13 16:59:11 [539] [14] DEBUG: send_msg: sending msg to box:
<xx.xx.xx.xx>
2011-12-13 16:59:11 [539] [14] DEBUG: boxc_sender: sent message to
<xx.xx.xx.xx>
2011-12-13 16:59:11 [539] [13] DEBUG: boxc_receiver: sms received
2011-12-13 16:59:11 [539] [13] DEBUG: send_msg: sending msg to box:
<xx.xx.xx.xx>
2011-12-13 16:59:11 [539] [13] DEBUG: boxc_receiver: got ack
2011-12-13 16:59:11 [539] [6] DEBUG: AT2[CC]: <-- OK
2011-12-13 16:59:13 [539] [6] ERROR: AT2[CC]: Error encoding PDU!
2011-12-13 16:59:13 [539] [6] ERROR: System error 2: No such file or
directory
2011-12-13 16:59:17 [539] [13] DEBUG: boxc_receiver: heartbeat with load
value 0 received
2011-12-13 16:59:25 [539] [6] DEBUG: AT2[CC]: --> AT+CPMS?^M
2011-12-13 16:59:25 [539] [6] DEBUG: AT2[CC]: <-- +CPMS:
"SM",0,20,"SM",0,20,"SM",0,20
2011-12-13 16:59:25 [539] [6] DEBUG: AT2[CC]: <-- OK

****************************************************************************************************



smsbox.log:-

****************************************************************************************************

2011-12-13 16:42:20 [558] [4] DEBUG: no match found: ^[ ]*(www)[ ]*
2011-12-13 16:42:20 [558] [4] WARNING: No translation found for
<ABC-9898989898:www> from <BT-664120> to <1234>
2011-12-13 16:42:20 [558] [4] ERROR: request failed
2011-12-13 16:42:20 [558] [4] DEBUG: message length 14, sending 1 messages
2011-12-13 16:42:20 [558] [0] DEBUG: Got ACK (0) of
28eb0573-c1b3-4887-9477-7b97f4a8a42f
2011-12-13 16:42:20 [558] [0] DEBUG: No client - multi-send or ACK to
pull-reply
2011-12-13 16:59:11 [558] [4] DEBUG: no match found: ^[ ]*(www)[ ]*
2011-12-13 16:59:11 [558] [4] WARNING: No translation found for
<ABC-9898989898:test> from <BT-664120> to <1234>
2011-12-13 16:59:11 [558] [4] ERROR: request failed
2011-12-13 16:59:11 [558] [4] DEBUG: message length 14, sending 1 messages
2011-12-13 16:59:11 [558] [0] DEBUG: Got ACK (0) of
fa7b0005-3c3e-4974-bdea-754e0cdde359
2011-12-13 16:59:11 [558] [0] DEBUG: No client - multi-send or ACK to
pull-reply

****************************************************************************************************




-- 
------------------------
Thanks & Regards,
Ninad Shaha

Reply via email to