[solved] Incorrect interpretation when specifying unicode

Yes it is. SMS content is not processed as Unicode, but 82 Cyrillic characters (Russian font) were used in the SMS text.
But after, uncommented:
if (! $ unicode) $ unicode = core_detect_unicode ($ sms_msg);
in the file “web/plugin/gateway/kannel/fn.php”, without specifying unicode=1, Russian (Cyrillic) is recognized.

https:/example.com/index.php?app=ws&u=jf3s&h=f211e5c83435g4576hf6a672f91&op=pv&to=998974337489&msg=Отрывок+из+произведения+Шекспира,+Гамлет:+А+мать+твоя+знает,+на+ком+её+гобелен!!!

In Settings->Main configuration do you set Enable credit unicode SMS as normal SMS to yes or no.

  • Yes means it will bill unicodes as if normal SMS, so 2 SMS counted as 1 (per SMS limited to 140 chars)
  • No means default billing, if detected and set as unicode then it will be billed as 2 SMS (per SMS limited to 160 chars)

anton

Respectfully,
Jamshid Tursunov

ok. please set loglevel to 3 (in config.php, restart playsmsd) and test again the same way, just once, send the log here (mind the IP, user and pass in the log).

on loglevel 3 we can see what URL (and charset param) actually used to submit SMS via Kannel by playSMS

anton

Good day Anton!


Cyrillic version

https://example.com/index.php?app=ws&u=jft2p&h=f211e5c831fae5325cc6a672f91&op=pv&to=998974333459&msg=Отрывок+из+произведения+Шекспира,+Гамлет:+А+мать+твоя+знает,+на+ком+её+гобелен!!!


192.168.100.227 example.com 2020-03-05 11:21:58 PID5e609a864c9fb jftp L2 sendsms # start uid:5 sender_id:[Example] smsc:[]
192.168.100.227 example.com 2020-03-05 11:21:58 PID5e609a864c9fb jftp L3 sendsms # maxlen:7650 footerlen:0 footer:[] msglen:82 message:[Отрывок из произведения Шекспира, Гамлет: А мать твоя знает, на ком её гобелен!!!!]
192.168.100.227 example.com 2020-03-05 11:21:58 PID5e609a864c9fb jftp L2 sendsms_queue_create # saving queue_code:9f4af48416c4d266534e5ddd8848817c src:Example scheduled:2020-03-05 11:21:58
192.168.100.227 example.com 2020-03-05 11:21:58 PID5e609a864c9fb jftp L2 sendsms_queue_create # saved queue_code:9f4af48416c4d266534e5ddd8848817c id:3384
192.168.100.227 example.com 2020-03-05 11:21:58 PID5e609a864c9fb jftp L3 sendsms_manipulate_prefix # before prefix manipulation:[998974333459]
192.168.100.227 example.com 2020-03-05 11:21:58 PID5e609a864c9fb jftp L3 sendsms_manipulate_prefix # after prefix manipulation:[+998974333459]
192.168.100.227 example.com 2020-03-05 11:21:58 PID5e609a864c9fb jftp L3 simplerate_hook_rate_getbyprefix # rate not found to:+998974333459 default_rate:0.01
192.168.100.227 example.com 2020-03-05 11:21:58 PID5e609a864c9fb jftp L3 simplerate_hook_rate_getcharges # uid:5 u:jftp len:82 unicode:0 to:+998974333459 enable_credit_unicode:0 count:1 rate:0.01 charge:0.01
192.168.100.227 example.com 2020-03-05 11:21:58 PID5e609a864c9fb jftp L2 sendsms # dst_count:1 sms_count:1 total_charges:0.01
192.168.100.227 example.com 2020-03-05 11:21:58 PID5e609a864c9fb jftp L2 sendsms_queue_push # saving queue_code:9f4af48416c4d266534e5ddd8848817c dst:+998974333459
192.168.100.227 example.com 2020-03-05 11:21:58 PID5e609a864c9fb jftp L2 sendsms_queue_push # saved queue_code:9f4af48416c4d266534e5ddd8848817c smslog_id:123653
192.168.100.227 example.com 2020-03-05 11:21:58 PID5e609a864c9fb jftp L2 sendsms # end queue_code:9f4af48416c4d266534e5ddd8848817c queue_count:1 sms_count:1 failed_queue:0 failed_sms:0
192.168.100.227 example.com 2020-03-05 11:21:58 PID5e609a864c9fb jftp L3 webservices # u:jftp ip:192.168.100.227 op:pv timestamp:1583389318 status: error: error_string:
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L2 sendsmsd # start processing queue_code:9f4af48416c4d266534e5ddd8848817c chunk:0 queue_count:1 sms_count:1 scheduled:2020-03-05 11:21:58 uid:5 gpid:0 sender_id:Example
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L2 sendsmsd # sending queue_code:9f4af48416c4d266534e5ddd8848817c smslog_id:123653 to:+998974333459 sms_count:1 counter:1
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L3 sendsms_intercept # msgtemplate modified sms_sender:[Example] sms_footer:[] sms_to:[+998974333459] sms_msg:[Отрывок из произведения Шекспира, Гамлет: А мать твоя знает, на ком её гобелен!!!!] uid:[5] gpid:[0] sms_type:[text] unicode:[0] queue_code:[9f4af48416c4d266534e5ddd8848817c] smsc:[]
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L3 outgoing_hook_sendsms_intercept # no SMSC found uid:5 parent_uid:0 from:Example to:+998974333459
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L2 recvsms_process # using default SMSC smsc:[kannel]
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L2 sendsms_process # start
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L3 simplerate_hook_rate_getbyprefix # rate not found to:+998974333459 default_rate:0.01
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L3 simplerate_hook_rate_getcharges # uid:5 u:jftp len:82 unicode:0 to:+998974333459 enable_credit_unicode:0 count:1 rate:0.01 charge:0.01
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L2 simplerate_hook_rate_cansend # allowed user uid:5 sms_to:+998974333459 adhoc_credit:0.38 count:1 rate:0.01 charge:0.01 adhoc_balance:0.37
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L2 sendsms # saving smslog_id:123653 u:5 parent_uid:0 g:0 gw:kannel smsc:kannel s:Example d:+998974333459 type:text unicode:0 status:0
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L2 sendsms_process # saved smslog_id:123653 id:123653
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L3 sendsms # final smslog_id:123653 gw:kannel smsc:kannel message:Отрывок из произведения Шекспира, Гамлет: А мать твоя знает, на ком её гобелен!!!! len:82
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L3 kannel_hook_sendsms # enter smsc:kannel smslog_id:123653 uid:5 to:+998974333459
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L3 kannel_hook_sendsms # URL: http://192.168.10.21:13013/cgi-bin/sendsms?username=P8sUF3Re&password=rH7%3C7Q33kWR2d%2Am9wF%21piRpt&from=Example&to=%2B998974333459&dlr-mask=27&dlr-url=http%3A%2F%2F192.168.10.24%2Findex.php%3Fapp%3Dcall%26cat%3Dgateway%26plugin%3Dkannel%26access%3Ddlr%26type%3D%25d%26smslog_id%3D123653%26uid%3D5%26smsc%3Dkannel&charset=UTF-16BE&coding=2&account=jftp&text=%04%1E%04B%04%40%04K%042%04%3E%04%3A%00+%048%047%00+%04%3F%04%40%04%3E%048%047%042%045%044%045%04%3D%048%04O%00+%04%28%045%04%3A%04A%04%3F%048%04%40%040%00%2C%00+%04%13%040%04%3C%04%3B%045%04B%00%3A%00+%04%10%00+%04%3C%040%04B%04L%00+%04B%042%04%3E%04O%00+%047%04%3D%040%045%04B%00%2C%00+%04%3D%040%00+%04%3A%04%3E%04%3C%00+%045%04Q%00+%043%04%3E%041%045%04%3B%045%04%3D%00%21%00%21%00%21%00%21&from=Example
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L3 kannel__outgoing # smslog_id:123653 response:0: Accepted for delivery
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L3 dlr # isdlrd:1 smslog_id:123653 p_status:0 uid:5
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L3 kannel__outgoing # end smslog_id:123653 p_status:0
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L2 simplerate_hook_rate_deduct # enter smslog_id:123653
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L3 simplerate_hook_rate_getbyprefix # rate not found to:+998974333459 default_rate:0.01
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L3 simplerate_hook_rate_getcharges # uid:5 u:jftp len:82 unicode:0 to:+998974333459 enable_credit_unicode:0 count:1 rate:0.01 charge:0.01
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L2 simplebilling_hook_billing_post # saving smslog_id:123653 rate:0.01 count:1 charge:0.01
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L2 simplebilling_hook_billing_post # saved smslog_id:123653 id:123623
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L3 simplerate_hook_rate_deduct # deduct successful uid:5 parent_uid:0 smslog_id:123653
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L2 sendsms_process # end
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L2 sendsmsd # result queue_code:9f4af48416c4d266534e5ddd8848817c to:+998974333459 flag:1 smslog_id:123653
- - 2020-03-05 11:21:59 PID5e609a876dc0b - L2 sendsmsd # finish processing queue_code:9f4af48416c4d266534e5ddd8848817c uid:5 sender_id:Example queue_count:1 sms_count:1
- - 2020-03-05 11:21:59 PID5e5fbd5685c36 - L3 dlrd # id:242837 smslog_id:123653 p_status:0 uid:5
192.168.10.21 192.168.10.24 2020-03-05 11:22:09 PID5e609a90f0f77 - L2 kannel__call # start load:/var/www/playsms/plugin/gateway/kannel/dlr.php
192.168.10.21 192.168.10.24 2020-03-05 11:22:09 PID5e609a90f0f77 - L3 kannel__dlr # remote_addr:192.168.10.21 remote_host:192.168.10.24 type:[8] smslog_id:[123653] uid:[5] smsc:[kannel]
192.168.10.21 192.168.10.24 2020-03-05 11:22:09 PID5e609a90f0f77 - L3 dlr # isdlrd:1 smslog_id:123653 p_status:1 uid:5
192.168.10.21 192.168.10.24 2020-03-05 11:22:09 PID5e609a90f0f77 - L2 kannel__call # end load dlr
- - 2020-03-05 11:22:10 PID5e5fbd5685c36 - L3 dlrd # id:242838 smslog_id:123653 p_status:1 uid:5
- - 2020-03-05 11:22:10 PID5e5fbd5685c36 - L2 simplebilling__finalize # saving smslog_id:123653
- - 2020-03-05 11:22:10 PID5e5fbd5685c36 - L2 simplebilling__finalize # saved smslog_id:123653

Latin version

https://example.com/index.php?app=ws&u=jft2p&h=f211e5c831fae5325cc6a672f91&op=pv&to=998974333459&msg=Otrivok+iz+proizvedeniya+Shekspida,+Gamlet:+A+mat’+tvoya+znaet,+na+kom+eyo+gobelen!!!

192.168.100.227 example.com 2020-03-05 11:27:51 PID5e609be729730 jftp L2 sendsms # start uid:5 sender_id:[Example] smsc:[]
192.168.100.227 example.com 2020-03-05 11:27:51 PID5e609be729730 jftp L3 sendsms # maxlen:7650 footerlen:0 footer:[] msglen:86 message:[Otrivok iz proizvedeniya Shekspida, Gamlet: A mat' tvoya znaet, na kom eyo gobelen!!!!]
192.168.100.227 example.com 2020-03-05 11:27:51 PID5e609be729730 jftp L2 sendsms_queue_create # saving queue_code:8bb9692159015c2e95196d939fccccab src:Example scheduled:2020-03-05 11:27:51
192.168.100.227 example.com 2020-03-05 11:27:51 PID5e609be729730 jftp L2 sendsms_queue_create # saved queue_code:8bb9692159015c2e95196d939fccccab id:3387
192.168.100.227 example.com 2020-03-05 11:27:51 PID5e609be729730 jftp L3 sendsms_manipulate_prefix # before prefix manipulation:[998974333459]
192.168.100.227 example.com 2020-03-05 11:27:51 PID5e609be729730 jftp L3 sendsms_manipulate_prefix # after prefix manipulation:[+998974333459]
192.168.100.227 example.com 2020-03-05 11:27:51 PID5e609be729730 jftp L3 simplerate_hook_rate_getbyprefix # rate not found to:+998974333459 default_rate:0.01
192.168.100.227 example.com 2020-03-05 11:27:51 PID5e609be729730 jftp L3 simplerate_hook_rate_getcharges # uid:5 u:jftp len:86 unicode:0 to:+998974333459 enable_credit_unicode:0 count:1 rate:0.01 charge:0.01
192.168.100.227 example.com 2020-03-05 11:27:51 PID5e609be729730 jftp L2 sendsms # dst_count:1 sms_count:1 total_charges:0.01
192.168.100.227 example.com 2020-03-05 11:27:51 PID5e609be729730 jftp L2 sendsms_queue_push # saving queue_code:8bb9692159015c2e95196d939fccccab dst:+998974333459
192.168.100.227 example.com 2020-03-05 11:27:51 PID5e609be729730 jftp L2 sendsms_queue_push # saved queue_code:8bb9692159015c2e95196d939fccccab smslog_id:123656
192.168.100.227 example.com 2020-03-05 11:27:51 PID5e609be729730 jftp L2 sendsms # end queue_code:8bb9692159015c2e95196d939fccccab queue_count:1 sms_count:1 failed_queue:0 failed_sms:0
192.168.100.227 example.com 2020-03-05 11:27:51 PID5e609be729730 jftp L3 webservices # u:jftp ip:192.168.100.227 op:pv timestamp:1583389671 status: error: error_string:
- - 2020-03-05 11:27:51 PID5e609be768518 - L2 sendsmsd # start processing queue_code:8bb9692159015c2e95196d939fccccab chunk:0 queue_count:1 sms_count:1 scheduled:2020-03-05 11:27:51 uid:5 gpid:0 sender_id:Example
- - 2020-03-05 11:27:51 PID5e609be768518 - L2 sendsmsd # sending queue_code:8bb9692159015c2e95196d939fccccab smslog_id:123656 to:+998974333459 sms_count:1 counter:1
- - 2020-03-05 11:27:51 PID5e609be768518 - L3 sendsms_intercept # msgtemplate modified sms_sender:[Example] sms_footer:[] sms_to:[+998974333459] sms_msg:[Otrivok iz proizvedeniya Shekspida, Gamlet: A mat' tvoya znaet, na kom eyo gobelen!!!!] uid:[5] gpid:[0] sms_type:[text] unicode:[0] queue_code:[8bb9692159015c2e95196d939fccccab] smsc:[]
- - 2020-03-05 11:27:51 PID5e609be768518 - L3 outgoing_hook_sendsms_intercept # no SMSC found uid:5 parent_uid:0 from:Example to:+998974333459
- - 2020-03-05 11:27:51 PID5e609be768518 - L2 recvsms_process # using default SMSC smsc:[kannel]
- - 2020-03-05 11:27:51 PID5e609be768518 - L2 sendsms_process # start
- - 2020-03-05 11:27:51 PID5e609be768518 - L3 simplerate_hook_rate_getbyprefix # rate not found to:+998974333459 default_rate:0.01
- - 2020-03-05 11:27:51 PID5e609be768518 - L3 simplerate_hook_rate_getcharges # uid:5 u:jftp len:86 unicode:0 to:+998974333459 enable_credit_unicode:0 count:1 rate:0.01 charge:0.01
- - 2020-03-05 11:27:51 PID5e609be768518 - L2 simplerate_hook_rate_cansend # allowed user uid:5 sms_to:+998974333459 adhoc_credit:0.35 count:1 rate:0.01 charge:0.01 adhoc_balance:0.34
- - 2020-03-05 11:27:51 PID5e609be768518 - L2 sendsms # saving smslog_id:123656 u:5 parent_uid:0 g:0 gw:kannel smsc:kannel s:Example d:+998974333459 type:text unicode:0 status:0
- - 2020-03-05 11:27:51 PID5e609be768518 - L2 sendsms_process # saved smslog_id:123656 id:123656
- - 2020-03-05 11:27:51 PID5e609be768518 - L3 sendsms # final smslog_id:123656 gw:kannel smsc:kannel message:Otrivok iz proizvedeniya Shekspida, Gamlet: A mat' tvoya znaet, na kom eyo gobelen!!!! len:87
- - 2020-03-05 11:27:51 PID5e609be768518 - L3 kannel_hook_sendsms # enter smsc:kannel smslog_id:123656 uid:5 to:+998974333459
- - 2020-03-05 11:27:51 PID5e609be768518 - L3 kannel_hook_sendsms # URL: http://192.168.10.21:13013/cgi-bin/sendsms?username=P8sUF3Re&password=rH7%3C7Q33kWR2d%2Am9wF%21piRpt&from=Example&to=%2B998974333459&dlr-mask=27&dlr-url=http%3A%2F%2F192.168.10.24%2Findex.php%3Fapp%3Dcall%26cat%3Dgateway%26plugin%3Dkannel%26access%3Ddlr%26type%3D%25d%26smslog_id%3D123656%26uid%3D5%26smsc%3Dkannel&account=jftp&text=Otrivok+iz+proizvedeniya+Shekspida%2C+Gamlet%3A+A+mat%27+tvoya+znaet%2C+na+kom+eyo+gobelen%21%21%21%21&from=Example
- - 2020-03-05 11:27:51 PID5e609be768518 - L3 kannel__outgoing # smslog_id:123656 response:0: Accepted for delivery
- - 2020-03-05 11:27:51 PID5e609be768518 - L3 dlr # isdlrd:1 smslog_id:123656 p_status:0 uid:5
- - 2020-03-05 11:27:51 PID5e609be768518 - L3 kannel__outgoing # end smslog_id:123656 p_status:0
- - 2020-03-05 11:27:51 PID5e609be768518 - L2 simplerate_hook_rate_deduct # enter smslog_id:123656
- - 2020-03-05 11:27:51 PID5e609be768518 - L3 simplerate_hook_rate_getbyprefix # rate not found to:+998974333459 default_rate:0.01
- - 2020-03-05 11:27:51 PID5e609be768518 - L3 simplerate_hook_rate_getcharges # uid:5 u:jftp len:86 unicode:0 to:+998974333459 enable_credit_unicode:0 count:1 rate:0.01 charge:0.01
- - 2020-03-05 11:27:51 PID5e609be768518 - L2 simplebilling_hook_billing_post # saving smslog_id:123656 rate:0.01 count:1 charge:0.01
- - 2020-03-05 11:27:51 PID5e609be768518 - L2 simplebilling_hook_billing_post # saved smslog_id:123656 id:123626
- - 2020-03-05 11:27:51 PID5e609be768518 - L3 simplerate_hook_rate_deduct # deduct successful uid:5 parent_uid:0 smslog_id:123656
- - 2020-03-05 11:27:51 PID5e609be768518 - L2 sendsms_process # end
- - 2020-03-05 11:27:51 PID5e609be768518 - L2 sendsmsd # result queue_code:8bb9692159015c2e95196d939fccccab to:+998974333459 flag:1 smslog_id:123656
- - 2020-03-05 11:27:51 PID5e609be768518 - L2 sendsmsd # finish processing queue_code:8bb9692159015c2e95196d939fccccab uid:5 sender_id:Example queue_count:1 sms_count:1
- - 2020-03-05 11:27:52 PID5e5fbd5685c36 - L3 dlrd # id:242843 smslog_id:123656 p_status:0 uid:5
192.168.10.21 192.168.10.24 2020-03-05 11:27:54 PID5e609beabe2b4 - L2 kannel__call # start load:/var/www/playsms/plugin/gateway/kannel/dlr.php
192.168.10.21 192.168.10.24 2020-03-05 11:27:54 PID5e609beabe2b4 - L3 kannel__dlr # remote_addr:192.168.10.21 remote_host:192.168.10.24 type:[8] smslog_id:[123656] uid:[5] smsc:[kannel]
192.168.10.21 192.168.10.24 2020-03-05 11:27:54 PID5e609beabe2b4 - L3 dlr # isdlrd:1 smslog_id:123656 p_status:1 uid:5
192.168.10.21 192.168.10.24 2020-03-05 11:27:54 PID5e609beabe2b4 - L2 kannel__call # end load dlr
- - 2020-03-05 11:27:55 PID5e5fbd5685c36 - L3 dlrd # id:242844 smslog_id:123656 p_status:1 uid:5
- - 2020-03-05 11:27:55 PID5e5fbd5685c36 - L2 simplebilling__finalize # saving smslog_id:123656
- - 2020-03-05 11:27:55 PID5e5fbd5685c36 - L2 simplebilling__finalize # saved smslog_id:123656

