<?php
/*
$json = file_get_contents('http://proapi.whitepages.com/2.1/phone.json?phone=2066013560&api_key=3f9f57e7df15d5eea2ddd06ed88d4889');
*/
$json = file_get_contents("http://proapi.whitepages.com/2.1/phone.json?phone=$argv[1]&api_key=3f9f57e7df15d5eea2ddd06ed88d4889");
$data = json_decode($json,true);
//print_r($data['results'][0]['belongs_to'][0]);
//var_dump($data['results'][0]['belongs_to'][0]);
echo $data['results'][0]['belongs_to'][0]['best_name'];
exit;
?>
Assing permision to the script
chmod 755 /root/whitepage.php
//Dial Plan
[whitepage]
exten=_x.,1,Noop(call from ${CALLERID(num)})
same=>n,System(/usr/bin/php /root/whitepage.php ${CALLERID(num)}>/root/customer.conf)
Caller ID name saved to /root/customer.conf
No hay comentarios:
Publicar un comentario