farhadi / node-smpp

SMPP client and server implementation in node.js
MIT License
417 stars 177 forks source link

USSD use case #221

Closed BechirAhmed closed 1 year ago

BechirAhmed commented 1 year ago

I use this library to handle USSD, i could receive the first attempt, but to ask user to reply i must set ussd_service_op: 2 (as the provider documented), but whenever i put this param (whatever the value is) it keeps looping and updating the sequence number for few minutes and then response to the user that Error performing this request.

session.on('deliver_sm', function(pdu) {
                        session.deliver_sm_resp({
                                status: 0,
                        });

                        session.submit_sm(
                        {
                                source_addr_ton: 0x00,
                                source_addr_npi: 0x01,
                                source_addr: pdu.destination_addr,
                                dest_addr_ton: 0x01,
                                dest_addr_npi: 0x01,
                                destination_addr: pdu.source_addr,
                                short_message: 'USSD App',
//                              ussd_service_op: 1, <----- This param whenever i uncomment it (whatever the value is) the error occurs
                        },
                        (pdu) => {
                                console.log('session.submit_sm pdu=');
                                console.log(pdu);
                        });
                });