compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (11)

View Page History
require_once('Zend/Service/OrangeApi/CallDetails.php');

//mandatory data to WebPhone CallDetails
$accessKey = "my_access_key";

//Zend_Service_OrangeApi_CallDetails initialization
$callDetails = new Zend_Service_OrangeApi_CallDetails( $accessKey );

/**
* @desc get your API usage history. Lines are numbered from the newest (0) to the oldest
* @param callId (optional): the identifier of a previous API request (all API requests return a callId).
* @desc getCallDetails() : Calls the getCallDetails API method
* @param callId (mandatory): Allows users to get call details on a specific identifier.
* You can retrieve a callId in the orangeApi.log file,
* after sending a sms with ack parameter to true or check.
*/

//Response management
if($callDetails->getResponseCode()==200){
echo" CallId : ".$callDetails->getResponseCallId()."\n";
echo"<span>getCallDetails successfull</span>";
echo"<span id='status'>Get Call Details successfull</span>";
$log = new Zend_Service_OrangeApi_Common_Utility();
$log->log(' CallId : '.$callDetails->getResponseCallId()."\n");
$log->log(' Status : GetCallDetails successfull'."\n".$sep);
$data=$callDetails->getXmlReturn()->data;
foreach($data->api_call as $row){
echo"<table class='result'>";
if($row->call_id!=''){
echo"<tr><td class='O'>Call id :</td><td class='b'>$row->call_id</td></tr>";
}
if($row->date!=''){
echo"<tr><td class='O'>Date :</td><td class='b'>$row->date</td></tr>";
}
if($row->from!=''){
echo"<tr><td class='O'>From :</td><td class='b'>$row->from</td></tr>";
}
if($row->to!=''){
echo"<tr><td class='O'>TO :</td><td class='b'>$row->to</td></tr>";
}
if($row->ip!=''){
echo"<tr><td class='O'>IP :</td><td class='b'>$row->ip</td></tr>";
}
if($row->verb!=''){
echo"<tr><td class='O'>Verb:</td><td class='b'>$row->verb</td></tr>";
}
if($row->cost!=''){
echo"<tr><td class='O'>Cost:</td><td class='b'>$row->cost</td></tr>";
}
if($row->return_code!=''){
echo"<tr><td class='O'>Return code :</td><td class='b'>$row->return_code</td></tr>";
}
if($row->ack_status!=''){
echo"<tr><td class='O'>Ack Status :</td><td class='b'>$row->ack_status</td></tr>";
}
if($row->ack_date!=''){
echo"<tr><td class='O'>Ack Date:</td><td class='b'>$row->ack_date</td></tr>";
}
if($row->ack_code!=''){
echo"<tr><td class='O'>Ack code:</td><td class='b'>$row->ack_code</td></tr>";
}
echo"</table><hr>";
}

}
else {
$exception = new Zend_Service_OrangeApi_Exception($callDetails->getResponseCode()." - ".$callDetails->getResponseMessage());
$exception->DisplayFunctionalException();
}
//Display results
echo"<div id='formatedResult'>";
echo"<span style='margin-left: 50px;'><big><b>CallDetails</b></big></span><br />";
foreach($data->api_call as $row){
echo"<table class='result'>";
if($row->call_id!=''){echo"<tr><td class='O'>Call id :</td><td class='b'>$row->call_id</td></tr>";}
if($row->date!=''){echo"<tr><td class='O'>Date :</td><td class='b'>$row->date</td></tr>";}
if($row->from!=''){echo"<tr><td class='O'>From :</td><td class='b'>$row->from</td></tr>";}
if($row->to!=''){echo"<tr><td class='O'>TO :</td><td class='b'>$row->to</td></tr>";}
if($row->ip!=''){echo"<tr><td class='O'>IP :</td><td class='b'>$row->ip</td></tr>";}
if($row->verb!=''){echo"<tr><td class='O'>Verb:</td><td class='b'>$row->verb</td></tr>";}
if($row->cost!=''){echo"<tr><td class='O'>Cost:</td><td class='b'>$row->cost</td></tr>";}
if($row->return_code!=''){echo"<tr><td class='O'>Return code :</td><td class='b'>$row->return_code</td></tr>";}
if($row->ack_status!=''){echo"<tr><td class='O'>Ack Status :</td><td class='b'>$row->ack_status</td></tr>";}
if($row->ack_status_msg!=''){echo"<tr><td class='O'>Ack Status message :</td><td class='b'>$row->ack_status_msg</td></tr>";}
if($row->ack_date!=''){echo"<tr><td class='O'>Ack Date:</td><td class='b'>$row->ack_date</td></tr>";}
if($row->ack_status_code!=''){echo"<tr><td class='O'>Ack status code:</td><td class='b'>$row->ack_status_code</td></tr>";}
if($row->tag!=''){echo"<tr><td class='O'>Tag:</td><td class='b'>$row->tag</td></tr>";}

echo"</table><hr>";
}
echo"</div>";
}
else{
echo"<span id='status'> Warning : ".$callDetails->getResponseCode()." - ".$callDetails->getResponseMessage()."</span>";
$log = new Zend_Service_OrangeApi_Common_Utility();
$log->log($callDetails->getResponseCode()." - ".$callDetails->getResponseMessage()."\n".$sep);
header("Refresh: 10;url=index.php");
}
?>
{code}