Hello, I have following Kanel's config file:

group = core
admin-port = 1310
smsbox-port = 1320
admin-password = ***********
log-file = "/var/log/kannel/kannel.log"
log-level = 0
store-file = "/var/lib/kannel/kannel.store"
box-allow-ip = "127.0.0.1"

group = smsbox
bearerbox-host = "localhost"
sendsms-port = 1330
mo-recode = 1
log-file = "/var/log/kannel/smsbox.log"
log-level = 0

group = smsc
smsc = smpp
smsc-id = SMSC1
host = x.x.x.x
port = 2000
transceiver-mode = 1
smsc-username = "Username"
smsc-password = "Pasword"
system-type = ""
address-range = ""
source-addr-ton = 0
source-addr-npi = 1
dest-addr-ton = 1
dest-addr-npi = 1
interface-version = 34
alt-charset = "UTF-8"
log-file = "/var/log/kannel/smsc-operator.log"
log-level = 0

group = sendsms-user
username = root
password = my_password_here
user-allow-ip = "*.*.*.*"
concatenation = true
max-messages = 10

group = sms-service
keyword = default
catch-all = yes
exec = /usr/local/sbin/incoming.sh %t %I %p %a %c=1 %C=2 %O=2

The content of "/usr/local/sbin/incoming.sh" file is (Russian symbols):

#!/bin/sh

echo $1 $2 $3 $4 >> /tmp/111incoming.log
echo "Автоматический ответ!"


The string is a UTF-8 text. When I send a message from my mobile to my
service number I got a reply to my mobile that looks like: ?????????
?????!

2011-05-26 19:44:54 [28250] [6] DEBUG: SMPP[mnSMSC]: Sending PDU:
2011-05-26 19:44:54 [28250] [6] DEBUG: SMPP PDU 0x8776970 dump:
2011-05-26 19:44:54 [28250] [6] DEBUG:   type_name: submit_sm
2011-05-26 19:44:54 [28250] [6] DEBUG:   command_id: 4 = 0x00000004
2011-05-26 19:44:54 [28250] [6] DEBUG:   command_status: 0 = 0x00000000
2011-05-26 19:44:54 [28250] [6] DEBUG:   sequence_number: 14 = 0x0000000e
2011-05-26 19:44:54 [28250] [6] DEBUG:   service_type: NULL
2011-05-26 19:44:54 [28250] [6] DEBUG:   source_addr_ton: 0 = 0x00000000
2011-05-26 19:44:54 [28250] [6] DEBUG:   source_addr_npi: 1 = 0x00000001
2011-05-26 19:44:54 [28250] [6] DEBUG:   source_addr: "7920xxxxxxx"
2011-05-26 19:44:54 [28250] [6] DEBUG:   dest_addr_ton: 1 = 0x00000001
2011-05-26 19:44:54 [28250] [6] DEBUG:   dest_addr_npi: 1 = 0x00000001
2011-05-26 19:44:54 [28250] [6] DEBUG:   destination_addr: "7920xxxxxxx"
2011-05-26 19:44:54 [28250] [6] DEBUG:   esm_class: 3 = 0x00000003
2011-05-26 19:44:54 [28250] [6] DEBUG:   protocol_id: 0 = 0x00000000
2011-05-26 19:44:54 [28250] [6] DEBUG:   priority_flag: 0 = 0x00000000
2011-05-26 19:44:54 [28250] [6] DEBUG:   schedule_delivery_time: NULL
2011-05-26 19:44:54 [28250] [6] DEBUG:   validity_period: NULL
2011-05-26 19:44:54 [28250] [6] DEBUG:   registered_delivery: 0 = 0x00000000
2011-05-26 19:44:54 [28250] [6] DEBUG:   replace_if_present_flag: 0 = 0x00000000
2011-05-26 19:44:54 [28250] [6] DEBUG:   data_coding: 0 = 0x00000000
2011-05-26 19:44:54 [28250] [6] DEBUG:   sm_default_msg_id: 0 = 0x00000000
2011-05-26 19:44:54 [28250] [6] DEBUG:   sm_length: 20 = 0x00000014
2011-05-26 19:44:54 [28250] [6] DEBUG:   short_message:
2011-05-26 19:44:54 [28250] [6] DEBUG:    Octet string at 0x8772b90:
2011-05-26 19:44:54 [28250] [6] DEBUG:      len:  20
2011-05-26 19:44:54 [28250] [6] DEBUG:      size: 21
2011-05-26 19:44:54 [28250] [6] DEBUG:      immutable: 0
2011-05-26 19:44:54 [28250] [6] DEBUG:      data: 3f 3f 3f 3f 3f 3f 3f
3f 3f 20 3f 3f 3f 3f 3f 3f   ????????? ??????
2011-05-26 19:44:54 [28250] [6] DEBUG:      data: 3f 3f 21 0a
                             ??!.
2011-05-26 19:44:54 [28250] [6] DEBUG:    Octet string dump ends.
2011-05-26 19:44:54 [28250] [6] DEBUG: SMPP PDU dump ends.


As we can see, the "data_coding: 0 = 0x00000000".

When I send a message from web interface, using the following URL:
http://x.x.x.x:1330/cgi-bin/sendsms?user=root&pass=MyPasswordHere&from=7920xxxxxxx&to=7916xxxxxxx&text=Это
автоматический ответ!&charset=UTF-8&coding=2

The mobile receives the "righ message" , that I can read. The log is bellow:

2011-05-26 16:40:08 [32035] [6] DEBUG: SMPP[mnSMSC]: Sending PDU:
2011-05-26 16:40:08 [32035] [6] DEBUG: SMPP PDU 0x8af17b8 dump:
2011-05-26 16:40:08 [32035] [6] DEBUG:   type_name: submit_sm
2011-05-26 16:40:08 [32035] [6] DEBUG:   command_id: 4 = 0x00000004
2011-05-26 16:40:08 [32035] [6] DEBUG:   command_status: 0 = 0x00000000
2011-05-26 16:40:08 [32035] [6] DEBUG:   sequence_number: 23 = 0x00000017
2011-05-26 16:40:08 [32035] [6] DEBUG:   service_type: NULL
2011-05-26 16:40:08 [32035] [6] DEBUG:   source_addr_ton: 0 = 0x00000000
2011-05-26 16:40:08 [32035] [6] DEBUG:   source_addr_npi: 1 = 0x00000001
2011-05-26 16:40:08 [32035] [6] DEBUG:   source_addr: "7920xxxxxxx"
2011-05-26 16:40:08 [32035] [6] DEBUG:   dest_addr_ton: 1 = 0x00000001
2011-05-26 16:40:08 [32035] [6] DEBUG:   dest_addr_npi: 1 = 0x00000001
2011-05-26 16:40:08 [32035] [6] DEBUG:   destination_addr: "7916xxxxxxx"
2011-05-26 16:40:08 [32035] [6] DEBUG:   esm_class: 3 = 0x00000003
2011-05-26 16:40:08 [32035] [6] DEBUG:   protocol_id: 0 = 0x00000000
2011-05-26 16:40:08 [32035] [6] DEBUG:   priority_flag: 0 = 0x00000000
2011-05-26 16:40:08 [32035] [6] DEBUG:   schedule_delivery_time: NULL
2011-05-26 16:40:08 [32035] [6] DEBUG:   validity_period: NULL
2011-05-26 16:40:08 [32035] [6] DEBUG:   registered_delivery: 0 = 0x00000000
2011-05-26 16:40:08 [32035] [6] DEBUG:   replace_if_present_flag: 0 = 0x00000000
2011-05-26 16:40:08 [32035] [6] DEBUG:   data_coding: 8 = 0x00000008
2011-05-26 16:40:08 [32035] [6] DEBUG:   sm_default_msg_id: 0 = 0x00000000
2011-05-26 16:40:08 [32035] [6] DEBUG:   sm_length: 44 = 0x0000002c
2011-05-26 16:40:08 [32035] [6] DEBUG:   short_message:
2011-05-26 16:40:08 [32035] [6] DEBUG:    Octet string at 0x8af15b0:
2011-05-26 16:40:08 [32035] [6] DEBUG:      len:  44
2011-05-26 16:40:08 [32035] [6] DEBUG:      size: 45
2011-05-26 16:40:08 [32035] [6] DEBUG:      immutable: 0
2011-05-26 16:40:08 [32035] [6] DEBUG:      data: 00 48 00 65 00 6c 00
6c 00 6f 00 2c 00 20 04 3f   .H.e.l.l.o.,. .?
2011-05-26 16:40:08 [32035] [6] DEBUG:      data: 04 40 04 38 04 32 04
35 04 42 00 20 04 3e 04 42   [email protected]. .>.B
2011-05-26 16:40:08 [32035] [6] DEBUG:      data: 00 20 04 3c 04 35 04
3d 04 4f 00 21               . .<.5.=.O.!
2011-05-26 16:40:08 [32035] [6] DEBUG:    Octet string dump ends.
2011-05-26 16:40:08 [32035] [6] DEBUG: SMPP PDU dump ends.


As we can see, the "data_coding: 8 = 0x00000008", because the URL
contain: &charset=UTF-8&coding=2

What do I need to change in "exec", shell script or other parts of
configuration file to change from "data_coding: 0" to "data_coding: 8"
when "group = sms-service" call exec and my shell script?

-Ivan

Reply via email to