From 4fd52bf8fc593ae0f126482a325aa26f9196ffcd Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Wed, 28 Oct 2026 16:50:10 +0900 Subject: [PATCH] =?UTF-8?q?261028=5F01=5FENH:=20CTI=20=ED=86=B5=ED=99=94?= =?UTF-8?q?=20=EC=9E=AC=EC=97=B0=EA=B2=B0=20=EB=B3=B5=EC=9B=90=20=EB=8C=80?= =?UTF-8?q?=EC=9D=91=20=EB=B0=8F=20=EC=A2=85=EB=A3=8C=20=EC=9A=B0=ED=9A=8C?= =?UTF-8?q?=20=EC=B2=98=EB=A6=AC=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Talking 재수신 시 기존 통화 세션 복원 - 재로그인 상태 11인 종료 누락 통화를 기존 API로 정리 - 정상 종료 선반영 및 3초 강제 재연결 제거 - 종료 요청 대기·재시도와 중복 이벤트·지연 응답 처리 보완 --- .../list-contact/ListContactInfoPanel.tsx | 18 +- src/const/ctiConst.ts | 12 +- src/lib/cti/ctiClient.ts | 908 +++++++++--------- 3 files changed, 491 insertions(+), 447 deletions(-) diff --git a/src/components/list-contact/ListContactInfoPanel.tsx b/src/components/list-contact/ListContactInfoPanel.tsx index 6dff3fe..5c04950 100644 --- a/src/components/list-contact/ListContactInfoPanel.tsx +++ b/src/components/list-contact/ListContactInfoPanel.tsx @@ -62,15 +62,17 @@ const disabledContrastClass = 'bg-white disabled:opacity-100 disabled:text-foreg // disabled는 공용 Input 컴포넌트의 disabled:pointer-events-none 때문에 마우스 이벤트 자체를 못 받는다. const readOnlyContrastClass = 'bg-white read-only:text-foreground read-only:bg-muted/60' -const getCallButtonLabel = (isDialing: boolean, isOnCall: boolean) => { +const getCallButtonLabel = (isDialing: boolean, isOnCall: boolean, isEnding: boolean) => { + if (isEnding) return '종료 요청 중' if (isDialing) return '거는 중' if (isOnCall) return '전화 끊기' return '전화' } -const getCallButtonTitle = (isCtiReady: boolean, isDialing: boolean) => { +const getCallButtonTitle = (isCtiReady: boolean, isDialing: boolean, isEnding: boolean) => { if (!isCtiReady) return '전화 시스템에 연결되어 있지 않습니다.' if (isDialing) return '전화를 거는 중입니다.' + if (isEnding) return '통화 종료를 확인하고 있습니다.' return undefined } @@ -114,7 +116,8 @@ const ListContactInfoPanel = ({ const isCtiReady = ctiConnectionStatus === 'open' const ctiCallPhase = useCtiCallPhase() const isDialing = ctiCallPhase === 'dialing' - const isOnCall = ctiCallPhase === 'active' + const isEnding = ctiCallPhase === 'ending' + const isOnCall = ctiCallPhase === 'active' || isEnding const visibleHeaders = listHeaders .filter((header) => isListFieldVisibleForContact(header)) @@ -147,8 +150,7 @@ const ListContactInfoPanel = ({ } const handleCall = (telNum: string, listHderId: number) => { - if (!isCtiReady || isDialing) return - // CTI_HANGUP_PENDING_VENDOR: 외주사 Hangup 명령 동작 확인 후 통화 중 버튼을 활성화하면 즉시 사용할 수 있다. + if (!isCtiReady || isDialing || isEnding) return if (isOnCall) { ctiClient.hangup() return @@ -228,12 +230,12 @@ const ListContactInfoPanel = ({ type="button" variant="outline" className={cn('shrink-0 gap-2', isOnCall && 'bg-accent text-accent-foreground')} - disabled={isEditing || !isCtiReady || isDialing} - title={getCallButtonTitle(isCtiReady, isDialing)} + disabled={isEditing || !isCtiReady || isDialing || isEnding} + title={getCallButtonTitle(isCtiReady, isDialing, isEnding)} onClick={() => handleCall(value, header.listHderId)} > - {getCallButtonLabel(isDialing, isOnCall)} + {getCallButtonLabel(isDialing, isOnCall, isEnding)}