<?php
// Set the login credentials
$login = 201;
$password = 22@Kolahal;
// Set the API endpoint
$pbx = htm-global.wildixin.com;
$url = "https://$pbx/api/v1/Calls/";
// Set the data parameters
$data = [
'number' => '3969349',
'name' => '210',
'device' => 'any_device'
];
$data_string = http_build_query($data);
// Initialize curl session
$ch = curl_init();
// Set the curl options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_USERPWD, "$login:$password");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Execute the curl session
$response = curl_exec($ch);
// Check for errors
if (curl_errno($ch)) {
echo 'Curl error: ' . curl_error($ch);
}
// Close the curl session
curl_close($ch);
// Display the response
echo "Response: $response";
?>