Forfaits VoIP - API : planning horaire ligne : script pour connaitre le slot
... / API : planning horaire li...
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Frage

API : planning horaire ligne : script pour connaitre le slot

Von
hercule
Erstellungsdatum 2018-12-27 17:47:53 (edited on 2024-09-04 12:35:20) in Forfaits VoIP

Bonjour à tous,
Je cherche un script via l'API v6 qui me permettrait à un instant t, de savoir quelle action est programmée dans l'horodatage de la ligne.
Exemple : le lundi de 13h à 15h, l'appel sur la ligne renvoie vers une ligne x.
Si j'interroge le script le lundi entre 13h et 15h, j'aimerais qu'il renvoie l'info "renvoi vers ligne x".
J'ai cherché à partir de la requete GET /telephony/{billingAccount}/timeCondition/{serviceName}/condition sans succès.
Quelqu'un aurait-il une idée ?


1 Antwort ( Latest reply on 2019-07-06 13:35:17 Von
hercule
)

Je me suis fait mon script tout seul. Si ça peut aider:
` //appel API v6
$nomdujour=strtolower(date("l"));
$heuredujour=date("H");
$regulateur_slot="aucun";
$ovh = new OvhApi();
$id_list = $ovh->get(' /telephony/{billingAccount}/timeCondition/{serviceName}/condition');
foreach ($id_list as $l_id) {
$result = $ovh->get(' /telephony/{billingAccount}/timeCondition/{serviceName}/condition'.$l_id);
$jour_temp=$result['day'];
$hourBegin=substr($result['hourBegin'],0,2);
$hourEnd=substr($result['hourEnd'],0,2);
if (($nomdujour==$jour_temp) and ($heuredujour>=$hourBegin) and ($heuredujour<=$hourEnd)) {$regulateur_slot=$result['policy'];}
}
echo $regulateur_slot;
?>`