Many Arabic codes :S

Many Arabic codes :S SearchSearch
Author Message
Abudulamah
New member
Username: Abudulamah

Post Number: 1
Registered: 03-2009
Posted on Wednesday, March 04, 2009 - 07:38 pm:   

Hello,

i am a php programmer and i am testing different features of your nice sw in order to evaluate if we can use it when launch next year. i made a script that will be executed by nowsms 2-way features when the number "1" for example is received


when doing so with few mobiles i noticed that nowsms ignored some of the sms.

i have noticed also that when sending number 1 in arabic (utf) it is represented by more than one code in the sms-in-log so i put alternative cases that shall cover all different representative for the number on in the arabic script utf-8:



switch ($command) {
case'1':
$textback=$code1;
break;
case'١':
$textback=$code1;
break;
case'0661':
$textback=$code1;
break;
case'200F0661':
$textback=$code1;
break;

case'200F0031':
$textback=$code1;
break;
case'0031':
$textback=$code1;
break;

}


but i have noticed that when the case comes to 200F0031, the case is not triggered.


the character set used is:
x-unicode-2-0-utf-8

how can i overcome this to let nowsms recognize all of the charecters?


Just a hint might help you help me . isn't the 200F a special format in utf-8 (for example may be indicates direction of script ltr or rtl) if so it seems it is blocking nowsms from recognizing the code 1. may be I am wrong because i havne't seen nowsms responding or not to 0031 (witout 200F) so i am not sure if it is related to 200F or to 0031 or the problem not related to any. this is because most of the cases for "1" were: with 1 as text, 0661, or 200F0031.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 546
Registered: 08-2008
Posted on Wednesday, March 04, 2009 - 09:50 pm:   

Hi,

There is an issue that you cannot use non-Latin characters for filtering in the 2-way command prefix.

I know that causes an issue for Arabic numbers.

The only solution is to use a wildcard command prefix, and perform the parsing in your application.

Your command should receive all of the text, we just can't support filtering the prefix with non-Latin characters at this time.

It sounds like you are having problems receiving the complete text.

It would help to see an SMSDEBUG.LOG showing problem messages being received and routed to the 2-way command. Then we can get a better idea of what is happening.

Enable the SMSDEBUG.LOG via a checkbox option on the "Serial #" page of the configuration dialog, and let's take a look.

--
Des
NowSMS Support
Abudulamah
New member
Username: Abudulamah

Post Number: 2
Registered: 03-2009
Posted on Monday, March 09, 2009 - 08:21 pm:   

Hello Des,
I just figured out this log. i traced one of the test sms that was not processed for some reason in the php script i made (* is the trigger command). here is the sms-in log:

SMS-in, Log:
2009-03-09 8:44:00,xxxxxxx,Binary,200F0031,12321



and this is Debug log:
Debug:

17:41:11:808 [3] ThreadProcessModem: Processing SAR-xxxxxxxx-493c22e3-2-1.req...
17:41:11:871 [3] ThreadProcessModem: Processing SAR-xxxxxxxx-493c22e3-2-2.req...
17:41:17:246 [7] WaitForSocketClose: WinSock reported ioctlsocket complete
18:00:00:293 [0] main: 38 Days remaining in trial version
18:44:00:449 [5] SMPPReceiveMessageCallback: inbound message: sender=xxxءxxxxx, recip=12321, pid=0, dcs=8, msgFlags=0, udh=, msg=200F0031
18:44:01:340 [7] ThreadProcessInboundSMS: Processing 493C22E4.in...
18:44:01:340 [7] GetProgramToExecute: http://localhost/sendsms.php?subscriber=@@SENDER@@&command=@@SMSPREFIX@@&messege =@@FULLSMS@@&charset=iso-8859-6
18:44:01:340 [7] GetProgramToExecute: Converting character set for received SMS message to x-unicode-2-0-utf-8
18:44:01:340 [7] UTF8ToLocalString: Error 87 from WideCharToMultiByte
18:44:01:340 [7] UTF8ToLocalString: Error 87 from WideCharToMultiByte
18:44:01:340 [7] GetProgramToExecute: http://localhost/sendsms.php?subscriber=%2Bxxxxxxxxxx&command=%E2%80%8F1&messege =%E2%80%8F1&charset=iso-8859-6
18:44:01:340 [7] ThreadProcessInboundSMS: Executing http://localhost/sendsms.php?subscriber=%2Bxxxxxxxxx&command=%E2%80%8F1&messege= %E2%80%8F1&charset=iso-8859-6
18:44:01:340 [7] RetrieveURL: Retrieving http://localhost/sendsms.php?subscriber=%2Bxxxxxxxxxx&command=%E2%80%8F1&messege =%E2%80%8F1&charset=iso-8859-6
18:44:01:340 [7] RetrieveURL: Looking up localhost
18:44:01:340 [7] RetrieveURL: Retrieving sendsms.php?subscriber=%2Bxxxxxxxxx&command=%E2%80%8F1&messege=%E2%80%8F1&charse t=iso-8859-6
18:44:01:355 [7] RetrieveURL: GET /sendsms804611.php?subscriber=%2Bxxxxxxxxx&command=%E2%80%8F1&messege=%E2%80%8F1 &charset=iso-8859-6 HTTP/1.1
User-Agent: Now SMS/MMS Gateway v2009.01.12
Accept: */*
Host: localhost


18:44:01:371 [16] ThreadProcessConnection: Processing connection from 127.0.0.1...
18:44:01:371 [16] ThreadProcessConnection: Processing request /?Phone=%2Bxxxxxxxxxxx&Text=%D9%84%D9%84%D9%85%D8%B3%D8%A7%D8%B9%D8%AF%D8%A9%20% D9%81%D9%8A%20%D8%A3%D9%8A%20%D8%B3%D9%84%20%D9%85&SMSCRoute=SMPP%20-%20192.168. 2.59#2:10003&charset=UTF-8
18:44:01:371 [16] Debug: 1 recipient entries
18:44:01:371 [16] UTF8StringRequiresUnicodeEncoding: Translate to/from GSM string results in loss of data
18:44:01:371 [16] UTF8StringRequiresUnicodeEncoding: اختبار للمساعدة
18:44:01:371 [16] UTF8StringRequiresUnicodeEncoding: é@@@Eù3ù ù9 /ù ù @ ùJù #
18:44:01:371 [16] ThreadProcessConnection: SMS message must be submitted with Unicode
18:44:01:371 [16] ThreadProcessConnection: اختبار للمساعدة
18:44:01:386 [7] HttpResponseWait: Ok
18:44:01:386 [7] RetrieveURL: HTTP/1.1 200 OK
Date: Mon, 09 Mar 2009 15:44:01 GMT
Server: Apache/2.2.11 (Win32) PHP/5.2.6
X-Powered-By: PHP/5.2.6
Content-Length: 416
Content-Type: text/html

-----

i don't know why specially when the code "1" is represented by: 200F0031, the php script doens't work well.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 571
Registered: 08-2008
Posted on Wednesday, March 11, 2009 - 12:28 pm:   

Hi,

It looks like a two character message ...


200F is the first character, and 0031 is the second character.

When this gets encoded as UTF-8, the first character becomes 0xE2 0x80 0x8F, and the second character is 0x31 or simply "1".

You might want to use a character set other than UTF-8, as it can be confusing how some characters get encoded as multiple bytes, and some are encoded as single bytes.

--
Des
NowSMS Support