Use attached call data created in CFD in CRM

JonTheITGuy

Premier Customer
Joined
Jan 30, 2025
Messages
16
Reaction score
2
Is it possible to attach call data in a CFD and then pull that data in the reportcall of a crm integration? Use case is that we need a crm integration that I have created and works fine, except that it creates a ticket in the CRM for every inbound call. Trying to figure out a way to only create a ticket in the CRM for certain ring groups or extensions. I have created the CFD and it works just like the CRM to get contact and create ticket for the correct ring groups. I just do not have a way to get the call data when the call ends and update the ticket with tthe url for the call recording. All we need for now until we can get a transcription setup going. Is this possible or does anyone have any suggestions on how to get the system to only create tickets for certain extensions/ring groups and then update ticket info with call journaling values? Any help would be appreciated and thanks for all info in the forums, its helped me a lot setting this up.
 
Last edited:
I have figured this out. When you set the public_crm_contact you can set the ContactRawData. This is an object that the crm uses as "EntityId|EntityType", where | is the seperator. I was able to set a ticketId as entityId in the cfd and use that in the crm to do all the call journaling.
 
  • Like
Reactions: Evolute IT
So this does not seem to work since updating to Build 20.0.6.619. When setting the contactraw data with attach call data "public_crm_contact" it doesn't seem to update the contactrawdata for the crm. Are you still able to update the "public_crm_contact" in the CFD to affect the CRM? Attaching the "public_crm_contact_url" data in the CFD still seems to set the url but unable to set the "EntityId|EntityType" for contactrawdata.
 
So this does not seem to work since updating to Build 20.0.6.619. When setting the contactraw data with attach call data "public_crm_contact" it doesn't seem to update the contactrawdata for the crm. Are you still able to update the "public_crm_contact" in the CFD to affect the CRM? Attaching the "public_crm_contact_url" data in the CFD still seems to set the url but unable to set the "EntityId|EntityType" for contactrawdata.
It works but you need to set more than just the raw data. Name, number, url, etc.
 
Here you have the details of the information that needs to be attached:
 
  • Like
Reactions: Evolute IT
In the call flow I have been setting "public_crm_contact" as the following:
Code:
{
    "FirstName": "Jon",
    "LastName": "Doe",
    "Email": "[email protected]",
    "ContactUrl": "https://app.expertconnect.deere.com/public/ticket/82C46BC0-B01C-4FF6-890B-AA7ED8A73850",
    "PhoneBusiness": "+1234567890",
    "ContactRawData": "82c46bc0-b01c-4ff6-890b-aa7ed8a73850|Contacts"
}

It shows in the logs that this seems to be setting in the CallFlow logs. In the SystemService logs it shows the "public_crm_contact" as such:


Code:
{
  "FirstName": "Jon",
  "LastName": "Doe",
  "Email": null,
  "ContactUrl": "https://app.expertconnect.deere.com/ticket/86ac3c52-4730-40b6-a90b-714a1e708c67",
  "CompanyName": null,
  "PhotoUrl": null,
  "ContactType": 0,
  "PhoneBusiness": "1234567890",
  "PhoneBusiness2": null,
  "PhoneHome": null,
  "PhoneMobile": null,
  "PhoneMobile2": null,
  "PhoneOther": null,
  "FaxBusiness": null,
  "Pager": null,
  "ContactRawData": null,
  "Title": null,
  "Department": null
}

The Title and Department Values seem to be new and I have tried to set them in the CFD, but not sure of the syntax on them. When the CRM goes to do the ReportCall Scenario, its showing the ContactRawData = ''. Before the update I was able to not have a matching scenario and it would run through the CFD and apply the "public_crm_contact" update. After the update the CRM will stop processing if the ContactUrl is not set in the CRM. I have added the Scenario to apply the ContactUrl, but now it seems like when the CFD attaches the "public_crm_contact" it does not apply to the CRM side. Has this update with all the additional CDR stuff work differently now? Do I need to be setting every value in the "public_crm_contact" even if the value is null when I attach the call data in the CFD?
 
