Troubleshooting 3CX-Bitrix24(On Prem) caller lookup.

Status
Not open for further replies.

setechnical

Customer
Joined
Dec 13, 2019
Messages
40
Reaction score
1
Trying to sort something out.
I create a new contact in Bitrix. -- (Jankie Slappahoe) 800-555-1212. ---A contact is created. (See screenshot) 2mins later,
-I go to CRM Integration and run a test lookup on 800-555-1212 (See screen)
-the contact is not found, a lead is generated (See screen):
-Can you help with what might be wrong?
______________________________________________________________________
[
{
"UnparsedOutputs": {
"ContactUrl": "https://bitrix.XXXXXX.com/crm/lead/show/965/",
"FirstName": "New",
"LastName": "3CX Contact 800-555-1212",
"PhoneBusiness": "800-555-1212",
"EntityType": "1",
"EntityId": "965",
"FullName": "New 3CX Contact 800-555-1212"
},
"FirstName": "New",
"LastName": "3CX Contact 800-555-1212",
"Email": null,
"ContactUrl": "https://bitrix.XXXXXX.com/crm/lead/show/965/",
"CompanyName": null,
"PhotoUrl": null,
"ContactType": 0,
"PhoneBusiness": "800-555-1212",
"PhoneBusiness2": null,
"PhoneHome": null,
"PhoneHome2": null,
"PhoneMobile": null,
"PhoneMobile2": null,
"PhoneOther": null,
"FaxBusiness": null,
"FaxHome": null,
"Pager": null
}
]
_______________________________________________________________

Started scenario with empty id
Request text: https://bitrix.XXXXXX.com/rest/1/5m...1212&select[]=*&select[]=PHONE&select[]=EMAIL
Response text: {"result":[],"total":0,"time":{"start":1583595995.269018,"finish":1583595995.315028,"duration":0.04601001739501953,"processing":0.010759830474853516,"date_start":"2020-03-07T10:46:35-05:00","date_finish":"2020-03-07T10:46:35-05:00"}}
Response finished
Finished scenario with empty id
Started scenario with empty id
Request text: https://bitrix.XXXXXX.com/rest/1/5m...1212&select[]=*&select[]=PHONE&select[]=EMAIL
Response text: {"result":[],"total":0,"time":{"start":1583595995.373911,"finish":1583595995.41738,"duration":0.04346919059753418,"processing":0.010524988174438477,"date_start":"2020-03-07T10:46:35-05:00","date_finish":"2020-03-07T10:46:35-05:00"}}
Response finished
Finished scenario with empty id
Started scenario with empty id
Request text: https://bitrix.XXXXXX.com/rest/1/5m...1212&select[]=*&select[]=PHONE&select[]=EMAIL
Response text: {"result":[],"total":0,"time":{"start":1583595995.471837,"finish":1583595995.50948,"duration":0.0376429557800293,"processing":0.006041049957275391,"date_start":"2020-03-07T10:46:35-05:00","date_finish":"2020-03-07T10:46:35-05:00"}}
Response finished
Finished scenario with empty id
Started CreateContactRecord
Request text: https://bitrix.XXXXXX.com/rest/1/5m3wxv0ae8wt90ru/crm.lead.add
Request message: {"fields":{"NAME":"New","LAST_NAME":"3CX Contact 800-555-1212","TITLE":"New 3CX Contact 800-555-1212","PHONE":[{"VALUE_TYPE":"WORK","VALUE":"800-555-1212"}]}}
Response text: {"result":965,"time":{"start":1583595995.566016,"finish":1583595995.682942,"duration":0.11692595481872559,"processing":0.08505797386169434,"date_start":"2020-03-07T10:46:35-05:00","date_finish":"2020-03-07T10:46:35-05:00"}}
Response finished
Variable Id set to 965
Finished CreateContactRecord
Result obtained
______________________________________________
 

Attachments

  • 800-555-1212-lookup.JPG
    800-555-1212-lookup.JPG
    76.5 KB · Views: 13
  • jankie-create-bitrix.JPG
    jankie-create-bitrix.JPG
    44.9 KB · Views: 13
  • lead-created.JPG
    lead-created.JPG
    16.2 KB · Views: 12
Getting closer here.... it seems 3CX does a lookup with 8005551212, however, when I create the contact in bitrix, Bitrix saves the contact as (800)555-1212. So if I do a JSON lookup manually in the browser... like this:

https://bitrix.XXXXX.com/rest/1/5m3wxv0ae8wt90ru/crm.contact.list.json?filter[PHONE]=(800)555-1212

The lookup returns correctly and returns Jankie Slappahoe as the result....

How do I marry these two systems? Do I change all my bitrix phone numbers or do I change the search string, or what?
 
Seems that no matter what I do, Bitrix saves any number input, with (XXX)XXX-XXXX format...I can;t get bitrix to save it as XXXXXXXXXX. Anyone know how to change this in Bitrix, or adjust 3cx to look for the former format?
 
3CX will not send parenthesys of any other non-numeric character during lookup, except maybe the plus (+) sign at the beginning.

I think that the problem might be the country code stored in Bitrix. Maybe the number to lookup should be +18005551212 (or the country code in which you're). Have you tried that?
 
@edossantos .... I tried the JSON Lookup the following ways, including the one you suggest

https://bitrix.XXX.com/rest/1/5m3wx...1212&select[]=*&select[]=PHONE&select[]=EMAIL

RESULT:
{"result":[],"total":0,"time":{"start":1583873792.173299,"finish":1583873792.218862,"duration":0.0455629825592041,"processing":0.011855125427246094,"date_start":"2020-03-10T16:56:32-04:00","date_finish":"2020-03-10T16:56:32-04:00"}}


https://bitrix.XXX.com/rest/1/5m3wx...1212&select[]=*&select[]=PHONE&select[]=EMAIL

RESULT:
{"result":[],"total":0,"time":{"start":1583873772.988855,"finish":1583873773.035211,"duration":0.046356201171875,"processing":0.011389017105102539,"date_start":"2020-03-10T16:56:12-04:00","date_finish":"2020-03-10T16:56:13-04:00"}}


https://bitrix.XXX.com/rest/1/5m3wx...1212&select[]=*&select[]=PHONE&select[]=EMAIL

RESULT:
{"result":[{"ID":"1492","POST":"","COMMENTS":"","HONORIFIC":"HNR_EN_2","NAME":"Jannie","SECOND_NAME":"","LAST_NAME":"Slappahoe","PHOTO":null,"LEAD_ID":null,"TYPE_ID":"CLIENT","SOURCE_ID":"CALL","SOURCE_DESCRIPTION":"","COMPANY_ID":null,"BIRTHDATE":"","EXPORT":"Y","HAS_PHONE":"Y","HAS_EMAIL":"Y","HAS_IMOL":"N","DATE_CREATE":"2020-03-07T12:32:38-05:00","DATE_MODIFY":"2020-03-10T08:45:39-04:00","ASSIGNED_BY_ID":"1","CREATED_BY_ID":"1","MODIFY_BY_ID":"1","OPENED":"Y","ORIGINATOR_ID":null,"ORIGIN_ID":null,"ORIGIN_VERSION":null,"FACE_ID":null,"ADDRESS":null,"ADDRESS_2":null,"ADDRESS_CITY":null,"ADDRESS_POSTAL_CODE":null,"ADDRESS_REGION":null,"ADDRESS_PROVINCE":null,"ADDRESS_COUNTRY":null,"ADDRESS_COUNTRY_CODE":null,"UTM_SOURCE":null,"UTM_MEDIUM":null,"UTM_CAMPAIGN":null,"UTM_CONTENT":null,"UTM_TERM":null,"PHONE":[{"ID":"5414","VALUE_TYPE":"WORK","VALUE":"(700)555-1212","TYPE_ID":"PHONE"}],"EMAIL":[{"ID":"5430","VALUE_TYPE":"WORK","VALUE":"[email protected]","TYPE_ID":"EMAIL"}]}],"total":1,"time":{"start":1583873716.207855,"finish":1583873716.252434,"duration":0.04457902908325195,"processing":0.010899066925048828,"date_start":"2020-03-10T16:55:16-04:00","date_finish":"2020-03-10T16:55:16-04:00"}}

Note that this contact was entered by hand into Bitrix. I approached Bitrix about the problem and answer was as follows:

"Hello! Thank you for holding!

Tech team checked the case: please refer to application developers team, because we provide support only about our internal applications. Due to the fact that we did not develop this exact external application, we do not consult on its usage either. "


Please advise. This functionality is critical to our 3CX-Bitrix integrations. I cannot seemingly find how to change the format in Bitrix to be the format that 3CX wants to see, and I cannot change Bitrix to be what 3CX wants to see.
 
You should contact Bitrix back, but not tell them that this is an external app. You should ask why their REST API is not returning any data when you do that query. Because this is something that only Bitrix knows... In our testing environment the query works, so this seems to be something particular to your installation.
 
I have submitted the question as you have stated. Will reply with their response. Thank you!
 
so frustrating... here is their response:

Hello!
We recommend using another method to search by phone number. It also allows you to search through an array of up to 20 phones.
Please, use method: crm.duplicate.findbycomm
 
The filtering method that we use works fine here, so it's something in your installation. It seems that Bitrix support doesn't want to provide help. Try checking the settings of your installation, maybe you find something related to how the phone numbers are stored (with or without dashes, parenthesys, and so on).
 
The filtering method that we use works fine here, so it's something in your installation. It seems that Bitrix support doesn't want to provide help. Try checking the settings of your installation, maybe you find something related to how the phone numbers are stored (with or without dashes, parenthesys, and so on).
I've been doing exactly that for days..... I just can't find it anywhere. The attached is literally the only thing I can see in my system. Note that I'm on the latest Bitrix on-prem with all the patches applied... can you confirm yous is the same?
 

Attachments

  • phoneformat.JPG
    phoneformat.JPG
    14.1 KB · Views: 4
that setting was found in "Settings", from the left menu
 
@edossantos

OK, I've discovered something interesting

If I create a Lead by hand in Bitrix.. The number is saved in a format without () or -'s.

For Example:8005551212

I've tested the creation of the lead, then open\edit\save with Bitrix Gui.

The number remains in the format 8005551212.

If all a person ever does is work with leads then the 3CX plugin works just fine and the 3CX JSON query works before and after the save, and lookups work as expected.

However, if this lead is converted to a contact in Bitrix (which usually happens), then the () and - are inserted by the Contact form (but not the lead form) upon save and the JSON query can no longer find it
For Example: (800)555-1212 (changed upon save by the contact form)

to clarify:

If I create a Contact by hand in Bitrix, the () and - are automatically inserted.
For Example: (800)555-1212

Except, 3CX will always perform the lookup with Contacts or Leads like this:
8005551212


If I perform a manual JSON query and insert these symbols, the lookup works fine.
For Example:
https://bitrix.XXX.com/rest/1/5m3wx...1212&select[]=*&select[]=PHONE&select[]=EMAIL

This then means:

1. The 3CX Plugin only does lookups properly with Leads and not Contacts, and contact lookup was not tested.

or

2. The code for Bitrix changed at least for On-Prem in a recent update, and the Contact form now inserts () and - into phone numbers.

So:

Would this mean that Bitrix needs to update their code to remove forced insertion of the () and - in the numbers in the contact form, or the plugin needs to be updated to look for () and - in the phone numbers in only the contact form.

Or can this be adjusted inside the XML template file somehow?

Bottom line
Contact Form Adds () and -
Lead Form Does not, and will permit and retain a flat number structure that 3CX wants to see

(see attached versions for 3CX Test system comparison)

Thanks so much.
 

Attachments

  • bitrix-onprem-version.JPG
    bitrix-onprem-version.JPG
    88 KB · Views: 5
Bitrix, regarding Lead\Contact Form differences:

Automated notification of a new development request ticket

A development request has been created based on this ticket.
The issue will be forwarded to product developers. At present, we cannot provide any time estimates.
Ticket number: 479296:51 am

Added this chat to development ticket to increase development priority.
You'll be notified of development status and implementation even if this chat is already finished.
Finishing this chat does not mean the termination of work on the application in the Development department.

Development department can not report about the approximate release date of updates.
So I have no opportunity to announce timing information.
 
3CX will always do the lookup without special characters. Only numbers are included.

This is something that needs to be handled on the Bitrix side. It's Bitrix who is adding those characters, and their web service not working as it should in that case... Maybe the procedure of converting leads to contacts can be customized somehow to avoid this characters addition...
 
Can you confirm that your test system does not add these characters? I would think that many would be having this issue, particularly if Bitrix adjusted their code.

Do you think that the XML template could be modified to do the search with the method they have indicated? e
 
Can you confirm that your test system does not add these characters? I would think that many would be having this issue, particularly if Bitrix adjusted their code.

Do you think that the XML template could be modified to do the search with the method they have indicated?
Just tested this in our testing environment, which is cloud based (not on-premise).

First, created a lead, did the contact lookup and the lead was returned.

Next, converted the lead to a contact, did the contact lookup and the contact was returned.

It's important to note however, that when you convert a lead to a contact, 3CX will have the contact duplicated in 3CX Contacts, because both have a different URL. Then, 3CX will pick the first one, which is the lead because it was created first. So in order yo work with the contact, you need to manually delete the lead from 3CX Contacts.
 
well, that's actually my next issue. My contacts are not coming over from Bitrix at all.. Could that have something to do with this? (I had planned on a separate thread for this). All of these test cases above, are not in my 3CX contacts..
 
Yes, of course, you need to fix the lookup issue in order to get contacts synched.
 
Status
Not open for further replies.

Forum statistics

Threads
112,325
Messages
591,898
Members
165,479
Latest member
Senergia