function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
HoldcroftHoldcroft 

Problem with CTI Toolkit 4.0 Autologin

Hello,

 

I'm having difficulty with CTI Toolkit 4.0 with regard to Autologin:  I turn off autologin (to the phone system) as described at https://login.salesforce.com/help/doc/en/cti_login.htm, and then I close my browser.  When I restart the browser and log in to Salesforce again, I get unexpectedly automatically logged in to the phone system.  It didn't do this with Toolkit 3.0.

 

Does anybody else have this problem, or is able to offer help towards a solution, please?

 

Thanks,

 

James.

jarsjars

Odd... Did you also try restarting the SalesforceCTI.exe? Perhaps that will force cleaning up all cached values?

 

Cheers,

jars

HoldcroftHoldcroft

Yes, restarting SalesforceCTI.exe clears the cache.

 

James.

HoldcroftHoldcroft

After a little more investigation, it would seem that this problem is because the Browser Connector is not telling the CTI Connector when the user logs out.  I think that there should be an "EXIT" message sent.

 

Upon logout with CTI Toolkit 4, there is no evidence in the logs of any activity by either SalesforceCTI.exe or my adapter DLL.

 

Whereas, upon logout, with CTI Toolkit 3, I get:

 

browser_connector.log:
01/26/2012 13:48:09: CShellEventHandler::CheckForLogout: Found 2 browsers. 01/26/2012 13:48:09: CShellEventHandler::CheckForLogout: Attempting to get Browser 01/26/2012 13:48:09: CShellEventHandler::CheckForLogout: Browser 0 is at file:///C:/Program%20Files%20(x86)/Envox/PhoneLink%203 01/26/2012 13:48:09: CShellEventHandler::CheckForLogout: Attempting to get Browser 01/26/2012 13:48:09: CShellEventHandler::CheckForLogout: Browser 1 is at https://na1.salesforce.com/secur/logout.jsp?product=www.salesforce.com 01/26/2012 13:48:09: CShellEventHandler::CheckForLogout: No logged in browser found 01/26/2012 13:48:09: CBrowserEventHandler::UpdateSid: Logging out current user and unloading his adapter. 01/26/2012 13:48:09: CAdapterLink::sendCommand: Command received EXIT 01/26/2012 13:48:09: Sending XML message: <?xml version="1.0" encoding="UTF-8"?><MESSAGE ID="EXIT"> </MESSAGE> 01/26/2012 13:48:09: CBrowserEventHandler::TransformBuffer: Creating XML from thread 5200. 01/26/2012 13:48:09: CIEEventHandler::UpdateSoftphone: Found softphone div, replacing inner html. 01/26/2012 13:48:09: CIEEventHandler::UpdateSoftphone: COM error while replacing inner html: Access is denied.. 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: Found 2 browsers. 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: Attempting to get Browser 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: Browser 0 is at file:///C:/Program%20Files%20(x86)/Envox/PhoneLink%203 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: Attempting to get Browser 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: Browser 1 is at https://login.salesforce.com/?product=www.salesforce.com 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: No logged in browser found 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: Found 2 browsers. 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: Attempting to get Browser 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: Browser 0 is at file:///C:/Program%20Files%20(x86)/Envox/PhoneLink%203 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: Attempting to get Browser 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: Browser 1 is at https://login.salesforce.com/?product=www.salesforce.com 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: No logged in browser found 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: Found 2 browsers. 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: Attempting to get Browser 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: Browser 0 is at file:///C:/Program%20Files%20(x86)/Envox/PhoneLink%203 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: Attempting to get Browser 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: Browser 1 is at https://login.salesforce.com/?product=www.salesforce.com 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: No logged in browser found 01/26/2012 13:48:11: CShellEventHandler::RemoveRevokedBrowsers: Total browsers # : 2 01/26/2012 13:48:11: CShellEventHandler::RemoveRevokedBrowsers: Found 1 browsers to unregister. 01/26/2012 13:48:11: CShellEventHandler::RemoveRevokedBrowsers: Keeping: file:///C:/Program%20Files%20(x86)/Envox/PhoneLink%203 01/26/2012 13:48:11: CShellEventHandler::RemoveRevokedBrowsers: Unregistered browser. 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: Found 1 browsers. 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: Attempting to get Browser 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: Browser 0 is at file:///C:/Program%20Files%20(x86)/Envox/PhoneLink%203 01/26/2012 13:48:11: CShellEventHandler::CheckForLogout: No logged in browser found

 

