Introduction
本文在脚本描述如何配置在智能联络管理器(ICM)的DBLookup功能为了拿来从外部数据库的数据和使用它。为了说明如何配置功能,本文使用用户设法识别的示例情景,如果呼叫人是列表的一部分(例如,为了提供优先服务)。
Prerequisites
Requirements
There are no specific requirements for this document.
Components Used
This document is not restricted to specific software and hardware versions.
The information in this document was created from the devices in a specific lab environment.All of the devices used in this document started with a cleared (default) configuration.If your network is live, make sure that you understand the potential impact of any command.
Configure
- 创建数据库。
首先,请创建数据库。在Miscrosoft SQL server管理工作室,请用鼠标右键单击数据库并且选择新的数据库: 其次,请创建在此数据库的一张表。用鼠标右键单击表在新建立的数据库下。然后,您能添加一些列:
Note:定义所有整数域在DBLookup节点获取的表里如不是NULL。仅这些数据类型为SQL数据库支持:SQLINT1 (tinyint), SQLINT2 (smallint), SQLINT4 (int), SQLCHAR (字符), SQLVARCHAR (varchar), SQLFLT4DBFLT4 (实际), SQLFLT8DBFLT8 (浮动)和SQLDATETIME (时间)。您必须定义除了SQLDATETIME、SQLVARCHAR和SQLCHAR的所有字段如不是NULL字段。您能定义这三个字段成NULL。
因为允许灵活性也有在编号的字符请选择varchar数据类型。为了设置电话列作为主密钥,请不选定准许使无效在复选框。为了设置此列作为主密钥,请用鼠标右键单击并且选择集合主密钥:
一旦这些步骤完成,请保存更改。现在,您能添加数据到您的表:
- 配置ICM为了连接到此数据库。
请使用配置管理器在Explorer工具下为了打开数据库查找Explorer。然后,请添加新建立的数据库和列: 默认情况下,因为系统以一个空密码使用sa您也需要配置用户名/密码为了登陆到数据库。用此键配置在注册的用户名/密码:
HKEY_LOCAL_MACHINE\SOFTWARE\Cisco Systems,
Inc.\ICM\inst1\RouterA\Router\CurrentVersion\Configuration\Database\SQLLogin
此示例显示您如何能用域用户配置键:
\\POD2SPRAWLA\DBLookup=(ZFB\Administrator,password)
Note:请勿使用以下特殊字符在密码:“=”, ")”, “(", “”, “?”, “\”, “/”
-
保证您选择Enable (event)在编辑路由器屏幕的数据库路由,在Web接口设置的路由器可以被获取:
- 请使用此数据库在脚本。
添加DBLookup节点并且指定在哪张表里您要搜索。此示例显示优先级表的搜索与CallingLineID的。由于nchar被选择了作为数据类型,您必须转换编号成字符串,在您输入查找前: 查找在设置作为主密钥的列发生。以后,您能使用从同一行的数据填充呼叫变量。此示例显示另一列的添加,城市,在数据库和在配置管理器,在脚本可以被填充:
Verify
请使用此部分确认DB工作人员能连接到外部数据库。创建包含日志的txt文件dbw.txt,自从DB工作人员进程的最后重新启动:
C:\Users\Administrator.ZFB>cdlog <instance_name> ra
C:\icm\inst1\ra\logfiles>dumplog dbw /o /ms /last
验证DB工作人员能连接到数据库用dbw.txt :
12:39:08:413 ra-dbw Trace: Attempting integrated security open of
POD2SPRAWLA using ZFB\Administrator
12:39:08:451 ra-dbw Trace: Sucessfully impersonated ZFB\Administrator
12:39:08:476 ra-dbw Trace: 'id' is column 2 in sysobjects.
12:39:08:477 ra-dbw Trace: ID for table Priority is 5575058
12:39:08:484 ra-dbw Trace: Columns for Priority:
12:39:08:484 ra-dbw Trace: Column 1: Phone, type=47, length=30
12:39:08:536 ra-dbw Trace: Primary key for Priority is Phone, column 1.
12:39:08:557 ra-dbw Trace: Created connection to POD2SPRAWLA,DBLookup for thread 0
12:39:08:557 ra-dbw Trace: Created connection to POD2SPRAWLA,DBLookup for thread 1
12:39:08:558 ra-dbw Trace: Created connection to POD2SPRAWLA,DBLookup for thread 2
12:39:08:558 ra-dbw Trace: Created connection to POD2SPRAWLA,DBLookup for thread 3
12:39:08:558 ra-dbw Trace: Created connection to POD2SPRAWLA,DBLookup for thread 4
12:39:08:558 ra-dbw Trace: ScriptTable Piority is now available.
12:39:08:559 ra-dbw Trace: ScriptTable Piority (ID 5000) connected to
POD2SPRAWLA,DBLookup,Priority
12:39:08:559 ra-dbw Trace: Internal connect for POD2SPRAWLA,DBLookup,Priority
12:39:08:559 ra-dbw Trace: 'id' is column 2 in sysobjects.
12:39:08:560 ra-dbw Trace: ID for table Priority is 5575058
12:39:08:560 ra-dbw Trace: Columns for Priority:
12:39:08:560 ra-dbw Trace: Column 1: Phone, type=47, length=30
12:39:08:561 ra-dbw Trace: Primary key for Priority is Phone, column 1.
12:39:08:561 ra-dbw Trace: Column Phone (ID 5002) is table column 1, type 47.
12:39:08:561 ra-dbw Trace: ScriptTable Piority (ID 5000) connected to
POD2SPRAWLA,DBLookup,Priority
DB工作人员日志显示此回应,当没有在主密钥列匹配的条目时(触发由在脚本的DBLookup节点) :
13:24:05:294 ra-dbw Trace: Queue a lookup request
13:24:05:295 ra-dbw Trace: DBWorker Thread 0 (ID 350760 Table:Priority):
Received request: transactionID 1
13:24:05:295 ra-dbw Trace: DBWorker Thread 0 (ID 350760),transactionID 1,
Attempt to read the record:
13:24:05:295 ra-dbw Trace: DBWorker transactionID 1, Failed! result=1
当有匹配时,这是回应:
13:25:25:810 ra-dbw Trace: Queue a lookup request
13:25:25:810 ra-dbw Trace: DBWorker Thread 1 (ID 354428 Table:Piority):
Received request: transactionID 2
13:25:25:810 ra-dbw Trace: DBWorker Thread 1 (ID 354428),transactionID 2,
Attempt to read the record:
13:25:25:811 ra-dbw Trace: DBWorker Thread 1 (ID 354428),transactionID 2,
Succeeded.
Troubleshoot
目前没有针对此配置的故障排除信息。