Call Journaling not working without Country Code

Status
Not open for further replies.

StudyTech

Customer
Joined
Nov 20, 2020
Messages
2
Reaction score
0
Hi all,

We've found an issue with 3cx and CRM integration that we weren't having prior to the v18 upgrade. We're using Zoho, but I believe this would affect any CRM. First let me describe the setup and scenario:

Setup:
* Zoho CRM integration
* Call Journaling enabled
* Contact creation NOT enabled
* Outbound Rule for 10 digit dialing will prepend a '1'
* 3CX Click2Call Installed on Chrome/Edge

Scenario 1:
* Agent clicks on phone number in Zoho CRM -> Contacts
* Phone number is 650-555-1234 (notice there isn't a 1 prepended)

The Result:
In this scenario, the call journaling only happens when the call is unanswered. If the call is answered, the call will not be logged in Zoho.

Scenario 2:
* Agent clicks on phone number in Zoho CRM -> Contacts
* Phone number is 1-650-555-1234 (notice there is a 1 prepended)

The Result:
In this scenario, the call journaling happens with answered and unanswered calls.

Looking at the debug logging, it seems that 3CX will correctly look up the call based on the last 6 digits of the phone number:

Code:
2021/12/28 11:37:18.558|9276|0051|Verb|Performing GET request 'https://www.zohoapis.com/crm/v2.1/Contacts/search?criteria=((Phone:equals:551234) or (Mobile:equals:551234) or (Home_Phone:equals:551234) or (Other_Phone:equals:551234) or (Fax:equals:551234))&fields=Account_Name,id,First_Name,Last_Name,Phone,Mobile,Home_Phone,Asst_Phone,Other_Phone,Email,Fax'.
2021/12/28 11:37:18.993|9276|0047|Verb|The response is: '{"data":[{"First_Name":"Steve","Home_Phone":null,"Asst_Phone":null,"Email":null,"Last_Name":"Smith","Phone":null,"Other_Phone":null,"Account_Name":null,"id":"10691240XXXXXXXXX","Fax":null,"Mobile":"6505551234"}],"info":{"call":false,"per_page":200,"count":1,"page":1,"email":false,"more_records":false}}'
2021/12/28 11:37:18.993|9276|0047|Verb|Unknown path element: name. Null value is returned.
2021/12/28 11:37:18.993|9276|0047|Verb|Filtered variables for matching:
2021/12/28 11:37:18.993|9276|0047|Verb|   'MobilePhone' = '6505551234'
2021/12/28 11:37:18.993|9276|0047|Verb|   'Phone' = ''
2021/12/28 11:37:18.993|9276|0047|Verb|   'OtherPhone' = ''
2021/12/28 11:37:18.993|9276|0047|Verb|   'HomePhone' = ''
2021/12/28 11:37:18.993|9276|0047|Verb|   'FirstName' = 'Steve'
2021/12/28 11:37:18.993|9276|0047|Verb|   'AccountName' = ''
2021/12/28 11:37:18.993|9276|0047|Verb|   'Fax' = ''
2021/12/28 11:37:18.993|9276|0047|Verb|   'Email' = ''
2021/12/28 11:37:18.993|9276|0047|Verb|   'Id' = '10691240XXXXXXXXX'
2021/12/28 11:37:18.993|9276|0047|Verb|   'LastName' = 'Smith'
2021/12/28 11:37:18.993|9276|0047|Verb|   'AssistantPhone' = ''
...
...
2021/12/28 11:37:18.999|9276|0047|Info|CRM: Contact Wphonebook.384353: Wtenant.1: default - 6505551234 - Steve Smith was updated from CRM
2021/12/28 11:37:18.999|9276|0047|Verb|Removed from processing. Number=16505551234
2021/12/28 11:37:18.999|9276|0047|Info|CRM: processing of 16505551234 has been finished
2021/12/28 11:37:18.999|9276|0012|Verb|Dequeue Updated.TRANSACTION.4921


Notice here that the CRM lookup went just fine, but near the end 3CX has now started to identify the number with the 1 prepended, and that's what is going to cause things to fail to update the call log in Zoho:

Code:
2021/12/28 11:37:27.968|9276|0047|Info|CRM: about to report 1 calls at maxConcurrency 1
2021/12/28 11:37:27.968|9276|0047|Verb|CRM: Call Journaling event received, searching for number '16505551234' in 3CX Contacts.
2021/12/28 11:37:27.968|9276|0047|Verb|Processing scenario 'ReportCall'.
2021/12/28 11:37:27.968|9276|0047|Verb|Creating new HttpClient for Scenario authentication.
2021/12/28 11:37:27.968|9276|0047|Verb|   Header 'Authorization' = 'Zoho-oauthtoken XXXXXXXXXXXXXXX'
2021/12/28 11:37:27.968|9276|0047|Verb|Skipping request...
2021/12/28 11:37:27.968|9276|0047|Verb|Continue with empty matching.
2021/12/28 11:37:27.968|9276|0047|Verb|Processing scenario 'CreateCall'.
2021/12/28 11:37:27.969|9276|0047|Verb|Creating new HttpClient for Scenario authentication.
2021/12/28 11:37:27.969|9276|0047|Verb|   Header 'Authorization' = 'Zoho-oauthtoken XXXXXXXXXXXXXXX'
2021/12/28 11:37:27.969|9276|0047|Verb|Skipping request...
2021/12/28 11:37:27.969|9276|0047|Verb|No matchings found.

For some reason, 3CX is now trying to search 3CX contacts for 16505551234 instead of the dialed number 6505551234, (well, I assume it's because of the outbound route adding the '1') when it has already found the correct contact information in Zoho as noted 9 seconds earlier in the log. Because of the prepended "1", it returns no results, and thus does not try to post the journal entry to Zoho.

Now if the number already has the 1 prepended in Zoho when the agent clicks on it/calls it, the journaling works just fine:

Code:
2021/12/28 14:01:44.422|9276|0065|Info|CRM: about to report 1 calls at maxConcurrency 1
2021/12/28 14:01:44.422|9276|0065|Verb|CRM: Call Journaling event received, searching for number '16505551234' in 3CX Contacts.
2021/12/28 14:01:44.422|9276|0065|Verb|Processing scenario 'ReportCall'.
2021/12/28 14:01:44.422|9276|0065|Verb|Creating new HttpClient for Scenario authentication.
2021/12/28 14:01:44.422|9276|0065|Verb|   Header 'Authorization' = 'Zoho-oauthtoken XXXXXXXXXXXXXXX'
2021/12/28 14:01:44.422|9276|0065|Verb|Performing GET request 'https://www.zohoapis.com/crm/v2.1/users/search?criteria=(email:equals:[email protected])'.
2021/12/28 14:01:44.523|9276|0065|Verb|The response is: ''
2021/12/28 14:01:44.523|9276|0065|Verb|Continue with empty matching.
2021/12/28 14:01:44.523|9276|0065|Verb|Processing scenario 'CreateCall'.
2021/12/28 14:01:44.523|9276|0065|Verb|Creating new HttpClient for Scenario authentication.
2021/12/28 14:01:44.523|9276|0065|Verb|   Header 'Authorization' = 'Zoho-oauthtoken XXXXXXXXXXXXXXX'
2021/12/28 14:01:44.524|9276|0065|Verb|Performing POST request to 'https://www.zohoapis.com/crm/v2.1/Calls' with message '{"data":[{"Subject":"3CX PhoneSystem Call","Call_Start_Time":"2021-12-28T22:01:34Z","Call_Duration":"00:10","Call_Type":"Outbound","Call_Result":"Successful","$se_module":"Contacts","Who_Id":"10691240XXXXXXXXX","Description":"12/28/2021 2:01 PM: Answered outgoing call from 505 to 16505551234  (00:10)"}]}'.
2021/12/28 14:01:44.675|9276|0065|Verb|The response is: '{"data":[{"code":"SUCCESS","details":{"Modified_Time":"2021-12-28T14:01:44-08:00","Modified_By":{"name":"Agent Calling","id":"10691240XXXXXXXXX"},"Created_Time":"2021-12-28T14:01:44-08:00","id":"10691240XXXXXXXXX","Created_By":{"name":"Agent Calling","id":"10691240XXXXXXXXX"}},"message":"record added","status":"success"}]}'


This is an entirely new issue after upgrading to v18. I know every contact should have a country code in front of it, but at the same time, I feel like this lookup should happen based on the actual number the was entered. Or do a fuzzy lookup like is done against Zoho. Or, ignore the failure to find the contact in 3CX since it was already found in Zoho, which is exactly what we are trying to log against here. We have about 950,980 contacts in Zoho (not all with phone numbers), some with a country code and some without (which is why 3CX will prepend that 1 for us on 10 digits), which is going to be nearly impossible to update all of. Is there any setting we can set, or something we can do on the 3CX side to get this working again?
 
@edossantos I have a similar issue with a French customer that uses +33 in the CRM but OVH sends 06xxxxxxxx so lookup works (match at least 9, the CRM API supports "contains") but the call journaling doesn't work as it searches the local PBX phonebook for the 10-digits national format instead of following the 9-digits rule set.
 
We're also having this same problem affecting only outbound calls since the upgrade to V18, using Twilio in Australia. I've been able to trace the issue back to the following chain of events

  1. A phone number such as 04xx xxx xxx is dialed.
  2. An outbound rule on the sip trunk removes 0 and replaces it with +61 before it is sent to Twilio to make the call.
  3. 3CX does a phone number lookup from Zoho based on the last 8 digits of the number and finds the contact with an entry in our CRM as 04xx xxx xxx, it creates an entry in the 3CX contact list if one does not already exist with a phone number 04xx xxx xxx
  4. The Journaling event executes, searching the local 3CX phone book for the number based on the rewritten outbound rule and is unable to find a match.
Code:
2022/01/28 16:03:12.690|20343|0055|Info|CRM: about to report 1 calls at maxConcurrency 1
2022/01/28 16:03:12.690|20343|0055|Verb|CRM: Call Journaling event received, searching for number '+614xxxxxxxx' in 3CX Contacts.
2022/01/28 16:03:12.690|20343|0055|Verb|Processing scenario 'ReportCall'.
2022/01/28 16:03:12.690|20343|0055|Verb|Creating new HttpClient for Scenario authentication.
2022/01/28 16:03:12.690|20343|0055|Verb|   Header 'Authorization' = 'Zoho-oauthtoken 1000.yyyyyyyyy'
2022/01/28 16:03:12.690|20343|0055|Verb|Skipping request...
2022/01/28 16:03:12.690|20343|0055|Verb|Continue with empty matching.
2022/01/28 16:03:12.690|20343|0055|Verb|Processing scenario 'CreateCall'.
2022/01/28 16:03:12.690|20343|0055|Verb|Creating new HttpClient for Scenario authentication.
2022/01/28 16:03:12.690|20343|0055|Verb|   Header 'Authorization' = 'Zoho-oauthtoken 1000.yyyyyyyyy'
2022/01/28 16:03:12.690|20343|0055|Verb|Skipping request...
2022/01/28 16:03:12.690|20343|0055|Verb|No matchings found.

I'd agree with the above posters, 3CX call journaling should be able to match based on the same method the contact book matches on being a partial last x digits, not an exact match. But it cannot do that, and then no call log is recorded in the CRM.

Any help 3CX team?
 
We're also having this same problem affecting only outbound calls since the upgrade to V18, using Twilio in Australia. I've been able to trace the issue back to the following chain of events

  1. A phone number such as 04xx xxx xxx is dialed.
  2. An outbound rule on the sip trunk removes 0 and replaces it with +61 before it is sent to Twilio to make the call.
  3. 3CX does a phone number lookup from Zoho based on the last 8 digits of the number and finds the contact with an entry in our CRM as 04xx xxx xxx, it creates an entry in the 3CX contact list if one does not already exist with a phone number 04xx xxx xxx
  4. The Journaling event executes, searching the local 3CX phone book for the number based on the rewritten outbound rule and is unable to find a match.
Code:
2022/01/28 16:03:12.690|20343|0055|Info|CRM: about to report 1 calls at maxConcurrency 1
2022/01/28 16:03:12.690|20343|0055|Verb|CRM: Call Journaling event received, searching for number '+614xxxxxxxx' in 3CX Contacts.
2022/01/28 16:03:12.690|20343|0055|Verb|Processing scenario 'ReportCall'.
2022/01/28 16:03:12.690|20343|0055|Verb|Creating new HttpClient for Scenario authentication.
2022/01/28 16:03:12.690|20343|0055|Verb|   Header 'Authorization' = 'Zoho-oauthtoken 1000.yyyyyyyyy'
2022/01/28 16:03:12.690|20343|0055|Verb|Skipping request...
2022/01/28 16:03:12.690|20343|0055|Verb|Continue with empty matching.
2022/01/28 16:03:12.690|20343|0055|Verb|Processing scenario 'CreateCall'.
2022/01/28 16:03:12.690|20343|0055|Verb|Creating new HttpClient for Scenario authentication.
2022/01/28 16:03:12.690|20343|0055|Verb|   Header 'Authorization' = 'Zoho-oauthtoken 1000.yyyyyyyyy'
2022/01/28 16:03:12.690|20343|0055|Verb|Skipping request...
2022/01/28 16:03:12.690|20343|0055|Verb|No matchings found.

I'd agree with the above posters, 3CX call journaling should be able to match based on the same method the contact book matches on being a partial last x digits, not an exact match. But it cannot do that, and then no call log is recorded in the CRM.

Any help 3CX team?
Yup they know. Fixed in U3, which should be beta pretty soon.
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,323
Messages
591,896
Members
165,474
Latest member
costionofrei