SMPP发送消息在PDU中收到不同的结果-混淆结果

问题描述 投票:0回答:1

在Nodejs中实现使用node-smpp库和Selenium SMPPSim Simulator

const smpp = require('smpp');
const session = new smpp.Session({host: 'localhost', port: 1234});

session.on('connect', () => {
    isConnected = true;
    session.bind_transceiver({
        system_id: "SYSTEMID",
        password: "PASSWORD",
    }, (pdu) => {
        if (pdu.command_status == 0) {
            console.log('smpp connected !')
        }
    })
})


//**all pdu listener**
session.on('pdu', (pdu)=>{
    console.log(pdu)
})


function sendMessage(from, to, text){

    from = `+${from}`
    to = `+${to}`

    session.submit_sm({
        source_addr:      from,
        destination_addr: to,
        short_message:    text
    }, function(pdu) {
        console.log(pdu)
        if (pdu.command_status == 0) {
            console.log(pdu.message_id);
        }
    });
}

sendMessage("1111", "2222", "Hello World!")

sendMessage()]方法调用时输出:

PDU {
  command_length: 18,
  command_id: 2147483652,
  command_status: 0,
  sequence_number: 2,
  command: 'submit_sm_resp',
  message_id: '3' }

这里我正在使用SMPPSim MO注射剂输出:当发送硒模拟器的消息

:时
PDU {
  command_length: 63,
  command_id: 5,
  command_status: 0,
  sequence_number: 8,
  command: 'deliver_sm',
  service_type: '',
  source_addr_ton: 1,
  source_addr_npi: 1,
  source_addr: '111111',
  dest_addr_ton: 1,
  dest_addr_npi: 1,
  destination_addr: '222222',
  esm_class: 0,
  protocol_id: 0,
  priority_flag: 0,
  schedule_delivery_time: '',
  validity_period: '',
  registered_delivery: 0,
  replace_if_present_flag: 0,
  data_coding: 0,
  sm_default_msg_id: 0,
  short_message: { message: 'Hello from SMPPSim' } }

两个结果之间都感到困惑,如果消息使用sendMessage()方法发送,那么为什么它仅返回submit_sm_resp

,这是由于本地计算机引起的吗?或者是其他东西 ??需要帮助来了解这种行为。

在Nodejs中使用node-smpp库和Selenium SMPPSim Simulator实现const smpp = require('smpp'); const session = new smpp.Session({host:'localhost',port:1234}); session.on('connect',()...

node.js submit smpp sm
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.