@webex/calling 3.9.0-webinar5k.1 → 3.10.0

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 (184) 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 +457 -201
  24. package/dist/CallingClient/CallingClient.js.map +1 -1
  25. package/dist/CallingClient/CallingClient.test.js +458 -315
  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 +369 -333
  34. package/dist/CallingClient/calling/call.js.map +1 -1
  35. package/dist/CallingClient/calling/call.test.js +411 -410
  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 +9 -6
  45. package/dist/CallingClient/constants.js.map +1 -1
  46. package/dist/CallingClient/line/index.js +10 -11
  47. package/dist/CallingClient/line/index.js.map +1 -1
  48. package/dist/CallingClient/line/line.test.js +10 -9
  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 +280 -201
  53. package/dist/CallingClient/registration/register.js.map +1 -1
  54. package/dist/CallingClient/registration/register.test.js +251 -180
  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 +25 -10
  59. package/dist/CallingClient/registration/webWorker.js.map +1 -1
  60. package/dist/CallingClient/registration/webWorker.test.js +85 -38
  61. package/dist/CallingClient/registration/webWorker.test.js.map +1 -1
  62. package/dist/CallingClient/registration/webWorkerStr.js +1 -1
  63. package/dist/CallingClient/registration/webWorkerStr.js.map +1 -1
  64. package/dist/CallingClient/types.js.map +1 -1
  65. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js +142 -0
  66. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -0
  67. package/dist/Contacts/ContactsClient.js +244 -238
  68. package/dist/Contacts/ContactsClient.js.map +1 -1
  69. package/dist/Contacts/ContactsClient.test.js +89 -90
  70. package/dist/Contacts/ContactsClient.test.js.map +1 -1
  71. package/dist/Contacts/constants.js +2 -2
  72. package/dist/Contacts/constants.js.map +1 -1
  73. package/dist/Contacts/contactFixtures.js.map +1 -1
  74. package/dist/Contacts/types.js.map +1 -1
  75. package/dist/Errors/catalog/CallError.js +2 -2
  76. package/dist/Errors/catalog/CallError.js.map +1 -1
  77. package/dist/Errors/catalog/CallingDeviceError.js +2 -2
  78. package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
  79. package/dist/Errors/catalog/ExtendedError.js +3 -3
  80. package/dist/Errors/catalog/ExtendedError.js.map +1 -1
  81. package/dist/Errors/catalog/LineError.js +2 -2
  82. package/dist/Errors/catalog/LineError.js.map +1 -1
  83. package/dist/Errors/index.js.map +1 -1
  84. package/dist/Errors/types.js.map +1 -1
  85. package/dist/Events/impl/index.js +2 -2
  86. package/dist/Events/impl/index.js.map +1 -1
  87. package/dist/Events/types.js.map +1 -1
  88. package/dist/Logger/index.js.map +1 -1
  89. package/dist/Logger/index.test.js.map +1 -1
  90. package/dist/Logger/types.js.map +1 -1
  91. package/dist/Metrics/index.js +221 -104
  92. package/dist/Metrics/index.js.map +1 -1
  93. package/dist/Metrics/index.test.js +112 -23
  94. package/dist/Metrics/index.test.js.map +1 -1
  95. package/dist/Metrics/types.js +15 -1
  96. package/dist/Metrics/types.js.map +1 -1
  97. package/dist/SDKConnector/index.js +0 -1
  98. package/dist/SDKConnector/index.js.map +1 -1
  99. package/dist/SDKConnector/index.test.js.map +1 -1
  100. package/dist/SDKConnector/types.js.map +1 -1
  101. package/dist/SDKConnector/utils.js.map +1 -1
  102. package/dist/SDKConnector/utils.test.js.map +1 -1
  103. package/dist/Voicemail/BroadworksBackendConnector.js +42 -39
  104. package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
  105. package/dist/Voicemail/BroadworksBackendConnector.test.js +119 -120
  106. package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
  107. package/dist/Voicemail/UcmBackendConnector.js +54 -47
  108. package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
  109. package/dist/Voicemail/UcmBackendConnector.test.js +73 -74
  110. package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
  111. package/dist/Voicemail/Voicemail.js +12 -11
  112. package/dist/Voicemail/Voicemail.js.map +1 -1
  113. package/dist/Voicemail/Voicemail.test.js +2 -2
  114. package/dist/Voicemail/Voicemail.test.js.map +1 -1
  115. package/dist/Voicemail/WxCallBackendConnector.js +78 -70
  116. package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
  117. package/dist/Voicemail/WxCallBackendConnector.test.js +184 -185
  118. package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
  119. package/dist/Voicemail/constants.js.map +1 -1
  120. package/dist/Voicemail/types.js.map +1 -1
  121. package/dist/Voicemail/voicemailFixture.js.map +1 -1
  122. package/dist/api.js.map +1 -1
  123. package/dist/common/Utils.js +84 -65
  124. package/dist/common/Utils.js.map +1 -1
  125. package/dist/common/Utils.test.js +111 -117
  126. package/dist/common/Utils.test.js.map +1 -1
  127. package/dist/common/constants.js.map +1 -1
  128. package/dist/common/index.js.map +1 -1
  129. package/dist/common/testUtil.js +1 -1
  130. package/dist/common/testUtil.js.map +1 -1
  131. package/dist/common/types.js.map +1 -1
  132. package/dist/index.js +5 -5
  133. package/dist/index.js.map +1 -1
  134. package/dist/module/CallHistory/CallHistory.js +4 -0
  135. package/dist/module/CallSettings/UcmBackendConnector.js +1 -0
  136. package/dist/module/CallSettings/WxCallBackendConnector.js +7 -0
  137. package/dist/module/CallingClient/CallingClient.js +174 -32
  138. package/dist/module/CallingClient/calling/call.js +79 -43
  139. package/dist/module/CallingClient/constants.js +8 -4
  140. package/dist/module/CallingClient/line/index.js +3 -3
  141. package/dist/module/CallingClient/registration/register.js +34 -10
  142. package/dist/module/CallingClient/registration/webWorker.js +17 -3
  143. package/dist/module/CallingClient/registration/webWorkerStr.js +19 -3
  144. package/dist/module/CallingClient/windowsChromiumIceWarmupUtils.js +59 -0
  145. package/dist/module/Contacts/ContactsClient.js +23 -17
  146. package/dist/module/Contacts/constants.js +1 -1
  147. package/dist/module/Metrics/index.js +142 -55
  148. package/dist/module/Metrics/types.js +14 -0
  149. package/dist/module/Voicemail/BroadworksBackendConnector.js +3 -0
  150. package/dist/module/Voicemail/UcmBackendConnector.js +6 -0
  151. package/dist/module/Voicemail/WxCallBackendConnector.js +8 -0
  152. package/dist/module/common/Utils.js +27 -10
  153. package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
  154. package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
  155. package/dist/types/CallSettings/WxCallBackendConnector.d.ts.map +1 -1
  156. package/dist/types/CallingClient/CallingClient.d.ts +12 -1
  157. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  158. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  159. package/dist/types/CallingClient/calling/types.d.ts +2 -1
  160. package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
  161. package/dist/types/CallingClient/constants.d.ts +8 -4
  162. package/dist/types/CallingClient/constants.d.ts.map +1 -1
  163. package/dist/types/CallingClient/line/index.d.ts.map +1 -1
  164. package/dist/types/CallingClient/registration/register.d.ts +1 -0
  165. package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
  166. package/dist/types/CallingClient/registration/webWorker.d.ts +2 -1
  167. package/dist/types/CallingClient/registration/webWorker.d.ts.map +1 -1
  168. package/dist/types/CallingClient/registration/webWorkerStr.d.ts +1 -1
  169. package/dist/types/CallingClient/registration/webWorkerStr.d.ts.map +1 -1
  170. package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts +5 -0
  171. package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts.map +1 -0
  172. package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
  173. package/dist/types/Contacts/constants.d.ts +1 -1
  174. package/dist/types/Contacts/constants.d.ts.map +1 -1
  175. package/dist/types/Metrics/index.d.ts.map +1 -1
  176. package/dist/types/Metrics/types.d.ts +18 -3
  177. package/dist/types/Metrics/types.d.ts.map +1 -1
  178. package/dist/types/Voicemail/BroadworksBackendConnector.d.ts.map +1 -1
  179. package/dist/types/Voicemail/UcmBackendConnector.d.ts.map +1 -1
  180. package/dist/types/Voicemail/WxCallBackendConnector.d.ts.map +1 -1
  181. package/dist/types/common/Utils.d.ts.map +1 -1
  182. package/dist/types/common/types.d.ts +1 -0
  183. package/dist/types/common/types.d.ts.map +1 -1
  184. package/package.json +10 -8
@@ -653,6 +653,7 @@ export class Call extends Eventing {
653
653
  await uploadLogs({
654
654
  correlationId: this.correlationId,
655
655
  callId: this.callId,
656
+ broadworksCorrelationInfo: this.broadworksCorrelationInfo,
656
657
  });
657
658
  }
658
659
  }
@@ -695,6 +696,7 @@ export class Call extends Eventing {
695
696
  await uploadLogs({
696
697
  correlationId: this.correlationId,
697
698
  callId: this.callId,
699
+ broadworksCorrelationInfo: this.broadworksCorrelationInfo,
698
700
  });
699
701
  }
700
702
  }
@@ -707,14 +709,14 @@ export class Call extends Eventing {
707
709
  const response = await this.postSSRequest(undefined, SUPPLEMENTARY_SERVICES.RESUME);
708
710
  log.log(`Response code: ${response.statusCode}`, {
709
711
  file: CALL_FILE,
710
- method: this.handleCallResume.name,
712
+ method: METHODS.HANDLE_CALL_RESUME,
711
713
  });
712
714
  if (this.isHeld() === true) {
713
715
  this.supplementaryServicesTimer = setTimeout(async () => {
714
- const errorContext = { file: CALL_FILE, method: this.handleCallResume.name };
716
+ const errorContext = { file: CALL_FILE, method: METHODS.HANDLE_CALL_RESUME };
715
717
  log.warn('Resume response timed out', {
716
718
  file: CALL_FILE,
717
- method: this.handleCallResume.name,
719
+ method: METHODS.HANDLE_CALL_RESUME,
718
720
  });
719
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);
720
722
  this.emit(CALL_EVENT_KEYS.RESUME_ERROR, callError);
@@ -726,17 +728,18 @@ export class Call extends Eventing {
726
728
  const extendedError = new Error(`Failed to resume the call: ${e}`);
727
729
  log.error(extendedError, {
728
730
  file: CALL_FILE,
729
- method: this.handleCallResume.name,
731
+ method: METHODS.HANDLE_CALL_RESUME,
730
732
  });
731
733
  const errData = e;
732
734
  handleCallErrors((error) => {
733
735
  this.emit(CALL_EVENT_KEYS.RESUME_ERROR, error);
734
736
  this.submitCallErrorMetric(error);
735
737
  this.sendCallStateMachineEvt({ type: 'E_CALL_ESTABLISHED', data: errData });
736
- }, 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);
737
739
  await uploadLogs({
738
740
  correlationId: this.correlationId,
739
741
  callId: this.callId,
742
+ broadworksCorrelationInfo: this.broadworksCorrelationInfo,
740
743
  });
741
744
  }
742
745
  }
@@ -749,20 +752,20 @@ export class Call extends Eventing {
749
752
  if (data?.callProgressData?.inbandMedia) {
750
753
  log.log('Inband media present. Setting Early Media flag', {
751
754
  file: CALL_FILE,
752
- method: this.handleIncomingCallProgress.name,
755
+ method: METHODS.HANDLE_INCOMING_CALL_PROGRESS,
753
756
  });
754
757
  this.earlyMedia = true;
755
758
  }
756
759
  else {
757
760
  log.log('Inband media not present.', {
758
761
  file: CALL_FILE,
759
- method: this.handleIncomingCallProgress.name,
762
+ method: METHODS.HANDLE_INCOMING_CALL_PROGRESS,
760
763
  });
761
764
  }
762
765
  if (data?.callerId) {
763
766
  log.info('Processing Caller-Id data', {
764
767
  file: CALL_FILE,
765
- method: this.handleIncomingCallProgress.name,
768
+ method: METHODS.HANDLE_INCOMING_CALL_PROGRESS,
766
769
  });
767
770
  this.startCallerIdResolution(data.callerId);
768
771
  }
@@ -777,19 +780,19 @@ export class Call extends Eventing {
777
780
  if (!this.mediaConnection) {
778
781
  log.info('Media connection is not up, buffer the remote Offer Request for later handling', {
779
782
  file: CALL_FILE,
780
- method: this.handleIncomingRoapOfferRequest.name,
783
+ method: METHODS.HANDLE_INCOMING_ROAP_OFFER_REQUEST,
781
784
  });
782
785
  this.seq = message.seq;
783
786
  log.info(`Setting Sequence No: ${this.seq}`, {
784
787
  file: CALL_FILE,
785
- method: this.handleIncomingRoapOfferRequest.name,
788
+ method: METHODS.HANDLE_INCOMING_ROAP_OFFER_REQUEST,
786
789
  });
787
790
  this.remoteRoapMessage = message;
788
791
  }
789
792
  else if (this.receivedRoapOKSeq === message.seq - 2) {
790
793
  log.info('Waiting for Roap OK, buffer the remote Offer Request for later handling', {
791
794
  file: CALL_FILE,
792
- method: this.handleIncomingRoapOfferRequest.name,
795
+ method: METHODS.HANDLE_INCOMING_ROAP_OFFER_REQUEST,
793
796
  });
794
797
  this.remoteRoapMessage = message;
795
798
  }
@@ -808,24 +811,25 @@ export class Call extends Eventing {
808
811
  const res = await this.patch(MobiusCallState.ALERTING);
809
812
  log.log(`PATCH response: ${res.statusCode}`, {
810
813
  file: CALL_FILE,
811
- method: this.handleOutgoingCallAlerting.name,
814
+ method: METHODS.HANDLE_OUTGOING_CALL_ALERTING,
812
815
  });
813
816
  }
814
817
  catch (err) {
815
818
  const extendedError = new Error(`Failed to signal call progression: ${err}`);
816
819
  log.error(extendedError, {
817
820
  file: CALL_FILE,
818
- method: this.handleOutgoingCallAlerting.name,
821
+ method: METHODS.HANDLE_OUTGOING_CALL_ALERTING,
819
822
  });
820
823
  const errData = err;
821
824
  handleCallErrors((error) => {
822
825
  this.emit(CALL_EVENT_KEYS.CALL_ERROR, error);
823
826
  this.submitCallErrorMetric(error);
824
827
  this.sendCallStateMachineEvt({ type: 'E_UNKNOWN', data: errData });
825
- }, 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);
826
829
  await uploadLogs({
827
830
  correlationId: this.correlationId,
828
831
  callId: this.callId,
832
+ broadworksCorrelationInfo: this.broadworksCorrelationInfo,
829
833
  });
830
834
  }
831
835
  }
@@ -848,7 +852,7 @@ export class Call extends Eventing {
848
852
  if (!this.remoteRoapMessage) {
849
853
  log.warn('Offer not yet received from remote end... Exiting', {
850
854
  file: CALL_FILE,
851
- method: this.handleOutgoingCallConnect.name,
855
+ method: METHODS.HANDLE_OUTGOING_CALL_CONNECT,
852
856
  });
853
857
  return;
854
858
  }
@@ -857,24 +861,25 @@ export class Call extends Eventing {
857
861
  const res = await this.patch(MobiusCallState.CONNECTED);
858
862
  log.log(`PATCH response: ${res.statusCode}`, {
859
863
  file: CALL_FILE,
860
- method: this.handleOutgoingCallConnect.name,
864
+ method: METHODS.HANDLE_OUTGOING_CALL_CONNECT,
861
865
  });
862
866
  }
863
867
  catch (err) {
864
868
  const extendedError = new Error(`Failed to connect the call: ${err}`);
865
869
  log.error(extendedError, {
866
870
  file: CALL_FILE,
867
- method: this.handleOutgoingCallConnect.name,
871
+ method: METHODS.HANDLE_OUTGOING_CALL_CONNECT,
868
872
  });
869
873
  const errData = err;
870
874
  handleCallErrors((error) => {
871
875
  this.emit(CALL_EVENT_KEYS.CALL_ERROR, error);
872
876
  this.submitCallErrorMetric(error);
873
877
  this.sendCallStateMachineEvt({ type: 'E_UNKNOWN', data: errData });
874
- }, 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);
875
879
  await uploadLogs({
876
880
  correlationId: this.correlationId,
877
881
  callId: this.callId,
882
+ broadworksCorrelationInfo: this.broadworksCorrelationInfo,
878
883
  });
879
884
  }
880
885
  }
@@ -896,6 +901,11 @@ export class Call extends Eventing {
896
901
  file: CALL_FILE,
897
902
  method: METHODS.HANDLE_OUTGOING_CALL_DISCONNECT,
898
903
  });
904
+ uploadLogs({
905
+ correlationId: this.correlationId,
906
+ callId: this.callId,
907
+ broadworksCorrelationInfo: this.broadworksCorrelationInfo,
908
+ });
899
909
  }
900
910
  this.deleteCb(this.correlationId);
901
911
  this.unregisterListeners();
@@ -935,6 +945,11 @@ export class Call extends Eventing {
935
945
  file: CALL_FILE,
936
946
  method: METHODS.HANDLE_OUTGOING_CALL_DISCONNECT,
937
947
  });
948
+ uploadLogs({
949
+ correlationId: this.correlationId,
950
+ callId: this.callId,
951
+ broadworksCorrelationInfo: this.broadworksCorrelationInfo,
952
+ });
938
953
  }
939
954
  this.deleteCb(this.correlationId);
940
955
  this.unregisterListeners();
@@ -991,6 +1006,7 @@ export class Call extends Eventing {
991
1006
  await uploadLogs({
992
1007
  correlationId: this.correlationId,
993
1008
  callId: this.callId,
1009
+ broadworksCorrelationInfo: this.broadworksCorrelationInfo,
994
1010
  });
995
1011
  }
996
1012
  }, DEFAULT_SESSION_TIMER);
@@ -1010,7 +1026,7 @@ export class Call extends Eventing {
1010
1026
  try {
1011
1027
  this.setDisconnectReason();
1012
1028
  const response = await this.delete();
1013
- log.log(`handleOutgoingCallDisconnect: Response code: ${response.statusCode}`, {
1029
+ log.log(`Response code: ${response.statusCode}`, {
1014
1030
  file: CALL_FILE,
1015
1031
  method: METHODS.HANDLE_UNKNOWN_STATE,
1016
1032
  });
@@ -1020,6 +1036,11 @@ export class Call extends Eventing {
1020
1036
  file: CALL_FILE,
1021
1037
  method: METHODS.HANDLE_UNKNOWN_STATE,
1022
1038
  });
1039
+ uploadLogs({
1040
+ correlationId: this.correlationId,
1041
+ callId: this.callId,
1042
+ broadworksCorrelationInfo: this.broadworksCorrelationInfo,
1043
+ });
1023
1044
  }
1024
1045
  this.deleteCb(this.correlationId);
1025
1046
  if (this.sessionTimer) {
@@ -1108,6 +1129,7 @@ export class Call extends Eventing {
1108
1129
  await uploadLogs({
1109
1130
  correlationId: this.correlationId,
1110
1131
  callId: this.callId,
1132
+ broadworksCorrelationInfo: this.broadworksCorrelationInfo,
1111
1133
  });
1112
1134
  }
1113
1135
  }
@@ -1163,6 +1185,7 @@ export class Call extends Eventing {
1163
1185
  await uploadLogs({
1164
1186
  correlationId: this.correlationId,
1165
1187
  callId: this.callId,
1188
+ broadworksCorrelationInfo: this.broadworksCorrelationInfo,
1166
1189
  });
1167
1190
  }
1168
1191
  }
@@ -1183,22 +1206,22 @@ export class Call extends Eventing {
1183
1206
  if (!message?.sdp) {
1184
1207
  log.info('Initializing Offer...', {
1185
1208
  file: CALL_FILE,
1186
- method: this.handleOutgoingRoapOffer.name,
1209
+ method: METHODS.HANDLE_OUTGOING_ROAP_OFFER,
1187
1210
  });
1188
1211
  this.mediaConnection.initiateOffer();
1189
1212
  return;
1190
1213
  }
1191
1214
  try {
1192
1215
  const res = await this.postMedia(message);
1193
- log.log(`handleOutgoingRoapOffer: Response code: ${res.statusCode}`, {
1216
+ log.log(`Response code: ${res.statusCode}`, {
1194
1217
  file: CALL_FILE,
1195
- method: this.handleOutgoingRoapOffer.name,
1218
+ method: METHODS.HANDLE_OUTGOING_ROAP_OFFER,
1196
1219
  });
1197
1220
  }
1198
1221
  catch (err) {
1199
1222
  log.warn('Failed to process MediaOk request', {
1200
1223
  file: CALL_FILE,
1201
- method: this.handleOutgoingRoapOffer.name,
1224
+ method: METHODS.HANDLE_OUTGOING_ROAP_OFFER,
1202
1225
  });
1203
1226
  const errData = err;
1204
1227
  handleCallErrors(this.getEmitterCallback(errData), ERROR_LAYER.MEDIA, (interval) => {
@@ -1207,10 +1230,11 @@ export class Call extends Eventing {
1207
1230
  this.sendMediaStateMachineEvt({ type: 'E_SEND_ROAP_OFFER', data: event.data });
1208
1231
  }, interval * 1000);
1209
1232
  }
1210
- }, this.getCorrelationId(), errData, this.handleOutgoingRoapOffer.name, CALL_FILE);
1233
+ }, this.getCorrelationId(), errData, METHODS.HANDLE_OUTGOING_ROAP_OFFER, CALL_FILE);
1211
1234
  await uploadLogs({
1212
1235
  correlationId: this.correlationId,
1213
1236
  callId: this.callId,
1237
+ broadworksCorrelationInfo: this.broadworksCorrelationInfo,
1214
1238
  });
1215
1239
  }
1216
1240
  }
@@ -1223,15 +1247,15 @@ export class Call extends Eventing {
1223
1247
  try {
1224
1248
  message.seq = this.seq;
1225
1249
  const res = await this.postMedia(message);
1226
- log.log(`handleOutgoingRoapAnswer: Response code: ${res.statusCode}`, {
1250
+ log.log(`Response code: ${res.statusCode}`, {
1227
1251
  file: CALL_FILE,
1228
- method: this.handleOutgoingRoapAnswer.name,
1252
+ method: METHODS.HANDLE_OUTGOING_ROAP_ANSWER,
1229
1253
  });
1230
1254
  }
1231
1255
  catch (err) {
1232
1256
  log.warn('Failed to send MediaAnswer request', {
1233
1257
  file: CALL_FILE,
1234
- method: this.handleOutgoingRoapAnswer.name,
1258
+ method: METHODS.HANDLE_OUTGOING_ROAP_ANSWER,
1235
1259
  });
1236
1260
  const errData = err;
1237
1261
  handleCallErrors(this.getEmitterCallback(errData), ERROR_LAYER.MEDIA, (interval) => {
@@ -1240,10 +1264,11 @@ export class Call extends Eventing {
1240
1264
  this.sendMediaStateMachineEvt({ type: 'E_SEND_ROAP_ANSWER', data: event.data });
1241
1265
  }, interval * 1000);
1242
1266
  }
1243
- }, this.getCorrelationId(), errData, this.handleOutgoingRoapAnswer.name, CALL_FILE);
1267
+ }, this.getCorrelationId(), errData, METHODS.HANDLE_OUTGOING_ROAP_ANSWER, CALL_FILE);
1244
1268
  await uploadLogs({
1245
1269
  correlationId: this.correlationId,
1246
1270
  callId: this.callId,
1271
+ broadworksCorrelationInfo: this.broadworksCorrelationInfo,
1247
1272
  });
1248
1273
  }
1249
1274
  }
@@ -1257,25 +1282,25 @@ export class Call extends Eventing {
1257
1282
  if (!this.mediaConnection) {
1258
1283
  log.info('Media connection is not up, buffer the remote offer for later handling', {
1259
1284
  file: CALL_FILE,
1260
- method: this.handleIncomingRoapOffer.name,
1285
+ method: METHODS.HANDLE_INCOMING_ROAP_OFFER,
1261
1286
  });
1262
1287
  this.seq = message.seq;
1263
1288
  log.info(`Setting Sequence No: ${this.seq}`, {
1264
1289
  file: CALL_FILE,
1265
- method: this.handleIncomingRoapOffer.name,
1290
+ method: METHODS.HANDLE_INCOMING_ROAP_OFFER,
1266
1291
  });
1267
1292
  }
1268
1293
  else if (this.receivedRoapOKSeq === message.seq - 2) {
1269
1294
  log.info('Waiting for Roap OK, buffer the remote offer for later handling', {
1270
1295
  file: CALL_FILE,
1271
- method: this.handleIncomingRoapOffer.name,
1296
+ method: METHODS.HANDLE_INCOMING_ROAP_OFFER,
1272
1297
  });
1273
1298
  this.remoteRoapMessage = message;
1274
1299
  }
1275
1300
  else {
1276
1301
  log.info('Handling new offer...', {
1277
1302
  file: CALL_FILE,
1278
- method: this.handleIncomingRoapOffer.name,
1303
+ method: METHODS.HANDLE_INCOMING_ROAP_OFFER,
1279
1304
  });
1280
1305
  this.seq = message.seq;
1281
1306
  if (this.mediaConnection) {
@@ -1313,6 +1338,7 @@ export class Call extends Eventing {
1313
1338
  await uploadLogs({
1314
1339
  correlationId: this.correlationId,
1315
1340
  callId: this.callId,
1341
+ broadworksCorrelationInfo: this.broadworksCorrelationInfo,
1316
1342
  });
1317
1343
  }
1318
1344
  };
@@ -1465,7 +1491,7 @@ export class Call extends Eventing {
1465
1491
  async patch(state) {
1466
1492
  log.info(`Send a PATCH for ${state} to Webex Calling`, {
1467
1493
  file: CALL_FILE,
1468
- method: this.patch.name,
1494
+ method: 'patch',
1469
1495
  });
1470
1496
  return this.webex.request({
1471
1497
  uri: `${this.mobiusUrl}${DEVICES_ENDPOINT_RESOURCE}/${this.deviceId}/${CALLS_ENDPOINT_RESOURCE}/${this.callId}`,
@@ -1528,7 +1554,7 @@ export class Call extends Eventing {
1528
1554
  default: {
1529
1555
  log.warn(`Unknown type for PUT request: ${type}`, {
1530
1556
  file: CALL_FILE,
1531
- method: this.postSSRequest.name,
1557
+ method: METHODS.POST_SS_REQUEST,
1532
1558
  });
1533
1559
  }
1534
1560
  }
@@ -1556,7 +1582,7 @@ export class Call extends Eventing {
1556
1582
  if (transferType === TransferType.BLIND && transferTarget) {
1557
1583
  log.info(`Initiating Blind transfer with : ${transferTarget}`, {
1558
1584
  file: CALL_FILE,
1559
- method: this.completeTransfer.name,
1585
+ method: METHODS.COMPLETE_TRANSFER,
1560
1586
  });
1561
1587
  const context = {
1562
1588
  transferorCallId: this.getCallId(),
@@ -1564,28 +1590,33 @@ export class Call extends Eventing {
1564
1590
  };
1565
1591
  try {
1566
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
+ });
1567
1597
  this.metricManager.submitCallMetric(METRIC_EVENT.CALL, TRANSFER_ACTION.BLIND, METRIC_TYPE.BEHAVIORAL, this.getCallId(), this.getCorrelationId(), undefined);
1568
1598
  }
1569
1599
  catch (e) {
1570
1600
  log.warn(`Blind Transfer failed for correlationId ${this.getCorrelationId()}`, {
1571
1601
  file: CALL_FILE,
1572
- method: this.completeTransfer.name,
1602
+ method: METHODS.COMPLETE_TRANSFER,
1573
1603
  });
1574
1604
  const errData = e;
1575
1605
  handleCallErrors((error) => {
1576
1606
  this.emit(CALL_EVENT_KEYS.TRANSFER_ERROR, error);
1577
1607
  this.submitCallErrorMetric(error, TRANSFER_ACTION.BLIND);
1578
- }, 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);
1579
1609
  await uploadLogs({
1580
1610
  correlationId: this.correlationId,
1581
1611
  callId: this.callId,
1612
+ broadworksCorrelationInfo: this.broadworksCorrelationInfo,
1582
1613
  });
1583
1614
  }
1584
1615
  }
1585
1616
  else if (transferType === TransferType.CONSULT && transferCallId) {
1586
1617
  log.info(`Initiating Consult transfer between : ${this.callId} and ${transferCallId}`, {
1587
1618
  file: CALL_FILE,
1588
- method: this.completeTransfer.name,
1619
+ method: METHODS.COMPLETE_TRANSFER,
1589
1620
  });
1590
1621
  const context = {
1591
1622
  transferorCallId: this.getCallId(),
@@ -1593,28 +1624,33 @@ export class Call extends Eventing {
1593
1624
  };
1594
1625
  try {
1595
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
+ });
1596
1631
  this.metricManager.submitCallMetric(METRIC_EVENT.CALL, TRANSFER_ACTION.CONSULT, METRIC_TYPE.BEHAVIORAL, this.getCallId(), this.getCorrelationId(), undefined);
1597
1632
  }
1598
1633
  catch (e) {
1599
1634
  log.warn(`Consult Transfer failed for correlationId ${this.getCorrelationId()}`, {
1600
1635
  file: CALL_FILE,
1601
- method: this.completeTransfer.name,
1636
+ method: METHODS.COMPLETE_TRANSFER,
1602
1637
  });
1603
1638
  const errData = e;
1604
1639
  handleCallErrors((error) => {
1605
1640
  this.emit(CALL_EVENT_KEYS.TRANSFER_ERROR, error);
1606
1641
  this.submitCallErrorMetric(error, TRANSFER_ACTION.CONSULT);
1607
- }, 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);
1608
1643
  await uploadLogs({
1609
1644
  correlationId: this.correlationId,
1610
1645
  callId: this.callId,
1646
+ broadworksCorrelationInfo: this.broadworksCorrelationInfo,
1611
1647
  });
1612
1648
  }
1613
1649
  }
1614
1650
  else {
1615
1651
  log.warn(`Invalid information received, transfer failed for correlationId: ${this.getCorrelationId()}`, {
1616
1652
  file: CALL_FILE,
1617
- method: this.completeTransfer.name,
1653
+ method: METHODS.COMPLETE_TRANSFER,
1618
1654
  });
1619
1655
  }
1620
1656
  }
@@ -1677,13 +1713,13 @@ export class Call extends Eventing {
1677
1713
  case RoapScenario.OFFER: {
1678
1714
  log.info(`before modifying sdp: ${event.roapMessage.sdp}`, {
1679
1715
  file: CALL_FILE,
1680
- method: this.mediaRoapEventsListener.name,
1716
+ method: METHODS.MEDIA_ROAP_EVENTS_LISTENER,
1681
1717
  });
1682
1718
  event.roapMessage.sdp = modifySdpForIPv4(event.roapMessage.sdp);
1683
1719
  const sdpVideoPortZero = event.roapMessage.sdp.replace(/^m=(video) (?:\d+) /gim, 'm=$1 0 ');
1684
1720
  log.info(`after modification sdp: ${sdpVideoPortZero}`, {
1685
1721
  file: CALL_FILE,
1686
- method: this.mediaRoapEventsListener.name,
1722
+ method: METHODS.MEDIA_ROAP_EVENTS_LISTENER,
1687
1723
  });
1688
1724
  event.roapMessage.sdp = sdpVideoPortZero;
1689
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';
@@ -148,6 +147,7 @@ export const METHODS = {
148
147
  HANDLE_OUTGOING_ROAP_ANSWER: 'handleOutgoingRoapAnswer',
149
148
  HANDLE_INCOMING_ROAP_OFFER: 'handleIncomingRoapOffer',
150
149
  HANDLE_INCOMING_ROAP_ANSWER: 'handleIncomingRoapAnswer',
150
+ INIT: 'init',
151
151
  FORCE_SEND_STATS_REPORT: 'forceSendStatsReport',
152
152
  UPDATE_ACTIVE_MOBIUS: 'updateActiveMobius',
153
153
  DEQUEUE_WS_EVENTS: 'dequeueWsEvents',
@@ -199,6 +199,7 @@ export const METHODS = {
199
199
  GET_CALL_RTP_STATS: 'getCallRtpStats',
200
200
  REGISTER: 'register',
201
201
  DEREGISTER: 'deregister',
202
+ DELETE_REGISTRATION: 'deleteRegistration',
202
203
  NORMALIZE_LINE: 'normalizeLine',
203
204
  LINE_EMITTER: 'lineEmitter',
204
205
  GET_LOGGING_LEVEL: 'getLoggingLevel',
@@ -210,7 +211,10 @@ export const METHODS = {
210
211
  SET_MOBIUS_SERVERS: 'setMobiusServers',
211
212
  HANDLE_CONNECTION_RESTORATION: 'handleConnectionRestoration',
212
213
  RECONNECT_ON_FAILURE: 'reconnectOnFailure',
213
- DETECT_NETWORK_CHANGE: 'detectNetworkChange',
214
+ MERCURY_OFFLINE: 'handleMercuryOffline',
215
+ MERCURY_ONLINE: 'handleMercuryOnline',
216
+ NETWORK_OFFLINE: 'handleNetworkOffline',
217
+ NETWORK_ONLINE: 'handleNetworkOnline',
214
218
  GET_CLIENT_REGION_INFO: 'getClientRegionInfo',
215
219
  GET_MOBIUS_SERVERS: 'getMobiusServers',
216
220
  REGISTER_CALLS_CLEARED_LISTENER: 'registerCallsClearedListener',
@@ -69,9 +69,6 @@ export default class Line extends Eventing {
69
69
  this.registration.setMobiusServers(this.#primaryMobiusUris, this.#backupMobiusUris);
70
70
  await this.registration.triggerRegistration();
71
71
  });
72
- if (this.mobiusDeviceId) {
73
- this.callManager.updateLine(this.mobiusDeviceId, this);
74
- }
75
72
  }
76
73
  async deregister() {
77
74
  log.info(METHOD_START_MESSAGE, {
@@ -93,6 +90,9 @@ export default class Line extends Eventing {
93
90
  this.rehomingIntervalMax = rehomingIntervalMax;
94
91
  this.voicePortalNumber = voicePortalNumber;
95
92
  this.voicePortalExtension = voicePortalExtension;
93
+ if (this.mobiusDeviceId) {
94
+ this.callManager.updateLine(this.mobiusDeviceId, this);
95
+ }
96
96
  }
97
97
  lineEmitter = (event, deviceInfo, lineError) => {
98
98
  log.info(METHOD_START_MESSAGE, {
@@ -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);
@@ -121,6 +122,14 @@ export class Registration {
121
122
  }
122
123
  return abort;
123
124
  }
125
+ async handle404KeepaliveFailure(caller) {
126
+ if (caller === KEEPALIVE_UTIL) {
127
+ const abort = await this.attemptRegistrationWithServers(caller);
128
+ if (!abort && !this.isDeviceRegistered()) {
129
+ await this.startFailoverTimer();
130
+ }
131
+ }
132
+ }
124
133
  async handle429Retry(retryAfter, caller) {
125
134
  if (caller === FAILBACK_UTIL) {
126
135
  if (this.failback429RetryAttempts >= REG_FAILBACK_429_MAX_RETRIES) {
@@ -140,6 +149,16 @@ export class Registration {
140
149
  await this.restartRegistration(REG_429_RETRY_UTIL);
141
150
  }
142
151
  }
152
+ else if (caller === KEEPALIVE_UTIL) {
153
+ this.clearKeepaliveTimer();
154
+ setTimeout(async () => {
155
+ log.log(`Resuming keepalive after ${retryAfter} seconds`, {
156
+ file: REGISTRATION_FILE,
157
+ method: REG_429_RETRY_UTIL,
158
+ });
159
+ await this.startKeepaliveTimer(this.deviceInfo.device?.uri, this.deviceInfo.keepaliveInterval, 'UNKNOWN');
160
+ }, retryAfter * 1000);
161
+ }
143
162
  else {
144
163
  this.retryAfter = retryAfter;
145
164
  }
@@ -354,18 +373,18 @@ export class Registration {
354
373
  });
355
374
  await this.mutex.runExclusive(async () => {
356
375
  if (retry) {
357
- log.log('Mercury connection is up again, re-registering with Webex Calling if needed', {
376
+ log.log('Network is up again, re-registering with Webex Calling if needed', {
358
377
  file: REGISTRATION_FILE,
359
- method: this.handleConnectionRestoration.name,
378
+ method: METHODS.HANDLE_CONNECTION_RESTORATION,
360
379
  });
361
380
  this.clearKeepaliveTimer();
362
381
  if (this.isDeviceRegistered()) {
363
382
  await this.deregister();
364
383
  }
365
384
  if (this.activeMobiusUrl) {
366
- const abort = await this.restorePreviousRegistration(this.handleConnectionRestoration.name);
385
+ const abort = await this.restorePreviousRegistration(METHODS.HANDLE_CONNECTION_RESTORATION);
367
386
  if (!abort && !this.isDeviceRegistered()) {
368
- await this.restartRegistration(this.handleConnectionRestoration.name);
387
+ await this.restartRegistration(METHODS.HANDLE_CONNECTION_RESTORATION);
369
388
  }
370
389
  }
371
390
  retry = false;
@@ -433,12 +452,12 @@ export class Registration {
433
452
  const resp = await this.postRegistration(url);
434
453
  this.deviceInfo = resp.body;
435
454
  this.registrationStatus = RegistrationStatus.ACTIVE;
455
+ this.setActiveMobiusUrl(url);
436
456
  this.lineEmitter(LINE_EVENTS.REGISTERED, resp.body);
437
- log.log(`Registration successful for deviceId: ${this.deviceInfo.device?.deviceId} userId: ${this.userId}`, {
457
+ log.log(`Registration successful for deviceId: ${this.deviceInfo.device?.deviceId} userId: ${this.userId} responseTrackingId: ${resp.headers?.trackingid}`, {
438
458
  file: REGISTRATION_FILE,
439
459
  method: METHODS.REGISTER,
440
460
  });
441
- this.setActiveMobiusUrl(url);
442
461
  this.setIntervalValues(this.deviceInfo);
443
462
  this.metricManager.setDeviceInfo(this.deviceInfo);
444
463
  this.metricManager.submitRegistrationMetric(METRIC_EVENT.REGISTRATION, REG_ACTION.REGISTER, METRIC_TYPE.BEHAVIORAL, caller, serverType, resp.headers?.trackingid ?? '', undefined, undefined);
@@ -466,6 +485,7 @@ export class Registration {
466
485
  }
467
486
  if (abort) {
468
487
  this.setStatus(RegistrationStatus.INACTIVE);
488
+ await uploadLogs();
469
489
  break;
470
490
  }
471
491
  }
@@ -494,7 +514,7 @@ export class Registration {
494
514
  this.webWorker.onmessage = async (event) => {
495
515
  const logContext = {
496
516
  file: REGISTRATION_FILE,
497
- method: this.startKeepaliveTimer.name,
517
+ method: KEEPALIVE_UTIL,
498
518
  };
499
519
  if (event.data.type === WorkerMessageType.KEEPALIVE_SUCCESS) {
500
520
  log.info(`Sent Keepalive, status: ${event.data.statusCode}`, logContext);
@@ -507,17 +527,21 @@ export class Registration {
507
527
  if (finalError) {
508
528
  this.lineEmitter(LINE_EVENTS.ERROR, undefined, clientError);
509
529
  }
510
- this.metricManager.submitRegistrationMetric(METRIC_EVENT.REGISTRATION, REG_ACTION.KEEPALIVE_FAILURE, METRIC_TYPE.BEHAVIORAL, KEEPALIVE_UTIL, serverType, error.headers?.trackingid ?? '', event.data.keepAliveRetryCount, clientError);
511
- }, { method: KEEPALIVE_UTIL, file: REGISTRATION_FILE });
530
+ this.metricManager.submitRegistrationMetric(METRIC_EVENT.KEEPALIVE_ERROR, REG_ACTION.KEEPALIVE_FAILURE, METRIC_TYPE.BEHAVIORAL, KEEPALIVE_UTIL, serverType, error.headers?.trackingid ?? '', event.data.keepAliveRetryCount, clientError);
531
+ }, { method: KEEPALIVE_UTIL, file: REGISTRATION_FILE }, (retryAfter, retryCaller) => this.handle429Retry(retryAfter, retryCaller));
512
532
  if (abort || event.data.keepAliveRetryCount >= RETRY_COUNT_THRESHOLD) {
513
533
  this.failoverImmediately = this.isCCFlow;
514
534
  this.setStatus(RegistrationStatus.INACTIVE);
515
535
  this.clearKeepaliveTimer();
516
536
  this.clearFailbackTimer();
517
537
  this.lineEmitter(LINE_EVENTS.UNREGISTERED);
538
+ await uploadLogs();
518
539
  if (!abort) {
519
540
  await this.reconnectOnFailure(KEEPALIVE_UTIL);
520
541
  }
542
+ else if (error.statusCode === 404) {
543
+ this.handle404KeepaliveFailure(KEEPALIVE_UTIL);
544
+ }
521
545
  }
522
546
  else {
523
547
  this.lineEmitter(LINE_EVENTS.RECONNECTING);