[asterisk-users] Finding the status of an extension

2007-11-27 Thread Yehavi Bourvine +972-8-9489444
Hello,

  I would like to check whether an extension is busy or not before calling the
Dial() application to it (for example - to play a Busy if it is on
conversation).

  How do I check it? In the trunk version there was a function
DEVSTATE(SIP/123), however it does not exist on version 1.4.13... What is the
equivalent of it?

  Thanks, __Yehavi:

___
--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


Re: [asterisk-users] Finding the status of an extension

2007-11-27 Thread Atis Lezdins
Yehavi Bourvine +972-8-9489444 wrote:
 Hello,
 
   I would like to check whether an extension is busy or not before calling the
 Dial() application to it (for example - to play a Busy if it is on
 conversation).
 
   How do I check it? In the trunk version there was a function
 DEVSTATE(SIP/123), however it does not exist on version 1.4.13... What is the
 equivalent of it?

http://www.asterisk.org/node/48360

Btw, you can use also g flag of Dial() so, that call will continue, and 
you will get BUSY status instantly.

Regards,
Atis

___
--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


Re: [asterisk-users] Finding the status of an extension

2007-11-27 Thread Andre Courchesne - Consultant
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


Re: [asterisk-users] Finding the status of an extension

2007-11-27 Thread Ricardo Carvalho
If you have some SIP phone BLF feature capable, you can try it. With it in
the phone you can view the state of those the registered extensions you
like, as well with it if you do sip show subscriptions in the asterisk
CLI, you'll get the list of extensions and the last state of those monitored
extensions.


Regards,
Ricardo Carvalho.
___
--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