Need help with creating XML for phone log...

Status
Not open for further replies.

Tilo

Joined
Jan 30, 2019
Messages
3
Reaction score
0
Hello,

my company has given me the task to programm an interface to log incoming calls from our 3CX system on one of our servers. I tried to using a the CRM Integration and creating a XML like explaned in https://www.3cx.com/docs/crm-integration/. Currently it does nothing. Nothing to see in my script or server logs and nothing to the in the 3CX logs either.

My goal is to call a script on our servers and transfer the calling number and the called extension number.

Here is the XML I tried to use, can anyone help me find the mistake?


<?xml version="1.0"?>
<Crm xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Country="DE" Name="IncomingCall" Version="1">
<Number Prefix="Zeros" MaxLength="" />
<Connection MaxConcurrentRequests="16" />
<Parameters>
<Parameter Name="******************" Type="String" Title="ApiKey" />
</Parameters>
<Authentication Type="No" />
<Scenarios>
<Scenario Id="LogCall">
<Request Url="https://************/incomingcall.php" Message="IncomingCall" RequestType="Post" ResponseType="Json">
<PostValues>
<Value Key="requester_id" Type="Integer">[Contact::ContactId]</Value>
<Value Key="phone">[Number]</Value>
<Value Key="description" Passes="2" If="[CallType]==Inbound">InboundCallText</Value>
<Value Key="description" Passes="2" If="[CallType]==Missed">MissedCallText</Value>
<Value Key="description" Passes="2" If="[CallType]==Outbound">OutboundCallText</Value>
<Value Key="description" Passes="2" If="[CallType]==Notanswered">NotAnweredOutboundCallText</Value>
<Value Key="source" Type="Integer">3</Value>
<Array Key="tags">
<Value>[CallType]</Value>
<Value>Call</Value>
<Value>[Agent]</Value>
</Array>
</PostValues>
</Request>
<Variables />
<Outputs Next="" AllowEmpty="true" />
</Scenario>
</Scenarios>
</Crm>
 
Hello @Tilo,

If you just need to get the calls from a 3CX server, then maybe this is not the right approach. To do that, I would configure 3CX to generate CDRs, and then I would use some script or program to process the text files containing the information of the calls. Take a look at this:
https://www.3cx.com/docs/cdr-call-data-records/

If you still want to use the CRM template approach, please follow this guide:
https://www.3cx.com/docs/crm-integration/

And use this document as a reference:
https://www.3cx.com/docs/server-side-crm-template-xml-description/

But keep in mind the following:
1) You need a lookup scenario. This is a scenario with an empty ID. This scenario will be used to retrieve contacts from the CRM. This is mandatory, you can't have a template without a lookup scenario, because the ReportCall scenario also depends on this.

2) In order to send the calls details to your server, you need to use the ReportCall scenario. This scenario is invoked when the call ends. But it will only be invoked when the call matches a contact from the lookup scenario.

3) The ReportCall scenario will only send information about calls from and to external numbers. Calls between extensions are not reported. So if this is important to you, consider the CDR approach.

Kind regards.
 
I tried using the CRM template approach and I got the lookup scenario working. But when I try to implement the ReportCall scenario I get error messages whenever I try to add agent or call duration infos. I always get exceptions which I can't make sense of. And like written here...

https://www.3cx.com/docs/server-side-crm-template-xml-description/

the agent should be predefined.

And if I try to follow the instrunctions

https://www.3cx.com/docs/crm-integration/

some parts don't seem to work, like the output ContactId is missing. Any ideas? Is it possible the 3CX Template Generator itself is broken?
 
Are you in v15.5 by any chance? All the documentation is already updated to the features that will come with v16, so probably that's the issue. You can try this in a testing installation on v16.
 
I'm using the 3CX Template Generator from this page...

https://www.3cx.com/docs/crm-integration/

Can't tell which version it's supposed to be. In testing installations the feature is disabled and I'm not sure I want to "test" it in my live system...
 
You will need to wait for the final release of v16, which will be available shortly.
 
Status
Not open for further replies.

Latest Posts

Forum statistics

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