Mobile Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreMobile Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 2nd, 2007, 10:28 PM
motapa motapa is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2006
Posts: 8 motapa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 59 sec
Reputation Power: 0
Stopping kannel from sending too many messages

Hi all. I have finally configured kannel and it works, but not quite as I want it to. The problem is when I send one messages, it triggers a series of acknowledgement messages to the global sender without stopping; the only way to stop it is if I close the whole box.

Here is how my configurations look like:

#
# THIS IS A SAMPLE CONFIGURATION FOR SMS KANNEL
#
# It is run like this:
#
# 1% gw/bearerbox gw/smskannel.conf
# 2% gw/smsbox gw/smskannel.conf
# 3% test/fakesmsc -p 10000 -H localhost -i 1 -m 100 "123 345 text nop"
#
# ..all 3 commands in separate shells (or screen sessions)
#
# For any modifications to this file, see Kannel User Guide
# If that does not help, send email to users@kannel.org
#
# Kalle Marjola May 2000
# Changed for new fakesmsc version by Uoti Urpala Jan 2001
# Added service and sendsms for HTTP SMSC by Kalle Marjola Mar 2001

#----------------------------------------------
#CORE CONFIGURATION
#----------------------------------------------
group = core
admin-port = 13000
smsbox-port = 13001
admin-password = admin
status-password = admin
admin-deny-ip = *.*.*.*
admin-allow-ip = "127.0.0.1;192.168.*.*"
log-file = logfile/smskannel.log
log-level = 0
access-log = logfile/kannelaccess.log
box-deny-ip = *.*.*.*
box-allow-ip = "127.0.0.1;192.168.*.*"
unified-prefix = "+266,09266;"
store-file = logfile/kannel.store
#dlr-storage = mysql
#wpd-interface-name = *
#ssl-server-cert-file = "cert.pem"
#ssl-server-key-file = "key.pem"
#ssl-certkey-file = "mycertandprivkeyfile.pe

#---------------------------------------------
# SMSBOX SETUP
#---------------------------------------------
group = smsbox
bearerbox-host = localhost
sendsms-port = 13013
global-sender = +266********
sendsms-url = "http://localhost:13013/cgi-bin/sendsms"
sendsms-chars = "0123456789+-"
log-file = logfile/smsbox.log
log-level = 0
access-log = logfile/smsaccess.log
#http-queue-delay = 15
#http-request-retry = 4
#http-proxy-port = 3128
#http-proxy-host =
reply-couldnotfetch = "could not retrieve"
reply-couldnotrepresent = "could not represent"
reply-requestfailed = "request failed"
reply-emptymessage = "the message is empty"

#----------------------------------------------
#SMSC CONFIGURATION
#-----------------------------------------------
group = smsc
smsc = at
smsc-id = smsrelay
modemtype = wavecom
device = /dev/ttyS1
speed = 9600
pin = 1111
phone = +266********
sms-center = +266820088
my-number = +266*******
smsc-username = root
smsc-password = admin

group = smsc
smsc = http
smsc-id = smsrelay
system-type = kannel
smsc-username = root
smsc-password = admin
port = 14000
send-url = "http://localhost:14000/cgi-bin/sendsms"
connect-allow-ip = "127.0.0.1;192.168.*.*"

#----------------------------------------------
#The MODEM group configuration
#----------------------------------------------
group = modems
id = wavecom
name = wavecom
speed = 9600
no-pin = false
init-string = "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
detect-string = "WAVECOM"
detect-string2 = "MODEM"

#----------------------------------------------
# SERVICES
#----------------------------------------------
group = sms-service
keyword = default
#get-url = "http://localhost:14000/cgi-bin/sendsms"
get-url = "http://localhost:14000/cgi-bin/sendsms?username=root&password=admin&from=%p&to=%P&text=%a&smsc=%i"
#post-url = "http://localhost:14000/cgi-bin/sendsms?username=root&password=admin&sender=%p&to=%P&text=%r"
#send-url = "http://localhost/cgi-bin/sendsms?to=%P&text=%r"
#catch-all = true
#strip-keyword = true
#faked-sender = +266********
#faked-sender = +266********
concatenation = 1
#accept-x-kannel-headers = true
#text = "Enjoy the freedom of open source"

#group = sms-service
#keyword = nop
#get-url = "http://localhost/smskannel.php"

#group = sms-service
#keyword = nop
#text = "No service specified"

#----------------------------------------------
# SEND-SMS USERS
#----------------------------------------------
group = sendsms-user
username = root
password = admin
user-deny-ip = "*.*.*.*"
user-allow-ip = "127.0.0.1;192.168.*.*"
max-messages = 2
concatenation = 1

Reply With Quote
  #2  
