I've fired a script from an AGI-BIN to accomplish that.

Try this one:

#!/usr/bin/perl
# mk 2004  feel free to distribute
#  [EMAIL PROTECTED], _Vile
#  perl script to reboot phones
#  try telnetting to your phone, first.
#
use Net::Telnet ();

$phone_ip = shift;

# Your Cisco 79xx prompt
$prompt = "Enter Your Prompt Here";

# Your Password
$password = "xxxxxx";

# Reset Command
$command = "reset";

if ($phone_ip eq "all")
{
        reboot("xxx.xx.x.xx",$password,$command,$prompt);
        reboot("xxx.xx.x.xx",$password,$command,$prompt);
        reboot("xxx.xx.x.xx",$password,$command,$prompt);
        reboot("xxx.xx.x.xx",$password,$command,$prompt);
} elsif ($phone_ip eq "") {
        print "Enter an IP or 'all' for All.";
} else {
        reboot($phone_ip,$password,$command,$prompt);
}

exit;

sub reboot{

    my ($ip,$password,$command,$prompt) = @_;

    $t = new Net::Telnet;
    $t->open($ip);

    $t->waitfor('/Password :.*$/');
    $t->print($password);

    $t->waitfor('/'.$prompt.'>.*$/');
    $t->print($command);

}


_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to