frimtec / pikett-assist

:rotating_light: PAssist is an Android application to assist you while doing on-call duties. PAssist works for SMS based alerting systems.
Apache License 2.0
16 stars 2 forks source link

Numeric shortcode issue #585

Open gled-rs opened 3 days ago

gled-rs commented 3 days ago

Hi,

While testing the dynamic ack, I noticed that upon importing my contact from pagerduty numbers, a few things went wrong: 1/ PagerDuty gives a vcard with all their numbers ( multiple dozen ), and some were not imported ( too many numbers in the list ? ) => I trimmed it and it seemed to be ok. 2/ PagerDuty mostly uses numeric shortcodes ( example 43105 ) to send alerts, for which you can reply without trouble from the sms client ( no characters used, just numbers ). => the numeric shortcodes are not imported in sm2sp. => I then tried to set one of the shortcodes in the "Company" field of the contact, and it imported adding a +1 to the number in sm2p, but Passist still says "Number blocked" in SMS Adapter section of the main screen, and clicking on it, it asks again to add numbers to sm2sp, clicking Allow or Reject does nothing. After that, even though sm2sp shows the list of numbers registered to Passist, and a +1 43105 it extracted from the company field of the contact, receiving a text from that 43105 did nothing.

So I could not test yet the dynamic text :/

LMK if you need more infos, happy to help debug that !

frimtec commented 3 days ago

Hi, Yes I guess pure numeric short codes are not supported as they are interpreted as normal numbers and are therefore normalized. I was not aware that such numbers can be used to send back SMS, in contrast to alphanumeric short codes which do not support it. Any idea how to detect such numeric short codes? I have to think about it. Maybe that will take some time as I'm currently quite busy. Thx for your patience - and for sure, ideas are always welcome.

frimtec commented 3 days ago

Just read about short codes in Wikipedia. They are defined differently in each county. I opened a request in S2MSP (https://github.com/frimtec/secure-sms-proxy/issues/371).

frimtec commented 3 days ago

Maybe to keep it simple I will first only support a small list of countries. You need US, correct?

gled-rs commented 17 hours ago

I apologize for being not as responsive as I should be, going through a heavy life event at the moment...

Yes US has shortcodes with 5 or 6 digits long. I wonder if libphonenumber detect those. Valid number in the US should be then either 10 digits or 5-6.

frimtec commented 13 hours ago

Thx for your feedback. I wish you all the best for your heavy life event.

In the meantime I have a solution for the numeric short codes.

To test the following APKs can be installed:

Be aware:

As soon as you have time, it would be great if you could test your PagerDuty setup.

If all works fine, I will build a regular release for S2MSP and PAssist.

gled-rs commented 9 hours ago

I was able to test a couple times and it works as planned.

Both dynamic and static confirmation with US shortcodes. Now I have to update the contact, I hope the Company field does not have a short character limit given how many shortcodes Pagerduty advertise as their source :)

Thank you so much @frimtec, PAssist is going to make my life way easier, especially with the current events I am facing..