Creating an XML Application
41-001160-01, Rev 00, Release 2.3
G-83
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);
?>
Содержание 51i
Страница 4: ......
Страница 26: ......
Страница 30: ......
Страница 70: ......
Страница 179: ...Administrator Level Options 41 001160 01 Rev 00 Releaes 2 3 3 91 Administrator Options ...
Страница 180: ......
Страница 292: ...Configuration Server Protocol 4 112 41 001160 01 Rev 00 Releaes 2 3 IP Phone Administrator Guide ...
Страница 644: ...Operational Features 5 352 41 001160 01 Rev 00 Release 2 3 IP Phone Administrator Guide ...
Страница 702: ...Encrypted Files on the IP Phone 7 8 41 001160 01 Rev 00 Release 2 3 IP Phone Administrator Guide ...
Страница 712: ......
Страница 976: ......
Страница 980: ......
Страница 1014: ...Sample Configuration Files D 34 41 001160 01 Rev 00 Release 2 3 IP Phone Administrator Guide ...
Страница 1016: ...Sample Configuration Files D 36 41 001160 01 Rev 00 Release 2 3 IP Phone Administrator Guide ...
Страница 1022: ......
Страница 1026: ......
Страница 1030: ......
Страница 1133: ......