Merge branch 'master' into outgoing-calls
This commit is contained in:
@ -52,13 +52,13 @@ async function getTwimlApplication(
|
||||
}
|
||||
|
||||
const twimlApps = await twilioClient.applications.list();
|
||||
const twimlApp = twimlApps.find((app) => app.friendlyName === "Shellphone");
|
||||
const twimlApp = twimlApps.find((app) => app.friendlyName.startsWith("Shellphone"));
|
||||
if (twimlApp) {
|
||||
return updateTwimlApplication(twilioClient, twimlApp.sid);
|
||||
}
|
||||
|
||||
return twilioClient.applications.create({
|
||||
friendlyName: "Shellphone",
|
||||
friendlyName: getTwiMLName(),
|
||||
smsUrl: `https://${serverRuntimeConfig.app.baseUrl}/api/webhook/incoming-message`,
|
||||
smsMethod: "POST",
|
||||
voiceUrl: `https://${serverRuntimeConfig.app.baseUrl}/api/webhook/call`,
|
||||
@ -77,4 +77,15 @@ async function updateTwimlApplication(twilioClient: twilio.Twilio, twimlAppSid:
|
||||
return twilioClient.applications.get(twimlAppSid).fetch();
|
||||
}
|
||||
|
||||
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";
|
||||
}
|
||||
}
|
||||
|
||||
export default setTwilioWebhooks;
|
||||
|
@ -30,6 +30,13 @@ const HelpModal: FunctionComponent<Props> = ({ isHelpModalOpen, closeModal }) =>
|
||||
</a>{" "}
|
||||
and we will help you get started!
|
||||
</p>
|
||||
<p>
|
||||
Don't miss out on free $10 Twilio credit by using{" "}
|
||||
<a className="underline" href="https://www.twilio.com/referral/gNvX8p">
|
||||
our referral link
|
||||
</a>
|
||||
.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -32,7 +32,7 @@ export const getServerSideProps: GetServerSideProps = async ({ req, res }) => {
|
||||
await session.$revoke();
|
||||
return {
|
||||
redirect: {
|
||||
destination: Routes.Home().pathname,
|
||||
destination: Routes.LandingPage().pathname,
|
||||
permanent: false,
|
||||
},
|
||||
};
|
||||
|
@ -94,7 +94,7 @@ export const getServerSideProps: GetServerSideProps<Props> = async ({ req, res }
|
||||
await session.$revoke();
|
||||
return {
|
||||
redirect: {
|
||||
destination: Routes.Home().pathname,
|
||||
destination: Routes.LandingPage().pathname,
|
||||
permanent: false,
|
||||
},
|
||||
};
|
||||
|
@ -133,7 +133,7 @@ export const getServerSideProps: GetServerSideProps = async ({ req, res }) => {
|
||||
await session.$revoke();
|
||||
return {
|
||||
redirect: {
|
||||
destination: Routes.Home().pathname,
|
||||
destination: Routes.LandingPage().pathname,
|
||||
permanent: false,
|
||||
},
|
||||
};
|
||||
|
Reference in New Issue
Block a user