Creating Smpp server and session

Hi am creating my own smpp sms gateway using the node smpp package… I was wondering what is wrong with my code coz it’s showing an error of returned with undefined .the code is below
Your help is highly appreciated…not forgetting to mention i want i sold solution where i can connect all website of my client so that they can enjoy send sms from their sites @ no cost

import smpp from ‘smpp’
//creating smpp server
var server = smpp . createServer ({
debug : true
}, function ( session ) {
session . on ( ‘error’ , function ( err ) {
// Something ocurred, not listening for this event will terminate the program
});
session . on ( ‘bind_transceiver’ , function ( pdu ) {
// we pause the session to prevent further incoming pdu events,
// untill we authorize the session with some async operation.
session . pause ();
checkAsyncUserPass ( pdu . system_id , pdu . password , function ( err ) {
if ( err ) {
session . send ( pdu . response ({
command_status : smpp . ESME_RBINDFAIL
}));
session . close ();
return ;
}
session . send ( pdu . response ());
session . resume ();
});
});
});
//creating smpp session and connecting it
export function sendSms ( to , from , text ) {
from = + ${ from }
to = + ${ to }
var session = smpp . connect ( function () {
session . bind_transceiver ({
//what should be putted in systemId& password?
system_id : ‘your_systemid’ ,
password : ‘your system password’
}, function ( pdu ) {
if ( pdu . command_status === 0 ) {
// Successfully bound
session . submit_sm ({
source_addr : from ,
destination_addr : to ,
short_message : text
}, function ( pdu ) {
if ( pdu . command_status === 0 ) {
// Message successfully sent
console . log ( pdu . message_id );
}
});
}
});
});
}
//opening server indefinately
server . listen ( 2775 );

Please copy&paste the code itself in addition to the pictures you posted.

i did as you asked …please have a look again

I haven’t go over all your code as I never worked with this package (and it’s not easy to understand on first glance without getting into details), so I probably won’t be able to help, but I’ll suggest to try to run everything from the export function.

Something like:

//the import line
function createServer(){
	return smpp.createServer({
	//server creation code
	})
}

 export function sendSms(to, from, text) {
	const server = createSrever();
	server.listen(2775);
	//continue from here with the code
}

If there’s some wo used this package, maybe they will be able to be more helpful.