connecting Kannel gateway with Java servlet

Turc, Roxana Maria roxana.turc at siemens.com
Thu Feb 8 11:27:01 CET 2007


 
Hi everybody,
I'm currently trying to send a messsage from a Java application to
smsbox. I've configured the smskannel as listed bellow:
 
#
# THIS IS A SAMPLE CONFIGURATION FOR SMS KANNEL
#
# This basic version is used for system testing. It expects 'fakesmsc'
to
# send messages which are replied with simple fixed text message.
# It is run like this:
#
#  1% gw/bearerbox gw/smskannel.conf
#  2% gw/smsbox gw/smskannel.conf
#  3% test/fakesmsc -i 0.1 -m 100 "123 345 text nop"
#
# ..all 3 commands in separate shells (or screen sessions)
# Note that you can run them in different machines but have to
# add certain command line argument and configuration variables then
#
#
# For any modifications to this file, see Kannel User Guide 
# If that does not help, see Kannel web page (http://www.kannel.org) and
# various online help and mailing list archives
#
# Notes on those who base their configuration on this:
#  1) check security issues! (allowed IPs, passwords and ports)
#  2) groups cannot have empty rows inside them!
#  3) read the user guide
#
# Kalle Marjola for Kannel project 2001, 2004
 
#---------------------------------------------
# CORE
#
# There is only one core group and it sets all basic settings
# of the bearerbox (and system). You should take extra notes on
# configuration variables like 'store-file' (or 'store-dir'),
# 'admin-allow-ip' and 'access.log'
 

group = core
admin-port = 13000
smsbox-port = 13001
admin-password = bar
#status-password = foo
#admin-deny-ip = ""
#admin-allow-ip = ""
log-file = "c:\\kannel.log"
log-level = 0
box-deny-ip = "*.*.*.*"
box-allow-ip = "127.0.0.1"
#unified-prefix = "+358,00358,0;+,00"
#access-log = "/tmp/access.log"
#store-file = "kannel.store"
#ssl-server-cert-file = "cert.pem"
#ssl-server-key-file = "key.pem"
store-file = "kannel.store"
 
#ssl-certkey-file = "mycertandprivkeyfile.pem"
 
#---------------------------------------------
# SMSC CONNECTIONS
#
# SMSC connections are created in bearerbox and they handle SMSC
specific
# protocol and message relying. You need these to actually receive and
send
# messages to handset, but can use GSM modems as virtual SMSCs
 

# This is a fake smsc connection, _only_ used to test the system and
services.
# It really cannot relay messages to actual handsets!
 
group = smsc
smsc = fake
smsc-id = FAKE
port = 10000
connect-allow-ip = 127.0.0.1
 
 
 

#group = smsc
#smsc = http
#smsc-id=MT2MO
#system-type = kannel
#smsc-username = tester
#smsc-password = foobar
#port = 10000
#send-url="http://localhost:10000/cgi-bin/sendsms
<http://localhost:10000/cgi-bin/sendsms> "
 
#---------------------------------------------
# SMSBOX SETUP
#
# Smsbox(es) do higher-level SMS handling after they have been received
from
# SMS centers by bearerbox, or before they are given to bearerbox for
delivery
 
group = smsbox
bearerbox-host = 127.0.0.1
sendsms-port = 2040
http-request-retry = 5
#sendsms-chars = "0123456789 +-"
log-file = "c:\\smsbox.log"
log-level = 0
#access-log = "/tmp/access.log"
 
#---------------------------------------------
# SEND-SMS USERS
#
# These users are used when Kannel smsbox sendsms interface is used to
# send PUSH sms messages, i.e. calling URL like
#
http://kannel.machine:13013/cgi-bin/sendsms?username=tester&password=foo
bar
<http://kannel.machine:13013/cgi-bin/sendsms?username=tester&password=fo
obar> ...
 
group = sendsms-user
username = tester
password = foobar
max-messages=2
#user-deny-ip = ""
#user-allow-ip = ""
 

#---------------------------------------------
# SERVICES
#
# These are 'responses' to sms PULL messages, i.e. messages arriving
from
# handsets. The response is based on message content. Only one
sms-service is
# applied, using the first one to match.
 
group = sms-service
keyword = complex
text = "rox"
 
# There should be always a 'default' service. This service is used when
no
# other 'sms-service' is applied.
 

group = sms-service
keyword = default
get-url =
"http://localhost:8082/SmsEngine/SmsEngine?SenderAddress=%p&message=%a&s
msServiceActivationNumber=%P
<http://localhost:8082/SmsEngine/SmsEngine?SenderAddress=%p&message=%a&s
msServiceActivationNumber=%P> "
 
 
 
group = sms-service
keyword = nop1
text = "%r"
 
The problem is that when I'm trying to connect from my java application
to the smsbox it says : "Connection reset by the peer". From my Java
application I'm using the following URL to the SMS box:
"http://ro1cc28c:2040/cgi-bin/sendsms?username=tester&password=foobar&fr
om=345&to=1224&text=this"
This URL works ok from the browser, but if I'm using the URLConnection
in the java application it does not connect.
Thank you
............................................................

With best kind regards

Roxana Maria Turc

Siemens PSE Romania

Solutions for Multi-Service Communication

Tel: +40(264)506-046: 

mailto:roxana.turc at siemens.com

 

Important: Acest e-mail poate contine informatii si fisiere
confidentiale sau strict confidentiale. Daca ati primit acest e-mail din
greseala, va rugam sa informati imediat expeditorul si sa il stergeti.
Este strict interzisa modificarea, multiplicarea sau redistribuirea
mesajului sau a oricarei parti a acestuia. Va multumim pentru cooperare.

Important Note: This e-mail may contain trade secrets or privileged,
undisclosed or otherwise confidential information. If you have received
this e-mail in error, you are hereby notified that any review, copying
or distribution of it is strictly prohibited. Please inform the sender
immediately and destroy the original transmittal. Thank you for your
cooperation.

 

 

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.kannel.org/pipermail/announce/attachments/20070208/f180f383/attachment.html 


More information about the announce mailing list