clean setTwilioWebhooks and twilio webhook verification
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { NotFoundError } from "blitz";
|
||||
import { getConfig, NotFoundError } from "blitz";
|
||||
import twilio from "twilio";
|
||||
|
||||
import type { Organization } from "db";
|
||||
@ -19,3 +19,20 @@ export default function getTwilioClient(organization: MinimalOrganization | null
|
||||
accountSid: organization.twilioAccountSid,
|
||||
});
|
||||
}
|
||||
|
||||
const { serverRuntimeConfig } = getConfig();
|
||||
|
||||
export const smsUrl = `https://${serverRuntimeConfig.app.baseUrl}/api/webhook/incoming-message`;
|
||||
|
||||
export const voiceUrl = `https://${serverRuntimeConfig.app.baseUrl}/api/webhook/call`;
|
||||
|
||||
export function getTwiMLName() {
|
||||
switch (serverRuntimeConfig.app.baseUrl) {
|
||||
case "local.shellphone.app":
|
||||
return "Shellphone LOCAL";
|
||||
case "dev.shellphone.app":
|
||||
return "Shellphone DEV";
|
||||
case "www.shellphone.app":
|
||||
return "Shellphone";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user