[BUG] 3CX WebClient duplicates contacts despite successful CRM lookup and call logging

Status
Not open for further replies.

grayedfox

Forum User
Joined
Apr 17, 2019
Messages
16
Reaction score
0
Hello all.

When testing the CRM integration using a real mobile incoming call, 3CX always duplicates the contact on the 3CX side (no duplication occurs on Copper side, as lookup is successful and new contacts are only made when lookup fails).

Reproduction Steps (call using new number)
  1. 3CX performs lookup and gets no results (expected)
  2. 3CX creates new contact on Copper using default contact name (expected)
  3. 3CX will not let WebClient user (even with manager rights) edit or delete contact, with message "...To edit this contact, you need to modify it at CRM / Exchange level and wait for 3CX Phone System Company Directory service to syncronize again." (expected)
  4. Update contact details within Copper (i.e. company and contact name)
  5. Call using same number
- 3CX should perform lookup: it is unclear whether this actually happens (not sure)
- 3CX displays the old information, i.e. the default contact name instead of the new one (unexpected)
6. A new contact with the same information appears in 3CX (unexpected duplicate contact)

No new contact in Copper is created, so I can confirm that the contact creation scenario does not actually trigger (otherwise we would see duplicate contacts in Copper - which I confirmed allows contacts with the same name and number to exist - so it's not true that the contact creation scenario fires and Copper rejects the POST request).

The Bugs

  1. 3CX should not show duplicate contacts in the 3CX webclient when a lookup is successful
  2. 3CX should show the updated contact details the next time that number calls and a match is found (with updated contact information) on the CRM platform, in our case copper
Other Info

I can 100% confirm that the scenarios are working as expected: contact creation only occurs when no match is found, the different types of calls (missed inbound, missed outbound, etc) are recognised and different messages are logged in Copper (as an activity) at the right location, and the duration of the call is correct.

So, it's not a bug in the CRM engine scenario logic, and all credentials are correct: it really is either 3CX WebClient behaviour (for the duplicate contacts) and perhaps a caching issue somewhere

Questions

I was wondering if I can somehow force 3CX to sync with our integrated CRM platform (Copper) to refresh the CRM handled 3CX contacts and fetch new information?

I would expect that the 3CX CRM engine performs a lookup each time and does not cache any information or rely on the 3CX contact to exist - is that what happens under the hood?

Thanks for your time!
 
Hello @grayedfox,

- 3CX should perform lookup: it is unclear whether this actually happens (not sure)
When a new contact is added, it is cached by the CRM engine for 1 minute. If the second call is received in less than a minute after the first call, then no lookup is performed and the same contact is returned. After 1 minute, a new lookup is made, and the contact should be updated with the new information taken from the CRM.

- 3CX displays the old information, i.e. the default contact name instead of the new one (unexpected)
This could happen if you made the second call too fast. Please wait 1 minute before making the second call, and check if the behaviour changes.

6. A new contact with the same information appears in 3CX (unexpected duplicate contact)
A new contact should not be created in this case. Even if the contact is cached, or returned by the CRM, the same contact should be updated. However, this could happen if you do not provide the ContactUrl output in the CreateContactRecord scenario. Please note that the ContactUrl output is considered the "primary key" in 3CX Contacts for CRM contacts. If you return a contact without this value, it will be considered a different record and a new contact will be inserted instead of updating the existing one. So check this, and this might be the cause of the problem.

No new contact in Copper is created, so I can confirm that the contact creation scenario does not actually trigger (otherwise we would see duplicate contacts in Copper - which I confirmed allows contacts with the same name and number to exist - so it's not true that the contact creation scenario fires and Copper rejects the POST request).
When debugging a CRM template, it's good that you enable verbose logs from the 3CX Console > Dashboard > Activity Log > Settings, and then check what happens in the 3cxSystemService.log file. Any interaction with the CRM will be registered there. So you can see what HTTP request was sent from 3CX to the CRM, the response returned, and so on. This way you're 100% sure, and you don't need to guess if the request was sent or not.

The Bugs

  1. 3CX should not show duplicate contacts in the 3CX webclient when a lookup is successful
  2. 3CX should show the updated contact details the next time that number calls and a match is found (with updated contact information) on the CRM platform, in our case copper
Please check the logs and check if your template is providing the right ContactUrl output in the CreateContactRecord scenario. I'm quite sure that this is NOT a bug, as we have 16 templates which are working fine in this case. So, this is quite sure an implementation issue in this particular template.

I was wondering if I can somehow force 3CX to sync with our integrated CRM platform (Copper) to refresh the CRM handled 3CX contacts and fetch new information?
Unfortunately this is not possible. Contact synchronization only happens when 3CX receives an inbound call from an external line.

I would expect that the 3CX CRM engine performs a lookup each time and does not cache any information or rely on the 3CX contact to exist - is that what happens under the hood?
The CRM engine has a cache to avoid sending many requests to the CRM in short periods of time. This works in the following way:
  1. If the contact is created by the CRM engine via the CreateContactRecord scenario, the contact is cached during 1 minute.
  2. If the contact is returned by the CRM during the contact lookup scenarios, then the contact is cached during 10 minutes.


Hope the information helps. If you need help to understand what's going on with your template, please do not hesitate to send us the 3cxSystemService.log and the template files.

Kind regards.
 
  • Like
Reactions: grayedfox
Hi hi hi, thanks for the excellent support response!
@edossantos said:
Please check the logs and check if your template is providing the right ContactUrl output in the CreateContactRecord scenario. I'm quite sure that this is NOT a bug, as we have 16 templates which are working fine in this case. So, this is quite sure an implementation issue in this particular template.

It was indeed the ContactURL, which we figured out when clicking the CRM link. I never provided a ContactURL, and after the initial lookup is successful, I'm guessing the CRM engine changes it's behaviour slightly and expects that variable to not be null - because now new information is fetched as expected (if cache has expired).

The problem was I never actually output the ContactURL when creating the template! As a small aside: it may be worth checking if that variable is being output from one of the matching scenarios and showing a warning to the user if it is not (uploading the file with no ContactURL referenced anywhere works just fine, and results in the strange behaviour described above).

Thanks again!
 
Last edited:
  • Like
Reactions: grayedfox
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,324
Messages
591,897
Members
165,475
Latest member
lastshadow