Custom CRM Integration Not Sending Requests & No 3CXSystemService.log

elektrik.orange

Customer
Joined
Sep 17, 2024
Messages
7
Reaction score
1
I'm trying to set up a custom CRM integration.

The idea is to send POST requests whenever there's a call to my custom PHP script, where I plan to filter and process the data and then send it to the CRM system that we use.

The phone number lookup works perfectly fine — I provide 3CX with sufficient fake customer data that includes a unique ID each time. I've tested it both in the template generator and using the "Test" button, successfully in both cases.

But I am facing two major problems:

1. 3CX doesn't send anything to my custom script
Not even for a number lookup. Each request is logged on my server, and whenever I test my template with the Test button, there's a record of it in the logs on my server, but none after real calls.
"Query CRM" is set to "Always query." I've tried using templates without any settings and with "Enable Call Journaling" turned on.

While attempting to find out what went wrong, I encountered the second problem:

2. There is no 3CXSystemService.log in the Support Info archive
I set Activity Logs to "Verbose," made sure "Keep backup of log files" was checked, restarted the Configuration Server, waited for about 5 minutes, made a few test calls, then downloaded the Support Info. And there's no 3CXSystemService.log in the logs folder (nor in any other folder, I checked them all). I repeated this routine two or three times with the same outcome. Here's what's inside the logs folder:
1759829322270.png

Here's the current version of my 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="US" Name="TestTemplate6" Version="6" SupportsEmojis="false">
  <Number Prefix="AsIs" MaxLength="" />
  <Connection MaxConcurrentRequests="10" />
  <Parameters />
  <Authentication Type="No" />
  <Scenarios>
    <Scenario Id="" Type="REST" EntityId="" EntityOrder="">
      <Request SkipIf="" Url="https://mysite.com/some_folder/custom_script.php?fakelookupbyphone=[Number]" RequestContentType="application/json" RequestEncoding="Json" RequestType="Get" ResponseType="Json" />
      <Rules>
        <Rule Type="Any">customer.id</Rule>
      </Rules>
      <Variables>
        <Variable Name="EntityId">customer.id</Variable>
        <Variable Name="FirstName">customer.name</Variable>
        <Variable Name="Email">customer.email</Variable>
        <Variable Name="PhoneMobile">customer.phone</Variable>
        <Variable Name="ContactUrl">customer.url</Variable>
      </Variables>
      <Outputs AllowEmpty="true">
        <Output Type="EntityId" Value="[EntityId]" />
        <Output Type="EntityType" Value="contact" />
        <Output Type="FirstName" Value="[FirstName]" />
        <Output Type="Email" Value="[Email]" />
        <Output Type="PhoneMobile" Value="[PhoneMobile]"/>
        <Output Type="ContactUrl" Value="[ContactUrl]"/>
      </Outputs>
    </Scenario>
    <Scenario Id="ReportCall" Type="REST">
      <Request SkipIf="[CallType]!=Inbound" Url="https://mysite.com/some_folder/custom_script.php" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
        <PostValues Key="">
          <Value Key="callType" Type="String">[CallType]</Value>
        </PostValues>
      </Request>
      <Outputs Next="ReportCallMissed" AllowEmpty="true" />
    </Scenario>
    <Scenario Id="ReportCallMissed" Type="REST">
      <Request SkipIf="[CallType]!=Missed" Url="https://mysite.com/some_folder/custom_script.php" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
        <PostValues Key="">
          <Value Key="callType" Type="String">[CallType]</Value>
        </PostValues>
      </Request>
      <Outputs Next="ReportCallOutbound" AllowEmpty="true" />
    </Scenario>
    <Scenario Id="ReportCallOutbound" Type="REST">
      <Request SkipIf="[CallType]!=Outbound" Url="https://mysite.com/some_folder/custom_script.php" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
        <PostValues Key="">
          <Value Key="callType" Type="String">[CallType]</Value>
        </PostValues>
      </Request>
      <Outputs Next="ReportCallNotanswered" AllowEmpty="true" />
    </Scenario>
    <Scenario Id="ReportCallNotanswered" Type="REST">
      <Request SkipIf="[CallType]!=Notanswered" Url="https://mysite.com/some_folder/custom_script.php" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
        <PostValues Key="">
          <Value Key="callType" Type="String">[CallType]</Value>
        </PostValues>
      </Request>
      <Outputs AllowEmpty="true" />
    </Scenario>
  </Scenarios>
</Crm>

Does anyone have any idea what the issue could be?
 
There should definitely be a log file. Sounds like a possible permissions issue.

Also, what version are you using and how was it installed? And what OS do you run it on?
 
Thank you for your response.

3cx: Version 20.0 Update 7 (Build 1019 Beta)
OS: X64 Debian GNU/Linux 12 (bookworm), framework .NET 8.0.17
How it was installed: from debian-amd64-netinst-3cx.iso (v18) and then updated to v20

I've tested downloading the Support Info while logged in as both System Administrator and System Owner.
 
Are you making calls between extensions to test this? The CRM integration only works for external calls.
 
  • Like
Reactions: Evolute IT
Are you making calls between extensions to test this? The CRM integration only works for external calls.
No, I make calls to and from my cell phone, so they are external.
 
Is that mobile phone number set in your 3CX user? If so, it bypasses the CRM.
No, my number isn’t set anywhere - not in my user profile or anywhere else in the system. Besides, the system is being actively used by our sales team, they receive calls from different phone numbers and they make calls to different phone numbers. Yet it doesn't trigger the CRM integration.

Is there a way to make sure that the system does not consider all of our calls internal? Or to check if it does that
 
Last edited:
No, my number isn’t set anywhere - not in my user profile or anywhere else in the system. Besides, the system is being actively used by our sales team, they receive calls from different phone numbers and they make calls to different phone numbers. Yet it doesn't trigger the CRM integration.
For fun, try refreshing the license in the Dashboard, then reboot/restart system service.
 
For fun, try refreshing the license in the Dashboard, then reboot/restart system service.
did that, nothing changed.

Here's a log record from the dashboard regarding an outbound call, in case it's helpful (I replaced personal info):
Code:
[CDR] Call(C:1): CDR: Incoming params:
cdr_id = '00000000-01dc-3797-5a20-2b6e00000002'
call_history_id = '00000000-01dc-3797-5a1f-b6d800000001'
source_participant_id = '00000000-01dc-3797-5a1f-c47600000001'
source_entity_type = 'extension'
source_dn_type = 'extension'
source_dn_number = '104'
source_dn_name = 'Person 1 (sales 4)'
source_participant_name = 'Person 1 (sales 4)'
source_participant_phone_number = '104'
source_participant_trunk_did = ''
source_participant_is_incoming = 1 (i32)
source_participant_is_already_connected = 0 (i32)
source_participant_group_name = '__DEFAULT__'
source_participant_billing_suffix = ''
destination_participant_id = '00000000-01dc-3797-5a20-2b8800000003'
destination_entity_type = 'external_line'
destination_dn_number = '10020'
destination_dn_type = 'provider'
destination_dn_name = 'MTT 5551234567-500'
destination_participant_name = ''
destination_participant_phone_number = '1234567890'
destination_participant_trunk_did = ''
destination_participant_is_incoming = 0 (i32)
destination_participant_is_already_connected = 0 (i32)
destination_participant_group_name = ''
destination_participant_billing_suffix = ''
base_cdr_id = '00000000-01dc-3797-5a1f-c46a00000001'
originating_cdr_id = '00000000-01dc-3797-5a1f-c46a00000001'
creation_method = 'route_to'
creation_forward_reason = 'polling'
source_presentation = '5551234567-500'
termination_reason = 'dst_participant_terminated'
terminated_by_participant_id = '00000000-01dc-3797-5a20-2b8800000003'
cdr_started_at = '2025-10-07 14:33:30.591937'
cdr_answered_at = '2025-10-07 14:33:36.436002'
 
We fixed it.

To resolve the log file issue, we:
  • created a backup of the 3CX system,
  • reinstalled Linux, and
  • restored the 3CX system from the backup.
After these steps, 3CXSystemService.log started to appear in the Support Info archive, which helped us identify what was wrong with the CRM integration: we had the PHONEBOOK_MIN_MATCH value set to 15 for some reason, which led to the contact lookup scenario (as well as all the following ones) being skipped.

Setting a lower value fixed the issue — now everything works perfectly.

Thanks to everyone who tried to help.
 
Interesting that such a big value will cause this. That should be reported for review by the dev team I think. If that parameter is set to a length longer than the number, it should just check the full number I think....

@KyriacosS_3CX maybe you can check this internally?
 
The logic there is that it should match at-least the number of digits requested. I think this might be something for the ideas forum to describe it clearly as a scenario.
 

Forum statistics

Threads
111,872
Messages
589,493
Members
164,718
Latest member
appservices@bergmanbrothe