How to Create an XML Application
41-001160-00, Release 2.1, Rev 04
G-63
Creating an XML Application
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);
?>
Содержание 53I
Страница 4: ......
Страница 18: ......
Страница 42: ......
Страница 438: ......
Страница 470: ......
Страница 476: ......
Страница 486: ......
Страница 502: ......
Страница 684: ......
Страница 688: ......
Страница 722: ...Sample Configuration Files D 34 41 001160 00 Release 2 1 Rev 04 IP Phone Administrator Guide Appendix D ...
Страница 724: ...Sample Configuration Files D 36 41 001160 00 Release 2 1 Rev 04 IP Phone Administrator Guide Appendix D ...
Страница 730: ......
Страница 734: ......
Страница 738: ......
Страница 817: ......