-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d8a453
commit feb097e
Showing
7 changed files
with
144 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
import { NextRequest} from "next/server"; | ||
|
||
const accountSid = process.env.TWILIO_ACCOUNT_SID; | ||
const authToken = process.env.TWILIO_AUTH_TOKEN; | ||
const workspaceSid = process.env.TWILIO_WORKSPACE_SID || ''; | ||
const workflowSid = process.env.TWILIO_WORKFLOW_SID; | ||
const client = require('twilio')(accountSid, authToken); | ||
|
||
|
||
|
||
export async function POST(req: NextRequest ) { | ||
try { | ||
const resp = await client.taskrouter.v1.workspaces(workspaceSid).tasks.create({ | ||
workflowSid, | ||
}); | ||
|
||
return new Response(JSON.stringify(resp), { status: 200 }); | ||
} catch (error) { | ||
return new Response("something went wrong", { status: 500}); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { NextRequest, NextResponse } from 'next/server'; | ||
import { twilioClient } from '@/lib/twilioClient'; | ||
|
||
export async function POST(req: NextRequest) { | ||
|
||
|
||
console.log("RAAAAA") | ||
// console.log(req) | ||
|
||
const params = req.nextUrl.searchParams; | ||
console.log(Array.from(params.entries())); | ||
|
||
return new NextResponse(null, { status: 204, headers: { 'Content-Type': 'application/json' } }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { formatPhoneNumber } from '@/lib/utils'; | ||
|
||
export default function IncomingCallModal({ | ||
number, | ||
acceptCall, | ||
rejectCall, | ||
}: { | ||
number: string; | ||
acceptCall: () => void; | ||
rejectCall: () => void; | ||
}) { | ||
return ( | ||
<div className="fixed z-10 top-0 left-0 w-full h-full bg-black bg-opacity-50 flex justify-center items-center"> | ||
<div className="bg-white p-4 rounded-lg"> | ||
<section className="flex flex-col items-center justify-between p-8 gap-y-12"> | ||
<article className="flex flex-col gap-y-4 items-center"> | ||
<div className="text-xl font-medium text-[#6B7280]"> | ||
Incoming Call | ||
</div> | ||
<div className="text-4xl font-semibold"> | ||
{formatPhoneNumber(number)} | ||
</div> | ||
</article> | ||
|
||
<article className="flex flex-row gap-x-10"> | ||
<button | ||
className="w-[120px] h-12 border-2 border-[#6366f1] text-[#6366f1] rounded-[10px] hover:bg-[#6366f1] hover:text-white" | ||
onClick={() => acceptCall()} | ||
> | ||
Accept Call | ||
</button> | ||
<button | ||
className="w-[120px] h-12 rounded-[10px] hover:bg-black hover:text-white" | ||
onClick={() => rejectCall()} | ||
> | ||
Reject Call | ||
</button> | ||
</article> | ||
</section> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters