signalwire / freeswitch

FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a versatile software implementation that runs on any commodity hardware. From a Raspberry PI to a multi-core server, FreeSWITCH can unlock the telecommunications potential of any device.
https://freeswitch.com/#getting-started
Other
3.36k stars 1.38k forks source link

Oracle DB (reserverd field 'Level") integration with callcenter module #2379

Open rahulsonawane1518 opened 5 months ago

rahulsonawane1518 commented 5 months ago

I have enabled the callcenter module of the freeswitch and for reporting purpose I have integrated the Oracle DB with freeswitch. Now in tier report we have feild called level to reporting but in Oracle DB level is reserved keyword. Now we have created the level feild as string in oracle but freeswitch is not able send the data to oracle as it is not identifying the level string colum. Is there any workaaround for the same ?

ukolovda commented 5 months ago

@rahulsonawane1518 You should quote identifiers (LEVEL), for example:

db.execute("select id, \"level\" from ...");

You should do this for all queries.

Also quoted identifier in Oracle is case sensitive, "level" is not equal "LEVEL", you should use the same case for all queries.

abhishek9699 commented 4 months ago

@ukolovda We attempted this previously; however, the issue lies in the fact that the built-in queries in 'mod_callcenter' lack the 'level' as a string. Consequently, the query at the Oracle database is failing.

2024-02-20 11:08:23.870158 86.84% [ERR] switch_odbc.c:529 ERR: [UPDATE tiers SET level = '1' WHERE queue = 'nict2r@10.144.18.117' AND agent = '1001@10.144.18.117'] [STATE: HY000 CODE 1747 ERROR: [Oracle][ODBC][Ora]ORA-01747: invalid user.table.column, table.column, or column specification

2024-02-20 11:08:24.029763 86.84% [ERR] switch_odbc.c:529 ERR: [INSERT INTO tiers (queue, agent, state, level, position) VALUES('nict2r@10.144.18.117', 'abhishek', 'Ready', '1', '1');] [STATE: HY000 CODE 1747 ERROR: [Oracle][ODBC][Ora]ORA-01747: invalid user.table.column, table.column, or column specification

**The updated query should be UPDATE tiers SET "level" = '1' WHERE queue = 'nict2r@10.144.18.117' AND agent = '1001@10.144.18.117' INSERT INTO tiers (queue, agent, state, "level", position) VALUES('nict2r@10.144.18.117', 'abhishek', 'Ready', '1', '1')**