@webex/calling 3.9.0-multipleLLM.2 → 3.9.0-next.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/dist/CallHistory/CallHistory.js +51 -46
  2. package/dist/CallHistory/CallHistory.js.map +1 -1
  3. package/dist/CallHistory/CallHistory.test.js +146 -147
  4. package/dist/CallHistory/CallHistory.test.js.map +1 -1
  5. package/dist/CallHistory/callHistoryFixtures.js.map +1 -1
  6. package/dist/CallHistory/constants.js.map +1 -1
  7. package/dist/CallHistory/types.js.map +1 -1
  8. package/dist/CallSettings/CallSettings.js +8 -8
  9. package/dist/CallSettings/CallSettings.js.map +1 -1
  10. package/dist/CallSettings/CallSettings.test.js +1 -1
  11. package/dist/CallSettings/CallSettings.test.js.map +1 -1
  12. package/dist/CallSettings/UcmBackendConnector.js +12 -11
  13. package/dist/CallSettings/UcmBackendConnector.js.map +1 -1
  14. package/dist/CallSettings/UcmBackendConnector.test.js +9 -10
  15. package/dist/CallSettings/UcmBackendConnector.test.js.map +1 -1
  16. package/dist/CallSettings/WxCallBackendConnector.js +66 -59
  17. package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
  18. package/dist/CallSettings/WxCallBackendConnector.test.js +108 -109
  19. package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
  20. package/dist/CallSettings/constants.js.map +1 -1
  21. package/dist/CallSettings/testFixtures.js.map +1 -1
  22. package/dist/CallSettings/types.js.map +1 -1
  23. package/dist/CallingClient/CallingClient.js +452 -216
  24. package/dist/CallingClient/CallingClient.js.map +1 -1
  25. package/dist/CallingClient/CallingClient.test.js +374 -321
  26. package/dist/CallingClient/CallingClient.test.js.map +1 -1
  27. package/dist/CallingClient/callRecordFixtures.js.map +1 -1
  28. package/dist/CallingClient/calling/CallerId/index.js +2 -2
  29. package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
  30. package/dist/CallingClient/calling/CallerId/index.test.js +8 -7
  31. package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
  32. package/dist/CallingClient/calling/CallerId/types.js.map +1 -1
  33. package/dist/CallingClient/calling/call.js +343 -320
  34. package/dist/CallingClient/calling/call.js.map +1 -1
  35. package/dist/CallingClient/calling/call.test.js +405 -406
  36. package/dist/CallingClient/calling/call.test.js.map +1 -1
  37. package/dist/CallingClient/calling/callManager.js +3 -4
  38. package/dist/CallingClient/calling/callManager.js.map +1 -1
  39. package/dist/CallingClient/calling/callManager.test.js +67 -68
  40. package/dist/CallingClient/calling/callManager.test.js.map +1 -1
  41. package/dist/CallingClient/calling/index.js.map +1 -1
  42. package/dist/CallingClient/calling/types.js.map +1 -1
  43. package/dist/CallingClient/callingClientFixtures.js.map +1 -1
  44. package/dist/CallingClient/constants.js +8 -6
  45. package/dist/CallingClient/constants.js.map +1 -1
  46. package/dist/CallingClient/line/index.js +7 -7
  47. package/dist/CallingClient/line/index.js.map +1 -1
  48. package/dist/CallingClient/line/line.test.js +6 -6
  49. package/dist/CallingClient/line/line.test.js.map +1 -1
  50. package/dist/CallingClient/line/types.js.map +1 -1
  51. package/dist/CallingClient/registration/index.js.map +1 -1
  52. package/dist/CallingClient/registration/register.js +243 -234
  53. package/dist/CallingClient/registration/register.js.map +1 -1
  54. package/dist/CallingClient/registration/register.test.js +172 -173
  55. package/dist/CallingClient/registration/register.test.js.map +1 -1
  56. package/dist/CallingClient/registration/registerFixtures.js.map +1 -1
  57. package/dist/CallingClient/registration/types.js.map +1 -1
  58. package/dist/CallingClient/registration/webWorker.js +5 -4
  59. package/dist/CallingClient/registration/webWorker.js.map +1 -1
  60. package/dist/CallingClient/registration/webWorker.test.js +14 -14
  61. package/dist/CallingClient/registration/webWorker.test.js.map +1 -1
  62. package/dist/CallingClient/registration/webWorkerStr.js.map +1 -1
  63. package/dist/CallingClient/types.js.map +1 -1
  64. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js +2 -6
  65. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -1
  66. package/dist/Contacts/ContactsClient.js +244 -238
  67. package/dist/Contacts/ContactsClient.js.map +1 -1
  68. package/dist/Contacts/ContactsClient.test.js +89 -90
  69. package/dist/Contacts/ContactsClient.test.js.map +1 -1
  70. package/dist/Contacts/constants.js +2 -2
  71. package/dist/Contacts/constants.js.map +1 -1
  72. package/dist/Contacts/contactFixtures.js.map +1 -1
  73. package/dist/Contacts/types.js.map +1 -1
  74. package/dist/Errors/catalog/CallError.js +2 -2
  75. package/dist/Errors/catalog/CallError.js.map +1 -1
  76. package/dist/Errors/catalog/CallingDeviceError.js +2 -2
  77. package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
  78. package/dist/Errors/catalog/ExtendedError.js +3 -3
  79. package/dist/Errors/catalog/ExtendedError.js.map +1 -1
  80. package/dist/Errors/catalog/LineError.js +2 -2
  81. package/dist/Errors/catalog/LineError.js.map +1 -1
  82. package/dist/Errors/index.js.map +1 -1
  83. package/dist/Errors/types.js.map +1 -1
  84. package/dist/Events/impl/index.js +2 -2
  85. package/dist/Events/impl/index.js.map +1 -1
  86. package/dist/Events/types.js.map +1 -1
  87. package/dist/Logger/index.js.map +1 -1
  88. package/dist/Logger/index.test.js.map +1 -1
  89. package/dist/Logger/types.js.map +1 -1
  90. package/dist/Metrics/index.js +136 -50
  91. package/dist/Metrics/index.js.map +1 -1
  92. package/dist/Metrics/index.test.js.map +1 -1
  93. package/dist/Metrics/types.js +15 -1
  94. package/dist/Metrics/types.js.map +1 -1
  95. package/dist/SDKConnector/index.js +0 -1
  96. package/dist/SDKConnector/index.js.map +1 -1
  97. package/dist/SDKConnector/index.test.js.map +1 -1
  98. package/dist/SDKConnector/types.js.map +1 -1
  99. package/dist/SDKConnector/utils.js.map +1 -1
  100. package/dist/SDKConnector/utils.test.js.map +1 -1
  101. package/dist/Voicemail/BroadworksBackendConnector.js +42 -39
  102. package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
  103. package/dist/Voicemail/BroadworksBackendConnector.test.js +119 -120
  104. package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
  105. package/dist/Voicemail/UcmBackendConnector.js +54 -47
  106. package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
  107. package/dist/Voicemail/UcmBackendConnector.test.js +73 -74
  108. package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
  109. package/dist/Voicemail/Voicemail.js +12 -11
  110. package/dist/Voicemail/Voicemail.js.map +1 -1
  111. package/dist/Voicemail/Voicemail.test.js +2 -2
  112. package/dist/Voicemail/Voicemail.test.js.map +1 -1
  113. package/dist/Voicemail/WxCallBackendConnector.js +78 -70
  114. package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
  115. package/dist/Voicemail/WxCallBackendConnector.test.js +184 -185
  116. package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
  117. package/dist/Voicemail/constants.js.map +1 -1
  118. package/dist/Voicemail/types.js.map +1 -1
  119. package/dist/Voicemail/voicemailFixture.js.map +1 -1
  120. package/dist/api.js.map +1 -1
  121. package/dist/common/Utils.js +80 -63
  122. package/dist/common/Utils.js.map +1 -1
  123. package/dist/common/Utils.test.js +95 -104
  124. package/dist/common/Utils.test.js.map +1 -1
  125. package/dist/common/constants.js.map +1 -1
  126. package/dist/common/index.js.map +1 -1
  127. package/dist/common/testUtil.js +1 -1
  128. package/dist/common/testUtil.js.map +1 -1
  129. package/dist/common/types.js.map +1 -1
  130. package/dist/index.js +5 -5
  131. package/dist/index.js.map +1 -1
  132. package/dist/module/CallHistory/CallHistory.js +4 -0
  133. package/dist/module/CallSettings/UcmBackendConnector.js +1 -0
  134. package/dist/module/CallSettings/WxCallBackendConnector.js +7 -0
  135. package/dist/module/CallingClient/CallingClient.js +171 -43
  136. package/dist/module/CallingClient/calling/call.js +66 -43
  137. package/dist/module/CallingClient/constants.js +7 -4
  138. package/dist/module/CallingClient/registration/register.js +10 -7
  139. package/dist/module/CallingClient/registration/webWorker.js +2 -1
  140. package/dist/module/CallingClient/windowsChromiumIceWarmupUtils.js +1 -4
  141. package/dist/module/Contacts/ContactsClient.js +23 -17
  142. package/dist/module/Contacts/constants.js +1 -1
  143. package/dist/module/Metrics/index.js +63 -1
  144. package/dist/module/Metrics/types.js +14 -0
  145. package/dist/module/Voicemail/BroadworksBackendConnector.js +3 -0
  146. package/dist/module/Voicemail/UcmBackendConnector.js +6 -0
  147. package/dist/module/Voicemail/WxCallBackendConnector.js +8 -0
  148. package/dist/module/common/Utils.js +22 -8
  149. package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
  150. package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
  151. package/dist/types/CallSettings/WxCallBackendConnector.d.ts.map +1 -1
  152. package/dist/types/CallingClient/CallingClient.d.ts +12 -1
  153. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  154. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  155. package/dist/types/CallingClient/calling/types.d.ts +2 -1
  156. package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
  157. package/dist/types/CallingClient/constants.d.ts +7 -4
  158. package/dist/types/CallingClient/constants.d.ts.map +1 -1
  159. package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
  160. package/dist/types/CallingClient/registration/webWorker.d.ts +2 -1
  161. package/dist/types/CallingClient/registration/webWorker.d.ts.map +1 -1
  162. package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts +2 -4
  163. package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts.map +1 -1
  164. package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
  165. package/dist/types/Contacts/constants.d.ts +1 -1
  166. package/dist/types/Contacts/constants.d.ts.map +1 -1
  167. package/dist/types/Metrics/index.d.ts.map +1 -1
  168. package/dist/types/Metrics/types.d.ts +17 -2
  169. package/dist/types/Metrics/types.d.ts.map +1 -1
  170. package/dist/types/Voicemail/BroadworksBackendConnector.d.ts.map +1 -1
  171. package/dist/types/Voicemail/UcmBackendConnector.d.ts.map +1 -1
  172. package/dist/types/Voicemail/WxCallBackendConnector.d.ts.map +1 -1
  173. package/dist/types/common/Utils.d.ts.map +1 -1
  174. package/package.json +9 -7
@@ -709,14 +709,14 @@ export class Call extends Eventing {
709
709
  const response = await this.postSSRequest(undefined, SUPPLEMENTARY_SERVICES.RESUME);
710
710
  log.log(`Response code: ${response.statusCode}`, {
711
711
  file: CALL_FILE,
712
- method: this.handleCallResume.name,
712
+ method: METHODS.HANDLE_CALL_RESUME,
713
713
  });
714
714
  if (this.isHeld() === true) {
715
715
  this.supplementaryServicesTimer = setTimeout(async () => {
716
- const errorContext = { file: CALL_FILE, method: this.handleCallResume.name };
716
+ const errorContext = { file: CALL_FILE, method: METHODS.HANDLE_CALL_RESUME };
717
717
  log.warn('Resume response timed out', {
718
718
  file: CALL_FILE,
719
- method: this.handleCallResume.name,
719
+ method: METHODS.HANDLE_CALL_RESUME,
720
720
  });
721
721
  const callError = createCallError('An error occurred while resuming the call. Wait a moment and try again.', errorContext, ERROR_TYPE.TIMEOUT, this.getCorrelationId(), ERROR_LAYER.CALL_CONTROL);
722
722
  this.emit(CALL_EVENT_KEYS.RESUME_ERROR, callError);
@@ -728,14 +728,14 @@ export class Call extends Eventing {
728
728
  const extendedError = new Error(`Failed to resume the call: ${e}`);
729
729
  log.error(extendedError, {
730
730
  file: CALL_FILE,
731
- method: this.handleCallResume.name,
731
+ method: METHODS.HANDLE_CALL_RESUME,
732
732
  });
733
733
  const errData = e;
734
734
  handleCallErrors((error) => {
735
735
  this.emit(CALL_EVENT_KEYS.RESUME_ERROR, error);
736
736
  this.submitCallErrorMetric(error);
737
737
  this.sendCallStateMachineEvt({ type: 'E_CALL_ESTABLISHED', data: errData });
738
- }, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, this.handleOutgoingCallSetup.name, CALL_FILE);
738
+ }, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, METHODS.HANDLE_CALL_RESUME, CALL_FILE);
739
739
  await uploadLogs({
740
740
  correlationId: this.correlationId,
741
741
  callId: this.callId,
@@ -752,20 +752,20 @@ export class Call extends Eventing {
752
752
  if (data?.callProgressData?.inbandMedia) {
753
753
  log.log('Inband media present. Setting Early Media flag', {
754
754
  file: CALL_FILE,
755
- method: this.handleIncomingCallProgress.name,
755
+ method: METHODS.HANDLE_INCOMING_CALL_PROGRESS,
756
756
  });
757
757
  this.earlyMedia = true;
758
758
  }
759
759
  else {
760
760
  log.log('Inband media not present.', {
761
761
  file: CALL_FILE,
762
- method: this.handleIncomingCallProgress.name,
762
+ method: METHODS.HANDLE_INCOMING_CALL_PROGRESS,
763
763
  });
764
764
  }
765
765
  if (data?.callerId) {
766
766
  log.info('Processing Caller-Id data', {
767
767
  file: CALL_FILE,
768
- method: this.handleIncomingCallProgress.name,
768
+ method: METHODS.HANDLE_INCOMING_CALL_PROGRESS,
769
769
  });
770
770
  this.startCallerIdResolution(data.callerId);
771
771
  }
@@ -780,19 +780,19 @@ export class Call extends Eventing {
780
780
  if (!this.mediaConnection) {
781
781
  log.info('Media connection is not up, buffer the remote Offer Request for later handling', {
782
782
  file: CALL_FILE,
783
- method: this.handleIncomingRoapOfferRequest.name,
783
+ method: METHODS.HANDLE_INCOMING_ROAP_OFFER_REQUEST,
784
784
  });
785
785
  this.seq = message.seq;
786
786
  log.info(`Setting Sequence No: ${this.seq}`, {
787
787
  file: CALL_FILE,
788
- method: this.handleIncomingRoapOfferRequest.name,
788
+ method: METHODS.HANDLE_INCOMING_ROAP_OFFER_REQUEST,
789
789
  });
790
790
  this.remoteRoapMessage = message;
791
791
  }
792
792
  else if (this.receivedRoapOKSeq === message.seq - 2) {
793
793
  log.info('Waiting for Roap OK, buffer the remote Offer Request for later handling', {
794
794
  file: CALL_FILE,
795
- method: this.handleIncomingRoapOfferRequest.name,
795
+ method: METHODS.HANDLE_INCOMING_ROAP_OFFER_REQUEST,
796
796
  });
797
797
  this.remoteRoapMessage = message;
798
798
  }
@@ -811,21 +811,21 @@ export class Call extends Eventing {
811
811
  const res = await this.patch(MobiusCallState.ALERTING);
812
812
  log.log(`PATCH response: ${res.statusCode}`, {
813
813
  file: CALL_FILE,
814
- method: this.handleOutgoingCallAlerting.name,
814
+ method: METHODS.HANDLE_OUTGOING_CALL_ALERTING,
815
815
  });
816
816
  }
817
817
  catch (err) {
818
818
  const extendedError = new Error(`Failed to signal call progression: ${err}`);
819
819
  log.error(extendedError, {
820
820
  file: CALL_FILE,
821
- method: this.handleOutgoingCallAlerting.name,
821
+ method: METHODS.HANDLE_OUTGOING_CALL_ALERTING,
822
822
  });
823
823
  const errData = err;
824
824
  handleCallErrors((error) => {
825
825
  this.emit(CALL_EVENT_KEYS.CALL_ERROR, error);
826
826
  this.submitCallErrorMetric(error);
827
827
  this.sendCallStateMachineEvt({ type: 'E_UNKNOWN', data: errData });
828
- }, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, this.handleOutgoingCallAlerting.name, CALL_FILE);
828
+ }, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, METHODS.HANDLE_OUTGOING_CALL_ALERTING, CALL_FILE);
829
829
  await uploadLogs({
830
830
  correlationId: this.correlationId,
831
831
  callId: this.callId,
@@ -852,7 +852,7 @@ export class Call extends Eventing {
852
852
  if (!this.remoteRoapMessage) {
853
853
  log.warn('Offer not yet received from remote end... Exiting', {
854
854
  file: CALL_FILE,
855
- method: this.handleOutgoingCallConnect.name,
855
+ method: METHODS.HANDLE_OUTGOING_CALL_CONNECT,
856
856
  });
857
857
  return;
858
858
  }
@@ -861,21 +861,21 @@ export class Call extends Eventing {
861
861
  const res = await this.patch(MobiusCallState.CONNECTED);
862
862
  log.log(`PATCH response: ${res.statusCode}`, {
863
863
  file: CALL_FILE,
864
- method: this.handleOutgoingCallConnect.name,
864
+ method: METHODS.HANDLE_OUTGOING_CALL_CONNECT,
865
865
  });
866
866
  }
867
867
  catch (err) {
868
868
  const extendedError = new Error(`Failed to connect the call: ${err}`);
869
869
  log.error(extendedError, {
870
870
  file: CALL_FILE,
871
- method: this.handleOutgoingCallConnect.name,
871
+ method: METHODS.HANDLE_OUTGOING_CALL_CONNECT,
872
872
  });
873
873
  const errData = err;
874
874
  handleCallErrors((error) => {
875
875
  this.emit(CALL_EVENT_KEYS.CALL_ERROR, error);
876
876
  this.submitCallErrorMetric(error);
877
877
  this.sendCallStateMachineEvt({ type: 'E_UNKNOWN', data: errData });
878
- }, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, this.handleOutgoingCallConnect.name, CALL_FILE);
878
+ }, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, METHODS.HANDLE_OUTGOING_CALL_CONNECT, CALL_FILE);
879
879
  await uploadLogs({
880
880
  correlationId: this.correlationId,
881
881
  callId: this.callId,
@@ -901,6 +901,11 @@ export class Call extends Eventing {
901
901
  file: CALL_FILE,
902
902
  method: METHODS.HANDLE_OUTGOING_CALL_DISCONNECT,
903
903
  });
904
+ uploadLogs({
905
+ correlationId: this.correlationId,
906
+ callId: this.callId,
907
+ broadworksCorrelationInfo: this.broadworksCorrelationInfo,
908
+ });
904
909
  }
905
910
  this.deleteCb(this.correlationId);
906
911
  this.unregisterListeners();
@@ -940,6 +945,11 @@ export class Call extends Eventing {
940
945
  file: CALL_FILE,
941
946
  method: METHODS.HANDLE_OUTGOING_CALL_DISCONNECT,
942
947
  });
948
+ uploadLogs({
949
+ correlationId: this.correlationId,
950
+ callId: this.callId,
951
+ broadworksCorrelationInfo: this.broadworksCorrelationInfo,
952
+ });
943
953
  }
944
954
  this.deleteCb(this.correlationId);
945
955
  this.unregisterListeners();
@@ -1016,7 +1026,7 @@ export class Call extends Eventing {
1016
1026
  try {
1017
1027
  this.setDisconnectReason();
1018
1028
  const response = await this.delete();
1019
- log.log(`handleOutgoingCallDisconnect: Response code: ${response.statusCode}`, {
1029
+ log.log(`Response code: ${response.statusCode}`, {
1020
1030
  file: CALL_FILE,
1021
1031
  method: METHODS.HANDLE_UNKNOWN_STATE,
1022
1032
  });
@@ -1026,6 +1036,11 @@ export class Call extends Eventing {
1026
1036
  file: CALL_FILE,
1027
1037
  method: METHODS.HANDLE_UNKNOWN_STATE,
1028
1038
  });
1039
+ uploadLogs({
1040
+ correlationId: this.correlationId,
1041
+ callId: this.callId,
1042
+ broadworksCorrelationInfo: this.broadworksCorrelationInfo,
1043
+ });
1029
1044
  }
1030
1045
  this.deleteCb(this.correlationId);
1031
1046
  if (this.sessionTimer) {
@@ -1191,22 +1206,22 @@ export class Call extends Eventing {
1191
1206
  if (!message?.sdp) {
1192
1207
  log.info('Initializing Offer...', {
1193
1208
  file: CALL_FILE,
1194
- method: this.handleOutgoingRoapOffer.name,
1209
+ method: METHODS.HANDLE_OUTGOING_ROAP_OFFER,
1195
1210
  });
1196
1211
  this.mediaConnection.initiateOffer();
1197
1212
  return;
1198
1213
  }
1199
1214
  try {
1200
1215
  const res = await this.postMedia(message);
1201
- log.log(`handleOutgoingRoapOffer: Response code: ${res.statusCode}`, {
1216
+ log.log(`Response code: ${res.statusCode}`, {
1202
1217
  file: CALL_FILE,
1203
- method: this.handleOutgoingRoapOffer.name,
1218
+ method: METHODS.HANDLE_OUTGOING_ROAP_OFFER,
1204
1219
  });
1205
1220
  }
1206
1221
  catch (err) {
1207
1222
  log.warn('Failed to process MediaOk request', {
1208
1223
  file: CALL_FILE,
1209
- method: this.handleOutgoingRoapOffer.name,
1224
+ method: METHODS.HANDLE_OUTGOING_ROAP_OFFER,
1210
1225
  });
1211
1226
  const errData = err;
1212
1227
  handleCallErrors(this.getEmitterCallback(errData), ERROR_LAYER.MEDIA, (interval) => {
@@ -1215,7 +1230,7 @@ export class Call extends Eventing {
1215
1230
  this.sendMediaStateMachineEvt({ type: 'E_SEND_ROAP_OFFER', data: event.data });
1216
1231
  }, interval * 1000);
1217
1232
  }
1218
- }, this.getCorrelationId(), errData, this.handleOutgoingRoapOffer.name, CALL_FILE);
1233
+ }, this.getCorrelationId(), errData, METHODS.HANDLE_OUTGOING_ROAP_OFFER, CALL_FILE);
1219
1234
  await uploadLogs({
1220
1235
  correlationId: this.correlationId,
1221
1236
  callId: this.callId,
@@ -1232,15 +1247,15 @@ export class Call extends Eventing {
1232
1247
  try {
1233
1248
  message.seq = this.seq;
1234
1249
  const res = await this.postMedia(message);
1235
- log.log(`handleOutgoingRoapAnswer: Response code: ${res.statusCode}`, {
1250
+ log.log(`Response code: ${res.statusCode}`, {
1236
1251
  file: CALL_FILE,
1237
- method: this.handleOutgoingRoapAnswer.name,
1252
+ method: METHODS.HANDLE_OUTGOING_ROAP_ANSWER,
1238
1253
  });
1239
1254
  }
1240
1255
  catch (err) {
1241
1256
  log.warn('Failed to send MediaAnswer request', {
1242
1257
  file: CALL_FILE,
1243
- method: this.handleOutgoingRoapAnswer.name,
1258
+ method: METHODS.HANDLE_OUTGOING_ROAP_ANSWER,
1244
1259
  });
1245
1260
  const errData = err;
1246
1261
  handleCallErrors(this.getEmitterCallback(errData), ERROR_LAYER.MEDIA, (interval) => {
@@ -1249,7 +1264,7 @@ export class Call extends Eventing {
1249
1264
  this.sendMediaStateMachineEvt({ type: 'E_SEND_ROAP_ANSWER', data: event.data });
1250
1265
  }, interval * 1000);
1251
1266
  }
1252
- }, this.getCorrelationId(), errData, this.handleOutgoingRoapAnswer.name, CALL_FILE);
1267
+ }, this.getCorrelationId(), errData, METHODS.HANDLE_OUTGOING_ROAP_ANSWER, CALL_FILE);
1253
1268
  await uploadLogs({
1254
1269
  correlationId: this.correlationId,
1255
1270
  callId: this.callId,
@@ -1267,25 +1282,25 @@ export class Call extends Eventing {
1267
1282
  if (!this.mediaConnection) {
1268
1283
  log.info('Media connection is not up, buffer the remote offer for later handling', {
1269
1284
  file: CALL_FILE,
1270
- method: this.handleIncomingRoapOffer.name,
1285
+ method: METHODS.HANDLE_INCOMING_ROAP_OFFER,
1271
1286
  });
1272
1287
  this.seq = message.seq;
1273
1288
  log.info(`Setting Sequence No: ${this.seq}`, {
1274
1289
  file: CALL_FILE,
1275
- method: this.handleIncomingRoapOffer.name,
1290
+ method: METHODS.HANDLE_INCOMING_ROAP_OFFER,
1276
1291
  });
1277
1292
  }
1278
1293
  else if (this.receivedRoapOKSeq === message.seq - 2) {
1279
1294
  log.info('Waiting for Roap OK, buffer the remote offer for later handling', {
1280
1295
  file: CALL_FILE,
1281
- method: this.handleIncomingRoapOffer.name,
1296
+ method: METHODS.HANDLE_INCOMING_ROAP_OFFER,
1282
1297
  });
1283
1298
  this.remoteRoapMessage = message;
1284
1299
  }
1285
1300
  else {
1286
1301
  log.info('Handling new offer...', {
1287
1302
  file: CALL_FILE,
1288
- method: this.handleIncomingRoapOffer.name,
1303
+ method: METHODS.HANDLE_INCOMING_ROAP_OFFER,
1289
1304
  });
1290
1305
  this.seq = message.seq;
1291
1306
  if (this.mediaConnection) {
@@ -1476,7 +1491,7 @@ export class Call extends Eventing {
1476
1491
  async patch(state) {
1477
1492
  log.info(`Send a PATCH for ${state} to Webex Calling`, {
1478
1493
  file: CALL_FILE,
1479
- method: this.patch.name,
1494
+ method: 'patch',
1480
1495
  });
1481
1496
  return this.webex.request({
1482
1497
  uri: `${this.mobiusUrl}${DEVICES_ENDPOINT_RESOURCE}/${this.deviceId}/${CALLS_ENDPOINT_RESOURCE}/${this.callId}`,
@@ -1539,7 +1554,7 @@ export class Call extends Eventing {
1539
1554
  default: {
1540
1555
  log.warn(`Unknown type for PUT request: ${type}`, {
1541
1556
  file: CALL_FILE,
1542
- method: this.postSSRequest.name,
1557
+ method: METHODS.POST_SS_REQUEST,
1543
1558
  });
1544
1559
  }
1545
1560
  }
@@ -1567,7 +1582,7 @@ export class Call extends Eventing {
1567
1582
  if (transferType === TransferType.BLIND && transferTarget) {
1568
1583
  log.info(`Initiating Blind transfer with : ${transferTarget}`, {
1569
1584
  file: CALL_FILE,
1570
- method: this.completeTransfer.name,
1585
+ method: METHODS.COMPLETE_TRANSFER,
1571
1586
  });
1572
1587
  const context = {
1573
1588
  transferorCallId: this.getCallId(),
@@ -1575,18 +1590,22 @@ export class Call extends Eventing {
1575
1590
  };
1576
1591
  try {
1577
1592
  await this.postSSRequest(context, SUPPLEMENTARY_SERVICES.TRANSFER);
1593
+ log.info(`Blind Transfer completed for correlationId ${this.getCorrelationId()}`, {
1594
+ file: CALL_FILE,
1595
+ method: METHODS.COMPLETE_TRANSFER,
1596
+ });
1578
1597
  this.metricManager.submitCallMetric(METRIC_EVENT.CALL, TRANSFER_ACTION.BLIND, METRIC_TYPE.BEHAVIORAL, this.getCallId(), this.getCorrelationId(), undefined);
1579
1598
  }
1580
1599
  catch (e) {
1581
1600
  log.warn(`Blind Transfer failed for correlationId ${this.getCorrelationId()}`, {
1582
1601
  file: CALL_FILE,
1583
- method: this.completeTransfer.name,
1602
+ method: METHODS.COMPLETE_TRANSFER,
1584
1603
  });
1585
1604
  const errData = e;
1586
1605
  handleCallErrors((error) => {
1587
1606
  this.emit(CALL_EVENT_KEYS.TRANSFER_ERROR, error);
1588
1607
  this.submitCallErrorMetric(error, TRANSFER_ACTION.BLIND);
1589
- }, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, this.completeTransfer.name, CALL_FILE);
1608
+ }, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, METHODS.COMPLETE_TRANSFER, CALL_FILE);
1590
1609
  await uploadLogs({
1591
1610
  correlationId: this.correlationId,
1592
1611
  callId: this.callId,
@@ -1597,7 +1616,7 @@ export class Call extends Eventing {
1597
1616
  else if (transferType === TransferType.CONSULT && transferCallId) {
1598
1617
  log.info(`Initiating Consult transfer between : ${this.callId} and ${transferCallId}`, {
1599
1618
  file: CALL_FILE,
1600
- method: this.completeTransfer.name,
1619
+ method: METHODS.COMPLETE_TRANSFER,
1601
1620
  });
1602
1621
  const context = {
1603
1622
  transferorCallId: this.getCallId(),
@@ -1605,18 +1624,22 @@ export class Call extends Eventing {
1605
1624
  };
1606
1625
  try {
1607
1626
  await this.postSSRequest(context, SUPPLEMENTARY_SERVICES.TRANSFER);
1627
+ log.info(`Consult Transfer completed for correlationId ${this.getCorrelationId()}`, {
1628
+ file: CALL_FILE,
1629
+ method: METHODS.COMPLETE_TRANSFER,
1630
+ });
1608
1631
  this.metricManager.submitCallMetric(METRIC_EVENT.CALL, TRANSFER_ACTION.CONSULT, METRIC_TYPE.BEHAVIORAL, this.getCallId(), this.getCorrelationId(), undefined);
1609
1632
  }
1610
1633
  catch (e) {
1611
1634
  log.warn(`Consult Transfer failed for correlationId ${this.getCorrelationId()}`, {
1612
1635
  file: CALL_FILE,
1613
- method: this.completeTransfer.name,
1636
+ method: METHODS.COMPLETE_TRANSFER,
1614
1637
  });
1615
1638
  const errData = e;
1616
1639
  handleCallErrors((error) => {
1617
1640
  this.emit(CALL_EVENT_KEYS.TRANSFER_ERROR, error);
1618
1641
  this.submitCallErrorMetric(error, TRANSFER_ACTION.CONSULT);
1619
- }, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, this.completeTransfer.name, CALL_FILE);
1642
+ }, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, METHODS.COMPLETE_TRANSFER, CALL_FILE);
1620
1643
  await uploadLogs({
1621
1644
  correlationId: this.correlationId,
1622
1645
  callId: this.callId,
@@ -1627,7 +1650,7 @@ export class Call extends Eventing {
1627
1650
  else {
1628
1651
  log.warn(`Invalid information received, transfer failed for correlationId: ${this.getCorrelationId()}`, {
1629
1652
  file: CALL_FILE,
1630
- method: this.completeTransfer.name,
1653
+ method: METHODS.COMPLETE_TRANSFER,
1631
1654
  });
1632
1655
  }
1633
1656
  }
@@ -1690,13 +1713,13 @@ export class Call extends Eventing {
1690
1713
  case RoapScenario.OFFER: {
1691
1714
  log.info(`before modifying sdp: ${event.roapMessage.sdp}`, {
1692
1715
  file: CALL_FILE,
1693
- method: this.mediaRoapEventsListener.name,
1716
+ method: METHODS.MEDIA_ROAP_EVENTS_LISTENER,
1694
1717
  });
1695
1718
  event.roapMessage.sdp = modifySdpForIPv4(event.roapMessage.sdp);
1696
1719
  const sdpVideoPortZero = event.roapMessage.sdp.replace(/^m=(video) (?:\d+) /gim, 'm=$1 0 ');
1697
1720
  log.info(`after modification sdp: ${sdpVideoPortZero}`, {
1698
1721
  file: CALL_FILE,
1699
- method: this.mediaRoapEventsListener.name,
1722
+ method: METHODS.MEDIA_ROAP_EVENTS_LISTENER,
1700
1723
  });
1701
1724
  event.roapMessage.sdp = sdpVideoPortZero;
1702
1725
  this.localRoapMessage = event.roapMessage;
@@ -45,7 +45,7 @@ export const DUMMY_MOBIUS_URL = 'https://mobius.aintgen-a-1.int.infra.webex.com/
45
45
  export const IP_ENDPOINT = 'myip';
46
46
  export const INITIAL_SEQ_NUMBER = 1;
47
47
  export const MEDIA_ENDPOINT_RESOURCE = 'media';
48
- export const NETWORK_FLAP_TIMEOUT = 2000;
48
+ export const NETWORK_FLAP_TIMEOUT = 5000;
49
49
  export const CALL_HOLD_SERVICE = 'callhold';
50
50
  export const CALL_TRANSFER_SERVICE = 'calltransfer';
51
51
  export const HOLD_ENDPOINT = 'hold';
@@ -61,7 +61,7 @@ export const WEB_AGENT = '(web)';
61
61
  export const WEBEX = 'webex';
62
62
  export const WEBEX_WEB_CLIENT = 'webex-web-client';
63
63
  export const CALLER_ID_FILE = 'CallerId';
64
- export const UTILS_FILE = 'utils';
64
+ export const UTILS_FILE = 'src/common/Utils.ts';
65
65
  export const CALLING_CLIENT_FILE = 'CallingClient';
66
66
  export const LINE_FILE = 'line';
67
67
  export const CALL_FILE = 'call';
@@ -115,7 +115,6 @@ export const KEEPALIVE_UTIL = 'startKeepaliveTimer';
115
115
  export const FAILBACK_UTIL = 'executeFailback';
116
116
  export const REG_429_RETRY_UTIL = 'handle429Retry';
117
117
  export const FAILOVER_UTIL = 'startFailoverTimer';
118
- export const NETWORK_CHANGE_DETECTION_UTIL = 'detectNetworkChange';
119
118
  export const CALLS_CLEARED_HANDLER_UTIL = 'callsClearedHandler';
120
119
  export const RECONNECT_UTIL = 'reconnectOnFailure';
121
120
  export const NOISE_REDUCTION_EFFECT = 'noise-reduction-effect';
@@ -200,6 +199,7 @@ export const METHODS = {
200
199
  GET_CALL_RTP_STATS: 'getCallRtpStats',
201
200
  REGISTER: 'register',
202
201
  DEREGISTER: 'deregister',
202
+ DELETE_REGISTRATION: 'deleteRegistration',
203
203
  NORMALIZE_LINE: 'normalizeLine',
204
204
  LINE_EMITTER: 'lineEmitter',
205
205
  GET_LOGGING_LEVEL: 'getLoggingLevel',
@@ -211,7 +211,10 @@ export const METHODS = {
211
211
  SET_MOBIUS_SERVERS: 'setMobiusServers',
212
212
  HANDLE_CONNECTION_RESTORATION: 'handleConnectionRestoration',
213
213
  RECONNECT_ON_FAILURE: 'reconnectOnFailure',
214
- DETECT_NETWORK_CHANGE: 'detectNetworkChange',
214
+ MERCURY_OFFLINE: 'handleMercuryOffline',
215
+ MERCURY_ONLINE: 'handleMercuryOnline',
216
+ NETWORK_OFFLINE: 'handleNetworkOffline',
217
+ NETWORK_ONLINE: 'handleNetworkOnline',
215
218
  GET_CLIENT_REGION_INFO: 'getClientRegionInfo',
216
219
  GET_MOBIUS_SERVERS: 'getMobiusServers',
217
220
  REGISTER_CALLS_CLEARED_LISTENER: 'registerCallsClearedListener',
@@ -90,8 +90,9 @@ export class Registration {
90
90
  catch (error) {
91
91
  log.warn(`Delete failed with Mobius ${error}`, {
92
92
  file: REGISTRATION_FILE,
93
- method: METHODS.DEREGISTER,
93
+ method: METHODS.DELETE_REGISTRATION,
94
94
  });
95
+ await uploadLogs();
95
96
  }
96
97
  this.setStatus(RegistrationStatus.INACTIVE);
97
98
  this.lineEmitter(LINE_EVENTS.UNREGISTERED);
@@ -354,18 +355,18 @@ export class Registration {
354
355
  });
355
356
  await this.mutex.runExclusive(async () => {
356
357
  if (retry) {
357
- log.log('Mercury connection is up again, re-registering with Webex Calling if needed', {
358
+ log.log('Network is up again, re-registering with Webex Calling if needed', {
358
359
  file: REGISTRATION_FILE,
359
- method: this.handleConnectionRestoration.name,
360
+ method: METHODS.HANDLE_CONNECTION_RESTORATION,
360
361
  });
361
362
  this.clearKeepaliveTimer();
362
363
  if (this.isDeviceRegistered()) {
363
364
  await this.deregister();
364
365
  }
365
366
  if (this.activeMobiusUrl) {
366
- const abort = await this.restorePreviousRegistration(this.handleConnectionRestoration.name);
367
+ const abort = await this.restorePreviousRegistration(METHODS.HANDLE_CONNECTION_RESTORATION);
367
368
  if (!abort && !this.isDeviceRegistered()) {
368
- await this.restartRegistration(this.handleConnectionRestoration.name);
369
+ await this.restartRegistration(METHODS.HANDLE_CONNECTION_RESTORATION);
369
370
  }
370
371
  }
371
372
  retry = false;
@@ -435,7 +436,7 @@ export class Registration {
435
436
  this.registrationStatus = RegistrationStatus.ACTIVE;
436
437
  this.setActiveMobiusUrl(url);
437
438
  this.lineEmitter(LINE_EVENTS.REGISTERED, resp.body);
438
- log.log(`Registration successful for deviceId: ${this.deviceInfo.device?.deviceId} userId: ${this.userId}`, {
439
+ log.log(`Registration successful for deviceId: ${this.deviceInfo.device?.deviceId} userId: ${this.userId} responseTrackingId: ${resp.headers?.trackingid}`, {
439
440
  file: REGISTRATION_FILE,
440
441
  method: METHODS.REGISTER,
441
442
  });
@@ -466,6 +467,7 @@ export class Registration {
466
467
  }
467
468
  if (abort) {
468
469
  this.setStatus(RegistrationStatus.INACTIVE);
470
+ await uploadLogs();
469
471
  break;
470
472
  }
471
473
  }
@@ -507,7 +509,7 @@ export class Registration {
507
509
  if (finalError) {
508
510
  this.lineEmitter(LINE_EVENTS.ERROR, undefined, clientError);
509
511
  }
510
- this.metricManager.submitRegistrationMetric(METRIC_EVENT.REGISTRATION, REG_ACTION.KEEPALIVE_FAILURE, METRIC_TYPE.BEHAVIORAL, KEEPALIVE_UTIL, serverType, error.headers?.trackingid ?? '', event.data.keepAliveRetryCount, clientError);
512
+ this.metricManager.submitRegistrationMetric(METRIC_EVENT.KEEPALIVE_ERROR, REG_ACTION.KEEPALIVE_FAILURE, METRIC_TYPE.BEHAVIORAL, KEEPALIVE_UTIL, serverType, error.headers?.trackingid ?? '', event.data.keepAliveRetryCount, clientError);
511
513
  }, { method: KEEPALIVE_UTIL, file: REGISTRATION_FILE });
512
514
  if (abort || event.data.keepAliveRetryCount >= RETRY_COUNT_THRESHOLD) {
513
515
  this.failoverImmediately = this.isCCFlow;
@@ -515,6 +517,7 @@ export class Registration {
515
517
  this.clearKeepaliveTimer();
516
518
  this.clearFailbackTimer();
517
519
  this.lineEmitter(LINE_EVENTS.UNREGISTERED);
520
+ await uploadLogs();
518
521
  if (!abort) {
519
522
  await this.reconnectOnFailure(KEEPALIVE_UTIL);
520
523
  }
@@ -1,7 +1,7 @@
1
1
  import { v4 as uuid } from 'uuid';
2
2
  import { HTTP_METHODS, WorkerMessageType } from '../../common/types';
3
3
  let keepaliveTimer;
4
- export const messageHandler = (event) => {
4
+ const messageHandler = (event) => {
5
5
  const { type } = event.data;
6
6
  const postKeepAlive = async (accessToken, deviceUrl, url) => {
7
7
  const response = await fetch(`${url}/status`, {
@@ -57,3 +57,4 @@ export const messageHandler = (event) => {
57
57
  }
58
58
  };
59
59
  self.addEventListener('message', messageHandler);
60
+ export default messageHandler;
@@ -26,10 +26,7 @@ function waitForIceComplete(pc, timeoutMs) {
26
26
  }, timeoutMs);
27
27
  });
28
28
  }
29
- export default async function windowsChromiumIceWarmup({ iceServers = [
30
- { urls: 'stun:stun01a-us.bcld.webex.com:5004' },
31
- { urls: 'stun:stun02a-us.bcld.webex.com:5004' },
32
- ], timeoutMs = 1000, }) {
29
+ export default async function windowsChromiumIceWarmup({ iceServers = [], timeoutMs = 1000 }) {
33
30
  const pc1 = new RTCPeerConnection({ iceServers, iceCandidatePoolSize: 1 });
34
31
  const pc2 = new RTCPeerConnection({ iceServers, iceCandidatePoolSize: 1 });
35
32
  const candidates = { pc1: [], pc2: [] };