【发布时间】:2016-05-21 19:44:59
【问题描述】:
我正在尝试使用node-smpp 和ActiveXperts free demo service 发送短信。
以下是 ActiveXperts 文档中关于发送免费演示消息的说明:
根据node-smpp documentation,这是我的代码:
var smpp = require('smpp');
var session = smpp.connect('smpp.activexperts-labs.com', 2775);
session.bind_transceiver({}, function(pdu) {
console.log(pdu);
if (pdu.command_status == 0) {
// Successfully bound
session.submit_sm({
destination_addr: '1234567890',
short_message: 'Hello!'
}, function(pdu) {
if (pdu.command_status == 0) {
// Message successfully sent
console.log(pdu.message_id);
}
});
}
});
这是我的 PDU 响应:
PDU {
command_length: 32,
command_id: 2147483657,
command_status: 14,
sequence_number: 1,
command: 'bind_transceiver_resp',
system_id: 'ActiveXperts GW' }
发送消息的函数 (session.submit_sm) 显然没有被调用,因为 pdu 结果 command_status = 14 而不是 if 语句要求的 if (pdu.command_status == 0)。
我删除了 if 语句,但消息仍然没有发送。任何想法我做错了什么。
【问题讨论】:
-
您使用的是哪个版本的 smpp?
-
@JohnAnkanna 我运行了 npm install npm --save ,因此我使用的是“0.2.0”版本
-
您使用的
SMPP v5.0 in node.js, with support for custom commands and TLVs.不支持您的active experts free demo service -
我可以使用以前的版本吗?还是 SMPP 只是不支持我正在尝试做的事情?
-
检查这个链接versioneye.com/nodejs/smpp/0.0.3你可以下载旧版本,一定要检查任何语法变化和响应代码和所有