Returned Output values in lookup not updating

Status
Not open for further replies.

paoloLac

Free User
Joined
Jan 22, 2021
Messages
51
Reaction score
8
Hi,

I have successfully setup the xml template. The flow I have after the Auth was to:

- Lookup the Contacts DB with a "Next=CreateEngagement" attribute (No outputs here).
- The CreateEngagement does a POST request to create an engagement the returns back the data and this is where outputs are added with variables coming from the lookup.
- In the CreateEngagement outputs, there is a ContactUrl where I add a query param setting the value of the "EngagementID" I received from "CreateEngagement".

- The CreateContactRecord is also using the "CreateEngagement" as a Next attribute so it will be executed after the contact is created.

So far, when testing in the management console, everything works. When I lookup and there is a match found, it then creates an engagement in our db and I get a new engagement ID every time I test this in the console. The newly created engagement ID is then set in the ContactUrl ouput as a query param.

The problem is that when testing via an actual call, this engagement ID in the url param does not update. It always uses the initial id during the record creation.

Apologies, hope this make sense. Any help would be much appreciated.

Thanks!
 
Does 3CX save all custom outputs for a certain contacts? For example, the output "EngagementId", is this save together with the contact data in 3CX? I am asking because it seems that the ID showing when the ContactUrl is being displayed in the browser, it's the same EngagementID that was created during contact creation.
 
This is how my template looks like.

Screen Shot 2021-01-29 at 9.46.22 PM.png

Screen Shot 2021-01-29 at 9.45.39 PM.png

I thought that whatever I get from the variables will be passed in every time there is an incoming call. Where [ EngagementId ] will be populated with the value from the response. But this is not the case. Once a contact is created in 3cx and our CRM, when I call using the same number, the engagement id in the URL never changes. It keeps using the id that was sent back during contact creation.
 
This is probably due to the 10 minutes cache we have. If you call from the same number in less than 10 minutes, the contact lookup is skipped and instead the details are taken from cache, so the same result is returned during 10 minutes. After that time, or after restarting the 3CX System Service, the lookup will be triggered again.

This cache can't be skipped, it's hard coded.
 
Thanks @edossantos . Yeah, I saw a thread about the cache. So there is no workaround on this? Also, when you say 3CX System Service, is this the "3CX PhoneSystem 01 System Server" in "Services"? I see a lot of services and not sure if that is the right one. I tried restarting it and still it gets the cache. Below are the services I see in management console.

Screen Shot 2021-01-29 at 11.24.25 PM.png
 
Thanks @edossantos . Yeah, I saw a thread about the cache. So there is no workaround on this?
Unfortunately this can't be avoided.

Also, when you say 3CX System Service, is this the "3CX PhoneSystem 01 System Server" in "Services"?
Yes, that's correct.

I tried restarting it and still it gets the cache.
If you're returning a different ContactUrl for the same number, it will be considered a different contact, because the ContactUrl is the "primary key" to identify the record. As a result, you will end up with multiple contacts in 3CX Contacts for the same phone number, and different ContactUrls. And due to the way the integration works, the first contact created in 3CX Contacts will be passed on to the Web Client, so the Web Client will always receive the same URL.

As you can see, due to the way the integration with templates works, what you want to achieve is not possible. You should return the same contact details for the same number.
 
Thanks @edossantos! That I didn't know.

The reason why we added some query params to the ContactURL is because we are creating an engagement after the lookup (if there is a match) and append the engagement ID to the ContactUrl when the browser is opened. This is because we will be displaying multiple cards if there are multiple matches against the number. When the user clicks on a specific card, we will use the engagement ID to update the db with the user's ID. If we the engagement ID is not updated, we won't be able to track it correctly.

But since as you mentioned this is not possible respecting how 3CX works, I may have to look for a different approach. :)
 
You can configure the Web Client to launch an URL containing the caller's number. Maybe you can use this, to invoke an URL in your system, which can do the contact lookup and then redirect the page to the proper destination.
 
Thanks @edossantos . Yeah, we have this option but the downside is that we won't have the call journaling functionality or is it possible to have it using that option?
 
Call Journaling requires the template. But what you can do is using both:
1) The template returns always the same Contact URL for the same contact. This way, you will have contact lookup and call journaling implemented in the template.

2) The Web Client is configured to launch a static URL containing the caller number. This way the Contact URL will not be used in the popup from the Web Client, only the static URL that you define.
 
Hi @edossantos . Sorry for the late response here. Thanks for the insights! I was able to get a solution based the above suggestions!
 
  • Like
Reactions: edossantos
Status
Not open for further replies.

Latest Posts

Forum statistics

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