- Joined
- Jun 5, 2023
- Messages
- 4
- Reaction score
- 0
Hi,
We've had a CRM integration with 3cx for the last 18 months or so, and due to the purposes of our integration we need to display calls while they are occurring rather than just recording information once the call is done.
Up until now have been limited to only offering it to our customers who have a single location linked to their 3cx management account, as we haven't had a way on our end to determine which call belonged to which location. We've now got a solution for this on our end, but it relies on us knowing the 'agent' for a call before the call ends. We receive the GET request for contact lookup and then get a POST request for contact creation, and then after the call ends we receive a POST request based on whether the call was answered/missed etc. Currently we receive the AGENT during the final Call Record POST request, but not before that. Is there any way in which we can find out which agent a call is directed to before the call has ended? Would this change if the call goes through a more complex call journalling process (our test setup is quite simple, but in the real situations we're trying to handle the would be directed to one particular extension per location and then picked up by an agent, even accessing the number for that first extension rather than the final agent would be sufficient)
Our template XML includes the following for Contact Creation, but 'agent' is blank in the actual request body
Request body:
Any advice on how we might be able to identify the extension/agent before the calls ends greatly appreciated.
We've had a CRM integration with 3cx for the last 18 months or so, and due to the purposes of our integration we need to display calls while they are occurring rather than just recording information once the call is done.
Up until now have been limited to only offering it to our customers who have a single location linked to their 3cx management account, as we haven't had a way on our end to determine which call belonged to which location. We've now got a solution for this on our end, but it relies on us knowing the 'agent' for a call before the call ends. We receive the GET request for contact lookup and then get a POST request for contact creation, and then after the call ends we receive a POST request based on whether the call was answered/missed etc. Currently we receive the AGENT during the final Call Record POST request, but not before that. Is there any way in which we can find out which agent a call is directed to before the call has ended? Would this change if the call goes through a more complex call journalling process (our test setup is quite simple, but in the real situations we're trying to handle the would be directed to one particular extension per location and then picked up by an agent, even accessing the number for that first extension rather than the final agent would be sufficient)
Our template XML includes the following for Contact Creation, but 'agent' is blank in the actual request body
Code:
<Scenario Id="CreateContactRecord" Type="REST">
<Request SkipIf="[CreateContactEnabled]!=True||[IIf([CreateOnCallDirection]==Inbound,[CallDirection]!=Inbound,False)]==True" Url="[our base url]/api/caller_id/incoming_calls" MessagePasses="0" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
<PostValues Key="">
<Value Key="phone_number" Passes="1" Type="String">[Number]</Value>
<Value Key="call_direction" Passes="1" Type="String">[CallDirection]</Value>
<Value Key="agent" Passes="1" Type="String">[Agent]</Value>
</PostValues>
</Request>
<Rules>
<Rule Type="Any">contact.id</Rule>
</Rules>
<Variables>
<Variable Name="ContactID" Path="contact.id">
<Filter/>
</Variable>
<Variable Name="CompanyName" Path="contact.company">
<Filter/>
</Variable>
<Variable Name="PhoneBusiness" Path="contact.businessphone">
<Filter/>
</Variable>
<Variable Name="ContactUrl" Path="contact.url">
<Filter/>
</Variable>
</Variables>
<Outputs AllowEmpty="false">
<Output Type="ContactID" Passes="0" Value="[ContactID]"/>
<Output Type="CompanyName" Passes="0" Value="[CompanyName]"/>
<Output Type="PhoneBusiness" Passes="0" Value="[PhoneBusiness]"/>
<Output Type="ContactUrl" Passes="0" Value="[ContactUrl]"/>
<Output Type="EntityId" Passes="0" Value="[ContactID]"/>
<Output Type="EntityType" Passes="0" Value="Contacts"/>
</Outputs>
</Scenario>
Request body:
Code:
{
"phone_number"=>"0412345678",
"call_direction"=>"Inbound",
"agent"=>"",
"controller"=>"api/caller_id/incoming_calls",
"action"=>"create",
"incoming_call"=>{
"phone_number"=>"0412345678",
"call_direction"=>"Inbound",
"agent"=>""
}
}
Any advice on how we might be able to identify the extension/agent before the calls ends greatly appreciated.