Cyrillic + Latin version

https://example.com/index.php?app=ws&u=jft2p&h=f211e5c831fae5325cc6a672f91&op=pv&to=998974333459&msg=Otrivok+iz+proizvedeniya+Шекспира,+Гамлет:+A+mat’+tvoya+znaet,+na+kom+eyo+гобелен!!!

192.168.100.227 example.com 2020-03-05 11:24:41 PID5e609b2996e8c jftp L2 sendsms # start uid:5 sender_id:[Example] smsc:[]
192.168.100.227 example.com 2020-03-05 11:24:41 PID5e609b2996e8c jftp L3 sendsms # maxlen:7650 footerlen:0 footer:[] msglen:85 message:[Otrivok iz proizvedeniya Шекспира, Гамлет: A mat' tvoya znaet, na kom eyo гобелен!!!!]
192.168.100.227 example.com 2020-03-05 11:24:41 PID5e609b2996e8c jftp L2 sendsms_queue_create # saving queue_code:e782d665e05dc51152fd0e5bf8911ce5 src:Example scheduled:2020-03-05 11:24:41
192.168.100.227 example.com 2020-03-05 11:24:41 PID5e609b2996e8c jftp L2 sendsms_queue_create # saved queue_code:e782d665e05dc51152fd0e5bf8911ce5 id:3386
192.168.100.227 example.com 2020-03-05 11:24:41 PID5e609b2996e8c jftp L3 sendsms_manipulate_prefix # before prefix manipulation:[998974333459]
192.168.100.227 example.com 2020-03-05 11:24:41 PID5e609b2996e8c jftp L3 sendsms_manipulate_prefix # after prefix manipulation:[+998974333459]
192.168.100.227 example.com 2020-03-05 11:24:41 PID5e609b2996e8c jftp L3 simplerate_hook_rate_getbyprefix # rate not found to:+998974333459 default_rate:0.01
192.168.100.227 example.com 2020-03-05 11:24:41 PID5e609b2996e8c jftp L3 simplerate_hook_rate_getcharges # uid:5 u:jftp len:85 unicode:0 to:+998974333459 enable_credit_unicode:0 count:1 rate:0.01 charge:0.01
192.168.100.227 example.com 2020-03-05 11:24:41 PID5e609b2996e8c jftp L2 sendsms # dst_count:1 sms_count:1 total_charges:0.01
192.168.100.227 example.com 2020-03-05 11:24:41 PID5e609b2996e8c jftp L2 sendsms_queue_push # saving queue_code:e782d665e05dc51152fd0e5bf8911ce5 dst:+998974333459
192.168.100.227 example.com 2020-03-05 11:24:41 PID5e609b2996e8c jftp L2 sendsms_queue_push # saved queue_code:e782d665e05dc51152fd0e5bf8911ce5 smslog_id:123655
192.168.100.227 example.com 2020-03-05 11:24:41 PID5e609b2996e8c jftp L2 sendsms # end queue_code:e782d665e05dc51152fd0e5bf8911ce5 queue_count:1 sms_count:1 failed_queue:0 failed_sms:0
192.168.100.227 example.com 2020-03-05 11:24:41 PID5e609b2996e8c jftp L3 webservices # u:jftp ip:192.168.100.227 op:pv timestamp:1583389481 status: error: error_string:
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L2 sendsmsd # start processing queue_code:e782d665e05dc51152fd0e5bf8911ce5 chunk:0 queue_count:1 sms_count:1 scheduled:2020-03-05 11:24:41 uid:5 gpid:0 sender_id:Example
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L2 sendsmsd # sending queue_code:e782d665e05dc51152fd0e5bf8911ce5 smslog_id:123655 to:+998974333459 sms_count:1 counter:1
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L3 sendsms_intercept # msgtemplate modified sms_sender:[Example] sms_footer:[] sms_to:[+998974333459] sms_msg:[Otrivok iz proizvedeniya Шекспира, Гамлет: A mat' tvoya znaet, na kom eyo гобелен!!!!] uid:[5] gpid:[0] sms_type:[text] unicode:[0] queue_code:[e782d665e05dc51152fd0e5bf8911ce5] smsc:[]
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L3 outgoing_hook_sendsms_intercept # no SMSC found uid:5 parent_uid:0 from:Example to:+998974333459
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L2 recvsms_process # using default SMSC smsc:[kannel]
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L2 sendsms_process # start
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L3 simplerate_hook_rate_getbyprefix # rate not found to:+998974333459 default_rate:0.01
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L3 simplerate_hook_rate_getcharges # uid:5 u:jftp len:85 unicode:0 to:+998974333459 enable_credit_unicode:0 count:1 rate:0.01 charge:0.01
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L2 simplerate_hook_rate_cansend # allowed user uid:5 sms_to:+998974333459 adhoc_credit:0.36 count:1 rate:0.01 charge:0.01 adhoc_balance:0.35
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L2 sendsms # saving smslog_id:123655 u:5 parent_uid:0 g:0 gw:kannel smsc:kannel s:Example d:+998974333459 type:text unicode:0 status:0
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L2 sendsms_process # saved smslog_id:123655 id:123655
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L3 sendsms # final smslog_id:123655 gw:kannel smsc:kannel message:Otrivok iz proizvedeniya Шекспира, Гамлет: A mat' tvoya znaet, na kom eyo гобелен!!!! len:86
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L3 kannel_hook_sendsms # enter smsc:kannel smslog_id:123655 uid:5 to:+998974333459
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L3 kannel_hook_sendsms # URL: http://192.168.10.21:13013/cgi-bin/sendsms?username=P8sUF3Re&password=rH7%3C7Q33kWR2d%2Am9wF%21piRpt&from=Example&to=%2B998974333459&dlr-mask=27&dlr-url=http%3A%2F%2F192.168.10.24%2Findex.php%3Fapp%3Dcall%26cat%3Dgateway%26plugin%3Dkannel%26access%3Ddlr%26type%3D%25d%26smslog_id%3D123655%26uid%3D5%26smsc%3Dkannel&charset=UTF-16BE&coding=2&account=jftp&text=%00O%00t%00r%00i%00v%00o%00k%00+%00i%00z%00+%00p%00r%00o%00i%00z%00v%00e%00d%00e%00n%00i%00y%00a%00+%04%28%045%04%3A%04A%04%3F%048%04%40%040%00%2C%00+%04%13%040%04%3C%04%3B%045%04B%00%3A%00+%00A%00+%00m%00a%00t%00%27%00+%00t%00v%00o%00y%00a%00+%00z%00n%00a%00e%00t%00%2C%00+%00n%00a%00+%00k%00o%00m%00+%00e%00y%00o%00+%043%04%3E%041%045%04%3B%045%04%3D%00%21%00%21%00%21%00%21&from=Example
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L3 kannel__outgoing # smslog_id:123655 response:0: Accepted for delivery
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L3 dlr # isdlrd:1 smslog_id:123655 p_status:0 uid:5
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L3 kannel__outgoing # end smslog_id:123655 p_status:0
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L2 simplerate_hook_rate_deduct # enter smslog_id:123655
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L3 simplerate_hook_rate_getbyprefix # rate not found to:+998974333459 default_rate:0.01
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L3 simplerate_hook_rate_getcharges # uid:5 u:jftp len:85 unicode:0 to:+998974333459 enable_credit_unicode:0 count:1 rate:0.01 charge:0.01
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L2 simplebilling_hook_billing_post # saving smslog_id:123655 rate:0.01 count:1 charge:0.01
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L2 simplebilling_hook_billing_post # saved smslog_id:123655 id:123625
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L3 simplerate_hook_rate_deduct # deduct successful uid:5 parent_uid:0 smslog_id:123655
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L2 sendsms_process # end
- - 2020-03-05 11:24:41 PID5e609b29d4774 - L2 sendsmsd # result queue_code:e782d665e05dc51152fd0e5bf8911ce5 to:+998974333459 flag:1 smslog_id:123655
- - 2020-03-05 11:24:42 PID5e609b29d4774 - L2 sendsmsd # finish processing queue_code:e782d665e05dc51152fd0e5bf8911ce5 uid:5 sender_id:Example queue_count:1 sms_count:1
- - 2020-03-05 11:24:42 PID5e5fbd5685c36 - L3 dlrd # id:242841 smslog_id:123655 p_status:0 uid:5
192.168.10.21 192.168.10.24 2020-03-05 11:24:57 PID5e609b3965c91 - L2 kannel__call # start load:/var/www/playsms/plugin/gateway/kannel/dlr.php
192.168.10.21 192.168.10.24 2020-03-05 11:24:57 PID5e609b3965c91 - L3 kannel__dlr # remote_addr:192.168.10.21 remote_host:192.168.10.24 type:[8] smslog_id:[123655] uid:[5] smsc:[kannel]
192.168.10.21 192.168.10.24 2020-03-05 11:24:57 PID5e609b3965c91 - L3 dlr # isdlrd:1 smslog_id:123655 p_status:1 uid:5
192.168.10.21 192.168.10.24 2020-03-05 11:24:57 PID5e609b3965c91 - L2 kannel__call # end load dlr
- - 2020-03-05 11:24:58 PID5e5fbd5685c36 - L3 dlrd # id:242842 smslog_id:123655 p_status:1 uid:5
- - 2020-03-05 11:24:58 PID5e5fbd5685c36 - L2 simplebilling__finalize # saving smslog_id:123655
- - 2020-03-05 11:24:58 PID5e5fbd5685c36 - L2 simplebilling__finalize # saved smslog_id:123655

