Salesforce integration - Call report with exception for specific extension ?

Status
Not open for further replies.

o-Cyril-o

Free User
Joined
Mar 30, 2022
Messages
4
Reaction score
1
I posted this on the French forum but nobody knows. I hope that here I have a track of resolution.

Context:
* salesforce integration = Ok
* Call journaling = enabled

Problem:
call logging in salesforce also shows all calls going through digital answering machines or virtual extensions (checking schedules by services)
Looking for a way to not log calls with some Agents (extensions), I ended up finding in the model the 'SkipIf' attribute in the ReportCall and CreateCallActivity scenarios

Despite the addition of extensions to cause the Skip, consignments on the salesforce side still show these extensions

Here is the part of the xml for this scenario:

<Scenario Id="ReportCall" Type="REST">
<Request SkipIf="[ReportCallEnabled]!=True||[EntityId]==&quot;&quot;||[Agent]==&quot;200&quot;||[Agent]==&quot;850&quot;||[Agent]==&quot;851&quot;||[Agent]==&quot;852&quot;||[Agent]==&quot;855&quot;||[Agent]==&quot;800&quot;||[Agent]==&quot;801&quot;||[Agent]==&quot;802&quot;||[Agent]==&quot;803&quot;||[Agent]==&quot;804&quot;||[Agent]==&quot;805&quot;||[Agent]==&quot;806&quot;||[Agent]==&quot;807&quot;||[Agent]==&quot;808&quot;||[Agent]==&quot;809&quot;||[Agent]==&quot;810&quot;||[Agent]==&quot;811&quot;" Url="/services/data/v52.0/query/?q=SELEC...... thank you in advance Cyril / French User
 
Have you tried putting the [Agent]==200 without the &quot; ? It might be a integer.
 
No because in the https://www.3cx.com/docs/server-side-crm-template-xml-description/


"The following variables are predefined for the report call scenario, and can be used at any time:

  • CallType (string) - The type of call, it can be “Inbound”, “Outbound”, “Missed”, or “Notanswered”.
  • Number (string) - The external contact number (the number dialed for outbound calls or the caller number for inbound calls).
  • CallDirection (string) - The call direction, it can be “Inbound” or “Outbound”.
  • Name (string) - The name of the matched contact.
  • EntityId (string) - The ID of the matched entity (contact, lead or account).
  • EntityType (string) - The type of the matched entity (contact, lead or account).
  • Agent (string) - The extension number of the agent handling the call.
  • AgentFirstName (string) - The first name of the agent handling the call.
  • AgentLastName (string) - The last name of the agent handling the call.
  • AgentEmail (string) - The email of the agent handling the call.
  • Duration (string) - The duration of the call in “hh:mm:ss” format.
    ..."
 
  • Like
Reactions: Evolute IT
The parser we have for these expressions is very simple, and you can't use more than 2 operands in an OR expression. For example, the following expression is wrong because it uses 3 operands:
[ReportCallEnabled]!=True||[EntityId]==&quot;&quot;||[Agent]==&quot;200&quot;

The proper way to implement that expression is the following (you will see this used in our standard templates):
[ReportCallEnabled]!=True||[IIf([EntityId]==&quot;&quot;,[Agent]==&quot;200&quot;,False)]==True

In order to add more extensions to this expression, you need to start nesting IIf expressions, for example:
[ReportCallEnabled]!=True||[IIf([EntityId]==&quot;&quot;,[IIf([Agent]==&quot;200&quot;,[Agent]==&quot;850&quot;,False)],False)]==True

This will become more and more complex as you add more numbers, so you need to be very careful while editing this.
 
  • Like
Reactions: Evolute IT
It would be easier to use a PHP script that grabs the POST and Auth header, checks the POST Agent then simply forwards the call to Salesforce via cURL.

This way, a simple PHP array can hold all extensions to ignore.
 
  • Like
Reactions: edossantos
@edossantos
Horrible... :-(
No easier way to exclude these virtual extensions from log calls in SF?
 
These expressions are not designed to do what you're trying to do, that's why it's not simple to create such an expression. A much simpler solution if you want to edit the template is changing the Output for the ReportCall scenario, setting AllowEmpty="false". When you do this, if the query we execute to return the Salesforce user for an email doesn't return any data, the call will not be logged. Then, you can configure the email in 3CX extensions for the Salesforce users you need to match, and not for any other.
 
  • Like
Reactions: Evolute IT
I will try this tomorrow : it's "game over" for this day in France :)
 
Status
Not open for further replies.