only inbound calls are sent to crm (call journaling)

Status
Not open for further replies.

philip-freelance

New User
Joined
Aug 30, 2023
Messages
4
Reaction score
0
Hello Support Team,

I hope this message finds you well. I am currently working on integrating our 3CX Phone System with our CRM application. For this project, I am using n8n as the endpoint to manage and track all HTTP requests between the two systems.

While I can confirm that the call journal requests for inbound calls are successfully reaching the n8n endpoint, it appears that we are not receiving any HTTP requests related to outbound calls. This is critical to our operations, as we rely on full call journaling for both inbound and outbound activities to maintain an updated and comprehensive record in our CRM.

To summarize, here are the details of the issue:

  • Endpoint: n8n
  • Successfully Receiving: Inbound call journal requests
  • Not Receiving: Outbound call journal requests
  • Expected Behavior: Should receive HTTP requests for both inbound and outbound calls to sync with our CRM.
We have triple-checked our 3CX configuration and CRM settings to ensure that outbound call journaling should be activated, but we have not been able to resolve the issue.

I attached all the info that I have about this:
crm-template-config.xml -> scenarios for call journaling
log.log -> 3CXSystemServiceLog


outbound call was made at 18:45
 

Attachments

Hi,

Two things:

1. You should set your scenario like this for ReportCall, since you send the exact same data everywhere. This will reduce the XML complexity.
XML:
<Scenario Id="ReportCall" Type="REST">
  <Request SkipIf="[ReportCallEnabled]!=True||[EntityId]==&quot;&quot;" Url="https://n8n.holz-2.de/webhook/createCall" MessagePasses="0" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
    <PostValues Key="">
      <Value Key="duration" Passes="1" Type="String">[Duration]</Value>
      <Value Key="agent" Passes="1" Type="String">[Agent] [AgentFirstName] [AgentLastName]</Value>
      <Value Key="date" Passes="1" Type="String">[DateTime]</Value>
      <Value Key="type" Passes="1" Type="String">[CallType]</Value>
      <Value Key="direction" Passes="1" Type="String">[CallDirection]</Value>
      <Value Key="id" Passes="1" Type="String">[EntityId]</Value>
    </PostValues>
  </Request>
  <Variables />
  <Outputs AllowEmpty="true" />
</Scenario>

Second, it seems your template is not providing the EntityId and EntityType to the Output of the lookup, and thus the raw data is empty during lookup.
1693416605351.png
Whereas, it should be like this "[EntityId]|[EntityType]".
 
  • Like
Reactions: jed and edossantos
Hi,

Two things:

1. You should set your scenario like this for ReportCall, since you send the exact same data everywhere. This will reduce the XML complexity.
XML:
<Scenario Id="ReportCall" Type="REST">
  <Request SkipIf="[ReportCallEnabled]!=True||[EntityId]==&quot;&quot;" Url="https://n8n.holz-2.de/webhook/createCall" MessagePasses="0" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
    <PostValues Key="">
      <Value Key="duration" Passes="1" Type="String">[Duration]</Value>
      <Value Key="agent" Passes="1" Type="String">[Agent] [AgentFirstName] [AgentLastName]</Value>
      <Value Key="date" Passes="1" Type="String">[DateTime]</Value>
      <Value Key="type" Passes="1" Type="String">[CallType]</Value>
      <Value Key="direction" Passes="1" Type="String">[CallDirection]</Value>
      <Value Key="id" Passes="1" Type="String">[EntityId]</Value>
    </PostValues>
  </Request>
  <Variables />
  <Outputs AllowEmpty="true" />
</Scenario>

Second, it seems your template is not providing the EntityId and EntityType to the Output of the lookup, and thus the raw data is empty during lookup.
View attachment 37025
Whereas, it should be like this "[EntityId]|[EntityType]".
Thanks a lot for your reply and the tip about reducing the XML-size :)
I have some issues understanding this:

"Second, it seems your template is not providing the EntityId and EntityType to the Output of the lookup, and thus the raw data is empty during lookup."

Could you please explain it to me? In the XML there is the EntityId send:
<Value Key="id" Passes="1" Type="String">[EntityId]</Value>
 
Thanks a lot for your reply and the tip about reducing the XML-size :)
I have some issues understanding this:

"Second, it seems your template is not providing the EntityId and EntityType to the Output of the lookup, and thus the raw data is empty during lookup."

Could you please explain it to me? In the XML there is the EntityId send:
Basically, you send the EntityId in your ReportCall, but you probably don't define it in the <Output> of the lookup scenario. Thus, it is empty when the ReportCall needs it.

Can you share the lookup part of your XML?
 
  • Like
Reactions: edossantos
Basically, you send the EntityId in your ReportCall, but you probably don't define it in the <Output> of the lookup scenario. Thus, it is empty when the ReportCall needs it.

Can you share the lookup part of your XML?
sure, here is the complete file (I replaced some values with DOMAIN and COMPANY)
 

Attachments

sure, here is the complete file (I replaced some values with DOMAIN and COMPANY)
Ok, first of all, make sure you edit your reportCall as noted above (notice your Output Next and the Request SkipIf attributes.)

Now, I see the EntityId and EntityType being returned. When you run a test within the management console > Settings > CRM, do you see the variables/output being assigned correctly?
 
  • Like
Reactions: edossantos
Ok, first of all, make sure you edit your reportCall as noted above (notice your Output Next and the Request SkipIf attributes.)

Now, I see the EntityId and EntityType being returned. When you run a test within the management console > Settings > CRM, do you see the variables/output being assigned correctly?
Yes they are:

[
{
"UnparsedOutputs": {
"ContactID": "163",
"FirstName": "Test",
"LastName": "Import",
"Email": "[email protected]",
"PhoneBusiness": "",
"PhoneMobile": "00491702231313",
"ContactUrl": "https://xxxx.de/s/contacts/view/163",
"EntityId": "163",
"EntityType": "Contacts"
},
"FirstName": "Test",
"LastName": "Import",
"Email": "[email protected]",
"ContactUrl": "https://xxxx.de/s/contacts/view/163",
"CompanyName": null,
"PhotoUrl": null,
"ContactType": 0,
"PhoneBusiness": "",
"PhoneBusiness2": null,
"PhoneHome": null,
"PhoneHome2": null,
"PhoneMobile": "00491702231313",
"PhoneMobile2": null,
"PhoneOther": null,
"FaxBusiness": null,
"FaxHome": null,
"Pager": null,
"ContactRawData": "163|Contacts"
}
]
 
Ok, can you put the system in verbose (if not already) and run a few tests, then attach the full SystemService log (every line with "CRM:" in it.)

There has to be something here.

Also, what version of the PBX are you using?
 
  • Like
Reactions: edossantos
Status
Not open for further replies.