Handle disabled IP address from Voip.ms

This commit is contained in:
Eli Ribble 2026-02-18 22:11:30 +00:00
parent 4100263393
commit 85d2d0b95b
No known key found for this signature in database

View file

@ -48,6 +48,9 @@ func sendTextVoipms(ctx context.Context, to string, content string, media ...str
if err != nil { if err != nil {
return "", fmt.Errorf("Failed to send MMS: %w", err) return "", fmt.Errorf("Failed to send MMS: %w", err)
} }
if response.Status == "ip_not_enabled" {
return "", fmt.Errorf("Failed to send SMS: the IP address of the server is not enabled with voip.ms. You'll need to enable this server's IP with them.")
}
log.Info().Str("status", response.Status).Int("mms", response.MMS).Msg("Sent MMS message") log.Info().Str("status", response.Status).Int("mms", response.MMS).Msg("Sent MMS message")
return strconv.Itoa(response.MMS), nil return strconv.Itoa(response.MMS), nil
} }