Generic Database
The generic database plugin allows Noojee Answer to use an external database to map caller details into a url or fragment of javascript, paste data, caller name and display text.
JDBC
The generic database plugin uses JDBC (java's equivalent of ODBC) to access virtually any database.
The plugin needs the following configuration information:
- Database connection URL
- Database Class
- Query to return the data that takes 8 parameters and returns 4 fields.
The stored proc will be passed the following information.
Two version of the stored proc are supported. One that returns a set of URL that are to be poped and an alternate version that returns a fragment of javascript which will be executed within the browser.
The URL method is suitable for older page based web applications where each page is accessed by a unique URL. For new Web 2.0 web applications that operate multiple pages from a single URL the javascript method must be used.
To use the URL method use the following stored procedure name:
getData
"JdbcPlugin": {
"params.jdbcUrl": "jdbc:sqlserver://host;DatabaseName=xxxxxxx;user=xxxxxxxx;password=xxxxxxxxx",
"params.driverClass": "com.microsoft.sqlserver.jdbc.SQLServerDriver",
"params.query": "exec getData ?,?,?,?,?,?,?,?",
"channelVariables": ["UNIQUEID","UNIQUEID","UNIQUEID","UNIQUEID","UNIQUEID","UNIQUEID"]
}
The getData method can return one or more URL's each of which will be opened in a browser window or tab.
getJAVA
The java fragment will be executed within the page which hosts Noojee Answer. The fragment will normally call some existing javascript API within your CRM which will display the appropriate data (account, contact) with in your CRM.
To use the javascript method use the following stored procedure name:
For example:
"JdbcPlugin": {
"params.jdbcUrl": "jdbc:sqlserver://host;DatabaseName=xxxxxxx;user=xxxxxxxx;password=xxxxxxxxx",
"params.driverClass": "com.microsoft.sqlserver.jdbc.SQLServerDriver",
"params.query": "exec getJAVA ?,?,?,?,?,?,?,?",
"channelVariables": ["UNIQUEID","UNIQUEID","UNIQUEID","UNIQUEID","UNIQUEID","UNIQUEID"]
}
Note: the parameter names used in the stored procedure are not actually important. It is the ORDER of the parameters that is CRITICAL!
The following table details each parameter and the order they must be defined in the stored procedures signature.
Name | Type | Description |
callerIdNum | varchar(25) | The callers phone number stripped of any spaces. The exact format will depend on how your phone system is configured. |
exten | varchar(25) | The agent's SIP extension that the call is being delivered to. |
didNumber | varhcar(25) | The direct in dial (DID) that the call came in on. |
queueName | varchar(50) | The queue that the call passed through (if any) |
V1 | varchar(50) | Asterisk channel variable, if a <channelVariable> tag is defined or an empty string |
V2 | varchar(50) | Asterisk channel variable, if a <channelVariable> tag is defined or an empty string |
V3 | varchar(50) | Asterisk channel variable, if a <channelVariable> tag is defined or an empty string |
V4 | varchar(50) | Asterisk channel variable, if a <channelVariable> tag is defined or an empty string |
The query must return one or more rows containing the following fields, in this order
Field | Type | Description |
---|---|---|
DisplayData | varchar | The DisplayData is simple text which is displayed to the agent before the call is answered. This can be as simple as the Accout Name or could contain the Account Type, outstanding balance or whatever other data you want to display to the agent. |
PasteData | varchar | The pastedata is used by the CopyToClipboardCopy To Clipboard and will be placed on the agents clipboard if the agents clicks the 'copy' tool. |
Url | varchar | A URL to screen pop when the call is answered. |
CallerName | varchar | The callers name which is displayed along with the DisplayData before a call is answered. |
The data from the first row will be used by most tools. The url from each row will be used for screen pops, each url will be popped in it's own tab.
Sample Configuration
Note: Escaping special characters
You might have to escape certain parts of the jdbcURL value because of the inclusion of special characters such as spaces, semicolons, and quotation marks. The JDBC driver supports escaping these characters if they are enclosed in braces. For example, {;} escapes a semicolon.
Escaped values can contain special characters (especially '=', ';', '[]', and space) but cannot contain braces. Values that must be escaped and contain braces should be added to a properties collection.
Noojee recommend that your database name only contain alphnumeric characters.
"plugins": { "JdbcPlugin": { "params.jdbcUrl": "jdbc:sqlserver://host;DatabaseName=xxxxxxx;user=xxxxxxxx;password=xxxxxxxxx", "params.driverClass": "com.microsoft.sqlserver.jdbc.SQLServerDriver", "params.query": "exec getJAVA ?,?,?,?,?,?,?,?", "channelVariables": ["UNIQUEID","UNIQUEID","UNIQUEID","UNIQUEID","UNIQUEID","UNIQUEID"], "filter":{ "didPattern":"410", "queue":"test" } }