Trying to bind with SMSC and getting command_status=14 error

136 Views Asked by At

I am trying to connect and bind to SMSC and I keep getting command_status=14 here is my code:

var smpp = require('smpp');
var session = smpp.connect({
        url: 'smpp://HOST_NAME:PORT',
        auto_enquire_link_period: 10000,
        debug: true
}, function() {
        session.bind_transceiver({
                system_id: 'ID', //Some number
                password: 'password', //8 
                interface_version: '0x34',
                system_type: '0x00',
                addr_ton: '0x00',
                addr_npi: '0x00',
                address_range: '0x00'
        }, function(pdu) {
                if (pdu.command_status === 0) {
                        // Successfully bound
                       console.log("Successfully Created Bound");
                }else if(pdu.command_status === 14){  
                      console.log("Invalid Password");
                }
        });
});

session.on('deliver_sm', (pdu) => {
    const { short_message, destination_addr, esm_class} = pdu;
    if(esm_class !== 4 && short_message.message === 'ok') { //Indicates Message Type and enhanced network services, if it's 4 then it's a delivery receipt >
        console.log("Recieved SMS");
    }
    console.log("PDU IS : " + pdu);
})



session.on('error', (e) => {
    if(e.code === 'ETIMEOUT') {
        console.log("Connection to SMS-C Timeout");
    }else if(e.code === 'ECONNREFUSED'){
        console.log("Connection to SMS-C Refused")
    }else if(e.code === 'EAI_AGAIN'){
        console.log("Connection to internet is lost!");
    }else {
        console.log(`There is something wrong connecting to SMS-C, Error code: ${e.code}` );
    }
})
session.on('debug', function(type, msg, payload) {
        console.log({type: type, msg: msg, payload: payload});
});

I just read about command_status = 14 and it's about an invalid password but I really couldn't understand how that is possible. Does such restrictions maybe applied on the SMPP Server side? The password I am using here is correct as far as I know.

I was expecting to bind my smpp client to SMSC without error, but couldn't get it, what does invalid password really mean?

0

There are 0 best solutions below