SMPP Sample Code

There are some publicly available open-source implementation of SMPP client with Nodejs. How well this can scale will depend on the mode of implementation.

// BIND TO A SERVER
var session = smpp.connect({
	url: 'smpp://smpp.getspendo.com:2775',
	auto_enquire_link_period: 10000,
	debug: true
}, function() {
	session.bind_transceiver({
		system_id: {YOUR_CREDENTIAL},
		password: {YOUR_CREDENTIAL}
	}, function(pdu) {
        if (pdu.command_status === 0) {
            console.log('Bind success');
			// Successfully bound
		}
	});
	session.on('debug', function(type, msg, payload) {
		console.log({type: type, msg: msg, payload: payload});
	});
});


// SEND SMS THROUTH THE CONNECTED SESSION
session.submit_sm({
      source_addr:      'Spendo',
      destination_addr: '2347037716490',
      short_message:    'Hello from Spendo'
  }, function(pdu) {
      if (pdu.command_status == 0) {
          // Message successfully sent
          console.log(pdu.message_id);
          console.log(pdu);
      } else {
          // Message failed
          console.log(pdu);
      }
  });	
va

Last updated