Handle disabled IP address from Voip.ms
This commit is contained in:
parent
4100263393
commit
85d2d0b95b
1 changed files with 3 additions and 0 deletions
|
|
@ -48,6 +48,9 @@ func sendTextVoipms(ctx context.Context, to string, content string, media ...str
|
|||
if err != nil {
|
||||
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")
|
||||
return strconv.Itoa(response.MMS), nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue