Actually handle incoming text messages from Voip.ms
This commit is contained in:
parent
6a434c458d
commit
ef5d8168f0
2 changed files with 17 additions and 8 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue