Discuss How to send SMS with Kannel in the Mobile Programming forum on Dev Shed. How to send SMS with Kannel Mobile Programming forum discussing development for mobile technologies from basic mark-up languages
such as WML and XHTML MP to server generated code and applications. Widsets, SMS, gateway and server
set up are also covered here.
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month! Download and Activate to enter!
Web development can be a daunting task, even for specialists. There is a lot of information to absorb and a lot of technologies to learn in order to manage a superior website. When trying to learn the ropes, developers need a reliable source to introduce new ideas that can be easily implemented. When working on large projects, even web veterans may run into a technology or an aspect of a technology that they are unfamiliar with.
Posts: 8
Time spent in forums: 18 m 59 sec
Reputation Power: 0
How to send SMS with Kannel
I have configured sms kannel in the following manner, but I can't send any sms. I tried to use the sendsms.php script that comes with kannel but I just cant get any messages sent. What am I doin wrong? How can I actually send sms messages now that my kannel is up and running?
#The CORE group configuration
group = core
admin-port = 13000
smsbox-port = 13001
admin-password = bar
status-password = foo
Let the might of your compassion arise to bring a quick end
to the flowing stream of the blood and tears .....
Please hear my anguished words of truth.
__________________
Posts: 8
Time spent in forums: 18 m 59 sec
Reputation Power: 0
I've looked into my log files and its contents are the same as the outputs I get when running the boxes. I tried looking at the output of the running boxes when I send an sms and there was no change in the outputs.
Could this be because the php script is not correctly corrected to kannel. I tried copying the ".inc" file into the same folder as the php script and nothing still happens.
Posts: 31
Time spent in forums: 17 h 46 m 46 sec
Reputation Power: 13
Quote:
Originally Posted by motapa
I've looked into my log files and its contents are the same as the outputs I get when running the boxes. I tried looking at the output of the running boxes when I send an sms and there was no change in the outputs.
Could this be because the php script is not correctly corrected to kannel. I tried copying the ".inc" file into the same folder as the php script and nothing still happens.
hey motapa,would u mind sending the exact php scipt u r using so that i can see how and where ur problem might be! i might help u from there.
but again i just would like to know what OS u r using,webserver,php version...it will help help you.
if ($submit)
{
echo "Sending the SMS Text message <b>\"$text\"</b> to the phone <b>$to</b>...<br>\n";
$URL = "/cgi-bin/sendsms?username=".USERNAME."&password=".PASSWORD."&from=".GLOBAL_SENDER."&to=$to&text=".urlencode($text);
http_send($URL,13013);
echo "<address><a href=\"$PHP_SELF\">Back to Send SMS</a></address>\n";
} else {
def is_a_phone_number(str):
if not str:
return 0
for c in str:
if not c in "0123456789+- ":
return 0
return 1
def recipient(arg):
if is_a_phone_number(arg):
return arg
f = open(os.path.expanduser(NUMBERS), "r")
arg = string.lower(arg)
number = None
for line in f.readlines():
parts = string.split(line)
if len(parts) == 2 and string.lower(parts[0]) == arg:
number = parts[1]
break
f.close()
if number:
return number
print "Unknown recipient", arg
sys.exit(1)
def sendsms():
to = urllib.quote_plus(recipient(sys.argv[1]))
text = urllib.quote_plus(string.join(sys.argv[2:], " "))
url="http://%s:%d/cgi-bin/sendsms?username=%s&password=%s&to=%s&text=%s" \
% (HOST, PORT, USERNAME, PASSWORD, to, text)
f = urllib.urlopen(url)
print f.read()
f.close()
Posts: 8
Time spent in forums: 18 m 59 sec
Reputation Power: 0
I have done more home work and can now connect to my kannel. The only problem now is that when I try to send a sms it gives me a "Unknown Request" message. How can I overcome this.
if ($submit)
{
echo "Sending the SMS Text message <b>\"$text\"</b> to the phone <b>$to</b>...<br>\n";
$URL = "/cgi-bin/sendsms?username=".USERNAME."&password=".PASSWORD."&from=".GLOBAL_SENDER."&to=$to&text=".urlencode($text);
http_send($URL,13013);
echo "<address><a href=\"$PHP_SELF\">Back to Send SMS</a></address>\n";
} else {
def is_a_phone_number(str):
if not str:
return 0
for c in str:
if not c in "0123456789+- ":
return 0
return 1
def recipient(arg):
if is_a_phone_number(arg):
return arg
f = open(os.path.expanduser(NUMBERS), "r")
arg = string.lower(arg)
number = None
for line in f.readlines():
parts = string.split(line)
if len(parts) == 2 and string.lower(parts[0]) == arg:
number = parts[1]
break
f.close()
if number:
return number
print "Unknown recipient", arg
sys.exit(1)
def sendsms():
to = urllib.quote_plus(recipient(sys.argv[1]))
text = urllib.quote_plus(string.join(sys.argv[2:], " "))
url="http://%s:%d/cgi-bin/sendsms?username=%s&password=%s&to=%s&text=%s" \
% (HOST, PORT, USERNAME, PASSWORD, to, text)
f = urllib.urlopen(url)
print f.read()
f.close()
if __name__ == "__main__":
sendsms()
Hello,
I am at previous stage than this. Can you please help me in how to create these scripts with what extensions? What is the default locations for these script files?
and how is sendsms.php using the python script? where is it placed?
Posts: 7
Time spent in forums: 2 h 1 m 58 sec
Reputation Power: 0
I need to enable content providing service on a keyword
Hello ppl,
can anybody tell me how should I use a keyword enabled content providing service? According to me I would have to add a sms-service group to kannel.conf with get-url as the depending upon keyword.
Posts: 8
Time spent in forums: 18 m 59 sec
Reputation Power: 0
Re:
Quote:
Originally Posted by vijay_pict
Hello ppl,
can anybody tell me how should I use a keyword enabled content providing service? According to me I would have to add a sms-service group to kannel.conf with get-url as the depending upon keyword.
How should I create a cgi script for that?
Right you are. you have to add a sms-service group to your script. The service you provide can either be from a web page in which case you have to specif the get-url, or just url. Or it can be plain text,then you have to have a line like "text = <Your service here>", or the service could be to fetch content from a file then you'd need to add "file = <your filename and path here>".
And you do not need a script for that, the ".../cgi-bin/sendsms" is not necessarily a script. It is just a tag, kinda like 'status' and 'shutdown' and 'restart'.
Try using the alligata server manual along with the kannel manual. It helped fill the spaces that the kannel user guide left in my case.
Posts: 7
Time spent in forums: 2 h 1 m 58 sec
Reputation Power: 0
3: Queued for later
3: Queued or later delivery
Description of above response by kannel:
The message has been accepted and is delivered onward to a SMSC driver. Note that this status does not ensure that the intended recipient receives the
message.
How can I resolve this problem
I tried many things.
Added
my-number = < no. of SIM inserted>
smsc-center = < my smsc no. of above SIM> to kannel .conf
Is that right?
my modem is SIEMENS TC35
I am connecting it with USB to pc and RS232 to modem
is there any prob. of device-type?
I've tried it with ttyS0 and ttyUSB0
group = sendsms-user
username = mobile
password = mobile
#user-deny-ip = ""
#user-allow-ip = ""
faked-sender = abc
group = sendsms-user
username = mobile
password = mobile
dlr-url = "(URL address blocked: See forum rules):4400/DeliveryReport?sender=%p&to=%P&time=%T&status=%A"
# SERVICES
group = sms-service
keyword = nop
get-url = (URL address blocked: See forum rules)
text = "You asked nothing and I did it!"
# there should be default always
group = sms-service
keyword = tel
exec = "c:/windows/systm32/pq2.exe %p+%a"
max-messages = 0
group = sms-service
keyword = default
accept-x-kannel-headers = true
send-sender = true
omit-empty = true
post-url = "(URL address blocked: See forum rules):4400/IncomingMessage"
max-messages = 0
So please help me with this problem
Last edited by vijay_pict : January 15th, 2007 at 08:52 AM.
Reason: Needed to add some data in it
Posts: 2
Time spent in forums: 17 m 17 sec
Reputation Power: 0
the same problem happened to me
Hi, I met the same problem and end up with "queued for later delivery".
Can you share some solutions with me? I am using ubuntu7.04 and a nokia n80 phone.
I would really appreciate your help.
Thanks in advance
Quote:
Originally Posted by vijay_pict
The problem is solved Now.
It was pc and kannel version problem. yum helped me.