diff --git a/ChatGPT/src/main/java/cloud/cleo/squareup/functions/DrivingDirectionsVoice.java b/ChatGPT/src/main/java/cloud/cleo/squareup/functions/DrivingDirectionsVoice.java index 05a6b6b..1b51700 100644 --- a/ChatGPT/src/main/java/cloud/cleo/squareup/functions/DrivingDirectionsVoice.java +++ b/ChatGPT/src/main/java/cloud/cleo/squareup/functions/DrivingDirectionsVoice.java @@ -1,6 +1,7 @@ package cloud.cleo.squareup.functions; import java.util.function.Function; +import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.sns.SnsClient; /** @@ -31,7 +32,12 @@ protected Function getExecutor() { return mapper.createObjectNode().put("status","FAILED").put("message", "Caller is not calling from a mobile device"); } - final var result = SnsClient.create().publish(b -> b.phoneNumber(callingNumber).message(DRIVING_DIRECTIONS_URL) ); + final var result = SnsClient.builder() + // Force SMS sending to east because that's where all the 10DLC and campaign crap setup is done + // Otherwise have to pay for registrations and numbers in 2 regions, HUGE HASSLE (and more monthly cost) + // Also then all texts are sourced from the same phone number for consistancy + .region(Region.US_EAST_1).build() + .publish(b -> b.phoneNumber(callingNumber).message(DRIVING_DIRECTIONS_URL) ); log.info("SMS Directions sent to " + callingNumber + " with SNS id of " + result.messageId()); return mapper.createObjectNode().put("status","SUCCESS").put("message", "The directions have been sent"); } catch (Exception e) {