You don't need to set all the fields, just the name, the ContactUrl and one phone number. But if for the same call you see one JSON first, and something different later, then that means that someone is updating this data. Maybe your template is returning this data and that gets updated after the CFD set those values....
 
  • Like
Reactions: Evolute IT
I have looked at the logs and I don't know what else could be setting "public_crm_contact". The only thing I don't know about is the cdr log.
Code:
2025/04/29 12:00:23.485|0024|Debg| [Npgsql.Command] Executing command: insert into crm_cache (number, contact, crm_url, created_at, last_checked) values ($1, $2, $3, now(), now());

Other than that here are the main things I have found in the logs.
Code:
From SystemService:     2025/04/29 12:00:23.483|0005|Trac| Call control transaction               3CXSystemService01.AttachConnectionDataAsync.17 has completed by notification:
                            Success(NotSpecified:):
                            Wconnection.27019
                            AttachedData=System.Collections.Generic.Dictionary`2[System.String,System.String]
                            LastChangeStatus=04/29/2025 18:00:22
                            IsOutbound=True
                            IsInbound=False
                            DialedNumber=
                            ExternalParty=+13082253190
                            InternalParty=Wroutepoint.1396: 9060
                            Status=Connected
                            HistoryIDOfTheCall=00000000-01db-b930-93c7-a5fc00000a46
                            OriginatedBy=
                            ReferredBy=0
                            CallConnectionID=1
                            CallID=2630
                            OnBehalfOf=
                            DN=Wexternalline.34: 10000 on Wprovider.2: us-west-or.sip.flowroute.com:0 - Flowroute
                            OtherCallParties=TCX.Configuration.Interop.Wconnection[]
                            RecordingState=Stop
                            PartyConnectionID=27021
                            ReferredByDN=
                            OfferProvided=True
                            RouteTarget=
                            ID=27019
                            HasAttached=False
                                AttachedData:
                                    prevCall=0
                                    prevLeg=0
                                    devcontact=sip:[email protected]
                                    caller_name=testing:[V]+13082253190
                                    [email protected];to-tag=0715ef4d;from-tag=gK042a8c
                                    public_push_callerid=9060
                                    public_push_callername=testing
                                    inbound_did=+13082031341
                                    inbound_did_rule=testing
                                    sip_displayname=[V]+13082253190
                                    participant_uid=00000000-01db-b930-93c8-439141c
                                    [email protected]:5482
                                    [email protected]
                                    recordstate=0
                                    extnumber=+13082253190
                                    chid=00000000-01db-b930-93c7-a5fc00000a46
                                    public_lookup_displayname_override=Jon Landrum
                                    public_crm_contact={
                            "FirstName": "Jon",
                            "LastName": "Landrum",
                            "Email": null,
                            "ContactUrl": "https://app.expertconnect.deere.com/public/ticket/86ac3c52-4730-40b6-a90b-714a1e708c67",
                            "CompanyName": null,
                            "PhotoUrl": null,
                            "ContactType": 0,
                            "PhoneBusiness": "3082253190",
                            "PhoneBusiness2": null,
                            "PhoneHome": null,
                            "PhoneMobile": null,
                            "PhoneMobile2": null,
                            "PhoneOther": null,
                            "FaxBusiness": null,
                            "Pager": null,
                            "ContactRawData": null,
                            "Title": null,
                            "Department": null
                            }
                        2025/04/29 12:00:23.484|0005|Trac| Pending CallControlRequests:0
                        2025/04/29 12:00:23.487|0039|Info| [Integration.Crm.NumberProcessors.ProcessorChainFactory] CRM: processing of +3082253190 has been finished

From CallFlowLog:       2025/04/29 12:00:30.863|0008|Trac| [_3CX.Script] _9060_68.Main.27021.[C:2630.3]-testing - CallID 00000000-01db-b930-93c7-a5fc00000a46 - CallFlow.CFD.AttachCallDataComponent 'AttachCallData1' - Data attached with
                        Name='public_crm_contact' - Value='{
                            "FirstName": "Jon",
                            "LastName": "Landrum",
                            "Email": "",
                            "ContactUrl": "https://app.expertconnect.deere.com/public/ticket/2F58D0DE-5B7F-4BAF-91EB-FDF02CD5CF5B",
                            "PhoneBusiness": "+13082253190",
                            "ContactRawData": "2f58d0de-5b7f-4baf-91eb-fdf02cd5cf5b|Contacts"
                        }

From SystemService:     2025/04/29 12:00:41.712|0036|Trac| [_3CX.CDR] Call Flow 00000000-01db-b930-93c7-a5fc00000a46 COMPLETE!

                        2025/04/29 12:00:47.017|0017|Debg| [Integration.Crm.CallProcessingService] CRM: Triggering Call Journaling with values - CallType='Inbound' - PhoneNumber='+13082253190' - ContactName='Jon Landrum' -
                        AgentExtension='1000' - AgentFirstName='Jon' - AgentLastName='Landrum' - AgentEmail='[email protected]' - ContactRawData='' - StartTime='04/29/2025 18:00:22' - EndTime='04/29/2025 18:00:41' - EstablishedTime='04/29/2025     18:00:22'

Any ideas on what could be overriding the ContactRawData? If I am understanding the logs correctly it looks like it stops processing the CRM and then the call flow goes and sets the 'public_crm_contact' then call flow ends and it triggers call journaling but with null value for the rawdata. Thought I had figured this out then it all changes. Might be seeing the logs in my sleep. If you guys can point me in any direction I would greatly appreciate it. Thanks for taking time to respond on this forum.
 
Do you have a lookup scenario declared in your CRM integration template? If so, it's probably that.
 
I didn't but now it seems to stop processing the CRM if I don't have one that sets the ContactUrl. I get this in the logs.
Code:
[Integration.Crm.NumberProcessors.ProcessorChainFactory] CRM: Removed from processing. Number=+13082253190
Then it never tries to do any of the call journaling through the crm. I tried having it just set the ContactUrl and also just setting static ContactUrl. I just don't know why it stopped working. Even learned how to make a class and object in c# to see if the json wasnt getting populated correctly. Wish my boss didnt want to update to Alpha build but here we are. Thanks for the help. Hopefully I'll figure something out.
 
Do you guys know if this functionality works with Update 6? Attaching the "public_crm_contact" property in the CFD updates everything but the ContactRawData. I made a test flow that gets the "public_crm_contact" data before attaching it. Running this flow is showing that the CRM updates that before the CFD attaches the data to it. Everything I have tried seems to show that. I have even tried attaching data to "public_crm_contact_rawdata" that I have found in another thread, but believe that was for an earlier version. Just wanting to know if this works in the newest Build.
 
If you don't have a lookup scenario defined, it should attach properly.

Make sure you're building your CallFlow using the latest Designer app. It may be related to that if you're still using the v18 designer. See the blog, there's a recent post about the new v20 updated designer.
 
This functionality works with U6, I checked it with the RC released yesterday. You can update the data set by the CRM integration from the CFD app, but maybe you are setting a wrong property. Can you show what value you are setting there?
 
  • Like
Reactions: Evolute IT
In my CFD app I am setting this:
Code:
[_3CX.Script] _9060_56.Main.12008.[C:1188.3]-testing - CallID 00000000-01db-bad6-b34e-f42e000004a4 - CallFlow.CFD.AttachCallDataComponent 'AttachCallData1' - Data attached with Name='public_crm_contact' - Value='{
  'FirstName': 'Test',
  'LastName': 'Landrum',
  'Email': '[email protected]',
  'ContactUrl': 'https://app.expertconnect.deere.com/public/ticket/994A6599-57B4-4D38-A790-E11B2725971E',
  'PhoneBusiness': '+13082253190',
     'ContactRawData': '994a6599-57b4-4d38-a790-e11b2725971e|Contacts'
}'
I am using CONCATENATE() in an Attach Call Data component to set "public_crm_contact" as such:

C#:
CONCATENATE("{\"FirstName\":\"Test\",\"LastName\":\"Landrum\",\"Email\": \"[email protected]\",\"ContactUrl\":\"",callflow$.TicketUrl,"\",\"PhoneBusiness\":\"",session.ani,"\",\"ContactRawData\":\"",callflow$.TicketId,"|Contacts\"}")

I initially had the it with \r\n to make it look more like a json, but removed it to see if that was an issue. So without the \r\n it looks like this in the logs:
Code:
2025/05/01 14:36:51.805|0011|Trac| [_3CX.Script] _9060_60.Main.12495.[C:1229.3]-testing - CallID 00000000-01db-bad8-bff6-05a5000004cd - CallFlow.CFD.AttachCallDataComponent 'AttachCallData1' - Attaching data to the call Name='public_crm_contact' - Value='{"FirstName":"Test","LastName":"Landrum","Email": "[email protected]","ContactUrl":"https://app.expertconnect.deere.com/public/ticket/3CE17DC0-B271-4EFE-9E85-1895AB352BF4","PhoneBusiness":"+13082253190","ContactRawData":"3ce17dc0-b271-4efe-9e85-1895ab352bf4|Contacts"}'
 
Last edited:
This looks good to me. Why do you think this is not being considered by 3CX? This information is used for Call Journaling, are you having issues with that?
 
  • Like
Reactions: Evolute IT
Yes when the call journaling comes up its showing the ContactRawData as blank. I have tried not using a matching scenario, but then it does not run the Call Journaling at all. When I do have a matching scenario I only set ContactUrl and FirstName. I have tried it with the v20 CFD builder and still not getting ContatRawData to set for the call journaling.

Code:
2025/05/01 15:25:58.565|0014|Debg| [Integration.Crm.CallProcessingService] CRM: Triggering Call Journaling with values - CallType='Inbound' -
PhoneNumber='+13082253190' - ContactName='Test Landrum' - AgentExtension='1000' - AgentFirstName='Jon' - AgentLastName='Landrum' -
AgentEmail='[email protected]' - ContactRawData='' - StartTime='05/01/2025 21:25:40' - EndTime='05/01/2025 21:25:55' - EstablishedTime='05/01/2025 21:25:40'

Maybe my CRM template is the issue. Can you create a template without a matching scenario? According to the docs and forum posts you need at least FirstName and ContactUrl for the crm to be considered successful or thats how I understand it.
 
That's weird. You should check the call notifications in the 3CX logs to see when this value is being changed.

The contact lookup scenario is required, otherwise the call journaling will not be triggered.
 
AFAIK, the lookup isn't needed as long as CRM data is present on the call, whether via the lookup scenario, or via a callflow/call script that attaches it.

The ReportCall is ran as long as there's data present.

Also, in the lookup scenario, you also need to provide at least 1 phone number that matches the number looked up, otherwise the match is ignored.
 
AFAIK, the lookup isn't needed as long as CRM data is present on the call, whether via the lookup scenario, or via a callflow/call script that attaches it.

The ReportCall is ran as long as there's data present.

Also, in the lookup scenario, you also need to provide at least 1 phone number that matches the number looked up, otherwise the match is ignored.
Yes, this is correct, that scenario is needed if you're not adding that information in a different way. If you do it from the CFD, that's enough.

Can you describe your callflow? Are you receiving an inbound call from an external number and sending it to the CFD app? When the CFD app attaches the data to the call, it does it on the call it is currently connected with. However, this information is only useful when connected to an ExternalLine. If you're calling the CFD app from an extension for example, the information you attach will not do what you need.
 
  • Like
Reactions: Evolute IT
Are you talking about the SystemService and CallFlow logs? Showing CRM attaches data with "public_crm_contact" property

Code:
2025/05/01 15:25:40.561|0005|Trac| Call control transaction 3CXSystemService01.AttachConnectionDataAsync.810 has completed by notification:
Success(NotSpecified:):

Then about 8 seconds later the Call Script attatchs data with that property.

Code:
2025/05/01 15:25:48.567|0004|Trac| Call control transaction 3CXCallFlow01.AttachConnectionDataAsync.1805 has completed by notification:
Success(NotSpecified:)

But then a bit later in the CallFlow log when it transfers the call it shows all the call data without the "public_crm_contact" property, but believe it did this before. Unsure on that.