<?php

if(isset($_GET['phone_number'])){$output['value'] = $_GET['phone_number'];}
  elseif(isset($_POST['phone_number'])){$output['value'] = $_POST['phone_number'];}
if(isset($_GET['agent_id'])){$output['agent_user'] = $_GET['agent_id'];}
  elseif(isset($_POST['agent_id'])){$output['agent_user'] = $_POST['agent_id'];}

$post = 
  [
    'value'       => $output['value'],
    'agent_user'  => $output['agent_user'],
    'source'      => 'test',
    'user'        => '6666',
    'pass'        => 'eurus2020',
    'function'    => 'external_dial',
    'phone_code'  => '1',
    'search'      => 'YES',
    'preview'     => 'NO',
    'focus'       => 'YES'
  ];

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://etidialer206.telxio.com.sg/agent/api.php?".http_build_query($post),
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>