Hello,
I am using PHP script to generate XML phonebook from our CRM.
This file is in all the phones as a remote phonebook and works great.
How Can I add a link to the photo into XML phonebook.
I would like to see a face photo when person calling.
Files are on local server and stored like: http:\\192.168.0.1\pictires\john_doe
Can I link the photos in XML, or do I need to upload the photos somewhere or convert them into specific format / resolution?
Hi tikky,
I don't think you can do it in the XML phonebook directly.
We use this header in our dialplan to remotely fetch the picture on an
incoming phone call. This answers half of your question.
Code:
SIPAddHeader(Call-Info: <http://server/voip/callerid.php?num=${CALLERID(num)}>\;purpose=icon)
Then a small callerid.php script fetches the appropriate picture from a database or serves a generic one:
PHP Code:
<?php
$db = new PDO('mysql:host=server;port=1234;dbname=phonebook;charset=utf8', 'username', 'password');
$number = $_GET['num'];
$query = $db->prepare("SELECT * from callerid where number=:number AND not isnull(picture);");
$query->execute(':number'=>$number));
$data = $query->fetchAll(PDO::FETCH_ASSOC);
if (count($data)>0) {
$ImageDataLength = strlen($data[0]['picture']);
header("Content-type: image/jpeg") ;
header("Content-Length: ".$ImageDataLength);
echo $data[0]['picture'];
} else {
header("location:generic.jpg");
}
php?>
As for the other half of the solution:
The only way I have found to display the picture of an
outgoing call is to add all the pictures and corresponding numbers in the
local phonebook. As long as the number matches the one in your XML phonebook, it should work. Loading the local addressbook can be done via provisioning. In that case you strictly would not need the script above, as long as the incoming number is in the local addressbook...
Hope this helps
/CJ