cti_connector.log:
01/26/2012 13:48:09: CCTIUserInterface::UIHandleMessage: Message received: EXIT. Parameters: 01/26/2012 13:48:09: CCTIUserInterface::OnAgentStateChange: LOGOUT. 01/26/2012 13:48:09: Sending XML (len 649): <CTIUserInterface LOGGED_IN="false"><CTIForm><CTIStaticText ID="ENTER_LOGIN"/><CTIStaticText ID="ENTER_LOGIN" LABEL="Line 1 - Agent"/><CTIEditBox ID="EXTENSION" VALUE="2004"/><CTIEditBox ID="AGENT_ID" VALUE=""/><CTIEditBox ID="ACD_QUEUE_DN" LABEL="ACD Queue" VALUE=""/><CTIEditBox ID="PASSWORD" PASSWORD="true" VALUE=""/><CTIStaticText ID="ENTER_LOGIN" LABEL="Line 2 - Standard DN"/><CTIEditBox ID="EXTENSION2" LABEL="Extension" VALUE="2005"/><CTIButton COLOR="GREEN" ID="LOGIN" LONG_STYLE="true"/></CTIForm><CTILogo IMAGE_URL="https://na1.salesforce.com/servlet/servlet.ImageServer?oid=00D300000006oOZ&amp;id=01530000000BN7U"/></CTIUserInterface> 01/26/2012 13:48:09: CCTIUserInterface::EnableAgentStates: New agent state: LOGOUT. 01/26/2012 13:48:09: CCtcEventSink::GetEventThread exiting normally. 01/26/2012 13:48:09: CCtcEventSink::GetEventThread exiting normally. 01/26/2012 13:48:10: CCTIUserInterface::OnCTIConnectionClosed: Connection closed. 01/26/2012 13:48:10: Sending XML (len 649): <CTIUserInterface LOGGED_IN="false"><CTIForm><CTIStaticText ID="ENTER_LOGIN"/><CTIStaticText ID="ENTER_LOGIN" LABEL="Line 1 - Agent"/><CTIEditBox ID="EXTENSION" VALUE="2004"/><CTIEditBox ID="AGENT_ID" VALUE=""/><CTIEditBox ID="ACD_QUEUE_DN" LABEL="ACD Queue" VALUE=""/><CTIEditBox ID="PASSWORD" PASSWORD="true" VALUE=""/><CTIStaticText ID="ENTER_LOGIN" LABEL="Line 2 - Standard DN"/><CTIEditBox ID="EXTENSION2" LABEL="Extension" VALUE="2005"/><CTIButton COLOR="GREEN" ID="LOGIN" LONG_STYLE="true"/></CTIForm><CTILogo IMAGE_URL="https://na1.salesforce.com/servlet/servlet.ImageServer?oid=00D300000006oOZ&amp;id=01530000000BN7U"/></CTIUserInterface> 01/26/2012 13:48:10: CCTIAppExchange::Reset: Clearing all cached info. 01/26/2012 13:48:10: UserId set to .

 

Any ideas as to how I might fix or work-around this problem would be most welcome.

 

Thanks,

 

James.

HoldcroftHoldcroft

