@ivrפון
ואם אתה רוצה, להלן קוד קצר בהרבה ומדוייק יותר(, מוריד את מה שאחרי הנקודה רק לאחר צירוף הדקות הנכנסות בחיוג ישיר ובמעבר ממערכת אחרת).
<?php
$ok=$_GET['ok'];
$ApiDID=$_GET['ApiDID'];
$password=$_GET['password'];
$ApiExtension=$_GET['ApiExtension'];
$from=$_GET['from'];
$to=$_GET['to'];
if($ok=="ok"){
if($from==null){
print"read=t-אנה בחר תאריך ממנו יבדוק ב.n-8.t-ספרות שנה יום וחודש.=from,,8,8,,No,,";
exit();
}
elseif($to==null){
print"read=t-אנה בחר תאריך שעד אז יבדוק ב.n-8.t-ספרות שנה יום וחודש.=to,,8,8,,No,,";
exit();
}
$from1 = mb_substr($from, 0, 4, "UTF-8");
$from2 = mb_substr($from, 4, 2, "UTF-8");
$from3 = mb_substr($from, 6, 2, "UTF-8");
$to1 = mb_substr($to, 0, 4, "UTF-8");
$to2 = mb_substr($to, 4, 2, "UTF-8");
$to3 = mb_substr($to, 6, 2, "UTF-8");
$from4="{$from1}-{$from2}-{$from3}";
$to4="{$to1}-{$to2}-{$to3}";
$fromto="&from={$from4}&to={$to4}";
}
$ui=file_get_contents("https://www.call2all.co.il/ym/api/GetTextFile?token={$ApiDID}:{$password}&what=ivr2:{$ApiExtension}/did.ini");
$data = json_decode($ui, true);
$text = $data['contents'];
$the_big_array= explode("\n", $text);
$uy=0;
foreach ($the_big_array as $token) {
list($did, $pass) = explode("=", $token, 2);
$url = "https://www.call2all.co.il/ym/api/GetIncomingSum?token={$did}:{$pass}{$fromto}";
$json = json_decode(file_get_contents($url), true);
$direct = $json['direct'];
$transferIn = $json['transferIn'];
$transferOut = $json['transferOut'];
$txt1=$direct+$transferIn;
$txt2=$txt1-$transferOut;
$uy=$uy+$txt2;
}
$uy=(int)substr($uy, 0, strpos($uy, "."));
print "id_list_message=t-הדקות הם.n-$uy.";
?>