NTP-15328 | beep sound addition

This commit is contained in:
varnit goyal
2024-12-24 10:08:36 +05:30
parent 7589d3caac
commit fa1ed331af

View File

@@ -129,6 +129,11 @@ class AmeyoAdapter implements IAdapter {
}
_getElementFromDomById = (elementId: string): HTMLElement | null => {
return document.getElementById(elementId);
};
_onListenForCorsBypassResponse = (payload: GenericObject) => {
if(payload?.data?.requestKey !== RequestKeys.AMEYO_HEARTBEAT && !payload?.data?.err) {
this.metricProcessor.pushCounterMetric({
@@ -235,6 +240,8 @@ class AmeyoAdapter implements IAdapter {
this.currentCallState = CALL_STATES.CALL_DISCONNECTED;
ameyoHangupUser(this.sessionId, this.currentCallMetadata?.userCRTObjectId);
this.currentCallMetadata = {...this.currentCallMetadata, ...data?.data}
(this._getElementFromDomById("beep") as HTMLAudioElement)?.play();
}
if (data?.type === MessagingType.ON_AMEYO_AGENT_ON_BREAK) {
this.isAgentAvailable = false;
@@ -436,6 +443,10 @@ class AmeyoAdapter implements IAdapter {
id: 'dtmfTone',
src: 'https://public-assets.np.navi-gi.in/jarvis/dtmf.wav',
});
createElement("audio", {
id: "beep",
src: "https://public-assets.np.navi-gi.in/jarvis/beep.wav",
});
const onSipSetupReadyEvent = new CustomEvent('onSipSetupReady', {
detail: {message: 'Custom page loaded event triggered'}
});