Open tamerMarzouk opened 7 years ago
Hey @tamerMarzouk thank's to use my nodejs module, I'll add this feature.
@tamerMarzouk, I have add two functions to hep you,
app.sendUCS2SMS({
sender: 'TEST',
receiver: '06462845',
msgdata: 'Bonjour, Hi, 你好, صباح الخير', // UCS2 text
});
app.flashUCS2SMS({
sender: 'TEST',
receiver: '06462845',
msgdata: 'Bonjour, Hi, 你好, صباح الخير', // UCS2 text
});
I hope help you again.
I think the example is not correct. you should provide the msgdata must be encoded as UTF-16BE, if sent as is it will not received correctly. I use
msgdata: Buffer.from('063106330627064406290020','hex')
Can you test, UCS2 is UTF16BE, the buffer has correctly converted now.
My Setup is not connected to a live SMSC right now. I will try to send as soon as I could. But in nodejs , UCS2 s an alias for UTF-16LE
@tamerMarzouk, do you have test the new version of kannel(nom module)?
I've tested the new version of kannel. The MSG class has a missing ")" on line node_modules/kannel/lib/MSG.js:76 I've added the missing ")" and tried using the flashUCS2SMS with utf-16be encoded buffer but the SMS received was not correct format. I tried using flashUCS2SMS with an Arabic string as is but the msg received was not correct format and the coding was 0 and charset utf-8
I've just used sendSMS function and added two lines to the following code
this.write("sms", {
sender: conf.sender,
receiver: conf.receiver,
msgdata: conf.msg || conf.text || conf.msgdata,
coding: conf.coding, //added this line
charset: conf.charset,// added this line
time: conf.time,
id: conf.id || true,
sms_type: status.sms.mt_reply
});
then When I send Arabic text I provide code=2 and charset='UTF-16BE' and the msgdata is a string representation in hex for example '06310633062706440629' which is the Arabic word 'رسالة'
The above works good for me and is the same format received by an SMS app as if it was sent from kannel push SMS URL.
Hi @tamerMarzouk,
Please update kannel.js to the last version, and use sendUCS2SMS or flashUCS2SMS.
When using the smsbox.send, I don't see that the charset nor coding properties are used. How do I send Arabic text. In kannel url I used to set coding=2 url parameter, and charset=UTF-16BE, and text = hex I changed the sendSMS function like this to add charset and coding the text I sent as a buffer with hex encoding.