auto answer
This commit is contained in:
parent
73a344bd6e
commit
4333d2cd11
|
@ -17,6 +17,7 @@ export function QuickActionsCard({ details, loading }) {
|
||||||
const [isCalling, setIsCalling] = useState(false);
|
const [isCalling, setIsCalling] = useState(false);
|
||||||
const [callMode, setCallMode] = useState('hold');
|
const [callMode, setCallMode] = useState('hold');
|
||||||
const [callerId, setCallerId] = useState('');
|
const [callerId, setCallerId] = useState('');
|
||||||
|
const [autoAnswerMode, setAutoAnswerMode] = useState('none');
|
||||||
const [isCallMeDialogOpen, setIsCallMeDialogOpen] = useState(false);
|
const [isCallMeDialogOpen, setIsCallMeDialogOpen] = useState(false);
|
||||||
|
|
||||||
const handleCallMe = async () => {
|
const handleCallMe = async () => {
|
||||||
|
@ -27,6 +28,9 @@ export function QuickActionsCard({ details, loading }) {
|
||||||
if (callerId) {
|
if (callerId) {
|
||||||
url += `&callerId=${encodeURIComponent(callerId)}`;
|
url += `&callerId=${encodeURIComponent(callerId)}`;
|
||||||
}
|
}
|
||||||
|
if (autoAnswerMode !== 'none') {
|
||||||
|
url += `&autoAnswerMode=${autoAnswerMode}`;
|
||||||
|
}
|
||||||
await fetch(url, {
|
await fetch(url, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Authorization': `Bearer ${token}` }
|
headers: { 'Authorization': `Bearer ${token}` }
|
||||||
|
@ -89,6 +93,28 @@ export function QuickActionsCard({ details, loading }) {
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="grid grid-cols-1 gap-2 sm:grid-cols-4 sm:items-center sm:gap-4">
|
||||||
|
<Label htmlFor="autoAnswerMode" className="text-sm font-medium sm:text-right">
|
||||||
|
Auto Answer
|
||||||
|
</Label>
|
||||||
|
<Select value={autoAnswerMode} onValueChange={setAutoAnswerMode}>
|
||||||
|
<SelectTrigger className="sm:col-span-3">
|
||||||
|
<SelectValue placeholder="Select an auto-answer mode" />
|
||||||
|
</SelectTrigger>
|
||||||
|
<SelectContent>
|
||||||
|
<SelectItem value="none">None</SelectItem>
|
||||||
|
<SelectItem value="default">
|
||||||
|
Default <span className="text-gray-400 ml-2">(Yealink, Grandstream)</span>
|
||||||
|
</SelectItem>
|
||||||
|
<SelectItem value="intercom">
|
||||||
|
Intercom <span className="text-gray-400 ml-2">(Polycom, Snom)</span>
|
||||||
|
</SelectItem>
|
||||||
|
<SelectItem value="ring-answer">
|
||||||
|
Ring Answer <span className="text-gray-400 ml-2">(Other devices)</span>
|
||||||
|
</SelectItem>
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
</div>
|
||||||
<div className="grid grid-cols-1 gap-2 sm:grid-cols-4 sm:items-center sm:gap-4">
|
<div className="grid grid-cols-1 gap-2 sm:grid-cols-4 sm:items-center sm:gap-4">
|
||||||
<Label htmlFor="callerId" className="text-sm font-medium sm:text-right">
|
<Label htmlFor="callerId" className="text-sm font-medium sm:text-right">
|
||||||
Caller ID
|
Caller ID
|
||||||
|
|
Loading…
Reference in a new issue