Push XML App to phone using AGI?

I see the latest Sangoma Firmware/Endpoint updates allow for the user to customize the Voicemail button on the phone to access the VM XML app instead of *97 which is awesome!! So my question is…would it be possible to use a feature code to push an XML app to a phone using AGI? Not sure if/when Yealink will support this option but I’d like to replicate this on the Yealink if possible.

So I’m not looking for anyone to write the code for me just wondering if its possible? Assign a feature code to reference an AGI script and have AGI call a php script that will push the XML to the phone?

No its not sorry. Its a feature in our phones. Ask other manufactures to support it

1 Like

OK thanks! Just made a feature request to Yealink.

Don’t know if this is still relevant, but here goes nothing.

It is possible to push XML to yealink phones (v6x and up) using http POST or SIP Notify. You can use AGI to execute a script that will create the XML and push it to the phone. To accept a pushed page, the “PushXML_ServerIP” parameter on the phone must be configured with the IP address of the server allowed pushing a page.

In fact there’s a document called ‘XML Browser Developer’s Guide - Yealink’ that can shed some light to the matter.

Something like this:
exten => *6,1,AGI(my_script_here,ARGUMENT1,ARGUMENT2)

Then the script can build the XML and use some arguments to know where to push it. The yealink document even has a php sample script that goes something like this:

<?php
#
function push2phone($server,$phone,$data)
{
$xml = "xml=".$data;
$post = "POST / HTTP/1.1\r\n";
$post .= "Host: $phone\r\n";
$post .= "Referer: $server\r\n";
$post .= "Connection: Keep-Alive\r\n";
$post .= "Content-Type: text/xml\r\n";
$post .= "Content-Length: ".strlen($xml)."\r\n\r\n";
$fp = @fsockopen ( $phone, 80, $errno, $errstr, 5);
if($fp)
{
fputs($fp, $post.$xml);
flush();
fclose($fp);
}
}
##############################
#There is no need to make changes to the code above, simply edit the following code
#according to your requirement.
$xml = "XML item\n";
$xml = "XML item\n";
<!--Additional XML Items may be added -->
<!--All XML Items added here construct an XML object -->
push2phone(" 192.168.0.112 "," 192.168.0.150 ",$xml);
#replace 192.168.0.112 with your push XML server IP address
#replace 192.168.0.150 with your phone IP address
?>
1 Like