CRM INTEGRATION AND ReportCall not Started

Status
Not open for further replies.

slribeiro

Free User
Joined
Mar 16, 2020
Messages
9
Reaction score
0
Hello Guys, I'm building my first 3cx integration for CRM. I used the 3CX CRM Template Generator to generate the xml file. The "Contact Lookup" and "ReportCall" tests done on the Generator Template seem to be OK. The problem is that 3cx does not seem to run the Scenario ReportCall, even when the contact is found. Can you help me please ?

TEST_RESULT.jpg

XML Template
XML:
<?xml version="1.0"?>
<Crm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Country="BR" Name="exactsales" Version="1">
  <Number Prefix="Off" MaxLength="15" />
  <Connection MaxConcurrentRequests="2" />
  <Parameters>
    <Parameter Name="APIkey" Type="String" Parent="General Configuration" Editor="String" Title="API Key:" />
    <Parameter Name="CreateContactEnabled" Type="Boolean" Editor="String" Title="Enable Contact Creation" Default="False" />
    <Parameter Name="CreateContactFirstName" Type="String" Parent="CreateContactEnabled" Editor="String" Title="New Contact First Name:" Default="Novo" />
    <Parameter Name="CreateContactLastName" Type="String" Parent="CreateContactEnabled" Editor="String" Title="New Contact Last Name:" Default="3CX Contato" />
    <Parameter Name="ReportCallEnabled" Type="Boolean" Editor="String" Title="Enable Call Journaling" Default="False" />
  </Parameters>
  <Authentication Type="Basic">
    <Value>[APIkey]:X</Value>
  </Authentication>
  <Scenarios>
    <Scenario Id="" Type="REST">
      <Request Url="https://slribeiro.com/exact/person.php?action=list&amp;number=[Number]" 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="name">
          <Filter />
        </Variable>
        <Variable Name="Email" Path="email">
          <Filter />
        </Variable>
        <Variable Name="PhoneBusiness" Path="phone1">
          <Filter />
        </Variable>
        <Variable Name="PhoneBusiness2" Path="phone2">
          <Filter />
        </Variable>
        <Variable Name="Id" Path="id">
          <Filter />
        </Variable>
        <Variable Name="Contact" Path="id">
          <Filter />
        </Variable>
      </Variables>
      <Outputs AllowEmpty="false">
        <Output Type="ContactID" Passes="0" Value="[ContactID]" />
        <Output Type="FirstName" Passes="0" Value="[FirstName]" />
        <Output Type="Email" Passes="0" Value="[Email]" />
        <Output Type="PhoneBusiness" Passes="0" Value="[PhoneBusiness]" />
        <Output Type="PhoneBusiness2" Passes="0" Value="[PhoneBusiness2]" />
        <Output Type="ContactUrl" Passes="0" Value="https://slribeiro.com/exact/person.php?action=list&amp;contact=[ContactID]" />
      </Outputs>
    </Scenario>
    <Scenario Id="CreateContactRecord" Type="REST">
      <Request SkipIf="[CreateContactEnabled]!=True" Url="https://slribeiro.com/exact/person.php?action=create&amp;number=[Number]&amp;first_name=[CreateContactFirstName]&amp;last_name=[CreateContactLastName]" MessagePasses="0" RequestContentType="application/json" RequestEncoding="Json" RequestType="Get" ResponseType="Json">
        <PostValues>
          <Value Key="number" Passes="0" Type="String">[Number]</Value>
        </PostValues>
      </Request>
      <Variables />
      <Outputs AllowEmpty="false" />
    </Scenario>
    <Scenario Id="ReportCall" Type="REST">
      <Request SkipIf="[ReportCallEnabled]!=True||[CallType]!=Outbound" Url="https://slribeiro.com/exact/person.php?action=call&amp;number=[Number]&amp;TempoConversacao=[Duration]&amp;DtInicioChamada=[CallStartTimeLocal]&amp;DtFimChamada=[CallEndTimeLocal]&amp;OrigemTel=[Agent]" MessagePasses="0" Message="" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json" />
      <Variables />
      <Outputs AllowEmpty="true" />
    </Scenario>
  </Scenarios>
</Crm>
 
Last edited:
Please, enable verbose logs from the 3CX Console > Dashboard > Activity Log > Settings. Then make a test call to reproduce the issue and check the 3cxSystemService.log file. There you will see the interactions between 3CX and your CRM, so you will be able to spot the error.
 
Ernesto, can you help me find the problem, please? Follows part of the LOG

Code:
2020/03/16 15:47:52.455|32026|0029|Verb|The response is: '{"leadId":7305758,"email":"[email protected]","name":"SERGIO LUIZ RIBEIRO (teste)","jobTitle":"adm \/ GERENTE TI","phone1":"1131953380","phone2":"11982520390","messagingPlatform":"Nenhum","idMessagingPlatform":null,"mainContact":null,"id":8942735}
'
2020/03/16 15:47:52.455|32026|0029|Verb|Filtered variables for matching:
2020/03/16 15:47:52.456|32026|0029|Verb|   'FirstName' = 'SERGIO LUIZ RIBEIRO (teste)'
2020/03/16 15:47:52.456|32026|0029|Verb|   'Id' = '8942735'
2020/03/16 15:47:52.456|32026|0029|Verb|   'Contact' = '8942735'
2020/03/16 15:47:52.456|32026|0029|Verb|   'PhoneBusiness2' = '11982520390'
2020/03/16 15:47:52.456|32026|0029|Verb|   'ContactID' = '8942735'
2020/03/16 15:47:52.456|32026|0029|Verb|   'Email' = '[email protected]'
2020/03/16 15:47:52.456|32026|0029|Verb|   'PhoneBusiness' = '1131953380'
2020/03/16 15:47:52.457|32026|0029|Info|CRM: No changes detected for contact Wphonebook.2376: Wtenant.1: default -  - SERGIO LUIZ RIBEIRO (teste)
2020/03/16 15:47:52.457|32026|0029|Verb|Removed from processing. Number=1131953380
2020/03/16 15:47:52.457|32026|0029|Info|CRM: processing of 1131953380 has been finished
2020/03/16 15:47:53.231|32026|0010|Verb|Enqueue Updated.REGISTRATION.31
2020/03/16 15:47:53.231|32026|0011|Verb|Dequeue Updated.REGISTRATION.31
 
That part of the log is for contact lookup, and it shows that the contact is found. When the call ends, you will see more log lines related to call reporting. Those lines are not included in the log you copied.
 
OK Ernesto, tks
I found it! Do you know how to solve it?

Code:
2020/03/16 15:47:59.574|32026|0029|Info|Transcribe is disabled
2020/03/16 15:47:59.574|32026|0029|Info|CRM: Length of incoming CallerId '31953380' is less than 10 (PHONEBOOK_MIN_MATCH) - call journaling in CRM is skipped
2020/03/16 15:47:59.579|32026|0010|Verb|Enqueue Updated.PARAMETER.460
 
That setting is changed from the 3CX Console > Advanced > Contacts > Options.
 
Thanks Ernesto, I made the change but the problem remains

CONTACT.jpg

Code:
2020/03/17 09:30:45.221|32026|0017|Info|CRM: Length of incoming CallerId '31953380' is less than 10 (PHONEBOOK_MIN_MATCH) - call journaling in CRM is skipped
 
The change should be automatically applied, but somehow in this case it didn't. Try restarting the 3CX System Service.
 
  • Like
Reactions: Evolute IT
OK. thank you very much for the support and help
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,325
Messages
591,898
Members
165,478
Latest member
postmaster@studiolegaleda