Actually handle incoming text messages from Voip.ms

This commit is contained in:
Eli Ribble 2026-01-29 22:27:51 +00:00
parent 6a434c458d
commit ef5d8168f0
No known key found for this signature in database
2 changed files with 17 additions and 8 deletions

View file

@ -98,7 +98,13 @@ func ParsePhoneNumber(input string) (*E164, error) {
func StoreSources() error {
ctx := context.TODO()
for _, n := range []string{config.PhoneNumberReportStr, config.PhoneNumberSupportStr, config.VoipMSNumber} {
err := ensureInDB(ctx, n)
var err error
// Deal with Voip.ms not expecting API calls with the prefixed +1
if !strings.HasPrefix(n, "+1") {
err = ensureInDB(ctx, "+1"+n)
} else {
err = ensureInDB(ctx, n)
}
if err != nil {
return fmt.Errorf("Failed to add number '%s' to DB: %w", n, err)
}