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

ODBC Directory Search (V14SP2)

Status
Not open for further replies.

richardwvm

Joined
Dec 21, 2015
Messages
25
Reaction score
1
Hope someone can help me out here please. After much faffing I now have a situation where 3CX is performing the ODBC lookup when a call is answered and I can verify the result of the query returns a database entry.

It would seem however, that nothing is done with this data such that it is used for CID on the second call. Consequently, I don't see the returned result in the 'Company Phonebook' and the database is queried again when the second call is answered, even though it's already been done and should be cached already.

Have I missed something? Should I expect to see the result imported into the 'Company Phonebook'?

Regards,

Richard.
 
Hi Nick,

Yes I read that thread, but this is different. I understand that the name won't be cached and appended to CID until the second call, which I referred to in my original post.

The problem appears to be that the result of the first lookup after the first call is answered, doesn't get cached anywhere to be used the second time around. It just performs the same lookup after the second call is answered and doesn't append the name to the CID.

Presumably the result from the first lookup should be added to the 3CX 'Company Phonebook'? Mine is still empty despite the database being successfully queried after every answered call.

Hope that makes sense?
 
In order to see what exactly is happening you would have to set a specially logging level so that the queries get logged by the phone system as well. To do this you must do:
1) Go to Troubleshooting / Activity Log / Logging, set the logging level to Verbose, and press OK.
2) Go in C:\Program Files\3CX Phone System\Instance1\Bin\3CXCallHistoryService.exe.config
Comment out lines :
<add key="Log_Level" value="255" />
<add key="Log_Severity" value="Critical Error Except" />

like this:
<!--<add key="Log_Level" value="255" />
<add key="Log_Severity" value="Critical Error Except" />-->

3) Restart all services.
4) Review the instance callhistory log file which is located in C:\ProgramData\3CX\Instance1\Data\Logs\CallHistoryService.log

I can't remember the exact log lines, but I think it is pretty easy to read through the related logs.
 
Hi Nick,

Problem solved. It would seem that 3CX can't cope with any fields returning DBNull, so just had to wrap everything like this:
Code:
ISNULL(directory.FirstName, '') AS [FirstName]
Now works as expected! Incidentally you only need to restart the Call History service to see the change in log level, which is more convenient in a production environment.

Ta muchly, Richard.
 
Suggested bug fix in CompanyDirectoryService.OdbcReaderMapping:

Code:
        public string Get(string field)
        {
            int num;
            if (!this._mapping.TryGetValue(field, out num))
            {
                return string.Empty;
            }
            object value = this._reader.GetString(num);
            return value == DBNull.Value ? string.Empty : value.ToString();
        }
HTH, Richard.
 
Status
Not open for further replies.

Getting Started - Admin

Latest Posts

Members Online Now

Forum statistics

Threads
141,625
Messages
748,877
Members
144,738
Latest member
MattS
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.