[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
cadiken Offline
Junior Member
**

Posts: 6
Joined: Jul 2015
Reputation: 0
Post: #1
Add photo to remote xml phonebook
What is the syntax to add photos to the remote xml phone book entries on a T48G phone? I' have all the photos copied to a folder on the server where the RemotePhonebook.xml file is but they don't show up. I've added the name of the file as below:

<Unit Name="Test User" Phone1="1234" Phone2="" Phone3="" default_photo="Resource:picture.jpg"/>

Is this not the correct way?
(This post was last modified: 07-17-2015 01:38 AM by cadiken.)
07-17-2015 01:28 AM
Find all posts by this user    like0    dislike0 Quote this message in a reply
CWR Offline
Moderator
*****

Posts: 717
Joined: May 2013
Reputation: 7
Post: #2
RE: Add photo to remote xml phonebook
If I recall, remote phonebook is downloaded to the device and used locally.
If that is the case - then Resource:picture.jpg would be looking for a local photo.

I use the older XML format. Didn't know that photos were possible...
See top of PDF page 3 here: http://www.yealink.com/Upload/T2X/T2X-V7...280292.zip
Talks about using built in images or copying to the device. Looks like you will use config:photo.jpg instead - but not sure how to get the files copied over.


Code:
<DirectoryEntry>
<Name>Aaron Lastname</Name>
<Telephone>145</Telephone>
</DirectoryEntry>

Craig Reilly
MCSA, 3cx Advanced Certified
Scottsdale, AZ
(This post was last modified: 07-17-2015 04:25 AM by CWR.)
07-17-2015 04:11 AM
Find all posts by this user    like0    dislike0 Quote this message in a reply
cadiken Offline
Junior Member
**

Posts: 6
Joined: Jul 2015
Reputation: 0
Post: #3
RE: Add photo to remote xml phonebook
I placed a few photos on a test phone and tried both resource:photo.jpg and config:photo.jpg and neither worked. I figured out that resource: is used for the default photos in the phone so that not working is understandable.

Anyone ever get photos to work on theirs without creating local contacts individually?
07-17-2015 07:56 PM
Find all posts by this user    like0    dislike0 Quote this message in a reply
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
cadiken Offline
Junior Member
**

Posts: 6
Joined: Jul 2015
Reputation: 0
Post: #5
RE: Add photo to remote xml phonebook
Thanks for the detailed response cptjack, I appreciate it.

So loading local phonebook should work? Does the path to the photos and xml file matter (local_contact.data.url = http://server/voip/yealink/phonebook/ContactDataT48.xml)? Do the files have to be the same server that the .php config file resides on?

One more question. Is the default photo="" supported on T48G with firmware 35.73.0.50?

Going to test this today.
07-21-2015 09:23 PM
Find all posts by this user    like0    dislike0 Quote this message in a reply
cptjack Offline
Member
***

Posts: 97
Joined: Jan 2014
Reputation: 8
Post: #6
RE: Add photo to remote xml phonebook
You are welcome cadiken. The XML and TAR files can be on any webserver that is accessible by the phone. My suggestion would be to start with a couple of entries and photo's and work from there, using the example provided.

I tested the examples on a T48G with 35.70.0.50 firmware, so you should be good to go! Contrary to the documentation, T48 is also supported.

Please use the reputation button below if you like this post.
07-22-2015 04:30 AM
Find all posts by this user    like1    dislike0 Quote this message in a reply
cadiken Offline
Junior Member
**

Posts: 6
Joined: Jul 2015
Reputation: 0
Post: #7
RE: Add photo to remote xml phonebook
I got the xml file loading properly but the images will not load to the phone during auto provisioning. Is there something I'm not doing? just added the two lines:
local_contact.image.url = http://server/Photo.tar
local_contact.icon.url = http://server/Photo.tar

and updated the line:
local_contact.data.url = http://server/Localphonebook.xml
(This post was last modified: 07-24-2015 05:26 AM by cadiken.)
07-24-2015 05:25 AM
Find all posts by this user    like0    dislike0 Quote this message in a reply
cptjack Offline
Member
***

Posts: 97
Joined: Jan 2014
Reputation: 8
Post: #8
RE: Add photo to remote xml phonebook
Do you see the files being downloaded correctly (status 500) in the log of the webserver?
If you use the web interface to edit the contacts, are the pictures there to select?
It can be an issue with the xml or the tar file, so trying to eliminate which one to look at...
Maybe you can post an example of your files or send me a PM and I'll try them on my T48 to see if I can pinpoint the problem.

Please use the reputation button below if you like this post.
(This post was last modified: 07-24-2015 06:00 AM by cptjack.)
07-24-2015 06:00 AM
Find all posts by this user    like0    dislike0 Quote this message in a reply
cadiken Offline
Junior Member
**

Posts: 6
Joined: Jul 2015
Reputation: 0
Post: #9
RE: Add photo to remote xml phonebook
I sent you a PM cptjack and included the files.

I only see the xml file being downloaded. I explained more in the PM.
Thanks for your help.
(This post was last modified: 07-24-2015 07:54 PM by cadiken.)
07-24-2015 07:46 PM
Find all posts by this user    like0    dislike0 Quote this message in a reply
cptjack Offline
Member
***

Posts: 97
Joined: Jan 2014
Reputation: 8
Post: #10
RE: Add photo to remote xml phonebook
Hi cadiken, I send you an email.

The XML file shoud have default_photo="Config:" instead of default_photo="Resource:"
The photos.tar loads correctly, so that should be OK.
Also check for duplicate local_contact.xxx.url lines in your y000000000035.cfg file on the provisioning server.

Best regards,
/CJ

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


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

Forum Jump:


User(s) browsing this thread: 1 Guest(s)

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