Skip to content

Commit

Permalink
fix(audioPlayer): wrong audio player sound on incoming call (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyco97 authored Dec 19, 2024
1 parent e613554 commit 52b7019
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/Socket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const Socket: FC<SocketProps> = ({
})
eventDispatch('phone-island-call-answered', {})

// Stop the local audio element ringing
//to be sure that the call is not ringing anymore
store.dispatch.player.stopAudioPlayer()
}

Expand Down Expand Up @@ -132,6 +132,9 @@ export const Socket: FC<SocketProps> = ({
dispatch.currentCall.checkAcceptedUpdate({
acceptedSocket: true,
})
if (conv.direction === 'in') {
dispatch.player.pauseAudioPlayer()
}
// Add call to transfer calls
dispatch.currentCall.addTransferCalls({
type: 'transferred',
Expand Down Expand Up @@ -191,6 +194,7 @@ export const Socket: FC<SocketProps> = ({
}` || '',
})
}

case 'onhold':
// The new conversation during transferring
const { counterpartName, counterpartNum, startTime } = conv
Expand Down Expand Up @@ -426,8 +430,8 @@ export const Socket: FC<SocketProps> = ({
dispatchUrlCall(link, urlType)
})

// `updateDefaultDevice` is the socket event when user change the default device
socket.current.on('updateDefaultDevice', (extension:string) => {
// `updateDefaultDevice` is the socket event when user change the default device
socket.current.on('updateDefaultDevice', (extension: string) => {
// Dispatch phone island physical call event with the link and the urlType
dispatchDefaultDeviceUpdate(extension)
})
Expand Down

0 comments on commit 52b7019

Please sign in to comment.