Yealink Forums

Full Version: XML Idle screen
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can anyone tell me how to do an XML Idle Screen - say for weather?
There is a website that does free for Cisco - but obviously I will have to create my own:
Hi craigreilly,

You can refer to below forum post.
I guess my question was not clear... How do I even get the data? And create the XML file.
I can't create a static file - it will always be wrong...
You can refer to XML Browser user guide and some sample xml files.
Using XML Browser Feature on Yealink phones Rev_70.0
Maybe I need a programmers forum... I've read the guide... All is says is
"Users can customize practical applications, such as weather report, stock information, Google search and news service, etc."
It doesn't tell how to get dynamic content into the XML.
You will need to do several steps to accomplish this.

Here is how I would go about it.
Maybe someone else can come up with another idea.

First, you need to know how to use PHP or another Scripting Language
Your script would need to go to a web site that has XML Data for the weather like this one:
Then you need to look at the Page Source Code and Parse out the Elements that you are interested in:
<wind_string>North at 8.1 MPH (7 KT)</wind_string>

Then assign each Parsed Element a Variable Name:
$wind = "8.1"
$pressure = "30.07"

Then insert that Variable into your script to be sent to the phone.
<Line Size="small">Wind Speed:> $wind </Line>
<Line Size="small">Pressure:> $pressure </Line>

This code may not be syntax correct, but it just a concept of what needs to be done.

I hope this gets you started in the right direction.
Below is script I made.

You can change the script for different Weather Locations by going here:
Then select a state and look at the "Call Signs" for the different locations.

Auburn Muni Airport (KAUN)
Avalon, Catalina Airport (KAVX)
Bakersfield/Meadows (KBFL)
"Call Signs" are KAUN, KAVX and KBFL.

Then change the line in the script where KAVX is located to your new choice.
Then in your Yealink DSS Key programing area, make one of the DSS buttons "XML Browser" and put in the Server info where you are going to have the script.

To make it an Idle Screen, I am not 100% sure how to do it.
But you can use an "Action URL" like "On Hook" and put in the Server info where you are going to have the script.
That way when you hang up on a call, the Action URL "On Hook" sends the request for the script automatically.



// GetWX.php

//Get XML from web page
$url = "" ;
$xml = simplexml_load_file($url) ;

//Parse out fields
$temp = $xml->temp_f ;
$weather = $xml->weather ;
$humidity= $xml->relative_humidity ;
$wind_dir= $xml->wind_dir ;
$wind_mph= $xml->wind_mph ;
$location= $xml->location ;

//Push to Phone
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>".
"<YealinkIPPhoneFormattedTextScreen Beep=\"yes\" Timeout=\"10\" LockIn=\"no\">".
"<Line Size=\"normal\" Align=\"center\"> $location </Line>".
"<Line Size=\"normal\"> Weather: $weather </Line>".
"<Line Size=\"normal\"> Temperature: $temp </Line>".
"<Line Size=\"normal\"> Humidity: $humidity </Line>".
"<Line Size=\"normal\"> Wind Dir.: $wind_dir / $wind_mph MPH</Line>".

Thank you! I thought the T46 had an XML Idle screen option - but it seems I was confusing it with the T38.
Reference URL's