Old January 11th, 2007, 04:07 PM
motapa motapa is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2006
Posts: 8 motapa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 59 sec
Reputation Power: 0
I think i found out why my kannel will not stop sending. My get URL in the default service is a sendsms script, so upon receiving the requests it sends a "sent" message. It was locked in a cycle of receiving a sensms service and seding the message.

Anyway that problem is solved, but now I have another problem which persists despite my most serious effort to solve it. I sometimes think that it wants me to have some comprehensive python knowledge which I am a newbie to. I have a smsservice which I took from the alligator server documentation, with the proverb keyword. When i send the word proverb from my phone it does not it does not service that request, instead it routes my request to the default service. Even when I perform a sms push it still does the same thing.

This is what my log looks like. I will also include my updated script.

This is what happens when I send a "proverb" message from my phone.

2007-01-11 01:45:15 [24795] [4] INFO: Starting to service <proverb> from <+26658737146> to <1234>
2007-01-11 01:45:15 [24795] [4] DEBUG: Started thread 8 (gwlib/fdset.coller)
2007-01-11 01:45:15 [24795] [4] DEBUG: Started thread 9 (gwlib/http.c:write_request_thread)
2007-01-11 01:45:15 [24795] [8] DEBUG: Thread 8 (gwlib/fdset.coller) maps to pid 24795.
2007-01-11 01:45:15 [24795] [9] DEBUG: Thread 9 (gwlib/http.c:write_request_thread) maps to pid 24795.
2007-01-11 01:45:15 [24795] [9] DEBUG: Parsing URL `http://localhost:14000/potd.html':
2007-01-11 01:45:15 [24795] [9] DEBUG: Scheme: http://
2007-01-11 01:45:15 [24795] [9] DEBUG: Host: localhost
2007-01-11 01:45:15 [24795] [9] DEBUG: Port: 14000
2007-01-11 01:45:15 [24795] [9] DEBUG: Username: (null)
2007-01-11 01:45:15 [24795] [9] DEBUG: Password: (null)
2007-01-11 01:45:15 [24795] [9] DEBUG: Path: /potd.html
2007-01-11 01:45:15 [24795] [9] DEBUG: Query: (null)
2007-01-11 01:45:15 [24795] [9] DEBUG: Fragment: (null)
2007-01-11 01:45:25 [24795] [9] DEBUG: HTTP: Opening connection to `localhost:14000' (fd=28).
2007-01-11 01:45:25 [24795] [9] DEBUG: Socket connecting
2007-01-11 01:45:25 [24795] [8] DEBUG: Get info about connecting socket
2007-01-11 01:45:25 [24795] [8] DEBUG: HTTP: Sending request:
2007-01-11 01:45:25 [24795] [8] DEBUG: Octet string at 0x9f1a280:
2007-01-11 01:45:25 [24795] [8] DEBUG: len: 76
2007-01-11 01:45:25 [24795] [8] DEBUG: size: 1024
2007-01-11 01:45:25 [24795] [8] DEBUG: immutable: 0
2007-01-11 01:45:25 [24795] [8] DEBUG: data: 47 45 54 20 2f 70 6f 74 64 2e 68 74 6d 6c 20 48 GET /potd.html H
2007-01-11 01:45:25 [24795] [8] DEBUG: data: 54 54 50 2f 31 2e 31 0d 0a 48 6f 73 74 3a 20 6c TTP/1.1..Host: l
2007-01-11 01:45:25 [24795] [8] DEBUG: data: 6f 63 61 6c 68 6f 73 74 3a 31 34 30 30 30 0d 0a ocalhost:14000..
2007-01-11 01:45:25 [24795] [8] DEBUG: data: 55 73 65 72 2d 41 67 65 6e 74 3a 20 4b 61 6e 6e User-Agent: Kann
2007-01-11 01:45:25 [24795] [8] DEBUG: data: 65 6c 2f 31 2e 34 2e 30 0d 0a 0d 0a el/1.4.0....
2007-01-11 01:45:25 [24795] [8] DEBUG: Octet string dump ends.
2007-01-11 01:45:25 [24795] [8] DEBUG: HTTP: Status line: <HTTP/1.1 202 Accepted>
2007-01-11 01:45:25 [24795] [8] DEBUG: HTTP: Received response:
2007-01-11 01:45:25 [24795] [8] DEBUG: Octet string at 0x9f1a280:
2007-01-11 01:45:25 [24795] [8] DEBUG: len: 102
2007-01-11 01:45:25 [24795] [8] DEBUG: size: 1024
2007-01-11 01:45:25 [24795] [8] DEBUG: immutable: 0
2007-01-11 01:45:25 [24795] [8] DEBUG: data: 53 65 72 76 65 72 3a 20 4b 61 6e 6e 65 6c 2f 31 Server: Kannel/1
2007-01-11 01:45:25 [24795] [8] DEBUG: data: 2e 34 2e 30 0d 0a 43 6f 6e 74 65 6e 74 2d 4c 65 .4.0..Content-Le
2007-01-11 01:45:25 [24795] [8] DEBUG: data: 6e 67 74 68 3a 20 33 32 0d 0a 43 6f 6e 74 65 6e ngth: 32..Conten
2007-01-11 01:45:25 [24795] [8] DEBUG: data: 74 2d 54 79 70 65 3a 20 74 65 78 74 2f 70 6c 61 t-Type: text/pla
2007-01-11 01:45:25 [24795] [8] DEBUG: data: 69 6e 0d 0a 0d 0a 41 75 74 68 6f 72 69 7a 61 74 in....Authorizat
2007-01-11 01:45:25 [24795] [8] DEBUG: data: 69 6f 6e 20 66 61 69 6c 65 64 20 66 6f 72 20 73 ion failed for s
2007-01-11 01:45:25 [24795] [8] DEBUG: data: 65 6e 64 73 6d 73 endsms
2007-01-11 01:45:25 [24795] [8] DEBUG: Octet string dump ends.
2007-01-11 01:45:25 [24795] [5] DEBUG: message length 32, sending 1 messages



This I get when I send "Lumela motapa from my browser."
2007-01-11 01:53:31 [24795] [4] INFO: Starting to service <lumela motapa> from < 26658491286> to <58737146>
2007-01-11 01:53:31 [24795] [4] DEBUG: formatted text answer: <Sorry,no specified service for your request.>
2007-01-11 01:53:31 [24795] [4] DEBUG: message length 44, sending 1 messages
2007-01-11 01:53:41 [24795] [4] INFO: Starting to service <Sorry,no specified service for your request.> from <58737146> to < 26658491286>
2007-01-11 01:53:41 [24795] [4] DEBUG: formatted text answer: <Sorry,no specified service for your request.>
2007-01-11 01:53:41 [24795] [4] DEBUG: message length 44, sending 1 messages
2007-01-11 01:59:14 [24795] [0] ERROR: SIGINT received, aborting program...
2007-01-11 01:59:14 [24795] [0] INFO: Received (and handled?) 3 requests in 839 seconds (0.00 per second)


The new script;

#CORE GROUP
group = core
admin-port = 13000
admin-password = admin
smsbox-port = 13001
log-file = testlog/bearerbox.log
log-level = 1
box-deny-ip = *.*.*.*
box-allow-ip = 192.168.*.*;127.0.0.1;196.24.0.*
admin-deny-ip = *.*.*.*
admin-allow-ip = 192.168.*.*
unified-prefix = +266,09266;
access-log = testlog/accesslog.access
store-file = kannel.log
smsbox-max-pending = 5
maximum-queue-length = 5

#SMSBOX
group = smsbox
bearerbox-host = localhost
sendsms-port = 13013
#global-sender = +26658704044
log-file = testlog/smsbox.log
log-level = 1
access-log = testlog/smsbox.access

#SMSC MODEM
group = smsc
smsc = at
smsc-id = modemrelay
modemtype = wavecom
device = /dev/ttyS1
speed = 9600
pin = 1111
phone = +26658491286
sms-center = +266820088
smsc-username = root
smsc-password = admin

group = smsc
smsc = http
smsc-id = httprelay
host = localhost
port = 14000
our-port = 14001
system-type = kannel
smsc-username = root
smsc-password = admin
device = /dev/ttys1
connect-allow-ip = 192.168.*.*
send-url = "http://localhost:14000/cgi-bin/sendsms"
connect-allow-ip = "127.0.0.1;192.168.*.*;196.24.0.5"

#GROUP MODEM
group = modems
id = wavecom
name = wavecom
speed = 9600
no-pin = false
init-string = "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
detect-string = "WAVECOM"
detect-string2 = "MODEM"

#GROUP SERVICES
group = sms-service
keyword = proverb
aliases = potd
get-url = http://localhost:14000/potd.html
prefix = <!--beginprov-->
suffix = <!--endprov-->
split-chars = ,;.
split-suffix = "'cont.'"
accepted-smsc = modemrelay
concatenation = 1
max-messages = 3

group = sms-service
keyword = default
text = "Sorry,no specified service for your request."

#GROUP USERS
group = sendsms-user
username = root
password = admin
max-messages = 2
split-chars = .;,
split-suffix = "'cont.'"
header = "From the MMG group."
user-deny-ip = *.*.*.*
user-allow-ip = 192.168.*.*
forced-smsc = httprelay

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreMobile Programming > Stopping kannel from sending too many messages


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT