[mythtv-users] Asterisk Extension for Frontend WOL?

Tom Gerrard mythtv at simpletcpip.com
Mon Mar 22 09:39:07 UTC 2010


On 20 March 2010 01:28, Tortise <tortise at paradise.net.nz> wrote:
> Has anyone tried to wake up their myth front end(s) using an asterisk
> extension, say in FreePBX, to do WOL?
> The extension might be rang from a phone on the pbx including a WiFi or Cell
> phone.

HI Tortise,

Never tried to do this specifically.  I'd probably use a php agi
script, e.g. add to extensions_custom.conf:

exten => 1234,1,AGI(wakeup.php)
exten => 1234,n,Hangup()

and then in /var/lib/asterisk/agi-bin add a file like this:

#!/usr/bin/php
<?php
include "phpagi.php";
$agi = new AGI();
$agi->answer();
$agi->stream_file('silence');
sleep(2);
$agi->stream_file('vm-password');
$r = $agi->get_data('beep', 15000, 5);
$pass=$r['result'];
if ($pass == '4444')
{
    etherwake 00:22:44:66:88:aa
    $agi->stream_file('saved');
}
else
{
	$agi->stream_file('tt-somethingwrong');
}
$agi->hangup();
?>

Cheers,
Tom


More information about the mythtv-users mailing list