- 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:

Here's the current version of my template:
Does anyone have any idea what the issue could be?
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:

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?