You have a get-url and exec service in your config at the same time. Please use 
1 only at a time.

Also, your group = sms-service has vertical whitespaces in it. They are not 
allowed in kannel.conf.

 

== Rene

 

From: [email protected] [mailto:[email protected]] On Behalf Of 
Ninad Shaha
Sent: Tuesday, 13 December, 2011 13:51
To: [email protected]
Cc: [email protected]
Subject: Re: Problem while receiving SMS

 

HI,


I already tried that. Not working...












On Tue, Dec 13, 2011 at 6:01 PM, Supporto Tecnico - Crazy Network 
<[email protected]> wrote:

 What if you use:

exec:"/usr/bin/python /etc/smstomail.cgi %p %P %di" ?



Regards

Il 13/12/2011 12:34, Ninad Shaha ha scritto:

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 <tel:%2B919422099997> 

#--------------SMS-Service--------------
group = sms-service
catch-all = yes
keyword = www

get-url = "http://xx.xx.xx.xx/sms?phone=%p 
<http://xx.xx.xx.xx/sms?phone=%25p&text=%25a> &text=%a 
<http://xx.xx.xx.xx/sms?phone=%p <http://xx.xx.xx.xx/sms?phone=%25p&text=%25a> 
&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 <tel:%2B919442499997> 
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

 


-- 
Andrea Iannucci
----------------------------

----------------------------
Crazy Network di Iannucci Andrea
Viale G.B. Lulli, 24
00050 Cerveteri - RM
(w) www.crazynetwork.it
(e) [email protected]
(t) +39 06 62279876 <tel:%2B39%2006%2062279876> 
(f) +39 06 62298767 <tel:%2B39%2006%2062298767> 
(m) +39 338 8552885 <tel:%2B39%20338%208552885> 

-------------------------------------------------------------------------------
Please consider our enviromental responsabilità before printing this E-Mail. 
Thank you.
-------------------------------------------------------------------------------
Questo messaggio di posta elettronica contiene informazioni di carattere 
confidenziale rivolte esclusivamente al destinatario sopra indicato.
E' vietato l'uso, la diffusione, distribuzione o riproduzione da parte di ogni 
altra persona. Nel caso aveste ricevuto questo messaggio di posta elettronica 
per errore, siete pregati di segnalarlo immediatamente al mittente e 
distruggere quanto ricevuto (compresi i file allegati) senza farne copia.
Qualsivoglia utilizzo non autorizzato del contenuto di questo messaggio 
costituisce violazione dell'obbligo di non prendere cognizione della 
corrispondenza tra altri soggetti, salvo più grave illecito, ed espone il 
responsabile alle relative conseguenze.
--------------------------------------------------------------------------------
This e-mail is confidential and may also contain privileged information. If you 
are not the intended recipient you are not authorised to read, print, save, 
process or disclose this message. If you have received this message by mistake, 
please inform the sender immediately and delete this e-mail, its attachments 
and any copies.
Any use, distribution, reproduction or disclosure by any person other than the 
intended recipient is strictly prohibited and the person responsible may incur 
penalties.
--------------------------------------------------------------------------------
 






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

Reply via email to