• V20: 3CX Re-engineered. Get V20 for increased security, better call management, a new admin console and Windows softphone. Learn More.

assigning extension from sql database query

Status
Not open for further replies.

zman574

Joined
Jun 24, 2010
Messages
57
Reaction score
0
I have created a call flow that will successfully verify a customer from caller id via a sql database

The functionality is simple

When call comes in go directly to verify if the callerid exists in a sql database

If it exist look for the assigned agent from the last call by finding the extension of that agent in the database.

Everything seems to work as it should until I assign the query result of my query to get the agents direct extension

Here is my query

DECLARE @maxid INT

SET @maxid =
(SELECT MAX(ID)
FROM [CRM].[dbo].[CallLog]
WHERE Callerid = 2075708994)-- RIGHT({0}, 10))

SELECT LEFT(DirectCallExtension,4) As DirectCallExtension
FROM [CRM].[dbo].[CallLog]
WHERE ID = @maxid
AND DirectCallExtension IS NOT NULL

The result is a single 4 digit nchar of 7201 which is the extension I want.

I am pretty sure through my testing that the query is fine however when I add the variable assignment it makes the whole thing not work and just disconnects the call. I have attached a screenshot of the Expression Editor where I am assigning the value to the Variable

Really stuck on this and have a hard deadline to meet and support is not responding.

Thanks

Jim
 

Attachments

  • 2016-07-08_11-35-09.jpg
    2016-07-08_11-35-09.jpg
    28.9 KB · Views: 1,096
Hi Jim,

I have answered you to this via the support system. First suggestion is using query type "Scalar" instead of "Query" as the result is a single value. Next, we need to check the errors you get, either in the file 3CXIvrServer.log or Errors_DatabaseAccess.log, as explained here:
http://www.3cx.com/blog/docs/troublesho ... lications/

Kind regards.
 
Hi Jim,

I am a newbie in the 3CX area, but a rather seasoned DBA. How did you get this part working:

"When call comes in go directly to verify if the callerid exists in a sql database "

Cheers,

Cees
 
Status
Not open for further replies.

Getting Started - Admin

Latest Posts

Forum statistics

Threads
141,630
Messages
748,952
Members
144,742
Latest member
Steffen Ekerdt
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.