Force auto answer if intercom header is present

Hi Vitalpbx

Vitxi ChageLog “4.0.0-4” January 20, 2023

Force auto answer if intercom header is present (generated by click to call).

What header/variable do I add to this function so that it supports AA ?

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://{{host}}/api/v2/core/click_to_call',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "caller": 100,
    "callee": 13055605776,
    "cos_id": 1,
    "cid_name": "My PBX",
    "cid_number": 13055605776,
    "variables": {
        "X-APP": "Postman",
        "X-CAMPAIGN": "sales"
    }
}',
  CURLOPT_HTTPHEADER => array(
    'app-key: {{api-key}}',
    'tenant: {{tenant}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

“X-FORCE_INTERCOM” => “yes” or “intercom” => “yes” ?

Thanks

1 Like

You must add this variable/parameter: “FORCE_INTERCOM”: “yes”

2 Likes