CRM ReportCall scenario not being triggered for unanswered calls

oneam

Customer
Basic Certified
Joined
Oct 7, 2024
Messages
16
Reaction score
4
Hi,

we are configuring the CRM integration with our custom-made CRM and we are using the attached template but the reportcall scenario seems to get skipped when call isn't answered. What could be the cause?
 

Attachments

You should enable verbose logs and check the 3cxSystemService.log file. The call should be logged, except if it arrives from a number that can't be matched to a contact.
 
Thanks for the reply!
I tried regenerating the template from the wizard.

I dug inside the SystemService log file, and I got this error for the Notanswered scenario:

Code:
CRM: Exception during call reporting
System.NullReferenceException: Object reference not set to an instance of an object.
   at TcxLexicalParser.LexEvaluator.InstanceFunction(IValueManager valueManager, FunctionElement functionElement)
   at TcxLexicalParser.LexEvaluator.ProcessInt(FunctionElement functionElement, IValueManager valueManager)
   at Integration.Crm.Engine.ScenarioProcessorBase.CreateJsonFromPostValues(RequestItem requestItem, IValueManager customManager)
   at Integration.Crm.Engine.ScenarioProcessorBase.ProcessRequest(Boolean authScenario, ScenarioRequest request, IValueManager customManager, HttpClient client, Boolean retry, CancellationToken token)
   at Integration.Crm.Engine.ScenarioProcessorBase.ProcessScenario(ProtocolScenario scenario, IValueManager customManager, SqlQueryParameter[] sqlQueryParameter, CancellationToken token)
   at Integration.Crm.Engine.ScenarioProcessorBase.ProcessMatching(ProtocolScenario scenario, MatchingPath matching, ResponseMatcher responseMatcher, IValueManager customManager, SqlQueryParameter[] sqlQueryParameter, HashSet`1 distinctMatchings, CancellationToken token)
   at Integration.Crm.Engine.ScenarioProcessorBase.ProcessFoundMatchings(ProtocolScenario scenario, IValueManager customManager, SqlQueryParameter[] sqlQueryParameter, List`1 matchings, ResponseMatcher responseMatcher, CancellationToken token)
   at Integration.Crm.Engine.ScenarioProcessorBase.ProcessScenario(ProtocolScenario scenario, IValueManager customManager, SqlQueryParameter[] sqlQueryParameter, CancellationToken token)
   at Integration.Crm.Engine.ScenarioProcessorBase.ProcessMatching(ProtocolScenario scenario, MatchingPath matching, ResponseMatcher responseMatcher, IValueManager customManager, SqlQueryParameter[] sqlQueryParameter, HashSet`1 distinctMatchings, CancellationToken token)
   at Integration.Crm.Engine.ScenarioProcessorBase.ProcessFoundMatchings(ProtocolScenario scenario, IValueManager customManager, SqlQueryParameter[] sqlQueryParameter, List`1 matchings, ResponseMatcher responseMatcher, CancellationToken token)
   at Integration.Crm.Engine.ScenarioProcessorBase.ProcessScenario(ProtocolScenario scenario, IValueManager customManager, SqlQueryParameter[] sqlQueryParameter, CancellationToken token)
   at Integration.Crm.Engine.ScenarioProcessorBase.ProcessMatching(ProtocolScenario scenario, MatchingPath matching, ResponseMatcher responseMatcher, IValueManager customManager, SqlQueryParameter[] sqlQueryParameter, HashSet`1 distinctMatchings, CancellationToken token)
   at Integration.Crm.Engine.ScenarioProcessorBase.ProcessFoundMatchings(ProtocolScenario scenario, IValueManager customManager, SqlQueryParameter[] sqlQueryParameter, List`1 matchings, ResponseMatcher responseMatcher, CancellationToken token)
   at Integration.Crm.Engine.ScenarioProcessorBase.ProcessScenario(ProtocolScenario scenario, IValueManager customManager, SqlQueryParameter[] sqlQueryParameter, CancellationToken token)
   at Integration.Crm.Engine.ScenarioProcessorBase.Execute(ProtocolScenario scenario, SqlQueryParameter[] sqlQueryParameter, CancellationToken token)
   at Integration.Crm.Engine.CrmProcessor.ExecuteScenarioByName(String scenarioName, IEnumerable`1 parameters, Boolean useNoAuthProvider, CancellationToken token)
   at Integration.Crm.Engine.CrmProcessor.ExecuteScenarioWithRetries(String scenarioId, Dictionary`2 parameters, CancellationToken token)
   at Integration.Crm.Engine.CrmProcessor.ReportCall(CallEndedEvent callEndedEvent, CancellationToken token)

I also tried removing every POST value and the SkipIf condition, but with no avail, the contact lookup always returns a valid contact.
 

Attachments

Last edited:
Probably your issue is in this line:
<Value Key="establishedAt" Passes="1" Type="String">[[CallEstablishedTimeUTC].ToString("dd-MM-yyyy HH:mm:ss")]</Value>

You're using the variable CallEstablishedTimeUTC, but that variable might be null when the call is not answered, so you would need to add an If to add that only when the variable has a value:
<Value Key="establishedAt" Passes="1" Type="String" If="[IIf([CallType]==Inbound||[CallType]==Outbound,True,False)]">[[CallEstablishedTimeUTC].ToString("dd-MM-yyyy HH:mm:ss")]</Value>
 
  • Like
Reactions: Evolute IT
Thank you.
Unfortunately, that is not the issue. I even tried hardcoding its value and completely removing it.
Previous error still persists.
 
You have 4 chained scenarios in your template for call journaling, did you make the change to all of them?
 
Thank you so much for your precious help, that was the issue.
Have a good day!
 
Actually, instead of adding that If attribute, you can just remove the entire line for the 2 scenarios in which you don't have the established date time (missed and unanswered call). That will simplify the XML. But either way it will work.
 
  • Like
Reactions: Evolute IT