TP-55555 | cybertron integration longhorn

This commit is contained in:
varnit goyal
2024-11-06 09:59:26 +05:30
parent e0bd3f1aee
commit 5d2633d406
3 changed files with 11 additions and 2 deletions

View File

@@ -155,13 +155,11 @@ class AmeyoAdapter implements IAdapter {
this.currentCallMetadata = {...this.currentCallMetadata, ...data?.data}
}
if(data?.type === MessagingType.ON_AMEYO_AGENT_ON_BREAK) {
debugger;
console.log('on availability changed')
this.isAgentAvailable = false;
this.callbacks.onAgentAvailabilityChange(false);
}
if(data?.type === MessagingType.ON_AMEYO_FORCED_LOGOUT){
debugger;
this.callbacks.onForcedLogout()
}
};
@@ -224,6 +222,10 @@ class AmeyoAdapter implements IAdapter {
return this.isAgentAvailable;
}
getLatestCallState() {
return this.currentCallMetadata;
}
}
export default AmeyoAdapter;

View File

@@ -21,6 +21,8 @@ class IAdapter {
init() {}
getAgentAvailability(): boolean {return false}
getLatestCallState() {return {}}
}

View File

@@ -139,6 +139,10 @@ function UseCallSdk({AdapterClass, adapterOptions} : {AdapterClass: new (adapter
return adapter.getAgentAvailability();
}
function getLatestCallState(): GenericObject {
return adapter.getLatestCallState();
}
return {
callState,
registerOnCallIncoming,
@@ -152,6 +156,7 @@ function UseCallSdk({AdapterClass, adapterOptions} : {AdapterClass: new (adapter
unmuteCall,
initialize,
setAvailable,
getLatestCallState,
setOnBreak,
registerOnAdapterReady,
getAgentAvailability