SMS coming from kannel does not arrive until the sandbox!(SOLVED)

I am receiving the messages in kannel, ie all SMS sent to the chips are
arriving in the kannel but it does not reach the sandbox nor in the
inbox:

==> /var/log/kannel/smsbox.log <==
2017-04-06 17:09:17 [9983] [8] DEBUG: HTTP: Status line: <HTTP/1.1 200 OK>
2017-04-06 17:09:17 [9983] [8] DEBUG: HTTP: Received response:
2017-04-06 17:09:17 [9983] [8] DEBUG: Octet string at 0x8b0ec78:
2017-04-06 17:09:17 [9983] [8] DEBUG: len: 431
2017-04-06 17:09:17 [9983] [8] DEBUG: size: 1024
2017-04-06 17:09:17 [9983] [8] DEBUG: immutable: 0
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 44 61 74 65 3a 20 54 68 75 2c 20 30 36 20 41 70 Date: Thu, 06 Ap
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 72 20 32 30 31 37 20 32 30 3a 30 39 3a 31 37 20 r 2017 20:09:17
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 47 4d 54 0d 0a 53 65 72 76 65 72 3a 20 41 70 61 GMT…Server: Apa
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 63 68 65 2f 32 2e 34 2e 37 20 28 55 62 75 6e 74 che/2.4.7 (Ubunt
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 75 29 0d 0a 58 2d 50 6f 77 65 72 65 64 2d 42 79 u)…X-Powered-By
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 3a 20 50 48 50 2f 35 2e 35 2e 39 2d 31 75 62 75 : PHP/5.5.9-1ubu
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 6e 74 75 34 2e 32 31 0d 0a 43 61 63 68 65 2d 43 ntu4.21…Cache-C
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 6f 6e 74 72 6f 6c 3a 20 6e 6f 2d 73 74 6f 72 65 ontrol: no-store
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 2c 20 6e 6f 2d 63 61 63 68 65 2c 20 6d 75 73 74 , no-cache, must
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 2d 72 65 76 61 6c 69 64 61 74 65 2c 20 70 6f 73 -revalidate, pos
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 74 2d 63 68 65 63 6b 3d 30 2c 20 70 72 65 2d 63 t-check=0, pre-c
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 68 65 63 6b 3d 30 0d 0a 58 2d 46 72 61 6d 65 2d heck=0…X-Frame-
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 4f 70 74 69 6f 6e 73 3a 20 53 41 4d 45 4f 52 49 Options: SAMEORI
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 47 49 4e 0d 0a 53 65 74 2d 43 6f 6f 6b 69 65 3a GIN…Set-Cookie:
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 20 50 48 50 53 45 53 53 49 44 3d 6d 32 67 35 76 PHPSESSID=m2g5v
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 6f 39 61 34 72 31 6a 33 34 33 6c 76 38 75 70 75 o9a4r1j343lv8upu
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 6b 61 36 74 34 3b 20 70 61 74 68 3d 2f 0d 0a 45 ka6t4; path=/…E
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 78 70 69 72 65 73 3a 20 54 68 75 2c 20 31 39 20 xpires: Thu, 19
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 4e 6f 76 20 31 39 38 31 20 30 38 3a 35 32 3a 30 Nov 1981 08:52:0
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 30 20 47 4d 54 0d 0a 50 72 61 67 6d 61 3a 20 6e 0 GMT…Pragma: n
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 6f 2d 63 61 63 68 65 0d 0a 43 6f 6e 74 65 6e 74 o-cache…Content
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 2d 4c 65 6e 67 74 68 3a 20 30 0d 0a 4b 65 65 70 -Length: 0…Keep
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 2d 41 6c 69 76 65 3a 20 74 69 6d 65 6f 75 74 3d -Alive: timeout=
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 35 2c 20 6d 61 78 3d 31 30 30 0d 0a 43 6f 6e 6e 5, max=100…Conn
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 65 63 74 69 6f 6e 3a 20 4b 65 65 70 2d 41 6c 69 ection: Keep-Ali
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 76 65 0d 0a 43 6f 6e 74 65 6e 74 2d 54 79 70 65 ve…Content-Type
2017-04-06 17:09:17 [9983] [8] DEBUG: data: 3a 20 74 65 78 74 2f 68 74 6d 6c 0d 0a 0d 0a : text/html…
2017-04-06 17:09:17 [9983] [8] DEBUG: Octet string dump ends.

==> /var/log/playsms/playsms.log <==

    • 2017-04-06 17:09:18 PID58dea0e9dd0eb - L2 simplebilling__finalize # saving smslog_id:54
    • 2017-04-06 17:09:18 PID58dea0e9dd0eb - L2 simplebilling__finalize # saved smslog_id:54

==> /var/log/kannel/smsbox.log <==
2017-04-06 17:09:22 [9983] [8] DEBUG: HTTP: Server closed connection, destroying it localhost:80:0:<0xb5c00a08>fd:27.

==> /var/log/kannel/access.log <==
2017-04-06 17:09:33 Receive SMS [SMSC:smpp1] [SVC:] [ACT:] [BINF:] [FID:] [from:+556599690XXXX] [to:rapidosms] [flags:-1:0:-1:0:-1] [msg:116:id:0000000003 sub:000 dlvrd:000 submit date:1704061409 done date:1704061409 stat:ACCEPTD err:000 Text:Teste 1234444 ] [udh:0:]
2017-04-06 17:09:51 Receive SMS [SMSC:smpp1] [SVC:] [ACT:] [BINF:] [FID:] [from:+556599690XXXX] [to:rapidosms] [flags:-1:0:-1:0:-1] [msg:61:Torpedo SMS entregue p/ 5565996907395 (17:09:30 de 06.04.17).] [udh:0:]
2017-04-06 17:10:22 Receive SMS [SMSC:smpp1] [SVC:] [ACT:] [BINF:] [FID:] [from:+556598142XXXX] [to:rapidosms] [flags:-1:0:-1:0:-1] [msg:8:…admin ] [udh:0:]
^C

my kannel.conf

group = core
admin-port = 13000
admin-password = xxxxxx
admin-deny-ip = "…"
admin-allow-ip = "127.0.0.1;0.0.0.0"
smsbox-port = 13001
wdp-interface-name = "*"
log-file = "/var/log/kannel/bearerbox.log"
log-file = "/var/log/kannel/kannel.log"
access-log = "/var/log/kannel/access.log"
log-level = 0
dlr-storage=internal
store-type = spool
#store-location = "/var/spool/kannel/store"
smsbox-max-pending = 500
box-deny-ip = "…"
box-allow-ip = “127.0.0.1;XXX.XXX.0.0/24;0.0.0.0”

group = smsbox
smsbox-id = smsbox1
bearerbox-host = localhost
bearerbox-port = 13001
sendsms-port = 13131
sendsms-chars = "0123456789+ "
log-file = "/var/log/kannel/smsbox.log"
log-level = 0
mo-recode = true

group = sendsms-user
default-smsc = smpp1
username = xxxxxxx
password = xxxxxx
concatenation = true

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

group = smsc
smsc = smpp
smsc-id = smpp1
allowed-smsc-id = smpp1
preferred-smsc-id = smpp1
host = xxx.xxx.xxx.xxx
port = 7777
transceiver-mode = yes
smsc-username = XXXXXX
smsc-password = XXXXXX
system-type = "VMA"
log-file = "/var/log/kannel/smsc-smpp1.log"
log-level = 0

Rodrigo,

A entrega do kannel pro playsms acontece quando ele chama a get-url, ela tá batendo no web server? O kannel tá conseguindo acessar o playsms à partir de http://localhost/sms?

Caso este ponto esteja ok, dá uma olhada na tabela playsms_tblRecvSMS, é lá que os sms entrantes são salvos antes de irem pra inbox.

Abs,

Edilson

Então Edilson ele esta acessando normalmente mas não da log no playsms ! na tabela playsms_tblRecvSMS esta em branco somente com dois teste que eu gerei dentro do proprio playsms pelo teste de sms de entrada !!

Tenta pegar a url que o kannel usa para entregar a mensagem para o playsms, e chama na mão, adicionalmente, coloca alguns echos de depuração em plugin/gateway/kannel/geturl.php para ver o que tá acontecendo

achei o erro :

PID58ebc072e1187 - L2 kannel__incoming # unable to process incoming SMS. remote_addr:[::1] or remote_host:[localhost] does not match with your bearerbox_host config:[127.0.0.1] smsc:[kannel]

Easy to solve… just edit smsc so that playSMS web URL be the same as kannel URLs (bearerbox hostname or ip and send sms hostname or ip). This will solve your DLR problem also.

Does not work, see the logs:

kannel logs:
2017-04-12 01:14:30 Receive SMS [SMSC:smpp1] [SVC:] [ACT:] [BINF:] [FID:] [from:AAA5DA6] [to:rapidosms] [flags:-1:0:-1:0:-1] [msg:85:Vivo Recado: Lembramos que voce possui recados que ainda nao ouviu. Ligue agora *555.] [udh:0:]
2017-04-12 01:15:54 Receive SMS [SMSC:smpp1] [SVC:] [ACT:] [BINF:] [FID:] [from:1515] [to:rapidosms] [flags:-1:0:-1:0:-1] [msg:155:Receba agora R$3,00 para navegar na internet e fazer ligacoes! Responda CA em ate 4h e pague so na proxima recarga R$4,20 (Valor concedido +R$1,20 de taxa)] [udh:0:]
2017-04-12 01:42:02 Receive SMS [SMSC:smpp1] [SVC:] [ACT:] [BINF:] [FID:] [from:AAA5DA6] [to:rapidosms] [flags:-1:0:-1:0:-1] [msg:85:Vivo Recado: Lembramos que voce possui recados que ainda nao ouviu. Ligue agora *555.] [udh:0:]
2017-04-12 01:53:43 Receive SMS [SMSC:smpp1] [SVC:] [ACT:] [BINF:] [FID:] [from:AAA5DA6] [to:rapidosms] [flags:-1:0:-1:0:-1] [msg:85:Vivo Recado: Lembramos que voce possui recados que ainda nao ouviu. Ligue agora *555.] [udh:0:]
2017-04-12 03:19:57 Receive SMS [SMSC:smpp1] [SVC:] [ACT:] [BINF:] [FID:] [from:1515] [to:rapidosms] [flags:-1:0:-1:0:-1] [msg:117:Voce usou 80% da sua franquia de SMS. Continue economizando, envie SMS para 1515 e conheca todas as opcoes de pacotes] [udh:0:]
2017-04-12 03:23:28 Receive SMS [SMSC:smpp1] [SVC:] [ACT:] [BINF:] [FID:] [from:1515] [to:rapidosms] [flags:-1:0:-1:0:-1] [msg:117:Voce usou 80% da sua franquia de SMS. Continue economizando, envie SMS para 1515 e conheca todas as opcoes de pacotes] [udh:0:]
2017-04-12 03:25:19 Receive SMS [SMSC:smpp1] [SVC:] [ACT:] [BINF:] [FID:] [from:1515] [to:rapidosms] [flags:-1:0:-1:0:-1] [msg:117:Voce usou 80% da sua franquia de SMS. Continue economizando, envie SMS para 1515 e conheca todas as opcoes de pacotes] [udh:0:]
2017-04-12 03:34:04 Receive SMS [SMSC:smpp1] [SVC:] [ACT:] [BINF:] [FID:] [from:1515] [to:rapidosms] [flags:-1:0:-1:0:-1] [msg:117:Voce usou 80% da sua franquia de SMS. Continue economizando, envie SMS para 1515 e conheca todas as opcoes de pacotes] [udh:0:]
2017-04-12 05:37:03 Receive SMS [SMSC:smpp1] [SVC:] [ACT:] [BINF:] [FID:] [from:9003] [to:rapidosms] [flags:-1:0:-1:0:-1] [msg:133:Vivo Turbo: a promocao nao foi renovada. Saldo abaixo de R$7,99. Ligue *7000 e recarregue. 300MB + SMS + LIGACOES ILIMITADAS p/ Vivo] [udh:0:]
2017-04-12 06:04:27 Receive SMS [SMSC:smpp1] [SVC:] [ACT:] [BINF:] [FID:] [from:9003] [to:rapidosms] [flags:-1:0:-1:0:-1] [msg:132:Vivo Turbo: saldo abaixo de R$7,99. P/ renovar o Vivo Turbo e ter 300MB + SMS e LIGACOES ILIMITADAS p/ Vivo ligue *7000 e recarregue] [udh:0:]

playsms logs:

Shows nothing only when sending SMS.

When I send the shell by command like this:
wget “http://127.0.0.1/sms/index.php?app=call&cat=gateway&plugin=kannel&access=geturl&t=rapidosms&q=+556599690xxxx&a=texto+teste+separador&Q=DDD&smsc=kannel

When I send by command line it arrives in the sandbox and goes to admin’s box and logs this in the log see:

127.0.0.1 127.0.0.1 2017-04-12 06:46:02 PID58edf75a5d3be - L2 kannel__call # start load:/var/www/html/sms/plugin/gateway/kannel/geturl.php
127.0.0.1 127.0.0.1 2017-04-12 06:46:02 PID58edf75a5d3be - L3 kannel__incoming # remote_addr:127.0.0.1 remote_host:127.0.0.1 t:[rapidosms] q:[556599690xxxx] a:[texto teste separador] Q:[DDD] smsc:[kannel] smsc:[kannel]
127.0.0.1 127.0.0.1 2017-04-12 06:46:02 PID58edf75a5d3be - L3 recvsms # isrecvsmsd:1 dt:rapidosms sender:5565996907395 m:texto teste separador receiver:DDD smsc:kannel
127.0.0.1 127.0.0.1 2017-04-12 06:46:02 PID58edf75a5d3be - L2 kannel__call # end load geturl

    • 2017-04-12 06:46:02 PID58ecbbc948f83 - L3 recvsmsd # id:16 dt:1969-12-31 21:00:00 sender:556599690XXXX m:texto teste separador receiver:DDD smsc:kannel
    • 2017-04-12 06:46:02 PID58ecbbc948f83 - L3 recvsms_process # dt:1969-12-31 21:00:00 sender:556599690XXXX m:texto teste separador receiver:DDD smsc:kannel
    • 2017-04-12 06:46:02 PID58ecbbc948f83 - L3 recvsms_process # unhandled datetime:1969-12-31 21:00:00 sender:556599690XXXX receiver:DDD message:texto teste separador
    • 2017-04-12 06:46:02 PID58ecbbc948f83 - L3 incoming__recvsms_intercept_after # sandbox to user start u:admin dt:1969-12-31 21:00:00 s:556599690XXXX r:DDD m:[texto teste separador]
    • 2017-04-12 06:46:02 PID58ecbbc948f83 - L2 recvsms_inbox_add # saving sender:556599690XXXX receiver:DDD target:admin reference_id:
    • 2017-04-12 06:46:02 PID58ecbbc948f83 - L2 recvsms_inbox_add # saved id:16 sender:556599690XXXX receiver:DDD target:admin
    • 2017-04-12 06:46:03 PID58ecbbc948f83 - L3 incoming__recvsms_intercept_after # sandbox to user end u:admin

Does anyone have any ideas or can you help me?

Rodrigo, add me in skype: espessoto