<?php 
$ext=$_GET["ext"];
$ip=$_GET["ip"];
function get_url($url)
{
    $cmd  = "curl --max-time 60 ";
    $cmd .= "'" . $url . "'";
    $cmd .= " > /dev/null 2>&1 &";
    exec($cmd, $output, $exit);
    return $exit == 0;
}

$fields = array(
'ConfPage' => 'ConfSIPAccounts1Page',
'DisplayName' => $ext,
'RegisterName' => $ext,
'UserId' => $ext,
'Password' => '!mitruHotel_06072018!',
'UseAccount' => 'on',
'RegistrarIP' => '192.168.22.2',
'RegistrarPort' => '',
'ProxyAddress' => '',
'Expiry' => '600'
					);
//open connection
$ch = curl_init();
//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, "http://$ip/goform/ConfSIPAccountsPage_Save");
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields));
//execute post
$result = curl_exec($ch);

echo($result);

?>