PlaySMS settings:

config file fn.php (kannel plugin):
Screenshot_20200305_111155

Respectfully,
Jamshid Tursunov

detection works as it should be.

but, the credit/count still 1 because the detection is not affecting billing, it is added only before submission to Kannel, so playSMS didn’t re-count it (if its unicode), all counted as non unicode

anton

How to fix it?

Respectfully,
Jamshid Tursunov

try insert the unicode detection line above sendsms() here:

anton

Good day, Anton!
Do not tell me exactly how to do this and what exactly to add?
Thanks in advance.

Respectfully,
Jamshid Tursunov

didn’t know if you dont know how to do it.

ok, edit plugin/core/sendsms/fn.php and go to line 760

insert this code:

// auto detect unicode
if (!$unicode) $unicode = core_detect_unicode($sms_msg.$sms_footer);

by adding above code SMS with unicode=0 or not using unicode parameter will be autodetected. if detected as unicode then unicode set to 1 before sending it to gateway (Kannel).

anton

// auto detect unicode
if (! $ unicode) $ unicode = core_detect_unicode ($ sms_msg. $ sms_footer);

This log output, after

  192.168.10.22 example.com 2020-03-06 21:24:59 PID5e62795b2a97a jftp L2 sendsms # start uid:5 sender_id:[Example] smsc:[]
    192.168.10.22 example.com 2020-03-06 21:24:59 PID5e62795b2a97a jftp L3 sendsms # maxlen:7650 footerlen:0 footer:[] msglen:82 message:[Отрывок из произведения Шекспира, Гамлет: А мать твоя знает, на ком её гобелен!!!!]
    192.168.10.22 example.com 2020-03-06 21:24:59 PID5e62795b2a97a jftp L2 sendsms_queue_create # saving queue_code:fbbbd105928df1a271c0a91628139abe src:Example scheduled:2020-03-06 21:24:59
    192.168.10.22 example.com 2020-03-06 21:24:59 PID5e62795b2a97a jftp L2 sendsms_queue_create # saved queue_code:fbbbd105928df1a271c0a91628139abe id:3540
    192.168.10.22 example.com 2020-03-06 21:24:59 PID5e62795b2a97a jftp L3 sendsms_manipulate_prefix # before prefix manipulation:[998974332489]
    192.168.10.22 example.com 2020-03-06 21:24:59 PID5e62795b2a97a jftp L3 sendsms_manipulate_prefix # after prefix manipulation:[+998974332489]
    192.168.10.22 example.com 2020-03-06 21:24:59 PID5e62795b2a97a jftp L3 simplerate_hook_rate_getbyprefix # rate not found to:+998974332489 default_rate:0.01
    192.168.10.22 example.com 2020-03-06 21:24:59 PID5e62795b2a97a jftp L3 simplerate_hook_rate_getcharges # uid:5 u:jftp len:82 unicode:0 to:+998974332489 enable_credit_unicode:0 count:1 rate:0.01 charge:0.01
    192.168.10.22 example.com 2020-03-06 21:24:59 PID5e62795b2a97a jftp L2 sendsms # dst_count:1 sms_count:1 total_charges:0.01
    192.168.10.22 example.com 2020-03-06 21:24:59 PID5e62795b2a97a jftp L2 sendsms_queue_push # saving queue_code:fbbbd105928df1a271c0a91628139abe dst:+998974332489
    192.168.10.22 example.com 2020-03-06 21:24:59 PID5e62795b2a97a jftp L2 sendsms_queue_push # saved queue_code:fbbbd105928df1a271c0a91628139abe smslog_id:123809
    192.168.10.22 example.com 2020-03-06 21:24:59 PID5e62795b2a97a jftp L2 sendsms # end queue_code:fbbbd105928df1a271c0a91628139abe queue_count:1 sms_count:1 failed_queue:0 failed_sms:0
    192.168.10.22 example.com 2020-03-06 21:24:59 PID5e62795b2a97a jftp L3 webservices # u:jftp ip:192.168.10.22 op:pv timestamp:1583511899 status: error: error_string:
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L2 sendsmsd # start processing queue_code:fbbbd105928df1a271c0a91628139abe chunk:0 queue_count:1 sms_count:1 scheduled:2020-03-06 21:24:59 uid:5 gpid:0 sender_id:Example
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L2 sendsmsd # sending queue_code:fbbbd105928df1a271c0a91628139abe smslog_id:123809 to:+998974332489 sms_count:1 counter:1
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L3 sendsms_intercept # msgtemplate modified sms_sender:[Example] sms_footer:[] sms_to:[+998974332489] sms_msg:[Отрывок из произведения Шекспира, Гамлет: А мать твоя знает, на ком её гобелен!!!!] uid:[5] gpid:[0] sms_type:[text] unicode:[0] queue_code:[fbbbd105928df1a271c0a91628139abe] smsc:[]
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L3 outgoing_hook_sendsms_intercept # no SMSC found uid:5 parent_uid:0 from:Example to:+998974332489
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L2 recvsms_process # using default SMSC smsc:[kannel]
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L2 sendsms_process # start
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L3 simplerate_hook_rate_getbyprefix # rate not found to:+998974332489 default_rate:0.01
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L3 simplerate_hook_rate_getcharges # uid:5 u:jftp len:82 unicode:0 to:+998974332489 enable_credit_unicode:0 count:1 rate:0.01 charge:0.01
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L2 simplerate_hook_rate_cansend # allowed user uid:5 sms_to:+998974332489 adhoc_credit:0.33 count:1 rate:0.01 charge:0.01 adhoc_balance:0.32
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L2 sendsms # saving smslog_id:123809 u:5 parent_uid:0 g:0 gw:kannel smsc:kannel s:Example d:+998974332489 type:text unicode:0 status:0
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L2 sendsms_process # saved smslog_id:123809 id:123809
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L3 sendsms # final smslog_id:123809 gw:kannel smsc:kannel message:Отрывок из произведения Шекспира, Гамлет: А мать твоя знает, на ком её гобелен!!!! len:82
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L3 kannel_hook_sendsms # enter smsc:kannel smslog_id:123809 uid:5 to:+998974332489
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L3 kannel_hook_sendsms # URL: http://192.168.10.21:13013/cgi-bin/sendsms?username=P8sUF3Re&password=rH7%3C7QcakWR2d%2d3vf%9wF%21piRpt&from=Example&to=%2B998974332489&dlr-mask=27&dlr-url=http%3A%2F%2F192.168.100.224%2Findex.php%3Fapp%3Dcall%26cat%3Dgateway%26plugin%3Dkannel%26access%3Ddlr%26type%3D%25d%26smslog_id%3D123809%26uid%3D5%26smsc%3Dkannel&charset=UTF-16BE&coding=2&account=jftp&text=%04%1E%04B%04%40%04K%042%04%3E%04%3A%00+%048%047%00+%04%3F%04%40%04%3E%048%047%042%045%044%045%04%3D%048%04O%00+%04%28%045%04%3A%04A%04%3F%048%04%40%040%00%2C%00+%04%13%040%04%3C%04%3B%045%04B%00%3A%00+%04%10%00+%04%3C%040%04B%04L%00+%04B%042%04%3E%04O%00+%047%04%3D%040%045%04B%00%2C%00+%04%3D%040%00+%04%3A%04%3E%04%3C%00+%045%04Q%00+%043%04%3E%041%045%04%3B%045%04%3D%00%21%00%21%00%21%00%21&from=Example
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L3 kannel__outgoing # smslog_id:123809 response:0: Accepted for delivery
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L3 dlr # isdlrd:1 smslog_id:123809 p_status:0 uid:5
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L3 kannel__outgoing # end smslog_id:123809 p_status:0
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L2 simplerate_hook_rate_deduct # enter smslog_id:123809
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L3 simplerate_hook_rate_getbyprefix # rate not found to:+998974332489 default_rate:0.01
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L3 simplerate_hook_rate_getcharges # uid:5 u:jftp len:82 unicode:0 to:+998974332489 enable_credit_unicode:0 count:1 rate:0.01 charge:0.01
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L2 simplebilling_hook_billing_post # saving smslog_id:123809 rate:0.01 count:1 charge:0.01
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L2 simplebilling_hook_billing_post # saved smslog_id:123809 id:123779
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L3 simplerate_hook_rate_deduct # deduct successful uid:5 parent_uid:0 smslog_id:123809
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L2 sendsms_process # end
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L2 sendsmsd # result queue_code:fbbbd105928df1a271c0a91628139abe to:+998974332489 flag:1 smslog_id:123809
    - - 2020-03-06 21:25:00 PID5e62795bf151b - L2 sendsmsd # finish processing queue_code:fbbbd105928df1a271c0a91628139abe uid:5 sender_id:Example queue_count:1 sms_count:1
    - - 2020-03-06 21:25:00 PID5e62793e76925 - L3 dlrd # id:243148 smslog_id:123809 p_status:0 uid:5
    192.168.10.21 192.168.100.224 2020-03-06 21:25:15 PID5e62796b35d2a - L2 kannel__call # start load:/var/www/playsms/plugin/gateway/kannel/dlr.php
    192.168.10.21 192.168.100.224 2020-03-06 21:25:15 PID5e62796b35d2a - L3 kannel__dlr # remote_addr:192.168.10.21 remote_host:192.168.100.224 type:[8] smslog_id:[123809] uid:[5] smsc:[kannel]
    192.168.10.21 192.168.100.224 2020-03-06 21:25:15 PID5e62796b35d2a - L3 dlr # isdlrd:1 smslog_id:123809 p_status:1 uid:5
    192.168.10.21 192.168.100.224 2020-03-06 21:25:15 PID5e62796b35d2a - L2 kannel__call # end load dlr
    - - 2020-03-06 21:25:16 PID5e62793e76925 - L3 dlrd # id:243149 smslog_id:123809 p_status:1 uid:5
    - - 2020-03-06 21:25:16 PID5e62793e76925 - L2 simplebilling__finalize # saving smslog_id:123809
    - - 2020-03-06 21:25:16 PID5e62793e76925 - L2 simplebilling__finalize # saved smslog_id:123809
    a`Preformatted text`

nothing has changed, the same conclusion

Respectfully,
Jamshid Tursunov

I tested it just now, it worked

Here is my modification on plugin/core/sendsms/fn.php around line 760:

    _log("start uid:" . $uid . " sender_id:[" . $sms_sender . "] smsc:[" . $smsc . "]", 2, "sendsms");

    // add a space infront of footer if exists
    $c_sms_footer = (trim($sms_footer) ? ' ' . trim($sms_footer) : '');
    _log("maxlen:" . $max_length . " footerlen:" . core_smslen($c_sms_footer) . " footer:[" . $c_sms_footer . "] msglen:" . core_smslen($sms_msg) . " message:[" . $sms_msg . "]", 3, "sendsms");

    // auto detect unicode
    if (!$unicode) {
        if ($unicode = core_detect_unicode($sms_msg.$sms_footer)) {
            _log("autodetect unicode:1", 2, "sendsms");
        } else {
            _log("autodetect unicode:0", 2, "sendsms");
        }
    }
    // end of modification

    // create a queue
    $queue_code = sendsms_queue_create($sms_sender, $sms_footer, $sms_msg, $uid, 0, $sms_type, $unicode, $sms_schedule, $smsc);
    if (!$queue_code) {

and here is the log, it shown SMS counted as 2 SMS:

Screenshot your modification, send here

Anton

Yes, it works brilliantly.
Thank you for your assistance.
And by the way, special thanks for your product and for supporting it.
I think that the topic can be closed.

With great respect,
Jamshid Tursunov

@anton, if I’m not stunned, this fix is not included in the code base. Turn it on too, if possible. You fixed it once. Thanks a lot for earlier.

Respectfully,
Jamshid Tursunov

Currently autodetection done in codes before calling sendsms(), this means that service that want to send SMS must done the autodetection and decide for sendsms().

By adding this changes means that playSMS will do the autodetection regardless of what user sets on unicode variable. For example, setting unicode=0 or not set unicode in webservices won’t make the SMS sent as plain text if its actually unicodes, and vice versa.

Ok, lets add this, please test and let us know if it cause more problem.

Commited and pushed:

anton

Check soon

Yours faithfully,
Jamshid Tursnuov