diff --git a/packages/@webex/internal-plugin-metrics/src/call-diagnostic/call-diagnostic-metrics.util.ts b/packages/@webex/internal-plugin-metrics/src/call-diagnostic/call-diagnostic-metrics.util.ts index 43758dc66ed..9cef69066ab 100644 --- a/packages/@webex/internal-plugin-metrics/src/call-diagnostic/call-diagnostic-metrics.util.ts +++ b/packages/@webex/internal-plugin-metrics/src/call-diagnostic/call-diagnostic-metrics.util.ts @@ -383,11 +383,18 @@ export const generateClientErrorCodeForIceFailure = ({ errorCode = MISSING_ROAP_ANSWER_CLIENT_CODE; } - if (signalingState === 'stable' && iceConnectionState === 'connected') { + if ( + signalingState === 'stable' && + (iceConnectionState === 'connected' || iceConnectionState === 'disconnected') + ) { errorCode = DTLS_HANDSHAKE_FAILED_CLIENT_CODE; } - if (signalingState !== 'have-local-offer' && iceConnectionState !== 'connected') { + if ( + signalingState !== 'have-local-offer' && + iceConnectionState !== 'connected' && + iceConnectionState !== 'disconnected' + ) { if (turnServerUsed) { errorCode = ICE_FAILED_WITH_TURN_TLS_CLIENT_CODE; } else { diff --git a/packages/@webex/internal-plugin-metrics/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts b/packages/@webex/internal-plugin-metrics/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts index 39000d6e520..b9159f1ad53 100644 --- a/packages/@webex/internal-plugin-metrics/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +++ b/packages/@webex/internal-plugin-metrics/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts @@ -301,17 +301,23 @@ describe('internal-plugin-metrics', () => { [ ['client.exit.app', {}], - ['client.login.end', { - joinTimes: { - otherAppApiReqResp: undefined, - exchangeCITokenJMT: undefined, - } - }], - ['client.webexapp.launched', { - joinTimes: { - downloadTime: undefined, - } - }], + [ + 'client.login.end', + { + joinTimes: { + otherAppApiReqResp: undefined, + exchangeCITokenJMT: undefined, + }, + }, + ], + [ + 'client.webexapp.launched', + { + joinTimes: { + downloadTime: undefined, + }, + }, + ], [ 'client.interstitial-window.launched', { @@ -609,6 +615,12 @@ describe('internal-plugin-metrics', () => { turnServerUsed: true, errorCode: DTLS_HANDSHAKE_FAILED_CLIENT_CODE, }, + { + signalingState: 'stable', + iceConnectionState: 'disconnected', + turnServerUsed: true, + errorCode: DTLS_HANDSHAKE_FAILED_CLIENT_CODE, + }, { signalingState: 'stable', iceConnectionState: 'failed',