Created
June 9, 2011 08:52
-
-
Save JoseIbanez/1016365 to your computer and use it in GitHub Desktop.
Example XML PUSH on Aastra 6731i
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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