Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode sms broken #71

Closed
fvancaen opened this issue May 20, 2013 · 15 comments
Closed

Unicode sms broken #71

fvancaen opened this issue May 20, 2013 · 15 comments
Assignees
Milestone

Comments

@fvancaen
Copy link

if the message is too long, only the first part is send out for Unicode. In standard no problem when splitting the text. Before it was working fine for Unicode.
Tested in 0.9.8

@antonraharja
Copy link
Member

what gateway do you use ?

@Renzx
Copy link

Renzx commented May 21, 2013

Hi, we are using the SMSTools for SMS gateway

@ghost ghost assigned antonraharja May 21, 2013
@antonraharja
Copy link
Member

locate fn.php in plugin/gateway/smstools/, edit it and look for function smstools_hook_sendsms().

locate this code snippet inside smstools_hook_sendsms():

if ($unicode) {
if (function_exists('mb_convert_encoding')) {
$the_msg .= "Alphabet: UCS\n";
$sms_msg = mb_convert_encoding($sms_msg, "UCS-2BE", "auto");
}
// $sms_msg = str2hex($sms_msg);
}

if you check the unicode option, the message will be converted by using mb_convert_encoding with supplied encoding UCS-2BE. This may not be what you need. Try removing this code (comment them), or look for suitable encoding, other than UCS-2BE.

@antonraharja
Copy link
Member

just comment the mb_convert_encoding line, dont comment or remove all lines as you need to state "Alphabet: UCS" for smstools.

@Renzx
Copy link

Renzx commented May 21, 2013

Hi Anton
after we comment the line we can’t send SMS in Chinese correctly with or without the Unicode option.

We got the problem
1, sending SMS in Chinese issue, before the old version we don’t need to enable the option for Unicode, it can be sent successful
2, from the 0.9.7.2, we have to enable the option send by Unicode, otherwise the SMS can’t send by Chinese.
3, after that we found another problem that the SMS if send by two parts, the last part will be lost ( Unicode option enabled)

@antonraharja
Copy link
Member

Please focus on the issue, do not repeat all your problem on every posts.

Remove the comment and then replace UCS-2BE with UCS-2 and then UTF-16. See what happen.

@antonraharja
Copy link
Member

Btw, if possible, please share your smsd.conf (smstools config file), post it in pastebin.com or here

@Renzx
Copy link

Renzx commented May 21, 2013

After remove the comment for the line and try UCS-2 and UTF-16 both can working fine (check the Unicode option), but we were still lost the last part if the SMS over the 70 char

@antonraharja
Copy link
Member

Ok, please make sure, if you're using UCS-2BE, UCS-2 and UTF-16, all working fine for first part, but not second part or more.

Also please paste a sample text, not sure what to look for in the Internet.

@Renzx
Copy link

Renzx commented May 21, 2013

/etc/smsd.conf

devices = GSM1
outgoing = /var/spool/sms/outgoing
checked = /var/spool/sms/checked
failed = /var/spool/sms/failed
incoming = /var/spool/sms/incoming
report = /var/spool/sms/report
sent = /var/spool/sms/sent
logfile = /var/log/smsd.log
loglevel = 7
alarmlevel = 4
stats = /var/spool/sms/stats
stats_interval = 60
stats_no_zeroes = no
status_include_counters = yes
status_signal_quality = yes
status_interval = 1

#blacklist = /etc/smsd.black
#whitelist = /etc/smsd.white
receive_before_send = no
infofile = /var/run/sms/smsd.working
pidfile = /var/run/sms/smsd.pid
incoming_utf8 = yes
eventhandler = /sfli/sh/SMS_TEST/test.sh
decode_unicode_text = yes

[GSM1]
device = /dev/ttyS0
incoming = yes
smsc = 8613800100500
report = yes

@Renzx
Copy link

Renzx commented May 21, 2013

UCS-2BE, UCS-2 and UTF-16 all can working fine with Chinese, you may find the test message as below

1测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测2测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试

@antonraharja
Copy link
Member

Thanks.

I'm not sure if this is playSMS or smstools issue, I'm using Kannel mostly, and it seems to be ok, I'll test with your text.

Can you comment decode_unicode_text and eventhandler, restart smstools and test again without those options.

@Renzx
Copy link

Renzx commented May 22, 2013

Hi Anton

I commented the two options in “/etc/smsd.conf” and restart the sms3
service (check Unicode option), but the last part also lost

Thanks
Best regards
Zhixiang

@Renzx
Copy link

Renzx commented May 28, 2013

Hi Anton

Could you please let us know if there is any news for issue 71? and how
about your testing result for SMS in Chinese? Did you have the problem
same as us?

Thanks
Best regards
Zhixiang

-----邮件原件-----
发件人: Anton Raharja [mailto:notifications@github.com]
发送时间: 2013年5月21日 18:18
收件人: antonraharja/playSMS
抄送: Renzx
主题: Re: [playSMS] Unicode sms broken (#71)

Thanks.
I'm not sure if this is playSMS or smstools issue, I'm using Kannel
mostly, and it seems to be ok, I'll test with your text.
Can you comment decode_unicode_text and eventhandler, restart smstools
and test again without those options.

Reply to this email directly or view
<#71 (comment)

it on GitHub.
<https://github.com/notifications/beacon/nERF6T9FDG14BGf-WvDnkzSmLVGPeLe
xCLBq0U9FFOhCpg1dNbzV5T_jb6uxqN95.gif>

@antonraharja
Copy link
Member

Hi,

I did experience the same as yours, I was using Kannel and playSMS cut it off before reaching gateway (Kannel or smstools), so this is a confirmed bug.

anton

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants