CRM integration not displaying contact details in 3CX v20 Update 8 (works in v18)

lw06

Bronze Partner
Basic Certified
Joined
Nov 29, 2023
Messages
2
Reaction score
4
Hello,

I am trying to display the contact details and a URL to our custom CRM when our users receive a call from a contact.
This was working fine with version 18. We are now using version 20 Update 8.

On the client side, we activated the CRM integration using the server-side configuration.

The workflow is working correctly when using the test button.

Each time a client calls, our CRM receives a contact lookup request and responds successfully.

Here is the XML configuration file:

<?xml version="1.0"?>

<Crm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Country="US" Name="HAPY OAuth2 CRM" Version="1" SupportsEmojis="true">

<Number Prefix="AsIs" MaxLength="[MaxLength]" />

<Connection MaxConcurrentRequests="1" />

<Parameters>

<Parameter Name="ClientId" Type="String" Parent="General Configuration" Editor="String" Title="Client ID:" />

<Parameter Name="ClientSecret" Type="String" Parent="General Configuration" Editor="String" Title="Client Secret:" />

<Parameter Name="RefreshToken" Type="OAuth" Parent="General Configuration" Editor="String" Title="Refresh Token:" RequestUrl="https://our.crm.fr/oauth/authorize" RequestUrlParameters="response_type=code&amp;client_id=[ClientId]&amp;redirect_uri=[RedirectUri]&amp;state=[State]&amp;scope=search-contacts" ResponseScenario="OAuthGetRefreshToken" />

</Parameters>

<Authentication Type="Scenario">

<Value>Auth</Value>

</Authentication>

<Scenarios>

<Scenario Id="Auth" Type="REST">

<Request Url="https://our.crm.fr/oauth/token" MessagePasses="0" RequestContentType="application/x-www-form-urlencoded" RequestEncoding="UrlEncoded" RequestType="Post" ResponseType="Json">

<PostValues>

<Value Key="refresh_token" Passes="0" Type="String">[RefreshToken]</Value>

<Value Key="grant_type" Passes="0" Type="String">refresh_token</Value>

<Value Key="client_id" Passes="0" Type="String">[ClientId]</Value>

<Value Key="client_secret" Passes="0" Type="String">[ClientSecret]</Value>

</PostValues>

</Request>

<Rules>

<Rule Type="Any">access_token</Rule>

</Rules>

<Variables>

<Variable Name="AccessToken" Path="access_token">

<Filter />

</Variable>

<Variable Name="ExpiresIn" Path="expires_in">

<Filter />

</Variable>

<Variable Name="TmpRefreshToken" Path="refresh_token" >

<Filter />

</Variable>

</Variables>

<Outputs AllowEmpty="false">

<Output Type="HeaderName" Passes="0" Value="Authorization" />

<Output Type="HeaderValue" Passes="0" Value="Bearer [AccessToken]" />

<Output Type="BearerExpiration" Passes="0" Value="[ExpiresIn]" />

<Output Type="RefreshToken" Passes="0" Value="[TmpRefreshToken]" />

</Outputs>

</Scenario>

<Scenario Id="OAuthGetRefreshToken" Type="REST">

<Request Url="https://our.crm.fr/oauth/token" MessagePasses="0" RequestContentType="application/x-www-form-urlencoded" RequestEncoding="UrlEncoded" RequestType="Post" ResponseType="Json">

<PostValues>

<Value Key="code" Passes="0" Type="String">
Code:
</Value>

<Value Key="grant_type" Passes="0" Type="String">authorization_code</Value>

<Value Key="client_id" Passes="0" Type="String">[ClientId]</Value>

<Value Key="client_secret" Passes="0" Type="String">[ClientSecret]</Value>

<Value Key="redirect_uri" Passes="0" Type="String">[RedirectUri]</Value>

<Value Key="state" Passes="0" Type="String">[state]</Value>

<Value Key="scope" Passes="0" Type="String">search-contacts</Value>

</PostValues>

</Request>

<Rules>

<Rule Type="Any">refresh_token</Rule>

</Rules>

<Variables>

<Variable Name="Result" Path="refresh_token">

<Filter />

</Variable>

</Variables>

<Outputs AllowEmpty="false">

<Output Type="Result" Passes="0" Value="[Result]" />

</Outputs>

</Scenario>

<Scenario Id="" Type="REST">

<Request Url="[URL='https://our.crm.fr/api/search-contact?phone=%5bNumber%5d']https://our.crm.fr/api/search-contact?phone=[Number][/URL]" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />

<Rules>

<Rule Type="Any">id</Rule>

</Rules>

<Variables>

<Variable Name="ContactID" Path="id">

<Filter />

</Variable>

<Variable Name="FirstName" Path="firstname">

<Filter />

</Variable>

<Variable Name="LastName" Path="lastname">

<Filter />

</Variable>

<Variable Name="CompanyName" Path="company">

<Filter />

</Variable>

<Variable Name="Email" Path="email">

<Filter />

</Variable>

<Variable Name="PhoneMobile" Path="phone">

<Filter />

</Variable>

<Variable Name="PhoneMobile2" Path="phone2">

<Filter />

</Variable>

<Variable Name="CustomValue" Path="type">

<Filter />

</Variable>

<Variable Name="ContactUrl" Path="url">

<Filter />

</Variable>

</Variables>

<Outputs AllowEmpty="false">

<Output Type="ContactID" Passes="0" Value="[ContactID]" />

<Output Type="FirstName" Passes="0" Value="[FirstName]" />

<Output Type="LastName" Passes="0" Value="[LastName]" />

<Output Type="CompanyName" Passes="0" Value="[CompanyName]" />

<Output Type="Email" Passes="0" Value="[Email]" />

<Output Type="PhoneMobile" Passes="0" Value="[PhoneMobile]" />

<Output Type="PhoneMobile2" Passes="0" Value="[PhoneMobile2]" />

<Output Type="CustomValue" Passes="0" Value="[CustomValue]" />

<Output Type="ContactUrl" Passes="0" Value="[ContactUrl]" />

<Output Type="EntityId" Passes="0" Value="[ContactID]" />

<Output Type="EntityType" Passes="0" Value="Contacts" />

</Outputs>

</Scenario>

<Scenario Id="LookupByEmail" Type="REST">

<Request Url="[URL='https://our.crm.fr/api/search-contact?email=%5bEmail%5d']https://our.crm.fr/api/search-contact?email=[Email][/URL]" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />

<Rules>

<Rule Type="Any">id</Rule>

</Rules>

<Variables>

<Variable Name="ContactID" Path="id">

<Filter />

</Variable>

<Variable Name="FirstName" Path="firstname">

<Filter />

</Variable>

<Variable Name="LastName" Path="lastname">

<Filter />

</Variable>

<Variable Name="CompanyName" Path="company">

<Filter />

</Variable>

<Variable Name="Email" Path="email">

<Filter />

</Variable>

<Variable Name="PhoneMobile" Path="phone">

<Filter />

</Variable>

<Variable Name="PhoneMobile2" Path="phone2">

<Filter />

</Variable>

<Variable Name="CustomValue" Path="type">

<Filter />

</Variable>

<Variable Name="ContactUrl" Path="url">

<Filter />

</Variable>

</Variables>

<Outputs AllowEmpty="false">

<Output Type="ContactID" Passes="0" Value="[ContactID]" />

<Output Type="FirstName" Passes="0" Value="[FirstName]" />

<Output Type="LastName" Passes="0" Value="[LastName]" />

<Output Type="CompanyName" Passes="0" Value="[CompanyName]" />

<Output Type="Email" Passes="0" Value="[Email]" />

<Output Type="PhoneMobile" Passes="0" Value="[PhoneMobile]" />

<Output Type="PhoneMobile2" Passes="0" Value="[PhoneMobile2]" />

<Output Type="CustomValue" Passes="0" Value="[CustomValue]" />

<Output Type="ContactUrl" Passes="0" Value="[ContactUrl]" />

<Output Type="EntityId" Passes="0" Value="[ContactID]" />

<Output Type="EntityType" Passes="0" Value="Contacts" />

</Outputs>

</Scenario>

</Scenarios>

</Crm>
 

Attachments

  • img.png
    img.png
    14.9 KB · Views: 4
  • xml.txt
    xml.txt
    7.5 KB · Views: 2
Ok so it was working, and now?

Your post isn't clear as to what is the issue exactly...

Looking at the template, sounds like it should work. You'll wanna put the system in verbose and check the logs when doing real calls to find the issue. (3cxSystemService.log file, search for "CRM:" to find all lines.)
 
Ok so it was working, and now?

Your post isn't clear as to what is the issue exactly...

Looking at the template, sounds like it should work. You'll wanna put the system in verbose and check the logs when doing real calls to find the issue. (3cxSystemService.log file, search for "CRM:" to find all lines.)
Thank you for your help.
I managed to retrieve the logs and they confirmed that the connection to our custom CRM was working correctly.

The issue was related to the phone number format:
our CRM returns numbers in E.164 format (e.g. +336…), while 3CX was sending the lookup request using the national format (e.g. 06…).

After normalizing inbound numbers to E.164 on the trunk side in 3CX, the CRM lookup started matching correctly and the contact name is now displayed as expected.
 

Forum statistics

Threads
111,986
Messages
590,148
Members
164,917
Latest member
Oliver Hastedt