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

PromoSMS: Cannot send message/notification if too long #2544

Closed
2 tasks done
Krismm opened this issue Jan 5, 2023 · 5 comments · Fixed by #2586
Closed
2 tasks done

PromoSMS: Cannot send message/notification if too long #2544

Krismm opened this issue Jan 5, 2023 · 5 comments · Fixed by #2586
Labels
bug Something isn't working

Comments

@Krismm
Copy link

Krismm commented Jan 5, 2023

⚠️ Please verify that this bug has NOT been raised before.

  • I checked and didn't find similar issue

🛡️ Security Policy

📝 Describe your problem

Hi
I have a problem with PromoSMS notifications
PromoSMS does not send Down notifications (sends only Up)

I have additionally configured Email(SMTP) and sends Down and Up there.

Can anything be configured?

🐻 Uptime-Kuma Version

1.9.2

💻 Operating System and Arch

louislam/uptime-kuma:1.9.2-debian-data-2

🌐 Browser

Microsoft Edge Wersja 108.0.1462.54

🐋 Docker Version

louislam/uptime-kuma:1.9.2-debian-data-2

🟩 NodeJS Version

No response

@Krismm Krismm added the help label Jan 5, 2023
@louislam
Copy link
Owner

louislam commented Jan 5, 2023

"text": msg.replace(/[^\x00-\x7F]/g, ""),

Just have a quick look, both up/down notifications sent thought the same function.

@PopcornPanda any idea?

@Krismm
Copy link
Author

Krismm commented Jan 6, 2023

During the Down event, the following message appears in the console:

`Cannot send notification to XXX-Powiadomienie
Error: Error: Error: Error: Something gone wrong. Api returned 204.  
    at PromoSMS.throwGeneralAxiosError (/app/server/notification-providers/notification-provider.js:32:15)
    at PromoSMS.send (/app/server/notification-providers/promosms.js:36:18)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Function.sendNotification (/app/server/model/monitor.js:595:21)
    at async Timeout.beat [as _onTimeout] (/app/server/model/monitor.js:353:17)
Monitor #5 'TerminalXX - XX': Failing: PING 192.168.3.166 (192.168.3.166) 56(84) bytes of data.

--- 192.168.3.166 ping statistics ---
10 packets transmitted, 0 received, 100% packet loss, time 14ms`

That is, the values of the transferred data are incorrect

How can I see what is sent by the API?

@louislam
Copy link
Owner

louislam commented Jan 6, 2023

Checked PromoSMS API

204 Wiadomość jest dłuższa niż 1 sms

Google Translate:

204 The message is longer than 1 sms

I marked it as bug, see if anyone could fix it.

@louislam louislam added bug Something isn't working and removed help labels Jan 6, 2023
@louislam louislam changed the title PromoSMS only Up Notification PromoSMS: Cannot send message/notification if too long Jan 6, 2023
@Krismm
Copy link
Author

Krismm commented Jan 6, 2023

Okay, I've got something (debug promosms.js)

when the UP status is sent the date field looks like:

Start Send SMS2 : -----
{
  recipients: [ '+48XXXXXXXX' ],
  text: '[Terminal02 - 3.166] [ Up] ',
  type: 3,
  sender: 'MTM-Kuma'
}

but when Down is sent the date field looks like this

Start Send SMS2 : -----
{
  recipients: [ '+48XXXXXXX' ],
  text: '[Terminal02 - 3.166] [ Down] PING 192.168.3.166 (192.168.3.166) 56(84) bytes of data.\n' +
    '\n' +
    '--- 192.168.3.166 ping statistics ---\n' +
    '10 packets transmitted, 0 received, 100% packet loss, time 13ms\n' +
    '\n',
  type: 3,
  sender: 'MTM-Kuma'
}

196 characters in SMS
I checked the API via POSTman and if I cut the message to 156 characters, it's ok

@PopcornPanda
Copy link
Contributor

Sorry for long response time. I've to test changes for allowing long messages to be sent.
By default, PromoSMS allows sending 160 characters or 70 if special characters are used.

Fix should be ready today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants