Skip to content

Commit

Permalink
Move RSA init to after ACGR init
Browse files Browse the repository at this point in the history
  • Loading branch information
Ranfis Francisco committed Oct 11, 2024
1 parent 01a6c8a commit d6198e0
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 31 deletions.
2 changes: 1 addition & 1 deletion release/connect-streams-dr-min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion release/connect-streams-dr.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion release/connect-streams-min.js

Large diffs are not rendered by default.

25 changes: 11 additions & 14 deletions release/connect-streams.js
Original file line number Diff line number Diff line change
Expand Up @@ -28186,9 +28186,6 @@ connect.core.setSoftphoneUserMediaStream = function (stream) {
ringtoneParamsStorage.clean();
}

// init StorageAccess with the incoming params
connect.storageAccess.init(params.ccpUrl, containerDiv, params.storageAccess || {});

// This is emitted further below as event bus and customer event callbacks are not created yet.
let acgrParamError = null;
if (params?.enableGlobalResiliency === true){
Expand All @@ -28207,6 +28204,9 @@ connect.core.setSoftphoneUserMediaStream = function (stream) {
}
}

// Placed after ACGR init since StorageAccess does not work with ACGR
connect.storageAccess.init(params.ccpUrl, containerDiv, params.storageAccess || {});

var iframe = connect.core._createCCPIframe(containerDiv, params);
// Build the upstream conduit communicating with the CCP iframe.
var conduit = new connect.IFrameConduit(params.ccpUrl, window, iframe);
Expand Down Expand Up @@ -28469,7 +28469,7 @@ connect.core.setSoftphoneUserMediaStream = function (stream) {
}
};

connect.core.onIframeRetriesExhausted = function(f) {
connect.core.onIframeRetriesExhausted = function (f) {
return connect.core.getEventBus().subscribe(connect.EventType.IFRAME_RETRIES_EXHAUSTED, f);
}

Expand Down Expand Up @@ -29173,11 +29173,11 @@ connect.core.setSoftphoneUserMediaStream = function (stream) {
window.sessionStorage.setItem(connect.SessionStorageKeys.AUTHORIZE_RETRY_COUNT, (connect.core._getAuthRetryCount() + 1).toString());
}

connect.core.onAuthorizeRetriesExhausted = function(f) {
connect.core.onAuthorizeRetriesExhausted = function (f) {
return connect.core.getEventBus().subscribe(connect.EventType.AUTHORIZE_RETRIES_EXHAUSTED, f);
}

connect.core.onCTIAuthorizeRetriesExhausted = function(f) {
connect.core.onCTIAuthorizeRetriesExhausted = function (f) {
return connect.core.getEventBus().subscribe(connect.EventType.CTI_AUTHORIZE_RETRIES_EXHAUSTED, f);
}

Expand All @@ -29200,12 +29200,12 @@ connect.core.setSoftphoneUserMediaStream = function (stream) {
};

/**-----------------------------------------------------------------------*/
connect.core.onConfigure = function(f) {
connect.core.onConfigure = function (f) {
return connect.core.getEventBus().subscribe(connect.ConfigurationEvents.CONFIGURE, f);
}

/**-----------------------------------------------------------------------*/
connect.core.onInitialized = function(f) {
/**-----------------------------------------------------------------------*/
connect.core.onInitialized = function (f) {
return connect.core.getEventBus().subscribe(connect.EventType.INIT, f);
}

Expand Down Expand Up @@ -29875,10 +29875,7 @@ connect.core.setSoftphoneUserMediaStream = function (stream) {
// Because normal flow is initCCP > init softphone manager,
// it is possible the softphone manager was not yet initialized
if (connect.core?.softphoneManager) {
connect
.getLog()
.info('[GR] Refreshing softphone manager RTC peer connection factory.')
.sendInternalLogToServer();
connect.getLog().info('[GR] Refreshing softphone manager RTC peer connection factory.').sendInternalLogToServer();
connect.core.softphoneManager._refreshRtcPeerConnectionFactory();
} else {
connect
Expand Down Expand Up @@ -29956,7 +29953,7 @@ connect.core.setSoftphoneUserMediaStream = function (stream) {
} to ${newActiveConduit?.region} / ${newActiveConduit?.name}`
)
.sendInternalLogToServer();

// We need to clear all sessions now as it is not guarenteed that a snapshot informing
// the softphone manager that the contact is ended will be received before the failover occurrs
connect.core?.softphoneManager?._clearAllSessions();
Expand Down
18 changes: 9 additions & 9 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1322,9 +1322,6 @@ connect.core.setSoftphoneUserMediaStream = function (stream) {
ringtoneParamsStorage.clean();
}

// init StorageAccess with the incoming params
connect.storageAccess.init(params.ccpUrl, containerDiv, params.storageAccess || {});

// This is emitted further below as event bus and customer event callbacks are not created yet.
let acgrParamError = null;
if (params?.enableGlobalResiliency === true){
Expand All @@ -1343,6 +1340,9 @@ connect.core.setSoftphoneUserMediaStream = function (stream) {
}
}

// Placed after ACGR init since StorageAccess does not work with ACGR
connect.storageAccess.init(params.ccpUrl, containerDiv, params.storageAccess || {});

var iframe = connect.core._createCCPIframe(containerDiv, params);
// Build the upstream conduit communicating with the CCP iframe.
var conduit = new connect.IFrameConduit(params.ccpUrl, window, iframe);
Expand Down Expand Up @@ -1605,7 +1605,7 @@ connect.core.setSoftphoneUserMediaStream = function (stream) {
}
};

connect.core.onIframeRetriesExhausted = function(f) {
connect.core.onIframeRetriesExhausted = function (f) {
return connect.core.getEventBus().subscribe(connect.EventType.IFRAME_RETRIES_EXHAUSTED, f);
}

Expand Down Expand Up @@ -2309,11 +2309,11 @@ connect.core.setSoftphoneUserMediaStream = function (stream) {
window.sessionStorage.setItem(connect.SessionStorageKeys.AUTHORIZE_RETRY_COUNT, (connect.core._getAuthRetryCount() + 1).toString());
}

connect.core.onAuthorizeRetriesExhausted = function(f) {
connect.core.onAuthorizeRetriesExhausted = function (f) {
return connect.core.getEventBus().subscribe(connect.EventType.AUTHORIZE_RETRIES_EXHAUSTED, f);
}

connect.core.onCTIAuthorizeRetriesExhausted = function(f) {
connect.core.onCTIAuthorizeRetriesExhausted = function (f) {
return connect.core.getEventBus().subscribe(connect.EventType.CTI_AUTHORIZE_RETRIES_EXHAUSTED, f);
}

Expand All @@ -2336,12 +2336,12 @@ connect.core.setSoftphoneUserMediaStream = function (stream) {
};

/**-----------------------------------------------------------------------*/
connect.core.onConfigure = function(f) {
connect.core.onConfigure = function (f) {
return connect.core.getEventBus().subscribe(connect.ConfigurationEvents.CONFIGURE, f);
}

/**-----------------------------------------------------------------------*/
connect.core.onInitialized = function(f) {
/**-----------------------------------------------------------------------*/
connect.core.onInitialized = function (f) {
return connect.core.getEventBus().subscribe(connect.EventType.INIT, f);
}

Expand Down
7 changes: 2 additions & 5 deletions src/global-resiliency.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@
// Because normal flow is initCCP > init softphone manager,
// it is possible the softphone manager was not yet initialized
if (connect.core?.softphoneManager) {
connect
.getLog()
.info('[GR] Refreshing softphone manager RTC peer connection factory.')
.sendInternalLogToServer();
connect.getLog().info('[GR] Refreshing softphone manager RTC peer connection factory.').sendInternalLogToServer();
connect.core.softphoneManager._refreshRtcPeerConnectionFactory();
} else {
connect
Expand Down Expand Up @@ -121,7 +118,7 @@
} to ${newActiveConduit?.region} / ${newActiveConduit?.name}`
)
.sendInternalLogToServer();

// We need to clear all sessions now as it is not guarenteed that a snapshot informing
// the softphone manager that the contact is ended will be received before the failover occurrs
connect.core?.softphoneManager?._clearAllSessions();
Expand Down

0 comments on commit d6198e0

Please sign in to comment.