When you integrate Click to Call and Commerce Service Center with an external CTI system, you need to provide the CTI system with a URL that accesses the Click to Call information. Before you can configure the Commerce Service Center portion of the configuration, ensure that your external CTI system can produce a hash that Commerce Service Center will be able to reproduce.
The hash key can be set manually or set in a system repository. Hash keys are not available in clear text in a configuration file. Hash keys that are set in a system repository can be obtained using the C2CTools
property from the Dynamo Server Admin.
One you have the hash key, generate a script. For example:
/**
*
* Generates the URL that is used to spawn a CSC instance passing the required
* parameters for a Click To Connect Session
*
* @param pURL
* The initial part of the CSC URL e.g. http: //foo: 8080/agent/main
* @param pUsername
* The username of the CSC user
* @param pCallerID
* The caller id of the customer
* @return The fully qualified URL
*
*/
public URL generateURL(String pURL, String pUsername, String pCallerID) throws \
MalformedURLException, UnsupportedEncodingException {
// hashKey is the secret key used to salt the hash, this secret key is also
//configured within CSC and should be identical to what is used here.
final String hashKey = "mySecretKey
";
// hashingAlgorithim is the algorithm used to create the hash. The algorithm
//should be the same as is configured within CSC in order for CSC to recreate the
//hash.
final String hashingAlgoritim = "SHA1";
// hashText is the information that the hash is created from, the Agent username,
//customer telephone number and the hashKey.
String hashText = pUsername + pCallerID + hashKey;
String clickToCallURLString = "";
String hashString = "";
/*
* Create hash of the username, callerID and the hashKey. The Hashing algorithm
* used is SHA1, matching the hashing algorithm that CSC is configured to use.
*/
try {
MessageDigest m = MessageDigest.getInstance(hashingAlgoritim);
m.update(hashText.getBytes(), 0, hashText.length());
hashString = new BigInteger(1, m.digest()).toString(16).trim();
} catch (NoSuchAlgorithmException nsae) {
}
/*
* The URL is created from the initial CSC URL e.g http: //foo: 8080/agent, the
* clickToCallInit parameter, the Agent username, the hash value, and the
* telephone number of the shopper who initiated the click to call session
*/
clickToCallURLString += pURL + "?clickToCallInit=true&username="
+ URLEncoder.encode(pUsername, "UTF-8") + "&hash="
+ URLEncoder.encode(hashString, "UTF-8") + "&UserTelephoneNumber="
+ URLEncoder.encode(pCallerID, "UTF-8");
URL clickToCallURL = new URL(clickToCallURLString);
return clickToCallURL;
}
Once you have verified that your CTI system can produce the necessary hash and URL, create a script that integrates your system. The script should:
Get the username, user telephone number, secret key, and Commerce Service Center URL variables.
Set the
checkFTCallID
property of the/atg/svc/clicktoconnect/C2CTools
component tofalse
on the Commerce Service Center server.Create a hash of the username, user telephone number, and the secret key.
Generate a Web browser with a URL made up of the following:
The URL is made up of the following components:
Commerce Service Center URL (
http://
cscserver
:
port
/agent/main.jsp
)The
clickToCallInit=true
variableThe agent user name
The hash made earlier
The customer telephone number
The following is an example of a URL:
http://localhost:8080/main.jsp?clickToCallInit=true&username=bsmith&hash=5dd9701wtf3f&estara_fsguid=03891CD515C19&callid=newgui_58478%3A122.1.34%2A80%3A05504.2118&UserTelephoneNumber=4411411414