3CX v16 Custom server side CRM template timeout

Status
Not open for further replies.

it145

Free User
Basic Certified
Joined
Feb 4, 2014
Messages
24
Reaction score
3
Dear Anyone who can help!

I've had a very frustrating morning trying to get a relatively simple custom CRM XML template created using the 3CX supplied tool. Nick, I like your video and you make it look easy but there seems to be quite a lot of information lacking! After many, many set backs that have only been resolved through a combination of trial and error and reading between the lines (well Forum and existing documentation) it is all up and running fine in the editor tool. I'm concentrating on just the CRM lookup part (blank ID "Matching scenario"). This also uploads fine to the Server and although not clear, the "3CX PhoneSystem 01 System Server" service is also started each time for good measure and of course the authentication details added.

Here is the BIG but, when the "Test" button is used to test a phone number lookup the management console just locks up and then after approximately 30 seconds states that it has stopped responding. On clearing this dialog, everything seems to be well again. Just in case it's a test problem, an external call is then placed on the system with a number that we know matches but nothing happens. The Contact options have been set to match "At least 6 number characters". Even if the activity log is sent to the maximum "Verbose" level, there doesn't seem to be any debug or diagnostic logging that can be used to diagnose the issue. After quite a few hours and coming very close, I'm very reluctantly going to have to give up, unless the Forums can return something.

Please remember, this is all working fine in the editor tool running a "Contact lookup" and returns both variables and output like you would expect and similar to what Nick demonstrates in his video.

I would welcome anyone who might have a clue what's going on and/or how this can be diagnosed?

Many thanks in advance ;)
 
Can you post your XML CRM template?
 
Here is an earlier version of the template that works in the external tool but just times out when uploaded and during testing. I've tried allowing "Allow empty response" but didn't seem to make a difference. Then further scenario's have been added, in case these were mandatory (although the upload did not complain) but this seems to have made no difference either.

This is the simplest version, using http (rather than https) and also returning the [Number] in the Output which is apparently mandatory (for anyone else that might have this issue).

The main frustration is it's working in the tool and returning variables and an output but not when uploaded and I can find no way of getting and debug to know what might be happening. My main question is ... How do you debug once uploaded or is this not possible?

XML:
<?xml version="1.0"?>
<Crm xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Country="US" Name="DemoCRM" Version="1">
  <Number Prefix="Zeros" MaxLength="" />
  <Connection MaxConcurrentRequests="2" />
  <Parameters>
    <Parameter Name="APIUser" Type="String" Editor="String" Title="APIUser" />
    <Parameter Name="APIPwd" Type="String" Editor="String" Title="APIPwd" />
  </Parameters>
  <Authentication Type="Basic">
    <Value>[APIUser]:[APIPwd]</Value>
  </Authentication>
  <Scenarios>
    <Scenario Id="" Type="REST">
      <Request SkipIf="" Url="http://crm-url-goes-here/api/v1/Account?select=name%2Cwebsite%2CemailAddress%2CphoneNumber%2Ctype&amp;maxSize=20&amp;offset=0&amp;orderBy=createdAt&amp;order=desc&amp;where%5B0%5D%5Btype%5D=contains&amp;where%5B0%5D%5Battribute%5D=phoneNumber&amp;where%5B0%5D%5Bvalue%5D=[Number]" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
      <Rules>
        <Rule Type="Any">list.id</Rule>
        <Rule Type="Any">list.name</Rule>
        <Rule Type="Any">list.emailAddress</Rule>
        <Rule Type="Any">list.phoneNumber</Rule>
      </Rules>
      <Variables>
        <Variable Name="VID" Path="list.id">
          <Filter />
        </Variable>
        <Variable Name="VNAME" Path="list.name">
          <Filter />
        </Variable>
        <Variable Name="VEMAIL" Path="list.emailAddress">
          <Filter />
        </Variable>
        <Variable Name="VPHONE" Path="list.phoneNumber">
          <Filter />
        </Variable>
      </Variables>
      <Outputs Next="" AllowEmpty="false">
        <Output Type="LastName" Passes="0" Value="[VNAME]" />
        <Output Type="PhoneBusiness" Passes="0" Value="[Number]" />
        <Output Type="ContactUrl" Passes="0" Value="http://crm-url-goes-here/#Account/view/[VID]" />
      </Outputs>
    </Scenario>
  </Scenarios>
</Crm>
 
Hello @it145,

This will not cause any difference if it's working in the tool, however it's worth to mention that the rules are to identify a contact record from a response that might have an array of records. So, when you're specifying 4 items:
XML:
<Rules>
        <Rule Type="Any">list.id</Rule>
        <Rule Type="Any">list.name</Rule>
        <Rule Type="Any">list.emailAddress</Rule>
        <Rule Type="Any">list.phoneNumber</Rule>
</Rules>

Probably, only 1 item would be enough.

In order to understand what could be wrong, please ensure the following:
  1. Your 3CX server should be running v16. If you're running v15.5, then this could be an issue. The tool emulates the CRM server available in v16, so something that runs in the tool might not work in 3CX v15.5.
  2. If the previous point is not the issue, make a test from the 3CX Console > Settings > CRM Integration > Test button, and send us the contents of the Logs window. Please ensure that you remove any sensitive information before pasting the information here.

Kind regards.
 
Thank you for the information and the head's up about the rules (of course!).

As for the version, we're on Linux v16.0.1.273 (the latest non-beta I believe?)

Finally I can now confirm, having tested again in a Chrome Incognito window, the blue/yellow thin progress bar moves in the background during the test and then times out after 60-61 secs with the following message and therefore gives no logs!

Server Error
3CX Management console is not responding. This may be be a browser issue - Clear your browser cache, refresh and try again.
 

Attachments

  • 20190610-crm-test-timeout.png
    20190610-crm-test-timeout.png
    6.3 KB · Views: 12
In this case, please try the following:
  1. Enable verbose logs from the 3CX Console > Dashboard > Activity Log > Settings.
  2. Make a test call (from an external number), so the contact lookup is triggered.
  3. Check the 3cxSystemService.log file, which will contain more information about the interactions between 3CX and the CRM.
 
Thank you for your prompt reply.

Can you confirm which services (other than single System Service) need to be restarted when changing the logging level and also the Server Side CRM if any?

Having located the log file and run some tests with verbose logging enabled, the following relevant log information was obtained using an external call from a mobile (number and url info removed):

Code:
2019/06/10 16:45:16.366|14755|0026|Verb|Processing scenario 'Default'.
2019/06/10 16:45:16.367|14755|0026|Verb|Creating new HttpClient for Basic authentication
2019/06/10 16:45:16.369|14755|0026|Verb|Performing GET request 'http://#crm-url-here#/api/v1/Account?select=name%2Cwebsite%2CemailAddress%2CphoneNumber%2Ctype&maxSize=20&offset=0&orderBy=createdAt&order=desc&where%5B0%5D%5Btype%5D=contains&where%5B0%5D%5Battribute%5D=phoneNumber&where%5B0%5D%5Bvalue%5D=#07XXXXXXXX#'.
2019/06/10 16:45:17.085|14755|0013|Verb|Enqueue Inserted.REGISTRATION.90
...
2019/06/10 16:46:30.725|14755|0025|Erro|Exception during number processing: System.OperationCanceledException: The operation was canceled.
   at System.Net.Http.HttpClient.HandleFinishSendAsyncError(Exception e, CancellationTokenSource cts)
   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at CrmIntegration.ScenarioProcessorBase.ProcessRequest(ScenarioRequest request, IValueManager customManager, HttpClient client, CancellationToken token)
   at CrmIntegration.ScenarioProcessorBase.ProcessScenario(ProtocolScenario scenario, IValueManager customManager, CancellationToken token)
   at CrmIntegration.ScenarioProcessorBase.Execute(ProtocolScenario scenario, CancellationToken token)
   at CrmIntegration.CrmProcessor.GetContactInfoFromCrm(String contactNumber, String destinationEmail, Boolean createIfNotFound, CancellationToken token)
2019/06/10 16:46:30.768|14755|0025|Verb|Removed from processing. Number=#07XXXXXXXX#
2019/06/10 16:46:30.769|14755|0025|Info|CRM: processing of #07XXXXXXXX# has been finished
2019/06/10 16:46:34.000|14755|0014|Verb|WaitingEvent for updates:60000
...4-5lines later
2019/06/10 16:46:56.330|14755|0025|Erro|Exception during number processing: System.OperationCanceledException: The operation was canceled.
   at System.Net.Http.HttpClient.HandleFinishSendAsyncError(Exception e, CancellationTokenSource cts)
   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at CrmIntegration.ScenarioProcessorBase.ProcessRequest(ScenarioRequest request, IValueManager customManager, HttpClient client, CancellationToken token)
   at CrmIntegration.ScenarioProcessorBase.ProcessScenario(ProtocolScenario scenario, IValueManager customManager, CancellationToken token)
   at CrmIntegration.ScenarioProcessorBase.Execute(ProtocolScenario scenario, CancellationToken token)
   at CrmIntegration.CrmProcessor.GetContactInfoFromCrm(String contactNumber, String destinationEmail, Boolean createIfNotFound, CancellationToken token)
2019/06/10 16:46:56.342|14755|0025|Info|Call not reported because contact could not be found for number: #07XXXXXXXX#
2019/06/10 16:46:56.343|14755|0025|Info|CRM: about to report 7 calls at maxConcurrency 7
2019/06/10 16:46:56.343|14755|0025|Info|Call not reported because contact could not be found for number: #07XXXXXXXX#
2019/06/10 16:46:56.343|14755|0025|Info|Call not reported because contact could not be found for number: #07XXXXXXXX#
2019/06/10 16:46:56.344|14755|0025|Info|Call not reported because contact could not be found for number: #07XXXXXXXX#
2019/06/10 16:46:56.344|14755|0025|Info|Call not reported because contact could not be found for number: #07XXXXXXXX#
2019/06/10 16:46:56.344|14755|0025|Info|Call not reported because contact could not be found for number: #07XXXXXXXX#
2019/06/10 16:46:56.344|14755|0025|Info|Call not reported because contact could not be found for number: #07XXXXXXXX#
2019/06/10 16:46:56.344|14755|0025|Info|Call not reported because contact could not be found for number: #07XXXXXXXX#
2019/06/10 16:46:57.038|14755|0013|Verb|Enqueue Updated.REGISTRATION.63
 
Can you confirm which services (other than single System Service) need to be restarted when changing the logging level and also the Server Side CRM if any?
The change will be automatically detected, no need to restart any service.

Having located the log file and run some tests with verbose logging enabled, the following relevant log information was obtained using an external call from a mobile (number and url info removed):
From the logs, it seems that there is no response from the server, and the operation is canceled after a timeout... I would check for possible firewall issues here. Ensure that you can access the web service URL from your 3CX server.
 
Thank you very much, it was indeed a CRM/Firewall issue from that system (strange but wget on Linux box confirmed) and will hopefully help someone else.

Now to implement the other scenarios completely.
 
  • Like
Reactions: edossantos
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,324
Messages
591,897
Members
165,475
Latest member
lastshadow