Cyrillic characters in message

579 views
Skip to first unread message

Max Kovalenko

unread,
May 29, 2015, 11:12:14 AM5/29/15
to jasmin-sm...@googlegroups.com
Hello Team!

I've encoutered a problem with sending cyrillic characters.

I've sent message via HTTP-API with "coding" parameter set to 8 accodring to SMPP v3.4 spec, but have got just some random symbols

Please advise how can i send cyrilliic characters.

Thanks in advance

zoufou

unread,
May 29, 2015, 5:31:03 PM5/29/15
to jasmin-sm...@googlegroups.com, maxm...@gmail.com
Hi Max !

Please provide the url including the arguments you're using so i can reproduce your issue.

Thx !

Max Kovalenko

unread,
Jun 2, 2015, 9:40:41 AM6/2/15
to jasmin-sm...@googlegroups.com


пятница, 29 мая 2015 г., 18:12:14 UTC+3 пользователь Max Kovalenko написал:



Hello. I've tried to send SMS via HTTP-API.

Here is request: http://myserver:1401/send?username=foo&password=bar&from=TestSender&to=my_phone_number&content=Привет&coding=8


Christian Scholz

unread,
Jun 22, 2015, 11:19:33 AM6/22/15
to jasmin-sm...@googlegroups.com
Hello Jasmin Team,

we are trying to do a similar thing (sending german umlauts, Latin1) and are facing problems too, my Carrier assumes the problem is related to jasmin gateway.

Our sms mt http api request looks like this:
http://127.0.0.1:1401/send?username=foo&password=bar&to=my_phone_number&content=äöß@€&from=mobileapart&coding=3

Only the "@" sing is showing up correctly, other signs are missing or completely wrong.

KR 
Christian

zoufou

unread,
Jun 22, 2015, 12:47:29 PM6/22/15
to jasmin-sm...@googlegroups.com, christia...@mobileapart.com
Hi Christian,

Are you sending in UTF16 or in latin1 ?

Thx

Christian Scholz

unread,
Jun 23, 2015, 4:47:10 AM6/23/15
to jasmin-sm...@googlegroups.com, christia...@mobileapart.com
Hi,

testing with wget from command line on the jasmin server and with a short python script leads to the same broken result on the phone

# -*- coding: utf-8 -*-
import urllib
import urllib2


def main():
    print "sms.py called"
    baseParams = {'username':'testuser', 'password':'*****', 'to':'msisdn', 'content':'äöß@€', 'from': 'mobileapart', 'coding': '3'}

    # Send an SMS-MT with minimal parameters
    encoded_params = urllib.urlencode(baseParams)
    print encoded_params
    print urllib2.urlopen("http://127.0.0.1:1401/send?%s" % encoded_params).read()


if __name__ == "__main__":
    main()


command line output:

staff@jasmin:[~]$ python sms.py 
sms.py called
username=testuser&from=mobileapart&coding=3&content=%C3%A4%C3%B6%C3%9F%40%E2%82%AC&to=msisdn&password=*****
Success "22b87686-2e17-4f0d-8417-f281b05cef55"


logfile output:

==> smppclient-manager.log <==
2015-06-23 10:35:15 INFO     725 Publishing SubmitSmPDU with routing_key=submit.sm.DEMO_HSL, priority=0

==> http-api.log <==
2015-06-23 10:35:15 INFO     725 SMS-MT [cid:DEMO_HSL] [msgid:22b87686-2e17-4f0d-8417-f281b05cef55] [prio:0] [dlr:No] [from:mobileapart] [to:msisdn] [content:äöß@€]

==> http-accesslog.log <==
"127.0.0.1" - - [23/Jun/2015:08:35:15 +0000] "GET /send?username=testuser&from=mobileapart&coding=3&content=%C3%A4%C3%B6%C3%9F%40%E2%82%AC&to=msisdn&password=***** HTTP/1.1" 200 46 "-" "Python-urllib/2.7"

==> messages.log <==
2015-06-23 10:35:15 INFO     725 SMS-MT [cid:DEMO_HSL] [queue-msgid:22b87686-2e17-4f0d-8417-f281b05cef55] [smpp-msgid:C2F752972E4E9633] [status:ESME_ROK] [prio:0] [dlr:NO_SMSC_DELIVERY_RECEIPT_REQUESTED] [validity:none] [from:mobileapart] [to:msisdn] [content:äöß@€]


