connecting Kannel gateway with Java servlet
"Turc, Roxana Maria" <[email protected]> Thu, 8 Feb 2007 12:27:01 +0200
| Newsgroups | gmane.comp.mobile.kannel.announce |
|---|---|
| Message-ID | <531469B50F14D84C8B998BDDB8A6C58A02228693@BAVC302A.ww300.siemens.net> |
This is a multi-part message in MIME format. --===============1110170578== Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C74B6B.ABFA284F" This is a multi-part message in MIME format. ------_=_NextPart_001_01C74B6B.ABFA284F Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable =20 Hi everybody, I'm currently trying to send a messsage from a Java application to smsbox. I've configured the smskannel as listed bellow: =20 # # 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=20 # 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 =20 #--------------------------------------------- # 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' =20 group =3D core admin-port =3D 13000 smsbox-port =3D 13001 admin-password =3D bar #status-password =3D foo #admin-deny-ip =3D "" #admin-allow-ip =3D "" log-file =3D "c:\\kannel.log" log-level =3D 0 box-deny-ip =3D "*.*.*.*" box-allow-ip =3D "127.0.0.1" #unified-prefix =3D "+358,00358,0;+,00" #access-log =3D "/tmp/access.log" #store-file =3D "kannel.store" #ssl-server-cert-file =3D "cert.pem" #ssl-server-key-file =3D "key.pem" store-file =3D "kannel.store" =20 #ssl-certkey-file =3D "mycertandprivkeyfile.pem" =20 #--------------------------------------------- # 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 =20 # This is a fake smsc connection, _only_ used to test the system and services. # It really cannot relay messages to actual handsets! =20 group =3D smsc smsc =3D fake smsc-id =3D FAKE port =3D 10000 connect-allow-ip =3D 127.0.0.1 =20 =20 =20 #group =3D smsc #smsc =3D http #smsc-id=3DMT2MO #system-type =3D kannel #smsc-username =3D tester #smsc-password =3D foobar #port =3D 10000 #send-url=3D"http://localhost:10000/cgi-bin/sendsms <http://localhost:10000/cgi-bin/sendsms> " =20 #--------------------------------------------- # 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 =20 group =3D smsbox bearerbox-host =3D 127.0.0.1 sendsms-port =3D 2040 http-request-retry =3D 5 #sendsms-chars =3D "0123456789 +-" log-file =3D "c:\\smsbox.log" log-level =3D 0 #access-log =3D "/tmp/access.log" =20 #--------------------------------------------- # 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=3Dtester&password=3D= foo bar <http://kannel.machine:13013/cgi-bin/sendsms?username=3Dtester&password=3D= fo obar> ... =20 group =3D sendsms-user username =3D tester password =3D foobar max-messages=3D2 #user-deny-ip =3D "" #user-allow-ip =3D "" =20 #--------------------------------------------- # 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. =20 group =3D sms-service keyword =3D complex text =3D "rox" =20 # There should be always a 'default' service. This service is used when no # other 'sms-service' is applied. =20 group =3D sms-service keyword =3D default get-url =3D "http://localhost:8082/SmsEngine/SmsEngine?SenderAddress=3D%p&message=3D%= a&s msServiceActivationNumber=3D%P <http://localhost:8082/SmsEngine/SmsEngine?SenderAddress=3D%p&message=3D%= a&s msServiceActivationNumber=3D%P> " =20 =20 =20 group =3D sms-service keyword =3D nop1 text =3D "%r" =20 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=3Dtester&password=3Dfoobar= &fr om=3D345&to=3D1224&text=3Dthis" 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:=20 mailto:[email protected] =20 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. =20 =20 =20 ------_=_NextPart_001_01C74B6B.ABFA284F Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Dus-ascii"> <META content=3D"MSHTML 6.00.2900.3020" name=3DGENERATOR></HEAD> <BODY> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><SPAN class=3D675432210-08022007><FONT face=3DArial size=3D2>Hi=20 everybody,</FONT></SPAN></DIV> <DIV><SPAN class=3D675432210-08022007><FONT face=3DArial size=3D2>I'm = currently trying=20 to send a messsage from a Java application to smsbox. I've configured = the=20 smskannel as listed bellow:</FONT></SPAN></DIV> <DIV><SPAN class=3D675432210-08022007><FONT face=3DArial=20 size=3D2></FONT></SPAN> </DIV> <DIV><SPAN class=3D675432210-08022007><FONT face=3DArial size=3D2>#<BR># = THIS IS A=20 SAMPLE CONFIGURATION FOR SMS KANNEL<BR>#<BR># This basic version is used = for=20 system testing. It expects 'fakesmsc' to<BR># send messages which are = replied=20 with simple fixed text message.<BR># It is run like = this:<BR>#<BR># 1%=20 gw/bearerbox gw/smskannel.conf<BR># 2% gw/smsbox=20 gw/smskannel.conf<BR># 3% test/fakesmsc -i 0.1 -m 100 "123 345 = text=20 nop"<BR>#<BR># ..all 3 commands in separate shells (or screen = sessions)<BR>#=20 Note that you can run them in different machines but have to<BR># add = certain=20 command line argument and configuration variables then<BR>#<BR>#<BR># = For any=20 modifications to this file, see Kannel User Guide <BR># If that does not = help,=20 see Kannel web page (<A = href=3D"http://www.kannel.org">http://www.kannel.org</A>)=20 and<BR># various online help and mailing list archives<BR>#<BR># Notes = on those=20 who base their configuration on this:<BR># 1) check security = issues!=20 (allowed IPs, passwords and ports)<BR># 2) groups cannot have = empty rows=20 inside them!<BR># 3) read the user guide<BR>#<BR># Kalle Marjola = for=20 Kannel project 2001, 2004</FONT></SPAN></DIV> <DIV> </DIV> <DIV><SPAN class=3D675432210-08022007><FONT face=3DArial=20 size=3D2>#---------------------------------------------<BR># = CORE<BR>#<BR># There=20 is only one core group and it sets all basic settings<BR># of the = bearerbox (and=20 system). You should take extra notes on<BR># configuration variables = like=20 'store-file' (or 'store-dir'),<BR># 'admin-allow-ip' and=20 'access.log'</FONT></SPAN></DIV> <DIV> </DIV><SPAN class=3D675432210-08022007> <DIV><BR><FONT face=3DArial size=3D2>group =3D core<BR>admin-port =3D=20 13000<BR>smsbox-port =3D 13001<BR>admin-password =3D = bar<BR>#status-password =3D=20 foo<BR>#admin-deny-ip =3D ""<BR>#admin-allow-ip =3D ""<BR>log-file =3D=20 "c:\\kannel.log"<BR>log-level =3D 0<BR>box-deny-ip =3D = "*.*.*.*"<BR>box-allow-ip =3D=20 "127.0.0.1"<BR>#unified-prefix =3D "+358,00358,0;+,00"<BR>#access-log = =3D=20 "/tmp/access.log"<BR>#store-file =3D = "kannel.store"<BR>#ssl-server-cert-file =3D=20 "cert.pem"<BR>#ssl-server-key-file =3D "key.pem"<BR>store-file =3D=20 "kannel.store"</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>#ssl-certkey-file =3D=20 "mycertandprivkeyfile.pem"</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial = size=3D2>#---------------------------------------------<BR>#=20 SMSC CONNECTIONS<BR>#<BR># SMSC connections are created in bearerbox and = they=20 handle SMSC specific<BR># protocol and message relying. You need these = to=20 actually receive and send<BR># messages to handset, but can use GSM = modems as=20 virtual SMSCs</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><BR><FONT face=3DArial size=3D2># This is a fake smsc connection, = _only_ used=20 to test the system and services.<BR># It really cannot relay messages to = actual=20 handsets!</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>group =3D smsc<BR>smsc =3D = fake<BR>smsc-id =3D=20 FAKE<BR>port =3D 10000<BR>connect-allow-ip =3D 127.0.0.1</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><BR><FONT face=3DArial size=3D2>#group =3D smsc<BR>#smsc =3D=20 http<BR>#smsc-id=3DMT2MO<BR>#system-type =3D kannel<BR>#smsc-username = =3D=20 tester<BR>#smsc-password =3D foobar<BR>#port =3D = 10000<BR>#send-url=3D"</FONT><A=20 href=3D"http://localhost:10000/cgi-bin/sendsms"><FONT face=3DArial = color=3D#000000=20 size=3D2>http://localhost:10000/cgi-bin/sendsms</FONT></A><FONT = face=3DArial=20 size=3D2>"</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial = size=3D2>#---------------------------------------------<BR>#=20 SMSBOX SETUP<BR>#<BR># Smsbox(es) do higher-level SMS handling after = they have=20 been received from<BR># SMS centers by bearerbox, or before they are = given to=20 bearerbox for delivery</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>group =3D smsbox<BR>bearerbox-host =3D=20 127.0.0.1<BR>sendsms-port =3D 2040<BR>http-request-retry =3D = 5<BR>#sendsms-chars =3D=20 "0123456789 +-"<BR>log-file =3D "c:\\smsbox.log"<BR>log-level =3D = 0<BR>#access-log =3D=20 "/tmp/access.log"</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial = size=3D2>#---------------------------------------------<BR>#=20 SEND-SMS USERS<BR>#<BR># These users are used when Kannel smsbox sendsms = interface is used to<BR># send PUSH sms messages, i.e. calling URL = like<BR>#=20 </FONT><A=20 href=3D"http://kannel.machine:13013/cgi-bin/sendsms?username=3Dtester&= ;password=3Dfoobar"><FONT=20 face=3DArial color=3D#000000=20 size=3D2>http://kannel.machine:13013/cgi-bin/sendsms?username=3Dtester&am= p;password=3Dfoobar</FONT></A><FONT=20 face=3DArial size=3D2>...</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>group =3D sendsms-user<BR>username =3D=20 tester<BR>password =3D foobar<BR>max-messages=3D2<BR>#user-deny-ip =3D=20 ""<BR>#user-allow-ip =3D ""</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><BR><FONT face=3DArial=20 size=3D2>#---------------------------------------------<BR># = SERVICES<BR>#<BR>#=20 These are 'responses' to sms PULL messages, i.e. messages arriving = from<BR>#=20 handsets. The response is based on message content. Only one sms-service = is<BR>#=20 applied, using the first one to match.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>group =3D sms-service<BR>keyword =3D = complex<BR>text =3D=20 "rox"</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2># There should be always a 'default' = service. This=20 service is used when no<BR># other 'sms-service' is = applied.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><BR><FONT face=3DArial size=3D2>group =3D sms-service<BR>keyword = =3D=20 default<BR>get-url =3D "</FONT><A=20 href=3D"http://localhost:8082/SmsEngine/SmsEngine?SenderAddress=3D%p&= message=3D%a&smsServiceActivationNumber=3D%P"><FONT=20 face=3DArial color=3D#000000=20 size=3D2>http://localhost:8082/SmsEngine/SmsEngine?SenderAddress=3D%p&= ;message=3D%a&smsServiceActivationNumber=3D%P</FONT></A><FONT=20 face=3DArial size=3D2>"</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>group =3D sms-service<BR>keyword =3D = nop1<BR>text =3D=20 "%r"</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial><FONT size=3D2>T<SPAN = class=3D675432210-08022007>he problem is=20 that when I'm trying to connect from my java application to the smsbox = it says :=20 "Connection reset by the peer". From my Java application I'm using the = following=20 URL to the SMS box:</SPAN></FONT></FONT></DIV> <DIV><FONT face=3DArial><FONT size=3D2><SPAN = class=3D675432210-08022007>"<A=20 href=3D"http://ro1cc28c:2040/cgi-bin/sendsms?username=3Dtester&passwo= rd=3Dfoobar&from=3D345&to=3D1224&text=3Dthis">http://ro1cc28c= :2040/cgi-bin/sendsms?username=3Dtester&password=3Dfoobar&from=3D= 345&to=3D1224&text=3Dthis</A>"</SPAN></FONT></FONT></DIV> <DIV><FONT face=3DArial><FONT size=3D2><SPAN = class=3D675432210-08022007>This URL works=20 ok from the browser, but if I'm using the URLConnection in the java = application=20 it does not connect.</SPAN></FONT></FONT></DIV> <DIV><FONT face=3DArial><FONT size=3D2><SPAN = class=3D675432210-08022007>Thank=20 you</SPAN></FONT></FONT></SPAN></DIV> <DIV align=3Dleft><FONT face=3DArial size=3D2> <P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt; = mso-layout-grid-align: none"=20 align=3Dleft><SPAN=20 style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: UniversSEuro45Light; = mso-bidi-font-size: 10.0pt; mso-ansi-language: = EN-US">............................................................<?xml:= namespace=20 prefix =3D o ns =3D "urn:schemas-microsoft-com:office:office"=20 /><o:p></o:p></SPAN></P> <P class=3DMsoNormal=20 style=3D"MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN=20 style=3D"FONT-SIZE: 8pt; COLOR: black; mso-bidi-font-size: 10.0pt; = mso-ansi-language: EN-US; mso-bidi-font-family: Arial">With=20 best kind regards<o:p></o:p></SPAN></P> <P class=3DMsoNormal=20 style=3D"MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN=20 style=3D"FONT-SIZE: 8pt; COLOR: black; mso-bidi-font-size: 10.0pt; = mso-ansi-language: EN-US; mso-bidi-font-family: Arial">Roxana=20 Maria Turc</SPAN></P><SPAN=20 style=3D"FONT-SIZE: 8pt; COLOR: black; mso-bidi-font-size: 10.0pt; = mso-ansi-language: EN-US; mso-bidi-font-family: Arial"> <P class=3DMsoNormal=20 style=3D"MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN=20 style=3D"FONT-SIZE: 8pt; COLOR: black; mso-bidi-font-size: 10.0pt; = mso-ansi-language: EN-US; mso-bidi-font-family: Arial"><FONT=20 face=3DArial>Siemens PSE Romania</FONT></SPAN></P> <P class=3DMsoNormal=20 style=3D"MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN=20 style=3D"FONT-SIZE: 8pt; COLOR: black; mso-bidi-font-size: 10.0pt; = mso-ansi-language: EN-US; mso-bidi-font-family: Arial"><FONT=20 face=3DArial>Solutions for Multi-Service = Communication</FONT></SPAN></SPAN></P> <P class=3DMsoNormal=20 style=3D"MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN=20 style=3D"FONT-SIZE: 8pt; COLOR: black; mso-bidi-font-size: 10.0pt; = mso-ansi-language: EN-US; mso-bidi-font-family: Arial">Tel:=20 +40(264)506-046</SPAN><SPAN=20 style=3D"FONT-SIZE: 8pt; COLOR: black; mso-bidi-font-size: 10.0pt; = mso-ansi-language: EN-US; mso-bidi-font-family: Arial">:=20 </SPAN></P> <P class=3DMsoNormal=20 style=3D"MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN=20 style=3D"FONT-SIZE: 8pt; COLOR: black; mso-bidi-font-size: 10.0pt; = mso-ansi-language: EN-US; mso-bidi-font-family: Arial"></SPAN><SPAN=20 style=3D"FONT-SIZE: 8pt; COLOR: blue; mso-bidi-font-size: 10.0pt; = mso-ansi-language: EN-US; mso-bidi-font-family: Arial"><A=20 href=3D"mailto:[email protected]">mailto:[email protected]</A= ></SPAN></P> <P class=3DMsoNormal=20 style=3D"MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN=20 style=3D"FONT-SIZE: 8pt; COLOR: blue; mso-bidi-font-size: 10.0pt; = mso-ansi-language: EN-US; mso-bidi-font-family: Arial"><FONT=20 color=3D#000000 size=3D2></FONT></SPAN> </P><SPAN=20 style=3D"FONT-SIZE: 8pt; COLOR: blue; mso-bidi-font-size: 10.0pt; = mso-ansi-language: EN-US; mso-bidi-font-family: Arial"> <DIV> <DIV><EM><FONT face=3DArial><SPAN = class=3D623414212-10102006>Important:<SPAN=20 class=3D039112913-10102006> </SPAN>Acest e-mail poate = contine informatii si=20 fisiere confidentiale sau strict confidentiale. Daca ati primit = acest=20 e-mail din greseala, va rugam sa informati imediat<SPAN=20 class=3D039112913-10102006> expeditorul</SPAN> si sa il stergeti.=20 E</SPAN><SPAN class=3D623414212-10102006>ste strict interzisa = modificarea,=20 multiplicarea sau redistribuirea<SPAN class=3D039112913-10102006>=20 mesajului</SPAN> sau a oricarei parti a acestuia.<SPAN=20 class=3D039112913-10102006> </SPAN>Va m</SPAN><SPAN=20 class=3D623414212-10102006>ultumim pentru=20 cooperare.</SPAN></FONT></EM></DIV></DIV> <DIV> <P><FONT face=3DArial><EM>Important Note: This e-mail may contain trade = secrets or=20 privileged, undisclosed or otherwise confidential information. If you = have=20 received this e-mail in error, you are hereby notified that any review, = copying=20 or distribution of it is strictly prohibited. Please inform <SPAN=20 class=3D039112913-10102006>the sender</SPAN> immediately and = destroy the=20 original transmittal. Thank you for your=20 cooperation.</EM></FONT></P></DIV></SPAN> <P class=3DMsoNormal=20 style=3D"MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN=20 style=3D"FONT-SIZE: 8pt; COLOR: blue; mso-bidi-font-size: 10.0pt; = mso-ansi-language: EN-US; mso-bidi-font-family: Arial"><FONT=20 color=3D#000000></FONT></SPAN> </P> <P class=3DMsoNormal=20 style=3D"MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN=20 style=3D"FONT-SIZE: 8pt; COLOR: blue; mso-bidi-font-size: 10.0pt; = mso-ansi-language: EN-US; mso-bidi-font-family: Arial"></SPAN><SPAN=20 style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: UniversSEuro45Light; = mso-bidi-font-size: 10.0pt; mso-ansi-language: = EN-US"><o:p></o:p></SPAN> </P></FONT></DIV> <DIV> </DIV></BODY></HTML> ------_=_NextPart_001_01C74B6B.ABFA284F-- --===============1110170578== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ announce mailing list [email protected] http://www.kannel.org/mailman/listinfo/announce --===============1110170578==--