- Joined
- May 3, 2020
- Messages
- 30
- Reaction score
- 10
Hi,
I created this CRM template.
This template it's supposed to lookup for a number in the external app and save the CDR.
Unfortunately the CDR is not saved, checking 3CX logs I see this error:
Can you explain the sense of this message? Is this error depending on something wrong in the template?
Thanks
I created this CRM template.
XML:
<?xml version="1.0"?>
<Crm Country="IT" Name="TestApp" Version="1">
<Number Prefix="AsIs" MaxLength="[MaxLength]"/>
<Connection MaxConcurrentRequests="10"/>
<Parameters>
<Parameter Name="ReportCallEnabled" Type="Boolean" Editor="String" Title="Enable Call Journaling" Default="True"/>
<Parameter Name="ApiKey" Type="String" Parent="General Configuration" Editor="String" Title="ApiKey" Default="{Token}"/>
<Parameter Name="TestAppClient" Type="String" Parent="General Configuration" Editor="String" Title="TestApp client URL" Default="{TestAppClient}"/>
<Parameter Name="TestAppServer" Type="String" Parent="General Configuration" Editor="String" Title="TestApp server url" Default="{TestAppServer}"/>
</Parameters>
<Authentication Type="No"/>
<Scenarios>
<Scenario Id="" Type="REST">
<Request Url="[TestAppServer]/api/v1/integrations/3cx/contacts?phone-number=[Number]" MessagePasses="0" RequestEncoding="UrlEncoded"
RequestType="Get" ResponseType="Json">
<Headers>
<Value Key="Authorization" Passes="0" Type="String">Bearer [APIkey]</Value>
</Headers>
</Request>
<Rules>
<Rule Type="Any">contact.id</Rule>
</Rules>
<Variables>
<Variable Name="ContactID" Path="contact.id">
<Filter/>
</Variable>
<Variable Name="FirstName" Path="contact.firstName">
<Filter/>
</Variable>
<Variable Name="LastName" Path="contact.lastName">
<Filter/>
</Variable>
<Variable Name="CompanyName" Path="contact.companyName">
<Filter/>
</Variable>
<Variable Name="Email" Path="contact.email">
<Filter/>
</Variable>
<Variable Name="PhoneBusiness" Path="contact.landlinePhone">
<Filter/>
</Variable>
<Variable Name="PhoneMobile" Path="contact.mobilePhone">
<Filter/>
</Variable>
</Variables>
<Outputs AllowEmpty="false">
<Output Type="EntityType" Passes="0" Value="Contact"/>
<Output Type="EntityId" Passes="0" Value="[ContactID]"/>
<Output Type="FirstName" Passes="0" Value="[FirstName]"/>
<Output Type="LastName" Passes="0" Value="[LastName]"/>
<Output Type="CompanyName" Passes="0" Value="[CompanyName]"/>
<Output Type="Email" Passes="0" Value="[Email]"/>
<Output Type="PhoneBusiness" Passes="0" Value="[PhoneBusiness]"/>
<Output Type="PhoneMobile" Passes="0" Value="[PhoneMobile]"/>
<Output Type="ContactUrl" Passes="0" Value="[TestAppClient]/contacts/[ContactID]/dashboard"/>
</Outputs>
</Scenario>
<Scenario Id="ReportCall" Type="REST">
<Request SkipIf="[ReportCallEnabled]!=True||[EntityId]==""" Url="[TestAppServer]/api/v1/integrations/3cx/cdr" MessagePasses="0"
RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
<Headers>
<Value Key="Authorization" Passes="0" Type="String">Bearer [APIkey]</Value>
</Headers>
<PostValues Key="">
<Value Key="number" Passes="1" Type="String">[Number]</Value>
<Value Key="callDirection" Passes="1" Type="String">[CallDirection]</Value>
<Value Key="callType" Passes="1" Type="String">[CallType]</Value>
<Value Key="name" Passes="1" Type="String">[Name]</Value>
<Value Key="queueExtension" Passes="1" Type="String">[QueueExtension]</Value>
<Value Key="agent" Passes="1" Type="String">[Agent]</Value>
<Value Key="agentFirstName" Passes="1" Type="String">[AgentFirstName]</Value>
<Value Key="agentLastName" Passes="1" Type="String">[AgentLastName]</Value>
<Value Key="agentEmail" Passes="1" Type="String">[AgentEmail]</Value>
<Value Key="startDate" Passes="1" Type="String">[[CallStartTimeUTC].ToString("yyyy-MM-dd")]T[[CallStartTimeUTC].ToString("HH:mm:ss")]Z</Value>
<Value Key="endDate" Passes="1" Type="String">[[CallEndTimeUTC].ToString("yyyy-MM-dd")]T[[CallEndTimeUTC].ToString("HH:mm:ss")]Z</Value>
<Value Key="contactId" Passes="1" Type="String">[EntityId]</Value>
</PostValues>
</Request>
<Outputs AllowEmpty="true"/>
</Scenario>
</Scenarios>
</Crm>
This template it's supposed to lookup for a number in the external app and save the CDR.
Unfortunately the CDR is not saved, checking 3CX logs I see this error:
Code:
2022/11/11 09:09:28.645|3120|0034|Erro|CRM: Exception during call reporting: System.NullReferenceException: Object reference not set to an instance of an object.
at CrmIntegration.ResultVariableScenarioProcessor.ProcessFinalResult(ProtocolScenario scenario, IValueManager valueManager)
at CrmIntegration.ScenarioProcessorBase.ProcessMatching(ProtocolScenario scenario, MatchingPath matching, ResponseMatcher responseMatcher, IValueManager customManager, HashSet`1 distinctMatchings, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.ProcessFoundMatchings(ProtocolScenario scenario, IValueManager customManager, List`1 matchings, ResponseMatcher responseMatcher, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.ProcessScenario(ProtocolScenario scenario, IValueManager customManager, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.Execute(ProtocolScenario scenario, CancellationToken token)
at CrmIntegration.CrmProcessor.ExecuteScenarioByName(String scenarioName, IEnumerable`1 parameters, Boolean useNoAuthProvider, CancellationToken token)
at CrmIntegration.CrmProcessor.ExecuteScenarioWithRetries(String scenarioId, Dictionary`2 parameters, CancellationToken token)
at CrmIntegration.CrmProcessor.ReportCall(CallEndedEvent callEndedEvent, CancellationToken token)
Can you explain the sense of this message? Is this error depending on something wrong in the template?
Thanks