PlaySMS+Kannel unable to access Kannel admin commands and "Send from file"

Hello. My configuration is CentOS 6.5, Kannel 1.4.3, PlaySMS 1.2.1 and USB modem (all in localhost) and I have some problems.

  1. PlaySMS show message “unable to access Kannel admin commands” (Kannel admin port and password are correct) but i do not see any errors in logs.
  2. When i try “Send from file” and upload .CSV file with records like “+7XXXXXXXXXX,Chetvertoe сообщение!” i receive message with text “Chetvertoe” and in “Sent Messages” only word “Chetvertoe” (sending via “Compose message” workig fine)
  3. If there are errors in the .CSV file PlaySMS shows Invalid entries like "Chetvertiy ������!"
    Sorry for my grammar and please help!

Ok guys. Some of my problems was solved :smile:
During finding a solution have been updated: Kannel to 1.4.4, PlaySMS to 1.3.

  1. The problem was in the charset of the *.CSV file content’s. PlaySMS works fine only with UTF-8.

  2. The problem is that I’m using Cyrilic for sending message. But “function core_detect_unicode” in “fn_core.php” contain regexp cheking “(’/([\xC0-\xDF].)|([\xE0-\xEF]…)|([\xF0-\xFF]…)/m” which do not fecth Cyrilic. The solution for me was to add another regexp check to this function:

" function core_detect_unicode($text) {
$unicode = 0;
$textgsm = core_string_to_gsm($text);

    $match = preg_match_all('/([\\xC0-\\xDF].)|([\\xE0-\\xEF]..)|([\\xF0-\\xFF]...)/m', $textgsm, $matches);
    if ($match !== FALSE) {
            if ($match == 0) {
                    $unicode = 0;
            } else {
                    $unicode = 1;
            }
    } else {
            $match = preg_match('[\x{0400}-\x{04FF}]/m', $textgsm, $matches);
    if ($match !== FALSE) {
            if ($match == 0) {
                    $unicode = 0;
            } else {
                    $unicode = 1;
            }
    } else {
            //TODO broken regexp in this case, warn user
    }
    return $unicode; "

For correct message transmit to Kannel I add parameters to URL. They are "&coding=2&charset=UTF-8"
And it works correct with Cyrilic :relaxed:
@anton sorry for my corrections of function’s code, I’m not so good in coding and in php.
Issue under item 1 is still open. By the way in “View log” page i see “playSMS daemon is NOT runnig”.
Any help is appreciated

do you mind to test this changes:

basically I changed core_detect_unicode() to match the javascript function isGSMAlphabet() in common.js, reference: javascript - How to Detect Non "GSM 7 bit alphabet" characters in input field - Stack Overflow

anton

I’ve tested and it work great for Cyrilic if I use additional parameters “&coding=2&charset=UTF-8”.
Thank you very much Anton!
Can you give some advice how to solve “unable to access Kannel admin commands” and “playSMS daemon is NOT runnig” problems?

Try not to add coding=2
Let me know, thanks

Anton

No, it does not work. Also i found that it does not show valid entries from file (code is comment out). Thank you.

Can you paste an example text for tests

Anton

Yes, ofcourse. I try to send from file. Text is UTF-8.
Example: “Привет Антон! Спасибо за твой труд!”

Withouy the coding=2 in additional url, what happen when you send SMS, that text, from Compose message, not from Send from file

Anton

If I send this text from Compose message, without coding=2 in additional url, i receive message with correct text.

so it seems the core_detect_unicode() wasn’t actually working. let me try to adjust and do more tests.

anton

Viktor, for the issue 1, I had to disable SELINUX and restart the server …

man I have no idea how to fix this and I have no time to look further on this one, so I’ll just revert back and add yours instead: PlaySMS+Kannel unable to access Kannel admin commands and “Send from file”

yours was to add Cyrilic detection so I assumed it should be safe for non Cyrilic too

anton

I changed SELINUX mode to “Permissive” and i see Kannel Status. It works even without restart. Thank you very much @jcampos :smile:
I still see “playSMS daemon is NOT runnig” in “View log” page…

Sorry, but I see you just revert back without any changes. I will try find out the solution and let you know. It’s time to study PHP & regexp :smiley:

The commit haven’t pushed yet :smiley: I just made a remark that your changes will be in future version

Unless someone figure it out a better way

Anton

reference:

anton

It looks like the issue was not on core_detect_unicode(), this changes will fix it:

anton