'send sms with an operator using smpp and kannel
I work with ubuntu 10.10
currently I send sms with clickatell using this code
Message = space_to_plus("message de test."),
Url = io_lib:format("http://api.clickatell.com/http/sendmsg?user=...&password=...&api_id=...&to=216~s&text=~s", [Name, Message]),
http:request(lists:flatten(Url), sms).
and for the moment we have an agreement with an operator Orange
and we will send sms through this operator
sms will be sent using smpp 3.4 and API kannel
I install kannel using this command :
apt-get install libxml2
apt-get install kannel
and for the configuration of kannel.conf I make this values :
group = core
admin-port = 13000
smsbox-port = 13001
admin-password = zaibadmin
status-password = zaibstatus
log-file = "/var/log/kannel/bearerbox.log"
log-level = 0
box-deny-ip = "*.*.*.*"
box-allow-ip = "127.0.0.1"
group = smsc
smsc = smpp
smsc-id = testsmsc
host = localhost
port = 2775
receive-port = 2775
smsc-username = 'smppclient'
smsc-password = password
system-type = 'VMA'
service-type = 'test'
interface-version = 34
address-range = ''
msg-id-type = 0
group = modems
id = teltonika
name = "Teltonika E12"
detect-string = "Undefined"
enable-mms = true
init-string = "AT+CNMI=2,2,0,1,1"
speed = 115200
group = smsbox
bearerbox-host = localhost
sendsms-port = 13013
global-sender = 13013
sendsms-chars = "0123456789 +-"
log-file = "/var/log/kannel/smsbox.log"
log-level = 0
access-log = "/var/log/kannel/access.log"
group = sendsms-user
username = kannel
password = kannel
concatenation = true
max-messages = 3
group = sms-service
keyword = default
get-url = "http://localhost/kannel/receivesms.php?sender=%p&text=%b"
accept-x-kannel-headers = true
max-messages = 3
concatenation = true
catch-all = true
I think that we should have same parameter from the operator orange like :
smsc-username
smsc-password
host
port
when I try in the browser with :
http://10.20.20.26:13000/status?password=zaibstatus
I have :
Kannel bearerbox version `1.4.3'. Build `Apr 6 2010 13:16:08', compiler `4.4.3'. System Linux, release 2.6.32-41-generic, version #90-Ubuntu SMP Tue May 22 11:31:25 UTC 2012, machine i686. Hostname ubuntu, IP 127.0.1.1. Libxml version 2.7.6. Using OpenSSL 0.9.8k 25 Mar 2009. Compiled with MySQL 5.1.41, using MySQL 5.1.63. Using native malloc.
Status: running, uptime 0d 0h 0m 38s
WDP: received 0 (0 queued), sent 0 (0 queued)
SMS: received 0 (0 queued), sent 0 (0 queued), store size -1
SMS: inbound (0.00,0.00,0.00) msg/sec, outbound (0.00,0.00,0.00) msg/sec
DLR: 0 queued, using internal storage
Box connections:
smsbox:(none), IP 127.0.0.1 (0 queued), (on-line 0d 0h 0m 33s)
SMSC connections:
testsmsc SMPP:localhost:2775/2775:'smppclient':'VMA' (re-connecting, rcvd 0, sent 0, failed 0, queued 0 msgs)
and when I try with :
http://10.20.20.26:13013/cgi-bin/sendsms?username=kannel&password=kannel&to=97919860&text=ZAIB+KANNEL+WORk
I have :
3: Queued for later delivery
can sameone help me to correct the configuration of kannel.conf
because I think that I did an error in this configuration
Solution 1:[1]
I find in the net another configuration related to kannel.conf file
group = core
admin-port = 13000
smsbox-port = 13001
admin-password = bar
log-file = "/tmp/kannel.log"
log-level = 0
box-deny-ip = "*.*.*.*"
box-allow-ip = "127.0.0.1"
group=smsc
smsc=smpp
smsc-id=internal
interface-version=34
host=internal.smpp.ddj.co.za
port=9102
system-id=donsmpp
smsc-password=strngpas
system-type=default
transceiver-mode=1
group = smsbox
bearerbox-host = 127.0.0.1
sendsms-port = 13013
log-level = 0
of course I have to change the settings below
IP address
System-id (username)
Password
port
I want to know the right configuration
because I removed from the old configuration this part:
group = modems
id = teltonika
name = "Teltonika E12"
detect-string = "Undefined"
enable-mms = true
init-string = "AT+CNMI=2,2,0,1,1"
speed = 115200
group = sendsms-user
username = kannel
password = kannel
concatenation = true
max-messages = 3
group = sms-service
keyword = default
get-url = "http://localhost/kannel/receivesms.php?sender=%p&text=%b"
accept-x-kannel-headers = true
max-messages = 3
concatenation = true
catch-all = true
Solution 2:[2]
In your status shows SMSC connections: testsmsc is in reconnecting state , thats why it is showing status Queued for later delivery. You need to make smsc connection online .
Solution 3:[3]
Activate Kannel SMSBox
sudo mkdir -p /var/log/kannel /var/run/kannel /var/spool/kannel/store
sudo chown -R kannel /var/log/kannel /var/run/kannel /var/spool/kannel/store
sudo usermod -a -G dialout kannel
sudo sed -i 's/#START_SMSBOX/START_SMSBOX/' /etc/default/kannel
Done!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | francoi mocci |
Solution 2 | eshaiju |
Solution 3 | Majid Hajibaba |