Phone result:

" ¤  @ "

connector settings:

jcli : smppccm -l
#Connector id                        Service Session          Starts Stops
#DEMO_HSL                            started BOUND_TRX        14     13   
Total connectors: 1
jcli : smppccm -s DEMO_HSL
ripf 0
con_fail_delay 10
dlr_expiry 86400
coding 0
submit_throughput 5
elink_interval 30
bind_to 30
port *****
con_fail_retry yes
password *****
src_addr None
bind_npi 0
addr_range None
dst_ton 1
res_to 60
def_msg_id 0
priority 0
con_loss_retry yes
username *****
dst_npi 1
validity None
requeue_delay 120
host *****
src_npi 0
trx_to 300
logfile /var/log/jasmin/default-DEMO_HSL.log
systype SMPP
cid DEMO_HSL
loglevel 10
bind transceiver
proto_id None
con_loss_delay 10
bind_ton 0
pdu_red_to 10
src_ton 5

Majid Ghaffuri

unread,
Jun 27, 2015, 4:09:21 AM6/27/15
to jasmin-sm...@googlegroups.com
Hi Jasmin Team

I am trying to run the above example from jasmin examples:
# Python example
# http://jasminsms.com
import urllib2
import urllib

baseParams = {'username':'fourat', 'password':'secret', 'to':'+21698700177', 'content':'Hello'}

# Sending long content (more than 160 chars):
baseParams['content'] = 'Very long message ....................................................................................................................................................................................'
urllib2.urlopen("http://127.0.0.1:1401/send?%s" % urllib.urlencode(baseParams)).read()

# Sending UCS2 (UTF-16) arabic content
baseParams['content'] = '\x0623\x0631\x0646\x0628'
baseParams['coding'] = 8
urllib2.urlopen("http://127.0.0.1:1401/send?%s" % urllib.urlencode(baseParams)).read()

log in /var/log/jasmin/messages.log is
2015-06-27 11:56:28 INFO     1005 SMS-MT [cid:xxxxx] [queue-msgid:7a6c4598-f01a-49b9-81e1-ad80108e94df] [smpp-msgid:208fa1e2] [status:ESME_ROK] [prio:0] [dlr:NO_SMSC_DELIVERY_RECEIPT_REQUESTED] [validity:none] [from:xxxx] [to:+xxxxxxxxx] [content:23314628]

result in mobile is

Majid Ghaffuri

unread,
Jun 27, 2015, 4:12:21 AM6/27/15
to jasmin-sm...@googlegroups.com
The mobile result is not attached in prevous message!
Screenshot_2015-06-27-12-22-45.png

Majid Ghaffuri

unread,
Jun 28, 2015, 8:36:11 AM6/28/15
to jasmin-sm...@googlegroups.com
I finally solve this problem, it's not a bug in jasmin gateway, when we want to send a unicode sms we must do it like this:

#!/usr/bin/python

# -*- coding: utf-8 -*-
# Python example
# http://jasminsms.com
import urllib2
import urllib
import sys

reload(sys)
sys.setdefaultencoding('utf8')

baseParams = {'username':'xxxx', 'password':'xxxxx', 'to':'xxxxxxxxx', 'content':'', 'from':'xxxx'}


# Sending long content (more than 160 chars):

# Sending UCS2 (UTF-16) arabic content
baseParams['content'] = 'ﺱﻼﻣ'.encode('utf-16-be')
baseParams['coding'] = 8
print urllib2.urlopen("http://127.0.0.1:1401/send?%s" % urllib.urlencode(baseParams)).read()

zoufou

unread,
Jun 28, 2015, 12:40:01 PM6/28/15
to jasmin-sm...@googlegroups.com, majid...@gmail.com
Dear Majid,

The idea behind Jasmin design is to be a messaging router, a router will never transform/encode/reencode the content you want to send, it only look at the message header to decide where to send the message.

So if you're receiving a bad message in your mobile, it was bad before sending it to Jasmin's api.

Glad you fixed the issue by yourself !
Reply all
Reply to author
Forward
0 new messages