Wednesday, July 28, 2021

Failed to send Unicode Messages Playsms

We know that the "PlaySMS" is a free SMS gateway software as well as it is "Open-Source" also. It provides a web interface to manage SMS communication. We can send bulk SMS using this system. But its failed to send the Unicode messages. Because by default the Unicode messages sending feature is disabled in this system. We have to enable it manually.

In this tutorial, we are going to learn how to enable Unicode SMS support in the Playsms software.

From your Playsms System, navigate to the below path.


/var/www/html/playsms/plugin/gateway/generic/fn.php


After opening this file navigate to the below section and mark some lines as a comment as well as unmark one line from the comment.


$unicode_query_string = '';
             if ($unicode) {
                    if (function_exists('mb_convert_encoding')) {
                               // $sms_msg = mb_convert_encoding($sms_msg, "UCS-2BE", "auto");   
                              // $sms_msg = mb_convert_encoding($sms_msg, "UCS-2", "auto");    
                              // $sms_msg = mb_convert_encoding($sms_msg, "UTF-8", "auto");    
                                        $unicode_query_string = "&coding=8"; // added at the of query string if unicode
                        }
                }


Now please make sure the below lines mark as a comment. To convert a line to the comment just use the double slash sign "//" in front of the line. Sometimes the "#" value is used to mark a line as a comment.


// $sms_msg = mb_convert_encoding($sms_msg, "UCS-2BE", "auto");   
// $sms_msg = mb_convert_encoding($sms_msg, "UCS-2", "auto");    


Now please uncomment the below line. In that case, just remove the double slash sign (//) or the "#" sign from the starting point of the line.


  $sms_msg = mb_convert_encoding($sms_msg, "UTF-8", "auto");


In this regard, one snapshot is attached.




Now save your changes and restart the Playsms services. From now on all Unicode messages should be delivered via this SMS gateway.

Thank you.

No comments:

Post a Comment