Tag Archives: phone

Command line dialing on Cisco 7940/7960 IP Phone

I decided to share my perl script which I am using to dial numbers on my Cisco 7960 from command line. It can be used for integration with callto:// links, PIM or just to dial from console. To dial script using telnet interface on the phone, so it must be enabled. Script using “test” which emulates buttons on the phone. Pause between commands is required to work correctly, without it phone will go mad.


use Net::Telnet;
use Time::HiRes;

# cisco phone host name
my $host='';
# cisco phone password
my $password='cisco';
# mute on a dial 0/1
my $mute=0;

my $sleeptime=.2;
my $prompt='/> $/';

my $argc = @ARGV;
if ($argc!=1){
    print "Usage: call.pl <number>\n";
my $number=@ARGV[0];

if($number!~/^[0-9*#]+$/) {
    print "Error: wrong characters in the numer\n";
    exit 2;
$telnet = new Net::Telnet ( Timeout=>3, Errmode=>'die');
# connecting
$telnet->waitfor('/Password :$/i'); 

$telnet->print('test open');
$telnet->print('test key spkr');
    $telnet->print('test key mute');
$telnet->print("test key ".$number."#");
$telnet->print('test close');
Tagged , , ,