PageSourceSearch

https://sayda.ai/assets/VoicemailDropSettings-C3LtNfgI.js

js sayda.ai collected 2026-10-05 12:38:16 UTC 12,715 bytes, 1 lines download raw bytes

1import{j as e}from"./ui-vendor-CHpW9a2M.js";import{r}from"./react-vendor-D36Z8Ek4.js";import{S as W}from"./PersonalDialpad-DguXmxhA.js";import{A as $}from"./AppSidebar-BBbuV3Ll.js";import{C as b,b as w,c as P,d as V,a as R}from"./card-BJBX8cNb.js";import{u as ae,s as o,L as y,B as M,P as ne}from"./index-AFTA4_1Y.js";import{I as p}from"./input-CLo67OvU.js";import{L as n}from"./label-DnFdlC6l.js";import{S as x,a as g,b as h,c as u,d as i}from"./select-DhOf9CLy.js";import{S as le}from"./switch-CgLCovxL.js";import{S as I}from"./save-CoanvsBr.js";import"./separator-8v2jlNAp.js";import"./sheet-C0uxIRsV.js";import"./skeleton-CUgCSKuH.js";import"./call-CeHo6Pg2.js";import"./support-only-badge-jqUK_gsP.js";import"./badge-BaFdtpYI.js";import"./shield-C7cmjfas.js";import"./phone-call-BI_zqbt9.js";import"./mic-wTIvxew1.js";import"./volume-2-DredHui4.js";import"./collapsible-cskIESgb.js";import"./index-CJw9x8b8.js";import"./LogoProcessor-BV-TTrAs.js";import"./sayda-logo-B0pB8y1o.js";import"./chevron-down-BOyqnccF.js";import"./phone-outgoing-CEtjwD_U.js";import"./house-B3inu7I3.js";import"./building-2-CVYNDjsD.js";import"./search-DR37kmcE.js";import"./receipt-9DZO5nvn.js";import"./tag-CuddXRFb.js";import"./git-branch-B5cNlgBV.js";import"./file-text-BmSyd08v.js";import"./settings-CL9Kl5GF.js";import"./message-square-Bf0r2UdZ.js";import"./package-BQowS-nq.js";import"./workflow-rnU7j48n.js";import"./wrench-nadqWPGz.js";import"./clipboard-list-BGF3RYIr.js";import"./mic-vocal-Kh9CEM9A.js";import"./bell-CRaQYixL.js";import"./dollar-sign-vK_ZK0vh.js";import"./supabase-vendor-BIsb_flb.js";import"./chart-vendor-DDGAsiJd.js";import"./chevron-up-g2QEL5Nc.js";
1import"./check-BhzOaAMr.js";function ss(){const{toast:l}=ae(),[c,J]=r.useState(null),[K,k]=r.useState(!0),[O,T]=r.useState(!1),[E,F]=r.useState(!1),[B,q]=r.useState(!1),[d,X]=r.useState("internal"),m="call_drop_on_ring",[L,Y]=r.useState(100),[U,Z]=r.useState(1440),[_,A]=r.useState(3),[f,z]=r.useState(20),[N,D]=r.useState(200),[ee,se]=r.useState(500),[H,S]=r.useState(3),[v,C]=r.useState(6e3),[G,Q]=r.useState(!0);r.useEffect(()=>{j()},[]);const j=async()=>{k(!0);try{const{data:s,error:a}=await o.from("system_voicemail_drop_settings").select("*").limit(1).single();if(s){const t=s;J(t),Y(t.max_calls_per_number_per_period),Z(t.limit_period),z(t.max_concurrent_vmd_processing||20),A(t.retry_delay_minutes??3),D(t.drop_on_ring_delay_ms||200),se(t.drop_on_ring_blocking_call_delay_ms||500),S(t.max_drop_on_ring_retries??3),C(t.blocking_call_cancel_delay_ms??6e3),Q(t.drop_vmd_on_ringing??!0)}}catch(s){console.error("Error loading data:",s),l({title:"Error",description:"Failed to load voicemail drop settings",variant:"destructive"})}finally{k(!1)}},re=async()=>{q(!0);try{if(c){const{error:s}=await o.from("system_voicemail_drop_settings").update({implementation_type:m}).eq("id",c.id);if(s)throw s}else{const{error:s}=await o.from("system_voicemail_drop_settings").insert({implementation_type:m});if(s)throw s}l({title:"Provider settings saved",description:"VMD implementation type has been updated"}),await j()}catch(s){console.error("Error saving provider settings:",s),l({title:"Error",description:"Failed to save provider settings",variant:"destructive"})}finally{q(!1)}},ie=async()=>{T(!0);try{if(c){const{error:s}=await o.from("system_voicemail_drop_settings").update({max_calls_per_number_per_period:L,limit_period:U,max_concurrent_vmd_processing:f,implementation_type:m,retry_delay_minutes:_}).eq("id",c.id);if(s)throw s}else{const{error:s}=await o.from("system_voicemail_drop_settings").insert({max_calls_per_number_per_period:L,limit_period:U,max_concurrent_vmd_processing:f,implementation_type:m,retry_delay_minutes:_});if(s)throw s}l({title:"Settings saved",description:"Voicemail drop settings have been updated"}),await j()}catch(s){console.error("Error saving settings:",s),l({title:"Error",description:"Failed to save settings",variant:"destructive"})}finally{T(!1)}},te=async()=>{F(!0);try{const s={drop_on_ring_delay_ms:N,drop_on_ring_blocking_call_delay_ms:ee,max_drop_on_ring_retries:H,blocking_call_cancel_delay_ms:v,drop_vmd_on_ringing:G};if(c){const{error:a}=await o.from("system_voicemail_drop_settings").update(s).eq("id",c.id);if(a)throw a}else{const{error:a}=await o.from("system_voicemail_drop_settings").insert(s);if(a)throw a}l({title:"Timing settings saved",description:"Call timing parameters have been updated"}),await j()}catch(s){console.error("Error saving timing settings:",s),l({title:"Error",description:"Failed to save timing settings",variant:"destructive"})}finally{F(!1)}};return K?e.jsx(W,{children:e.jsxs("div",{className:"flex min-h-screen w-full",children:[e.jsx($,{}),e.jsx("main",{className:"flex-1 p-6",children:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx(y,{className:"h-8 w-8 animate-spin"})})})]})}):e.jsx(W,{children:e.jsxs("div",{className:"flex min-h-screen w-full",children:[e.jsx($,{}),e.jsx("main",{className:"flex-1 p-6 overflow-auto",children:e.jsxs("div",{className:"w-full space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold",children:"Voicemail Drop Settings"}),e.jsx("p",{className:"text-muted-foreground",children:"Configure provider, queue processing, and call timing settings for voicemail drops"})]}),e.jsxs(b,{children:[e.jsxs(w,{children:[e.jsx(P,{children:"VMD Provider"}),e.jsx(V,{children:"Select how voicemail drops are delivered. Internal uses blocking calls to bypass human answering."})]}),e.jsxs(R,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"vmdProvider",children:"Provider"}),e.jsxs(x,{value:d,onValueChange:s=>X(s),children:[e.jsx(g,{className:"w-[200px]",children:e.jsx(h,{placeholder:"Select provider"})}),e.jsxs(u,{children:[e.jsx(i,{value:"internal",children:"Internal (Blocking Calls)"}),e.jsx(i,{value:"provider1",disabled:!0,children:"Provider 1 (Coming Soon)"}),e.jsx(i,{value:"provider2",disabled:!0,children:"Provider 2 (Coming Soon)"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:d==="internal"?"Use internal blocking call system for voicemail delivery":d==="provider1"?"Use Provider 1 API for voicemail delivery":"Use Provider 2 API for voicemail delivery"})]}),d==="internal"&&e.jsxs("div",{className:"space-y-2 pt-4 border-t",children:[e.jsx(n,{htmlFor:"implementationType",children:"Implementation Type"}),e.jsxs(x,{value:m,disabled:!0,children:[e.jsx(g,{className:"w-[250px]",children:e.jsx(h,{placeholder:"Select implementation"})}),e.jsx(u,{children:e.jsx(i,{value:"call_drop_on_ring",children:"CallDropOnRing"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Uses single system call with ringing detection - drops on ring to force VMD to voicemail"})]}),d==="internal"&&e.jsx("div",{className:"pt-4",children:e.jsxs(M,{onClick:re,disabled:B,children:[B?e.jsx(y,{className:"h-4 w-4 mr-2 animate-spin"}):e.jsx(I,{className:"h-4 w-4 mr-2"}),"Save Provider Settings"]})})]})]}),e.jsxs(b,{children:[e.jsxs(w,{children:[e.jsx(P,{children:"Queue Processing Settings"}),e.jsx(V,{children:"Controls the maximum number of voicemail drops that can be processed concurrently. The actual batch size is dynamically determined by the number of available system phones, but will never exceed this limit. Recommended value: 20."})]}),e.jsxs(R,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"maxConcurrentProcessing",children:"Max Concurrent VMD Processing"}),e.jsx(p,{id:"maxConcurrentProcessing",type:"number",value:f,onChange:s=>
1z(parseInt(s.target.value)||20),placeholder:"20",className:"max-w-xs"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Maximum VMDs to process in parallel per queue run. Batch size = MIN(available system phones, this value)."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"retryDelayMinutes",children:"Retry Delay (minutes)"}),e.jsx(p,{id:"retryDelayMinutes",type:"number",value:_,onChange:s=>A(parseInt(s.target.value)||3),placeholder:"3",className:"max-w-xs"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Time to wait before retrying failed VMD sessions. Default: 3 minutes."})]}),e.jsxs(M,{onClick:ie,disabled:O,children:[O?e.jsx(y,{className:"h-4 w-4 mr-2 animate-spin"}):e.jsx(I,{className:"h-4 w-4 mr-2"}),"Save Settings"]})]})]}),d==="internal"&&e.jsxs(b,{children:[e.jsxs(w,{children:[e.jsxs(P,{className:"flex items-center gap-2",children:[e.jsx(ne,{className:"h-5 w-5"}),"CallDropOnRing Pattern"]}),e.jsx(V,{children:"Configure the CallDropOnRing pattern. Uses a single system call that is dropped when ringing is detected, forcing the VMD call to go directly to voicemail. If VMD call rings (line not busy), the session is retried."})]}),e.jsxs(R,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"dropOnRingDelay",children:"VMD Call Delay (ms)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(p,{id:"dropOnRingDelay",type:"number",value:N,onChange:s=>D(parseInt(s.target.value)||200),placeholder:"200",className:"flex-1"}),e.jsxs(x,{onValueChange:s=>D(parseInt(s)),children:[e.jsx(g,{className:"w-[120px]",children:e.jsx(h,{placeholder:"Presets"})}),e.jsxs(u,{children:[e.jsx(i,{value:"100",children:"100ms"}),e.jsx(i,{value:"200",children:"200ms"}),e.jsx(i,{value:"300",children:"300ms"}),e.jsx(i,{value:"500",children:"500ms"})]})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Delay from process start to VMD call initiation. Default: 200ms"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"maxDropOnRingRetries",children:"Max Retries"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(p,{id:"maxDropOnRingRetries",type:"number",min:0,value:H,onChange:s=>{const a=parseInt(s.target.value);S(isNaN(a)?3:a)},placeholder:"3",className:"flex-1"}),e.jsxs(x,{onValueChange:s=>S(parseInt(s)),children:[e.jsx(g,{className:"w-[120px]",children:e.jsx(h,{placeholder:"Presets"})}),e.jsxs(u,{children:[e.jsx(i,{value:"1",children:"1 retry"}),e.jsx(i,{value:"2",children:"2 retries"}),e.jsx(i,{value:"3",children:"3 retries"}),e.jsx(i,{value:"5",children:"5 retries"})]})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"How many times to retry if VMD call rings. Default: 3"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"blockingCallC
1ancelDelay",children:"Blocking Call Cancel Delay (ms)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(p,{id:"blockingCallCancelDelay",type:"number",value:v,onChange:s=>C(parseInt(s.target.value)||6e3),placeholder:"6000",className:"flex-1"}),e.jsxs(x,{onValueChange:s=>C(parseInt(s)),children:[e.jsx(g,{className:"w-[120px]",children:e.jsx(h,{placeholder:"Presets"})}),e.jsxs(u,{children:[e.jsx(i,{value:"0",children:"Immediate"}),e.jsx(i,{value:"3000",children:"3 seconds"}),e.jsx(i,{value:"6000",children:"6 seconds"}),e.jsx(i,{value:"10000",children:"10 seconds"})]})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Delay after ringing detected before canceling blocking call. Default: 6000ms"})]}),e.jsxs("div",{className:"space-y-4 flex flex-col justify-center",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(le,{id:"dropVmdOnRinging",checked:G,onCheckedChange:Q}),e.jsx(n,{htmlFor:"dropVmdOnRinging",className:"cursor-pointer",children:"Drop VMD call if ringing"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"If VMD call rings (line not busy), drop the call and re-queue for retry. Disable to let VMD call continue."})]})]}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4 space-y-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"Expected Timeline:"}),e.jsxs("div",{className:"text-xs text-muted-foreground space-y-1 font-mono",children:[e.jsx("p",{children:"T=0ms:     Blocking Call initiates (System phone)"}),e.jsxs("p",{className:"text-primary font-medium",children:["T=",N,"ms:   VMD Call initiates (Tenant phone)"]}),e.jsxs("p",{children:['T=???ms:   Blocking Call receives "ringing" → ',v>0?`Wait ${v}ms then drop`:"Drop immediately"]}),e.jsx("p",{className:"mt-2 border-t border-border pt-2 text-green-600",children:"VMD Call hits busy line → Goes to voicemail ✓"}),e.jsx("p",{className:"text-destructive",children:"OR VMD Call rings → Session failed, re-queued for retry"})]})]}),e.jsxs(M,{onClick:te,disabled:E,children:[E?e.jsx(y,{className:"h-4 w-4 mr-2 animate-spin"}):e.jsx(I,{className:"h-4 w-4 mr-2"}),"Save CallDropOnRing Settings"]})]})]})]})})]})})}export{ss as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.