Can't send SMS with Kannel (+CMS ERROR: +CMS ERROR: 500)


(Mapiiiaji) #1

Hi everybody! There is a similar situation, please help.
I have installed kannel version 1.4.4 and if I try send SMS (curl “http://127.0.0.1:13013/cgi-bin/sendsms?username=foo&password=bar&to=+998935217698&text=Hello+world”), I receive 0: Accepted for deliveryr in shell. In /var/log/kannel/access.log in last line I receive
request added - sender:foo:SMSd 127.0.0.1 target:998935217698 request: ‘Hello world’ without + sign and in /var/log/kannel/kannel.log
2018-08-25 15:32:26 [14571] [7] DEBUG: sms_router: gwlist_len = 3
2018-08-25 15:32:26 [14571] [7] DEBUG: sms_router: handling message (0x7fd9d8000fb0 vs 0x7fd9d8000fb0)
2018-08-25 15:32:26 [14571] [7] DEBUG: Message routed successfully.
2018-08-25 15:32:26 [14571] [7] DEBUG: sms_router: handling message (0x7fd9dc003c40 vs 0x7fd9dc003c40)
2018-08-25 15:32:26 [14571] [7] DEBUG: re-queing SMS not-yet-to-be resent
2018-08-25 15:32:26 [14571] [7] DEBUG: sms_router: handling message (0x7fd9d80013f0 vs 0x7fd9dc003c40)
2018-08-25 15:32:26 [14571] [7] DEBUG: Message routed successfully.
2018-08-25 15:32:26 [14571] [7] DEBUG: sms_router: handling message (0x7fd9dc003c40 vs 0x7fd9dc003c40)
2018-08-25 15:32:26 [14571] [7] DEBUG: re-queing SMS not-yet-to-be resent
2018-08-25 15:32:26 [14571] [7] DEBUG: sms_router: handling message (0x7fd9dc003c40 vs 0x7fd9dc003c40)
2018-08-25 15:32:26 [14571] [7] DEBUG: re-queing SMS not-yet-to-be resent
2018-08-25 15:32:26 [14571] [7] DEBUG: sms_router: time to sleep 30.00 secs.

and in /var/log/kannel/smsc-gsm1.log

2018-08-25 15:33:43 [14571] [6] DEBUG: AT2[gsm1]: --> AT+CPMS?^M
2018-08-25 15:33:43 [14571] [6] DEBUG: AT2[gsm1]: <-- +CPMS: “SM”,0,20,“SM”,0,20,“ME”,0,100
2018-08-25 15:33:43 [14571] [6] DEBUG: AT2[gsm1]: <-- OK
2018-08-25 15:33:57 [14571] [6] DEBUG: AT2[gsm1]: TP-Validity-Period: 55 minutes
2018-08-25 15:33:57 [14571] [6] DEBUG: AT2[gsm1]: --> AT+CMGS=24^M
2018-08-25 15:33:57 [14571] [6] DEBUG: AT2[gsm1]: <-- >
2018-08-25 15:33:57 [14571] [6] DEBUG: AT2[gsm1]: send command status: 1
2018-08-25 15:33:57 [14571] [6] DEBUG: AT2[gsm1]: --> 0011000C8199985312678900000A0BC8329BFD06DDDF723619
2018-08-25 15:33:57 [14571] [6] DEBUG: AT2[gsm1]: --> ^Z
2018-08-25 15:33:57 [14571] [6] DEBUG: AT2[gsm1]: <-- >
2018-08-25 15:34:00 [14571] [6] DEBUG: AT2[gsm1]: <-- +CMS ERROR: 500
2018-08-25 15:34:00 [14571] [6] ERROR: AT2[gsm1]: +CMS ERROR: +CMS ERROR: 500
2018-08-25 15:34:00 [14571] [6] ERROR: AT2[gsm1]: +CMS ERROR: An unknown error occurred (500)
2018-08-25 15:34:00 [14571] [6] DEBUG: AT2[gsm1]: send command status: 1
2018-08-25 15:34:02 [14571] [6] DEBUG: AT2[gsm1]: TP-Validity-Period: 55 minutes
2018-08-25 15:34:02 [14571] [6] DEBUG: AT2[gsm1]: --> AT+CMGS=21^M
2018-08-25 15:34:02 [14571] [6] DEBUG: AT2[gsm1]: <-- >
2018-08-25 15:34:02 [14571] [6] DEBUG: AT2[gsm1]: send command status: 1
2018-08-25 15:34:02 [14571] [6] DEBUG: AT2[gsm1]: --> 0031000C8199985312678900000A08F4F29C1EA132AD
2018-08-25 15:34:02 [14571] [6] DEBUG: AT2[gsm1]: --> ^Z
2018-08-25 15:34:02 [14571] [6] DEBUG: AT2[gsm1]: <-- >
2018-08-25 15:34:04 [14571] [6] DEBUG: AT2[gsm1]: <-- +CMS ERROR: 500
2018-08-25 15:34:04 [14571] [6] ERROR: AT2[gsm1]: +CMS ERROR: +CMS ERROR: 500
2018-08-25 15:34:04 [14571] [6] ERROR: AT2[gsm1]: +CMS ERROR: An unknown error occurred (500)
2018-08-25 15:34:04 [14571] [6] DEBUG: AT2[gsm1]: send command status: 1

My Kannel config:

CORE

group = core
admin-port = 13000
admin-password = p@$$w0rd
status-password = p@$$w0rd
box-allow-ip = “...
unified-prefix = “+99890;+99891;+99893;+99894;+99895;+99897;+99898;+99899”
log-file = /var/log/kannel/kannel.log
log-level = 0
access-log = /var/log/kannel/access.log
smsbox-port = 13003
store-type = spool
store-location = /var/spool/kannel/store
smsbox-max-pending = 100
#white-list-regex = ???

SMSBOX

group = smsbox
smsbox-id = mainbox
bearerbox-host = 192.168.100.225
bearerbox-port = 13003
global-sender = +988970000003
sendsms-port = 13013
sendsms-chars = "0123456789+ "
log-file = /var/log/kannel/smsbox.log
log-level = 0
access-log = /var/log/kannel/access.log
mo-recode = true

SMSC gsm1

group = smsc
smsc = at
smsc-id = gsm1
modemtype = auto
allowed-smsc-id = gsm1
preferred-smsc-id = gsm1
#allowed-prefix = “+99890;+99891;+99893;+99894;+99895;+99897;+99898;+99899”
unified-prefix = “+99890;+99891;+99893;+99894;+99895;+99897;+99898;+99899”
device = /dev/ttyUSB1
keepalive = 60
#sms-center = +988970000003
my-number = +998972979728
speed = autodetect
validityperiod = 10
sim-buffering = true
max-error-count = 5
log-file = /var/log/kannel/smsc-gsm1.log
log-level = 0

Modem SETUP

#group = modems
#id = ztemodem
#name = “ZTE”
#init-string = “ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0;+CNMI=1,2,0,1,0;+CMGF=1”
#detect-string = “ZTE INCORPORATED”
#need-sleep = true
#message-storage = “SM”
#no-smsc = true
#broken = true

group = modems
id = zte
name = “ZTE”
detect-string = “ZTE”
init-string = “ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0”
message-storage = “SM”
keepalive-cmd = “AT+CBC;+CSQ”

SENDSMS-USER

group = sendsms-user
default-smsc = gsm1
username = playsms
password = playsms
max-messages = 6
concatenation = true

SMS SERVICE

group = sms-service
keyword = default
omit-empty = true
max-messages = 0
concatenation=true
get-url = “http://192.168.100.225/index.php?app=call&cat=gateway&plugin=kannel&access=geturl&t=%t&q=%q&a=%a&Q=%Q&smsc=%i

SMS ROUTE

group = smsbox-route
smsbox-id = mainbox
smsc-id = gsm1

Please help! Thnak in advance.


(Mapiiiaji) #2

Problem was solved with specifying unified-prefix In me case it is ==> unified-prefix = “+9989,009989,0;+,00”.
But that is not all. In this situation, sending SMS will not work from the command line with curl, since the + character is interpreted as a space, and therefore, instead of + it will be necessary to specify 00 (in my cases, since in unified-prefix it is indicated like this). As for the API, it is perfectly well interpreted via API +. The topic is closed.