Есть диалплан на AEL:
Код: Выделить всё
context from-pstn-custom{
_X.=> {
// Get 1C
Set(HASH(GETMANAGER_1C)=${ONES_GET_MANAGER_1C_2(${CALLERID(num)})});
Log(NOTICE, GETMANAGER_1C(${CALLERID(num)}) = ${HASHKEYS(GETMANAGER_1C)}, ExistsManager?: ${HASH(GETMANAGER_1C,managername)}, ${HASH(GETMANAGER_1C,firmkod)}, ${HASH(GETMANAGER_1C,ContactInfo)}, ${HASH(GETMANAGER_1C,ContactInfo2)});
Set(HASH(GETMANAGER,firmkod)=${HASH(GETMANAGER_1C,firmkod)});
GetCBX:
// Get CBX info:
Agi(agi://127.0.0.1/cbx?to=${DST}&from=${CALLERID(num)}&name=${HASH(GETMANAGER_1C,ContactInfo)}&firmkod=${HASH(GETMANAGER_1C,firmkod)}&comment=${HASH(GETMANAGER_1C,ContactInfo2)}&isCompany=${IF($EXISTS(${HASH(GETMANAGER_1C,firmkod)})?true)}&manager=${HASH(GETMANAGER_1C,managername)});
&locatemanager();
}
e => {
NoOp(------------------> ERROR!!! <------------------);
NoOp(------------------> $EXCEPTION(reason) <------------------);
NoOp(------------------> $EXCEPTION(context) <------------------);
NoOp(------------------> $EXCEPTION(exten) <------------------);
NoOp(------------------> $EXCEPTION(priority) <------------------);
jump ${CALLERID(num)},GetCBX;
}
};
Код: Выделить всё
[2018-08-08 14:53:37] WARNING[16379][C-0000068e]: res_odbc.c:958 odbc_obj_connect: res_odbc: Error SQLConnect=-1 errno=0 [unixODBC][Microsoft][ODBC Driver 11 for SQL Server]Login timeout expired
[2018-08-08 14:53:37] WARNING[16379][C-0000068e]: res_odbc.c:958 odbc_obj_connect: res_odbc: Error SQLConnect=-1 errno=0 [unixODBC][Microsoft][ODBC Driver 11 for SQL Server]Login timeout expired
[2018-08-08 14:53:37] ERROR[16379][C-0000068e]: func_odbc.c:835 acf_odbc_read: Unable to execute query [SELECT TOP 1 '1C' as 'datasource', f.[FirmKod] as firmkod, cast(f.[FirmName]as varchar(200)) as ContactInfo, f.[Manager] as managername, cast(f.[Text] as varchar(100)) as ContactInfo2 FROM [OdinC_Connection_test].[dbo].[Mirror_1C_Firm] f inner join [OdinC_Connection_test].[dbo].[Mirror_1C_Tel] t on t.[FirmKod] = f.FirmKod and t.[Tel]='xxxxxx']
[2018-08-08 14:53:37] ERROR[16379][C-0000068e]: func_odbc.c:835 acf_odbc_read: Unable to execute query [SELECT TOP 1 '1C' as 'datasource', f.[FirmKod] as firmkod, cast(f.[FirmName]as varchar(200)) as ContactInfo, f.[Manager] as managername, cast(f.[Text] as varchar(100)) as ContactInfo2 FROM [OdinC_Connection_test].[dbo].[Mirror_1C_Firm] f inner join [OdinC_Connection_test].[dbo].[Mirror_1C_Tel] t on t.[FirmKod] = f.FirmKod and t.[Tel]='xxxxxx']
-- Executing [xxxxxx@from-pstn:6] Set("PJSIP/VEGA-00001ec1", "HASH(GETMANAGER_1C)=") in new stack
-- Executing [h@from-pstn:1] NoOp("PJSIP/VEGA-00001ec1", "------------------> ERROR!!! <------------------") in new stack
Что я делаю не так?