WebClient opens cached Contact instead new

Status
Not open for further replies.

EvgenyEUnify

New User
Joined
Apr 28, 2022
Messages
9
Reaction score
0
Hello,
We are using your API to return contacts data from our CRM.
When call starting 3cx calls our page and we see we return correct contact json data.
Also in these json-contact-data we populate url parameter, so when user click contact card(or it auto open)
user will see contact in out CRM

But we see your system cached information that we returned first time, and when return new data for same number
it does not use new URL.
How to disable this cache on your side?
 
If the URL is different, the contact entry will be recreated. The ContactUrl is what is being used for matching an updated JSON to the stored data in the phonebook. Therefore, if it changes on the second call, it will not match the original one.
 
I will explain why we need it. Your API thinks there is one contact in our CRM related to phone, but we may have few contacts related to one phone. So we want to give ability to operator to choose correct contact in our CRM. So we create special link in our json for your API call, when you receive contact from us:

https://cliptoall.s3.us-west-2.amazonaws.com/evgeny/20220509/59440be200814c4e8ec23c7924c4a824.jpg

we return:
{"contact": {"phone":"111111", ....., "url","https://oursite.com/show?CallId=xxxxx"}}

So we was sure when user click contact card it will open URL we sent you through API right after call. But no, it remember what we sent first time, but all next time it not use cached URL. So if same phone will call us10 times and every time we will return you different link in json, you will always use link that we sent first time, and other 9 times on card click user will see incorrect data.

How we can fix it? We do not want to use cached data.
 
If the URL is different, the contact entry will be recreated. The ContactUrl is what is being used for matching an updated JSON to the stored data in the phonebook. Therefore, if it changes on the second call, it will not match the original one.
The problem now - contcat URL changed, but we still receive old contcat URL, I checked it minute ago:

I logged data that I return from our API:

{ "contact": { "id": 0, "firstname": "NoContactsFound", "lastname": "", "email": "", "mobilephone": "421907498497", "url": "https://xxxxxx.net/FindAccountTeler...07498497&CallId=122475&tab=tab_MailingAddress", "customvalue": "122475" } }

and what URL it shows when I click on card

https://xxxxxx.net/FindAccountTeler...07498497&CallId=122437&tab=tab_MailingAddress

you see it is absolutely different.
 
I think I found bug on your side, if I populate id field in json data with some value, you cached these data and remember URL related to this id field. If I always change id in my json - it works correct and show every time new URL I sent. I think you should fix this because URL can be changed but ID of contact - no.
 
I think I found bug on your side, if I populate id field in json data with some value, you cached these data and remember URL related to this id field. If I always change id in my json - it works correct and show every time new URL I sent. I think you should fix this because URL can be changed but ID of contact - no.
I, don't work for 3CX.

@edossantos
 
I, don't work for 3CX.
Sorry :)
I just thought like you, if ContactUrl is different - it should change contact. But no. I see ID should be different also, if ID in json same, it showы previous cached URL. And it is very strange behavior. And looks like a bug.
 
Sorry :)
I just thought like you, if ContactUrl is different - it should change contact. But no. I see ID should be different also, if ID in json same, it showы previous cached URL. And it is very strange behavior. And looks like a bug.
Your ID in the JSON is the call ID or contact ID? And no it definitely uses the URL to match. This sounds more like the URL changes and maybe you don't notice.

Please send me your XML via DM, I'll take a look. Also attach a JSON example response please.
 
Your ID in the JSON is the call ID or contact ID? And no it definitely uses the URL to match. This sounds more like the URL changes and maybe you don't notice.

Please send me your XML via DM, I'll take a look. Also attach a JSON example response please.

Before it was "contact Id" and I had problems related to cached data. Now I changed it to "call Id" so when I return data to 3cx call field ID is always unique. like workaround it works correct. For example how to reproduce a problem:

If you return json like this:

{
"contact": {
"id": 125,
"firstname": "SomeContact",
"lastname": "",
"email": "",
"mobilephone": "421907498486",
"url": "https://xxxxxxx.net/FindAccount.aspx?MyVar=500&PhoneNumber=421907498486",
"customvalue": "125" }
}

then when user click card there will be URL:

https://xxxxxxx.net/FindAccount.aspx?MyVar=500&PhoneNumber=421907498486

so query string param: MyVar=500

if you next time return json like this(same id = 125 but another URL):

{
"contact": {
"id": 125,
"firstname": "SomeContact",
"lastname": "",
"email": "",
"mobilephone": "421907498486",
"url": "https://xxxxxxx.net/FindAccount.aspx?MyVar=5555&PhoneNumber=421907498486",
"customvalue": "125" }
}

then when user click card there will be incorrect old URL:

https://xxxxxxx.net/FindAccount.aspx?MyVar=500&PhoneNumber=421907498486

you see MyVar=500 now, but it should be MyVar=5555

So we see cached data, I think you save json result as CRM contact and show it for user.


Sorry I do not understand which XML you mean and what is DM. But I think I correct explained problem.
I think it should not show previous URL if Contact Id is same.
Maybe you need for it additional parameter in Template file.
 
Before it was "contact Id" and I had problems related to cached data. Now I changed it to "call Id" so when I return data to 3cx call field ID is always unique. like workaround it works correct. For example how to reproduce a problem:

If you return json like this:

{
"contact": {
"id": 125,
"firstname": "SomeContact",
"lastname": "",
"email": "",
"mobilephone": "421907498486",
"url": "https://xxxxxxx.net/FindAccount.aspx?MyVar=500&PhoneNumber=421907498486",
"customvalue": "125" }
}

then when user click card there will be URL:

https://xxxxxxx.net/FindAccount.aspx?MyVar=500&PhoneNumber=421907498486

so query string param: MyVar=500

if you next time return json like this(same id = 125 but another URL):

{
"contact": {
"id": 125,
"firstname": "SomeContact",
"lastname": "",
"email": "",
"mobilephone": "421907498486",
"url": "https://xxxxxxx.net/FindAccount.aspx?MyVar=5555&PhoneNumber=421907498486",
"customvalue": "125" }
}

then when user click card there will be incorrect old URL:

https://xxxxxxx.net/FindAccount.aspx?MyVar=500&PhoneNumber=421907498486

you see MyVar=500 now, but it should be MyVar=5555

So we see cached data, I think you save json result as CRM contact and show it for user.


Sorry I do not understand which XML you mean and what is DM. But I think I correct explained problem.
I think it should not show previous URL if Contact Id is same.
Maybe you need for it additional parameter in Template file.
What version of 3CX are you currently using?
 
What version of 3CX are you currently using?

18.0 Update 3 (Build 461)
We use web version.

Our domain is https://eunify.3cx.eu
When I click Test for testing template I see there is correct answer from our server:

https://cliptoall.s3.us-west-2.amazonaws.com/evgeny/20220523/fa977334473a4cb0b5cb9b633a2377e2.jpg

But when I call from my number to webclient and click on contact card I see url:

https://xxxxxxxx.serran.xxxxx/FindAccountTelerik.aspx?x=46132&ShowAccountId=no&PhoneNumber=xxxxx98497&CallId=122545&tab=tab_MailingAddress

url is different, domain is different! all information looks like some old cached url.

but in logs of our server I see we return to you correct url when was Api call:

{"contact":{"id":122513,"firstname":"NoContactsFound","lastname":"","email":"","mobilephone":"xxxxxx498497","url":"https://xxxxx.eunify.xxxxx/FindAccountTelerik.aspx?x=91516&ShowAccountId=no&PhoneNumber=xxxx498497&CallId=122513&tab=tab_MailingAddress","customvalue":"122513","error":null}};
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,323
Messages
591,894
Members
165,472
Latest member
arneg