首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >节点SMPP中未收到smpp传送回执响应

节点SMPP中未收到smpp传送回执响应
EN

Stack Overflow用户
提问于 2014-02-21 15:15:09
回答 1查看 2.3K关注 0票数 1

我正在使用Node SMPP,我可以发送短信到我的号码,但我不能得到交付收据,它是交付或没有。请参考我的以下代码

如果出了什么问题,你能给我指路吗?

代码语言:javascript
复制
var smpp = require('smpp');
var session = smpp.connect('103.250.30.x', 51612);

session.bind_transceiver({
  system_id: 'makesms1',
  password: 'Prasad@1'
}, function(pdu) {
  if (pdu.command_status == 0) {
    // Successfully bound
    console.log('bound bind_transceiver')
    session.submit_sm({
        destination_addr: '90000541x0',
        short_message: new Buffer("Hi, Froxtel interview SMS/email has been sent by company only. Its not any related to freshersworld. U can contact directly company or call 08688805062/3.Please ignore the word freshersworld in sms/mail.regards Froxtel team.","utf8"),
        source_addr:'FROXTL',
        registered_delivery:1,
        data_coding:0,

    }, function(pdu) {

        if (pdu.command_status == 0) {
            // Message successfully sent
            console.log(JSON.stringify(pdu));



        }
    });
}
});

当我使用nodejs shorty模块时,它工作得很好,并且我能够得到交付收据。但是我不能发送长消息。

我应该对长消息或其他消息使用data_sm吗?

EN

回答 1

Stack Overflow用户

发布于 2014-03-16 03:38:53

您的代码看起来可以很好地发送和处理对传出请求的响应。

传送回执是使用deliver_sm包从smpp服务器发送到您的客户端的,因此您需要注册一个事件处理程序:

代码语言:javascript
复制
session.on('deliver_sm', function(pdu) {
    console.log(pdu.short_message);
    session.send(pdu.response());
});
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21927762

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档