Hi,
Here is a small AGI script that get you the hint status of the extension
simply call AGI(script.agi,SIP/100)
!/usr/bin/perl
#
# page.agi - Original file was allpage.agi by Rob Thomas 2005.
# With parts of allcall.agi Original file by John Baker
# Modified by Adam Boeglin to allow for paging sccp phones
#Modified/Updated by Jeremy Betts 6/1/2006 for improved efficiency..
# We now use AGI to set the dialplan variable.. much smarter!
#Modifier by Andre Courchesne 11-27-2007 ([EMAIL PROTECTED])
# Modified to return the hint status of a single extension
# Tested with SIP extension only
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of Version 2 of the GNU General
# Public License as published by the Free Software Foundation
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# This works with both my aastra, polycom, sipura/linksys and cisco sccp phones.
# It should be easily modified for other sip phones
#
# Documentation:
# Simply returns channel variable MYSTATE
# 0: Extension is busy
# 1: Extension is available
#
#
#
use Asterisk::AGI;
$AGI = new Asterisk::AGI;
@bypass = @ARGV;
@sips = `sudo /usr/sbin/asterisk -rx show hints | grep -a $bypass[0]`;
#foreach $sipline (@sips)
#{
# print Noop $sipline\n;
#}
#print Noop ---\n;
#foreach $argline (@bypass)
#{
# print Noop $argline\n;
#}
$mystate=0;
my ($junk0, $junk1, $junk2, $exten, $state, $junk2) = split(/ +/, $sips[0],6);
my ($type, $extension) = split(/\//,$chan,2);
print Noop Comparing [.$exten.] and [.$bypass[0].] $state\n;
if($state eq State:Idle)
{
$mystate=1;
print Noop Found extension $exten to be Idle\n;
}
___
--Bandwidth and Colocation Provided by http://www.api-digital.com--
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users