[YMCS/YDMP Free Trial Program]Yealink would like to offer Free Trial Program of Yealink device management service for our current eligible customers. You can see the details below.
https://www.yealink.com/ydmp-freetrial-2020


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add photo to remote xml phonebook
Author Message
cptjack Offline
Member
***

Posts: 97
Joined: Jan 2014
Reputation: 8
Post: #4
RE: Add photo to remote xml phonebook
Add or update these three parameters in your y000000000035.php file:
Code:
#Before using these parameters, you should store the desired resource files to the provisioning server.
#For more information, refer to Yealink SIP-T46G IP Phone Family Administrator Guide.
local_contact.data.url = http://server/voip/yealink/phonebook/ContactDataT48.xml
local_contact.image.url = http://server/voip/yealink/phonebook/ContactPhotoT48.tar
local_contact.icon.url = http://server/voip/yealink/phonebook/ContactPhotoT48.tar
The actual filenames are arbitrary, choose something that makes sense to you...
  • The first parameter will add the XML phonebook entries to your phone.
  • The second line will add the large photos which are shown during the call.
  • The last line adds the small icons that you see in the local addressbook.

The tar file is just an archive of all the photos you reference in the XML file. Just the pictures in BMP JPG or PNG format without any (sub)folders! You can use the same tar file for icons and photos as the pictures will be resized automatically.

ContactDataT48.xml has this format:
Code:
<?xml version="1.0" encoding="utf-8"?>
<root_group>
    <group display_name="All Contacts" ring="" />
    <group display_name="Blacklist" ring="" />
</root_group>
<root_contact>
    <contact display_name="Test1" office_number="2510" mobile_number="2511" other_number="3610" line="1" ring="" group_id_name="All Contacts" default_photo="Config:test.jpg" />
    <contact display_name="Test2" office_number="3510" mobile_number="3511" other_number="3620" line="2" ring="" group_id_name="Blacklist" default_photo="Config:blocked.jpg" />
    <!--
    default_photo="" Only T46 supports!
    -->
</root_contact>

Tested on my T48G with the latest 35.73.0.50 firmware.



Alternatively, you can also add a SIP Header, that will display the picture you specify in the URL. I use this in Asterisk dialplan for adding a picture to a number that is NOT in the local directory:
Code:
same => n,SIPAddHeader(Call-Info: <http://server/voip/callerid.php?num=${CALLERID(num)}>\;purpose=icon)

Then create a php script that outputs a picture depending on the CallerID provided:
PHP Code:
<?php
    $db 
= new PDO('mysql:host=myserver;port=myport;dbname=mydatabase;charset=utf8''myuser''mypassword');

    
$accountid 1;
    
$number $_GET['num'];
    
// Number are stored in international format. Convert local numbers:
    
if (substr($number,0,2)=="00") { $number "+" substr($number,2,strlen($number)-2); }
    if (
substr($number,0,1)=="0") { $number "+44" substr($number,1,strlen($number)-1); }
    
        
$query $db->prepare("SELECT * from callerid where accountid=:accountid AND number=:number AND not isnull(picture);");
        
$query->execute(array(':accountid'=>$accountid,':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:nopicture.jpg");
    }
?>

For details, check out this thread. Tested on T38G and T48G phones.

Please use the reputation button below if you like this post.
(This post was last modified: 07-18-2015 06:14 AM by cptjack.)
07-18-2015 05:51 AM
Find all posts by this user    like2    dislike0 Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Add photo to remote xml phonebook - cptjack - 07-18-2015 05:51 AM

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Directory - Remote Phone Book XML Format Cloud9phone 4 18,160 07-28-2023 02:35 AM
Last Post: digiaustin
Information Toggle Power LED or update config via remote? 48design-cg 0 1,172 01-17-2023 05:32 PM
Last Post: 48design-cg
  Add the Remote Phone Book via a .cnf file sfrazier 6 7,696 02-04-2022 04:02 AM
Last Post: sfrazier
  T46S-Vonage Overwriting Remote Directory igendreau 1 4,792 09-29-2021 03:30 AM
Last Post: complex1
  T46S Remote phonebook update to local phonebook. T9 Search UCUC 5 8,887 06-30-2021 02:50 PM
Last Post: UCUC
  Public Phonebook on incomming call Oliaargau 3 12,245 04-16-2021 05:34 PM
Last Post: Oliaargau
  Local and Remote phonebooks with more than 3 #s per entry? AndyInNJ 1 5,191 04-04-2020 09:29 AM
Last Post: complex1
  Local and Remote phonebooks pause and code (conference bridges) AndyInNJ 0 3,150 04-03-2020 06:02 PM
Last Post: AndyInNJ
  Remote Phonebook Ringtone joshua@itstel.com 17 37,425 03-03-2020 12:58 PM
Last Post: sebastiaan
  Remote phonebook generator? kogarahchiro 2 7,837 01-17-2020 04:38 AM
Last Post: kogarahchiro

Forum Jump:


User(s) browsing this thread:

Contact Us   Yealink   Return to Top   Return to Content   Lite (Archive) Mode   RSS Syndication