Thanks Andre, Dave Bour and Dave York for your help. I settled with a BLF for now, but I'll definitely look into the xml push method within the next few days.
Cheers, Juan. -----Original Message----- From: Andre Courchesne [mailto:[email protected]] Sent: Friday, June 12, 2009 2:40 PM To: Juan Sicardi Cc: [email protected] Subject: Re: [on-asterisk] Aastra 57i LEDs Hi Juan, The following php script does that. you pass 3 arguments to the script: - ip address of the phone - prgkey to toggle - state (on or off) The key to affect must be programmed as an XML key and do not forget to change your server IP address when calling push2phone. <?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); } } ############################## # Retrieve parameters $ip=$argv[1]; $prgkey=$argv[2]; $state=$argv[3]; $xml="<AastraIPPhoneExecute triggerDestroyOnExit=\"yes\">"; $xml.="<ExecuteItem URI=\"Led: prgkey".$prgkey."=".$state."\"/>"; $xml.="</AastraIPPhoneExecute>"; push2phone("192.168.10.50",$ip,$xml); ?> Quoting "Juan Sicardi" <[email protected]>: > Hi, > > Anybody knows how to programmatically turn on/off the LEDs on an > Aastra 57i? The goal is to turn on an LED on phone B when phone A is > offhook. Any help and/or sample code would be greatly appreciated. > > Thanks, > Juan. > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
