【问题标题】:How to send deliver_sm request add user_message_reference TLV from node.js SMPP如何从node.js SMPP发送deliver_sm请求添加user_message_reference TLV
【发布时间】:2012-04-13 07:47:33
【问题描述】:

我正在使用node-smpp,想知道如何发送“deliver_sm”请求并将“TLV”响应添加到 user_message_reference。

node-smpp / lib / smpp.js 的摘录:

exports.addTLV = function(tag, options) {
    options.tag = tag;
    defs.tlvs[tlv] = options;
    defs.tlvsById[options.id] = options;
};

测试代码:

var tlv = new Object();
tlv.tag = 0x001E; // smpp.receipted_message_id;
tlv.lenght =  msgid.lenght;
tlv.value = msgid;

smpp.addTLV(tlv,tlv);

结果:

defs.tlvs[tlv] = options;
       ^
ReferenceError: tlv is not defined

【问题讨论】:

标签: node.js smpp tlv


【解决方案1】:

我是 node-smpp 模块的作者。

要将 tlv 参数或标准参数添加到您的 PDU,您只需向 pdu 添加一个具有适当名称的属性。

session.deliver_sm({
    source_addr: 'blahblah',
    destination_addr: 'blahblah',
    short_message: 'blahblah',
    receipted_message_id: 'blahblah',
    user_message_reference: msgid
});

这将发送一个 Deliver_sm pdu,其中包含上述参数以及设置为默认值的其他必需参数。

通常您根本不需要使用smpp.addTLV。它用于定义自定义供应商特定的 TLV(0x1400 和 0x3FFF 之间的标签)。

【讨论】:

  • 嗨,我知道这个答案已经很老了,但无论如何......我在尝试发送 Deliver_sm 时收到了TypeError: Cannot read property 'length' of undefined
猜你喜欢
  • 1970-01-01
  • 2015-11-06
  • 2015-11-26
  • 1970-01-01
  • 2018-09-06
  • 2020-10-30
  • 2019-04-08
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多