Skip to content

Instantly share code, notes, and snippets.

@JoseIbanez
Created June 9, 2011 08:52
Show Gist options
  • Select an option

  • Save JoseIbanez/1016365 to your computer and use it in GitHub Desktop.

Select an option

Save JoseIbanez/1016365 to your computer and use it in GitHub Desktop.
Example XML PUSH on Aastra 6731i
<?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);
}
}
##############################
$xml = "<AastraIPPhoneExecute>\n";
$xml .= "<ExecuteItem URI=\"Wav.Play:http://10.0.0.200/ring.wav\"/>\n";
$xml .= "</AastraIPPhoneExecute>\n";
push2phone("10.0.0.200","10.28.201.199",$xml);
$xml = "<AastraIPPhoneTextScreen>\n";
$xml .= "<Title>Hola</Title>\n";
$xml .= "<Text>This is a test for pushing.</Text>\n";
$xml .= "</AastraIPPhoneTextScreen>\n";
push2phone("10.0.0.200","10.28.201.199",$xml);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment