TP-56228 | accept call retry logic and error handling (#838)

* TP-1|Kunal|removing isPending check in AmeyoCollapsibleToolbarV2.tsx since it is not required

* TP-56228 | ameyo hotfix

* TP-111|Kunal|added fetchAndSetConnectedCustomerData in call ringing callback

---------

Co-authored-by: varnit-goyal_navi <varnit.goyal@navi.com>
Co-authored-by: Sai Rithwik <sai.rithwik@navi.com>
This commit is contained in:
Kunal Sharma
2024-02-21 10:24:39 +05:30
committed by GitHub
parent fc6c9f3bfa
commit d38dec99a6
3 changed files with 23 additions and 2 deletions

View File

@@ -182,6 +182,7 @@ export const AmeyoCollapsibleToolbarV2 = (props: {
const onCallInComingCallback = (phoneNumber: number, lan: string, crtObjectId: string) => {
dispatch(setCurrentState(AmeyoCallState.RINGING));
fetchAndSetConnectedCustomerData();
// this check is present in HRC and it is not required here ,
// it to make sure that all calls coming from ameyo while the agent is on call get automatically rejected
// if (!ExtensionHandler.getIsPending()) {
@@ -556,6 +557,9 @@ export const AmeyoCollapsibleToolbarV2 = (props: {
});
});
};
const onAmeyoAcceptError = () => {
resetButtonState();
};
function navigateToCaseDetail() {
if (!connectedCustomerData?.customerName) {
@@ -629,6 +633,10 @@ export const AmeyoCollapsibleToolbarV2 = (props: {
EXTENSION_LISTENER_TYPES.onAmeyoCallStatusChanged,
onAmeyoCallDataChanged
);
ExtensionHelper.addExtensionListener(
EXTENSION_LISTENER_TYPES.ameyoAcceptError,
onAmeyoAcceptError
);
}, []);
useEffect(() => {

View File

@@ -107,6 +107,9 @@ const originalCallbacks = {
} else {
console.log('AMEYO_LH no pingPongClickstream callback found for sender', data?.sender);
}
},
acceptCallError: () => {
console.log('AMEYO_LH on accept call callback found ');
}
//when ameyo becomes loggedout, reset the state()
};
@@ -430,6 +433,10 @@ function msgListner(msg: any) {
if (message.type === MessagingType.PING_PONG_CLICKSTREAM) {
extensionCallbacks.pingPongClickstream(message.data);
}
if (message.type === MessagingType.ACCEPT_CALL_ERROR) {
console.log('message type in accept call error', message.type);
extensionCallbacks.acceptCallError();
}
if (message.type === MessagingType.SEND_CURRENT_CALL_STATUS) {
const currentExtensionStatus = message.data;
@@ -529,7 +536,8 @@ enum MessagingType {
AMEYO_RELOADED = 'ameyoReloaded',
PING_PONG_CLICKSTREAM = 'pingPongClickstream',
GET_CURRENT_CALL_STATUS = 'getCurrentCallStatus',
SEND_CURRENT_CALL_STATUS = 'sendCurrentCallStatus'
SEND_CURRENT_CALL_STATUS = 'sendCurrentCallStatus',
ACCEPT_CALL_ERROR = 'acceptCallError'
}
interface MessagingRequest {

View File

@@ -25,7 +25,8 @@ export const enum EXTENSION_LISTENER_TYPES {
'manualLogin',
'extensionToggleMidCallClickEvent',
'ameyoReloaded',
'recieveCallStatus'
'recieveCallStatus',
'acceptCallError'
}
export const ExtensionHelper = {
@@ -111,6 +112,10 @@ export const ExtensionHelper = {
naviExtension.registerCallBack({ recieveCallStatus: cb });
return;
}
case EXTENSION_LISTENER_TYPES.acceptCallError: {
naviExtension.registerCallBack({ acceptCallError: cb });
return;
}
default: {
return;
}