Skip to content

is coding and charset MSG properties used? #1

@tamerMarzouk

Description

@tamerMarzouk

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.

smsbox.prototype.sendSMS = function(conf) {
    var def = {
        id: true,
        time: Math.floor((new Date).getTime() / 1000),
        sender: undefined,
        receiver: undefined,
        msgdata: undefined,
        charset: undefined, //added these two lines
        coding: undefined
    };
    for (var property in def)
        if (!conf.hasOwnProperty(property))
            conf[property] = def[property];
    if (!conf.receiver || !conf.msgdata) return null;
    this.write("sms", {
        sender: conf.sender,
        receiver: conf.receiver,
        msgdata: conf.msg || conf.text || conf.msgdata,
        time: conf.time,
        id: conf.id || true,
        sms_type: status.sms.mt_reply,
        coding: conf.coding, //added these two lines
        charset: conf.charset
    });
    return true;
};

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions