Yealink Forums

Full Version: LDAP picture attribute
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
While an LDAP attribute query would definitely by nice, I would suggest Yealink provided a way to query a photo URL like hpp://server/direcoty/photo.php?q=555-123456
This way, the server can pull the corresponding photo from anywhere you want and hand it to the phone in the appropriate .jpg/.png/.bmp format.

Something like: remote_contact.data_photo.url = hpp://server/direcoty/photo.php?q=
Thanks for your suggestion. Currently our phones don't support this. It maybe be added in the future.
Snom phones support this feature for some time via SIP Header, maybe Yealink can provide something similar:

Code:
The SIP INVITE should contain the following SIP Header:
Call-Info: <http://192.168.1.2:8080/images/extensions1.bmp>;purpose=icon
or
Call-Info: icon="http://192.168.10.14:80/snom/photo/DirectoryEntry1.png"

That would be just awesome!
Hi, I'm new in the post.
You can help please, i'm using LDAP in phone T48G working only (displayName and ipPhone) but i need use the "thumbnailPhoto" or jpegPhoto) How to make this?
My LDAP on Windows SErver 2008

Thanks for you help
Here is a PowerShell script that will export the Users in an OU that have a thumbnailPhoto attribute set. The resulting Contact.tar and ContactData.xml files are saved to an IIS folder where the phones can download them during provisioning. The script requires 7-Zip to be installed and IIS (or another webserver) to host the 2 files. I tested it on Server 2012 R2, but I guess this will work on 2008 also.

Contacts are displayed with their photo if one of the 3 numbers match.

YealinkContacts.ps1
Code:
Import-Module ActiveDirectory  

# Full Pathnames are needed for 7-Zip. Do NOT use relative pathnames or it will not work!
$photoTempDir = "C:\Yealink\photo\"
$tarFile = "C:\Yealink\photo.tar"
$zipExe = "C:\Program Files\7-Zip\7z.exe"
$OU = "OU=Yealink,DC=testdomain,DC=int"
$xmlContactData = "C:\inetpub\wwwroot\ContactData.xml"

#### Warning: this will delete all *.jpg files in the photoTempDir
Get-Item $photoTempDir -Include "*.jpg" | Remove-Item -force

# Find all AD Users with a thumbnailPhoto
$users = Get-ADUser -Filter * -SearchBase $OU -Properties thumbnailPhoto,telephoneNumber,mobile,ipPhone | ? {$_.thumbnailPhoto}

# ContactData.xml Headers
'<?xml version="1.0" encoding="UTF-8"?>' | Out-File -FilePath $xmlContactData
'<root_contact>' | Out-File -FilePath $xmlContactData -Append


# Create the photos and ContactData files
foreach ($user in $users) {
    $name = $photoTempDir + $user.SamAccountName + ".jpg"  
    $user.thumbnailPhoto | Set-Content $name -Encoding byte

    $strLine = '    <contact'
    $strLine+= ' display_name="' + $user.name + '" '
    $strLine+= ' mobile_number="' + $user.mobile + '" '
    $strLine+= ' office_number="' + $user.telephoneNumber + '" '
    $strLine+= ' other_number="' + $user.ipPhone + '" '
    $strLine+= ' default_photo="Config:' + $user.SamAccountName + '.jpg" '
    $strLine+= 'line="0" ring="" group_id_name="" selected_photo="0" />'
    $strLine | Out-File -FilePath $xmlContactData -Append
}
'</root_contact>' | Out-File -FilePath $xmlContactData -Append


#Build the 7-Zip Command to archive the photos into photo.tar
$command = 'cmd /C "' + $zipExe + '" a "' + $tarFile + '" "' + $photoTempDir + '\*.jpg"'
Invoke-Expression -Command:$command

Included these 3 lines in your autoprovision file:
Code:
local_contact.data.url = http://192.168.0.1/ContactData.xml
local_contact.image.url = http://192.168.0.1/photo.tar
local_contact.icon.url = http://192.168.0.1/photo.tar
cptjack,

Thanks for sharing. How is image clean up done on the Yealink? To my knowledge there is no automated "delete" photo function.
Pages: 1 2
Reference URL's