How to Create an XML Application
G-20
41-001129-00 Rev 09, Release 1.4.1
IP Phone Administrator Guide
Appendix G
Example 2
:
Below is a sample php source code which sends an XML object to an Aastra
phone.
<?php
#
function push2phone($server,$phone,$data)
{
# url-encode the xml object
$xml = "xml=".urlencode($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: application/x-www-form-urlencoded\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);
}
}
##############################
$xml = "<AastraIPPhoneTextScreen>\n";
$xml .= "<Title>Push test</Title>\n";
$xml .= "<Text>This is a test for pushing a screen to a phone </
Text>\n";
$xml .= "</AastraIPPhoneTextScreen>\n";
push2phone("172.16.96.63',"172.16.96.75",$xml);
?>
Summary of Contents for SIP 480i
Page 1: ...Administrator Guide Release 1 4 1 SIP IP PHONE 480i 480i CT 9112i 9133i 41 001129 00 Rev 09...
Page 4: ......
Page 16: ......
Page 34: ......
Page 264: ......
Page 274: ......
Page 290: ......
Page 408: ......
Page 412: ......
Page 462: ......
Page 466: ......
Page 470: ......
Page 502: ......
Page 503: ......