Hi,
I think tomcat doesn't support php.
When kannel calls the "get-url" it will response with the result of that
url, so, if you print or echo any thing in your java or php page, this
output will be sent to the mobile subscriber.
(from user guide): Normally, Kannel sends a warning to the user if there was
an empty reply from the service provider. If omit-empty is set to 'true',
Kannel will send nothing at all in such a case.
to prevent kannel from sending the output of your page you can use "
max-messages=0" in sms-service group, in this case you have to send the
message by your self.
to send sms with java I wrote this method:
Try it:
public String send(String serverIP, String serverSendPort, String user,
String password, String smsc, String mt, String text, String from) {
String result = "";
try {
String data = java.net.URLEncoder.encode(text, "UTF8");
String msisdn = java.net.URLEncoder.encode(mt, "UTF8");
String sendURL = "http://" + serverIP + ":" + serverSendPort +
"/cgi-bin/sendsms?username=" + user + "&password=" + password +
"&charset=utf-8&coding=2&to=" + msisdn + "&text=" + data + "&smsc=" + smsc+
"&from=" + from;
java.net.URL url = new java.net.URL(sendURL);
java.io.InputStream in = url.openStream();
java.io.BufferedInputStream bufIn = new
java.io.BufferedInputStream(in);
for (;;) {
int car = bufIn.read(); // Check for EOF
if (car == -1) {
break;
} else {
result = result + (char) car;
}
}
bufIn.close();
in.close();
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
On Sat, Jun 6, 2009 at 3:30 AM, Arnie white <[email protected]> wrote:
> Dear all:
> can you help me ,i have steup my kannel & tested using smpp its ok ,i can
> send & receive as test ,but i could not receive 2 way ,i wrote the file in
> to php
>
> get-url =
> "http://localhost:8080/sms.php?phone=%p&text=%a&receivedon=%t<http://www.example.com/index.php?mobilenumber=%p&message=%a&receivedon=%t>
> "
>
>
> then inside the php after codes
>
>
> http://localhost:13013/cgi-bin/sendsms?username=xxxxxx&password=xxxxx&smsc=xxxxx&from=6565&to="phone"&text="message"<http://something.com:13013/cgi-bin/sendsms?username=ksend&password=ksend&smsc=smscon2&from=5858&to=12345678&text=Hi>
>
> but no reply ,is there any modify or paramters inside cgi-bin ,please i
> need to run 2way sms
> do i have to open the port 13013 or if you have any idea might help
> im using tomcat
>
> or how can i test 2 way reply from url ??
>
>
> On Mon, Jun 1, 2009 at 5:17 PM, Hemant Gmail <[email protected]> wrote:
>
>> PERFECT !!! It is working just fine … thank you so much
>>
>>
>>
>> *From:* Alejandro Guerrieri [mailto:[email protected]]
>> *Sent:* Monday, June 01, 2009 8:35 PM
>> *To:* Hemant Gmail
>> *Cc:* [email protected]
>> *Subject:* Re: SEND-SMS problem
>>
>>
>>
>> You need to specify "allowed-smsc-id" on each connection.
>>
>>
>>
>> Regards,
>>
>>
>>
>> Alejandro
>>
>> On Mon, Jun 1, 2009 at 5:00 PM, Hemant Gmail <[email protected]> wrote:
>>
>> Hello friends,
>>
>>
>>
>> I am facing a strange problem.
>>
>>
>>
>> I have configured two SMSC server to which I am able to send the message
>> successfully when tested individually. Now when I start the bearbox with
>> both the connection live it shows me both “smscon1” and “smscon2”
>> connections live. But when I am send consecutive messages to “smscon2” some
>> of the messages are sent to “smscon1”.
>>
>>
>>
>> Below is the URL I call to send message and the configuration file. Can
>> you please let me how I can solve this problem?
>>
>>
>>
>> URL 1:
>> http://something.com:13013/cgi-bin/sendsms?username=llsend&password=llsend&smsc=smscon1&from=5555&to=12345678&text=HiSMSCON1
>>
>> URL 2:
>> http://something.com:13013/cgi-bin/sendsms?username=ksend&password=ksend&smsc=smscon2&from=5858&to=12345678&text=HiSMSCON2
>>
>>
>>
>> Configuration File:
>>
>>
>>
>> group = core
>>
>> admin-port = 13000
>>
>> smsbox-port = 13001
>>
>> admin-password = pw1122
>>
>> status-password = pw3344
>>
>> #admin-deny-ip = ""
>>
>> #admin-allow-ip = ""
>>
>> log-file = "/var/log/kannel/kannel.log"
>>
>> log-level = 0
>>
>> #box-deny-ip = "*.*.*.*"
>>
>> admin-allow-ip = "127.0.0.1;12.0.0.*"
>>
>> box-deny-ip = "*.*.*.*"
>>
>> box-allow-ip = "127.0.0.1;12.0.0.*"
>>
>> access-log = "/var/log/kannel/kannel-access.log"
>>
>> smsbox-max-pending = 1000
>>
>> sms-resend-retry = 3
>>
>> sms-resend-freq = 60
>>
>> dlr-storage = internal
>>
>> sms-incoming-queue-limit = -1
>>
>> sms-outgoing-queue-limit = -1
>>
>>
>>
>> #---------------------------------------------
>>
>> # SMSC CONNECTIONS
>>
>>
>>
>> group = smsc
>>
>> smsc = smpp
>>
>> smsc-id = smscon1
>>
>> host = 196.144.159.119
>>
>> port = 5016
>>
>> smsc-username = "con1"
>>
>> smsc-password = con1
>>
>> system-type = ""
>>
>> transceiver-mode = yes
>>
>> address-range = ""
>>
>> source-addr-ton = 1
>>
>> source-addr-npi = 1
>>
>> dest-addr-ton = 1
>>
>> dest-addr-npi = 1
>>
>> my-number = 555
>>
>>
>>
>>
>>
>> group = smsc
>>
>> smsc = smpp
>>
>> smsc-id = smscon2
>>
>> host = 10.111.141.180
>>
>> port = 5005
>>
>> smsc-username = "con2"
>>
>> smsc-password = con2
>>
>> system-type = ""
>>
>> transceiver-mode = yes
>>
>> address-range = ""
>>
>> source-addr-ton = 5
>>
>> source-addr-npi = 0
>>
>> dest-addr-ton = 1
>>
>> dest-addr-npi = 1
>>
>> my-number = 5858
>>
>>
>>
>> #---------------------------------------------
>>
>> # SMSBOX SETUP
>>
>>
>>
>> group = smsbox
>>
>> bearerbox-host = 127.0.0.1
>>
>> sendsms-port = 13013
>>
>> log-file = "/var/log/kannel/smsbox.log"
>>
>> log-level = 0
>>
>> access-log = "/var/log/kannel/smsbox-access.log"
>>
>>
>>
>> #---------------------------------------------
>>
>> # SEND-SMS USERS
>>
>>
>>
>> group = sendsms-user
>>
>> username = llsend
>>
>> password = llsend
>>
>> forced-smsc = smscon1
>>
>>
>>
>> group = sendsms-user
>>
>> username = ksend
>>
>> password = ksend
>>
>> forced-smsc = smscon2
>>
>>
>>
>> #---------------------------------------------
>>
>> # SERVICES
>>
>>
>>
>> group = sms-service
>>
>> keyword = default
>>
>> catch-all = yes
>>
>> get-url = "
>> http://www.example.com/index.php?mobilenumber=%p&message=%a&receivedon=%t<http://www.example.com/index.php?mobilenumber=%25p&message=%25a&receivedon=%25t>
>> "
>>
>>
>>
>> Regards,
>>
>> Hemant.
>>
>>
>>
>>
>>
>>
>>
>
>