I've modified CCTIUserInterface::UIHandleMessage so that when it receives an UPDATE_SID message and autologin is not enabled, it calls CTILogout:

 

	} else if (message==KEY_UPDATE_SID) {
		// CTI Toolkit 3.0 Browser Connector sends an EXIT message when you log out of Salesforce
		// Unfortunately CTI Toolkit 4.0 doesn't, so here's a kludge to simulate it when we get
		// the next message upon re-login.  Trusting that it works with no nasty side-effects...
		if (!GetAutoLogin())
		{
			CCTILogger::Log(LOGLEVEL_HIGH,L"CCTIUserInterface::UIHandleMessage: Logging out of previous session");
			PARAM_MAP no_parameters;
			CTILogout(no_parameters);
		}
		UIUpdateSid(parameters);

 

It seems to work for me when I try it.  Can you see any problems with this (rather kludged) work-around?

 

James.

jarsjars

Hi James,

 

I think there's a bug in the toolkit. The BrowserConnector should be receiving an EXIT command (and delivering it to the adapter) everytime there's a logout from Salesforce.com.

 

My scenario is:

 

1- User logs in to my call center

2- the user is ready, working, ... in the call center

3- the agent logs out from Salesforce.com and doesn't logout through the softphone and thus "my" adapter never gets to know what happened!

4- the salesforce user logins again and... gets the old session that is still logged in to the call center.

 

I am not 100% sure but I think that's what happens in your case also.

 

Of course that we'll have a problem whenever the agent simply closes the browser! (at least if salesforce.com is not able to trap the browser closing event and sending that EXIT message when that happens...)

 

Cheers,

jars

HoldcroftHoldcroft

Jars,

 

Yes, that's my scenario too.  I will report it through our Salesforce support contact.

 

I think I'll make my work-around configurable, just in case we come across any nasty side effects.

 

Thanks,

 

James.

sfdcAnonsfdcAnon

With CTI-4.0 we moved a web based model for the CTI adapter. This means that the session times out not when browser windows close, but when the the session timeout, as specified in AdapterExitWaitTime runs out.

 

The issue described in here is hard to solve in this new web based model. The best approach at the moment is to ping the salesforce web service from the adapter to check if the session still exists. A flavor of this approach is shown in the code above. This should work fine in most cases. Where it falls short is if there are stale pages are open from a previous session while the agent is looking at a browser page in the current session.

 

An alternative to this is to ping for salesforce session validity every minute. This can be done in the BrowserConnector project ( maybe BrowserHttpListener). The code for this already exists in BrowserHttpListener.isValidRequest

 

       

            sForceBinding.SessionHeaderValue = new SessionHeader() { sessionId = sid };
                GetUserInfoResult userInfo = null;
                try
                {
                    userInfo = sForceBinding.getUserInfo();
                }
                catch (SoapException se)
                {
                    Logger.WriteLogEntry(Logger.LOGLEVEL_HIGH, "BrowserHttpListener.isValidRequest: API call failed due to " + se.Code, se);
                    return false;
                }

                validSids.Add(sid, userInfo.userId);
                return true;

 Here. we check to see if the session id is valid. If the agent has hit the logout button in salesforce, the session id will become invalid. By using latest seen sid, we can ensure that within 1 minute of the agent's logout, we exit the adapter.The exit message would be sent via the AdapterLink.SendCommand method.

 

This does not maintain parity with the 3.0 adapter in terms of immediate notification of the agent's browser close. However, this is almost impossible with the new web based model of the CTI-4.0, where all the salesforcecti.exe is in the browser javascript.

 

We'll add this ping feature to our back log for 4.01.

 

Happy to provide more input if needed.

 

 

There

desktopIntegrationdesktopIntegration

Hi Gautam,

 

I m using the CTI toolkit 4.01 and still facing the same issue.

The CTI adapter does not exit if agent logs-out of the salesforce application.

 

Steps:

1. Agent login to salesforce

2. Agent login into the CTI adapter

3. Agent works for some time

4. Agent logs-out of the salesforce and does not exit the CTI adapter.

5. Agent re-logins after 1+ mins and sees the CTI adapter with the previous cached state.

 

Please let me if  there is some code implemention that needs to be done on the CTI adapter part to fix this.

 

Regards,

Shubha

 

sfdcAnonsfdcAnon

This will resolved with the 4.02 adapter coming out at the end of this month. 2 config options will allow you to specify the time out after logout after which the adaper receives the exit message.