CRM API calls not called on real calls but are called on tests

Status
Not open for further replies.

Venett

Bronze Partner
Joined
Jun 30, 2020
Messages
7
Reaction score
0
Hi,

We're attempting to integrate realworks into 3CX. However we noticed that for both this CRM integration and another one, that after upgrading to 3CX v20 (Update 2 (Build 715 Release)), that calls to the API aren't made on actual phone calls.

When testing through "Integrations > CRM" and then the "TEST" button, the request is beeing made to the other server, we can see that in the logs on the other end aswell. But when an actual phone call is made the request isn't logged. The call is visible in the call log.

Did something change in v20 on CRM activation? or does the XML syntax need an update to work in production? Or is it a bug that api calls/requests aren't made at all on actual calls?

For reference, the xml:

XML:
<?xml version="1.0" encoding="utf-8"?>
<Crm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Country="US" Name="Realworks" Version="2" SupportsEmojis="true" ListPageSize="0">
  <Number Prefix="AsIs" MaxLength="[MaxLength]" />
  <Connection MaxConcurrentRequests="16" />
  <Parameters>
    <Parameter Name="ServerId" Type="String" Parent="General Configuration" Editor="String" Title="Server ID:" Validation="" Default="" ListValues="" RequestUrl="" RequestUrlParameters="" ResponseScenario="" />
    <Parameter Name="UserId" Type="String" Parent="General Configuration" Editor="String" Title="User ID:" Validation="" Default="" ListValues="" RequestUrl="" RequestUrlParameters="" ResponseScenario="" />
    <Parameter Name="AuthToken" Type="String" Parent="General Configuration" Editor="String" Title="Auth Token:" Validation="" Default="" ListValues="" RequestUrl="" RequestUrlParameters="" ResponseScenario="" />
    <Parameter Name="CreateContactEnabled" Type="Boolean" Parent="General Configuration" Editor="String" Title="Allow contact creation directly to your CRM using 3CX Web Client" Validation="" Default="False" ListValues="" RequestUrl="" RequestUrlParameters="" ResponseScenario="" />
    <Parameter Name="ReportCallEnabled" Type="Boolean" Parent="" Editor="String" Title="Enable Call Journaling" Validation="" Default="False" ListValues="" RequestUrl="" RequestUrlParameters="" ResponseScenario="" />
  </Parameters>
  <Authentication Type="No" />
  <Scenarios>
    <Scenario Id="" Type="REST" EntityId="" EntityOrder="">
      <Request SkipIf="" Url="https://crm.example.com/webservices/rest/ippbx/signaleergesprek/[ServerId]/[UserId]/[AuthToken]/01[CallId]/[Number]/220[Agent]/2/[[CallDirection].Replace(&quot;Inbound&quot;,&quot;false&quot;).Replace(&quot;Outbound&quot;,&quot;true&quot;)]/0[CallStartTimeLocalMillis]" MessagePasses="0" Message="" RequestContentType="" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
      <Rules>
        <Rule Type="Any" Ethalon="">id</Rule>
      </Rules>
      <Variables>
        <Variable Name="Id" LookupValue="" Path="id"><Filter /></Variable>
        <Variable Name="ServerId" LookupValue="" Path="[ServerId]"><Filter /></Variable>
        <Variable Name="UserId" LookupValue="" Path="[UserId]"><Filter /></Variable>
        <Variable Name="AuthToken" LookupValue="" Path="[AuthToken]"><Filter /></Variable>
        <Variable Name="CallId" LookupValue="" Path="[CallId]"><Filter /></Variable>
        <Variable Name="CallFrom" LookupValue="" Path="[CallFrom]"><Filter /></Variable>
        <Variable Name="CallTo" LookupValue="" Path="[CallTo]"><Filter /></Variable>
        <Variable Name="Status" LookupValue="" Path="[Status]"><Filter /></Variable>
        <Variable Name="Outgoing" LookupValue="" Path="[Outgoing]"><Filter /></Variable>
        <Variable Name="IsOutgoing" LookupValue="" Path=""><Filter /></Variable>
        <Variable Name="Timestamp" LookupValue="" Path=""><Filter /></Variable>
      </Variables>
      <Outputs AllowEmpty="false" />
    </Scenario>
  </Scenarios>
</Crm>
 
Not sure what that template is but you're using variables that don't exist in the lookup scenario.

The only variables available are [Number] and [CallDirection].
 
Hi,

Thank you for your reply.

The goal isn't a lookup scenario, the goal is to make an API call when an outgoing or incomming call is made as soon as the [Agent] is known. It's closer to "call journaling" (https://www.3cx.com/docs/crm-integration/#h.o5j1mbrhb8tz) in that regard, and then those extra variables should be available. An external app should provide additional information for that agent about the caller/callee (this goes outside of the 3CX system). Similiar to the lookup scenario.

That beeing said; since no scenario is defined, it should fire on all events right? So I'm expecting to see every phone call in the external logs, but only the tests come through.
 
Based on the documentation you provided my assumption of firing on all calls is indeed incorrect: "When the Id is empty, the scenario is used for contact lookup using a phone number.". Thank you for pointing that out.

However my question isn't about the xml, my question is why "contact lookup" does fire in the test method, but doesn't in a real call. And why that did work in V18 but no longer works in V20. This issue affects multiple custom integrations, not just this one, which is work in progress.
 
Based on the documentation you provided my assumption of firing on all calls is indeed incorrect: "When the Id is empty, the scenario is used for contact lookup using a phone number.". Thank you for pointing that out.

However my question isn't about the xml, my question is why "contact lookup" does fire in the test method, but doesn't in a real call. And why that did work in V18 but no longer works in V20. This issue affects multiple custom integrations, not just this one, which is work in progress.
It definitely fires for every external calls. Perhaps something in the template that is broken. We use dozens of custom integrations and none stopped working.

I suggest you check the logs.
 
There are no additional logs (in event logs) at the same timestamps we see calls in the call log. Could one broken XML break other crm integrations aswell?
 
There are no additional logs (in event logs) at the same timestamps we see calls in the call log. Could one broken XML break other crm integrations aswell?
Not sure what you mean by "other CRM integrations". The XML is the one you build and only one is used at a time. If you use your own template, then you gotta respect the schema.

Are you testing with your cellphone by any means?
 
By "other CRM integrations" I mean other uploaded XML's that aren't the current active one. As in previously installed crm integrations.
Most calls were done with a cellphone, but there also aren't logs for landline phone calls. In the office physical phones are used (Yealink T46U). We weren't using the cellphone app for those calls, if that's what you're asking.
 
@ConceptsWeb is asking this because if you're calling from a number that is set as the mobile number of an extension, the contact name will not be shown. Also, you mention that you're using desk phone, please note that only the Web Client will show the contact name and link obtained from the CRM.
 
  • Like
Reactions: Evolute IT
Thank you for clarifying that.

The mobile phones are not set as the mobile number of any of the internal extensions.

For this specific CRM I don't need to use the webclient, because there is a second client (from the CRM) installed on every individual workstation. All I need to do is to make an API call to that CRM and that CRM will show the popup with the details (similiar to how 3cx does that). To make sure the popup is shown at the right workstation I do need to pass the agent/internal phone number for that user. This is how this CRM deals with that, their API does not give a response with any data, just an OK or NOK.

Their API doesn't trigger a popup though, because 3CX isn't making the call to the CRM on actual calls, only when we use the test function in the backend of 3CX.
 
That will not work. When the call starts, 3CX doesn't know yet which agent will pick up. So the lookup is triggered only passing the caller's number. You don't have the agent extension at this point. Then, Call Journaling has this information, but this is invoked when the call ends, too late for you.

The only option you have is using the Call Control API from a service running in the 3CX server, and listen to events in real time. Quite challenging, if you're not used to this API I would recommend that you hire some 3CX partner to do this for you.
 
  • Like
Reactions: Evolute IT
Status
Not open for further replies.

Forum statistics

Threads
112,320
Messages
591,873
Members
165,466
Latest member
EMMEPICASA