Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only one message recieved when multiple messages are sent. #245

Open
aTrueSeeker opened this issue Nov 23, 2023 · 5 comments
Open

Only one message recieved when multiple messages are sent. #245

aTrueSeeker opened this issue Nov 23, 2023 · 5 comments

Comments

@aTrueSeeker
Copy link

I have connected using bind_transceiver and is listening on deliver_sm. When multiple messages are sent to my app only one is being picked up by deliver_sm the other one goes missing. Sometimes the app receives both messages. Any idea why this is happening? Is there something wrong with the way I am listening to deilver_sm event?

@guicuton
Copy link

Without any code it's hard to guess but I would start checking the vendor side. This might be something on their side.

If you aren't receiving the messages as well, keep in mind that some brokers put some limits to avoid spam.

If this isn't your case where all sent messages were received and you didn't receive the DLRs, you need to check with them.

@aTrueSeeker
Copy link
Author

aTrueSeeker commented Nov 24, 2023

@guicuton Thanks for the prompt response 🙇

smpp.on("deliver_sm", async (pdu: any) => {
  const message: string = pdu.short_message.message
  const sourceAddress: string = pdu.source_addr
  const destinationAddress: string = pdu.destination_add

  const responsePdu = pdu.response()
  smpp.send(responsePdu)

// rest of the logic

That is what my code looks like. When multiple message are sent to my server at the same time only one is being caught in the deliver_sm callback sometimes both are being caught not sure why this happens. Do you see anything wrong with the code?

@franckck
Copy link

franckck commented Dec 26, 2023

Use event submit_sm to get received message

session.on("submit_sm", async (pdu) => { const message = pdu.short_message.message; const sourceAddress = pdu.source_addr; const destinationAddress = pdu.destination_addr; });

@elhananjair
Copy link

Use event submit_sm to get received message

session.on("submit_sm", async (pdu) => { const message = pdu.short_message.message; const sourceAddress = pdu.source_addr; const destinationAddress = pdu.destination_addr; });

Based on the SMPP protocol the submit_sm only indicates if sending SMS was successful or not, but deliver_sm is a way to know if the end-user received the SMS or not.

@elhananjair
Copy link

@guicuton Thanks for the prompt response 🙇

smpp.on("deliver_sm", async (pdu: any) => {
  const message: string = pdu.short_message.message
  const sourceAddress: string = pdu.source_addr
  const destinationAddress: string = pdu.destination_add

  const responsePdu = pdu.response()
  smpp.send(responsePdu)

// rest of the logic

That is what my code looks like. When multiple message are sent to my server at the same time only one is being caught in the deliver_sm callback sometimes both are being caught not sure why this happens. Do you see anything wrong with the code?

This is probably a problem with the SMSC you need to talk to them as @guicuton suggested, and your code doesn't seem to have a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants