NTP-26125 | fixed connected event

This commit is contained in:
Mayank Singh
2025-01-13 02:01:01 +05:30
parent 87d530c825
commit e802eac933

View File

@@ -117,32 +117,19 @@ class CallStateManager {
this.state.customerCallStatus = data?.status;
this.state.crtObjectId = data?.crtObjectId;
// If we detect a connected state from customer call update
if (data?.status === 'connected' && !this.state.isConnected) {
this.state.isConnected = true;
this.sendConnectedMessage();
}
// Handle call disconnection
// Keep disconnect handling
if (data?.isDisposing && data?.status === 'hungup') {
this.handleCallDisconnect();
}
}
private handleCustomerCallCreated(data: any) {
// Store customer call information
this.state.customerInfo = {
...this.state.customerInfo,
phoneNumber: data?.phone,
crtObjectId: data?.crtObjectId,
callId: data?.callId
};
// If we're already in a connected state but missed the event
if (data?.status === 'connected' && !this.state.isConnected) {
this.state.isConnected = true;
this.sendConnectedMessage();
}
}
private handleCRMCreate(data: any) {