[asterisk-users] ChanIsAvail function is breaking the round robin strategy

2013-05-27 Thread stefano scotti
Hello everybody,

i have two gsm line (extra channels) and i'd like to schedule the
outgoing calls with a round-robin strategy.
If all the gsm lines are busy, the call must be sent to the pri lines
with a linear strategy.

here is the dialplan:

exten => gsm,ChanIsAvail(EXTRA/r2&DAHDI/g1)
 same => n,GotoIf($["${AVAILORIGCHAN}" = ""]?unavail,1)
 same => n,Dial(${AVAILORIGCHAN}/${CALLEDNUMBER})

The problem is that the ChanIsAvail function is breaking the round
robin strategy.
When this function is executed i can see in the console this message:

Hungup 'EXTRA/3-1'

and when the Dial function is executed only the EXTRA/1 channel is
selected, never the EXTRA/3 one.

that happen because ChanIsAvail affect the round-robin selection
marking a channel as just used when it has only been checked.

Anyone can see a solution to that problem?

Thank you very much, im using asterisk 1.6.2 and dahdi 2.2.1 on a
debian squeeze station.

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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


Re: [asterisk-users] ChanIsAvail querry

2009-11-25 Thread ABBAS SHAKEEL
Thanks Michiel & Covici
@ Michiel i will try the script
@Covice yes it is a DAHDI channel


On Wed, Nov 25, 2009 at 8:12 PM,  wrote:

> I wonder if this is related to my problem where the channel returns with
> a status of BUSY even if it is on hook -- this is a dahdi channel.
>
> ABBAS SHAKEEL  wrote:
>
> > Dan I have reverted to 1.4.27 but got no success. Same behaviour
> > Do anyone has any success with it ?
> >
> > On Wed, Nov 25, 2009 at 3:54 PM, ABBAS SHAKEEL
> > wrote:
> >
> > > Thanks Michiel and Dan
> > >
> > > @ Michiel i have checked the variables but they dont contain any value.
> > > @Dan I am using 1.6.1.2  May be some issue with it ... In the mean
> while
> > > let me test with an older version of asterisk
> > >
> > >
> > > On Wed, Nov 25, 2009 at 3:19 PM, Dan Journo <
> d...@keshercommunications.com>wrote:
> > >
> > >>  What version of Asterisk are you using?
> > >>
> > >>
> > >>
> > >> I think this might be related to an issue that was resolved in version
> > >> 1.4.27
> > >>
> > >>
> > >>
> > >>
> > >>
> http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.4.27-summary.html-look
>  in the list of Closed Items, second one down.
> > >>
> > >> https://issues.asterisk.org/view.php?id=14426 – link to the issue
> > >>
> > >>
> > >>
> > >> Hope that helps.
> > >>
> > >> Dan Journo
> > >>
> > >>
> > >>
> > >> *From:* asterisk-users-boun...@lists.digium.com [mailto:
> > >> asterisk-users-boun...@lists.digium.com] *On Behalf Of *ABBAS SHAKEEL
> > >> *Sent:* 25 November 2009 09:59
> > >> *To:* Asterisk Users Mailing List - Non-Commercial Discussion
> > >> *Subject:* [asterisk-users] ChanIsAvail querry
> > >>
> > >>
> > >>
> > >> Hello
> > >>
> > >>
> > >>
> > >> We need to know if a channel is not in use and can be used to dial a
> > >> number etc..
> > >>
> > >> I have tried the ChanIsAvail function with different parameters.
> > >>
> > >> ie ChanIsAvail(DAHDI/1&DAHDI/2) ,ChanIsAvail(DAHDI/1,s) etc
> > >>
> > >>
> > >>
> > >> no matter the channel is busy or not it always return 0 .
> > >>
> > >>
> > >>
> > >> Please suggest
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> FYI
> > >>
> > >>
>  ChanIsAvail(Technology/resource[&Technology2/resource2...][,options]):
> > >>
> > >> This application will check to see if any of the specified channels
> are
> > >>
> > >> available.
> > >>
> > >>   Options:
> > >>
> > >> a - Check for all available channels, not only the first one.
> > >>
> > >> s - Consider the channel unavailable if the channel is in use at
> all.
> > >>
> > >> t - Simply checks if specified channels exist in the channel list
> > >>
> > >> (implies option s).
> > >>
> > >> This application sets the following channel variable upon completion:
> > >>
> > >>   AVAILCHAN - the name of the available channel, if one exists
> > >>
> > >>   AVAILORIGCHAN - the canonical channel name that was used to create
> the
> > >> channel
> > >>
> > >>   AVAILSTATUS   - the status code for the available channel
> > >>
> > >>
> > >>
> > >>
> > >> --
> > >> Best Regards
> > >> Shakeel Abbas
> > >>
> > >> ___
> > >> -- 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
> > >>
> > >
> > >
> > >
> > > --
> > > Best Regards
> > > Shakeel Abbas
> > >
> > >
> >
> >
> > --
> > Best Regards
> > Shakeel Abbas
> >
> > 
> > Alternatives:
> >
> > 
> > ___
> > -- 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
> --
> Your life is like a penny.  You're going to lose it.  The question is:
> How do
> you spend it?
>
> John Covici
> cov...@ccs.covici.com
>
> ___
> -- 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
>



-- 
Best Regards
Shakeel Abbas
___
-- 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] ChanIsAvail querry

2009-11-25 Thread covici
I wonder if this is related to my problem where the channel returns with
a status of BUSY even if it is on hook -- this is a dahdi channel.

ABBAS SHAKEEL  wrote:

> Dan I have reverted to 1.4.27 but got no success. Same behaviour
> Do anyone has any success with it ?
> 
> On Wed, Nov 25, 2009 at 3:54 PM, ABBAS SHAKEEL
> wrote:
> 
> > Thanks Michiel and Dan
> >
> > @ Michiel i have checked the variables but they dont contain any value.
> > @Dan I am using 1.6.1.2  May be some issue with it ... In the mean while
> > let me test with an older version of asterisk
> >
> >
> > On Wed, Nov 25, 2009 at 3:19 PM, Dan Journo 
> > wrote:
> >
> >>  What version of Asterisk are you using?
> >>
> >>
> >>
> >> I think this might be related to an issue that was resolved in version
> >> 1.4.27
> >>
> >>
> >>
> >>
> >> http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.4.27-summary.html-
> >>  look in the list of Closed Items, second one down.
> >>
> >> https://issues.asterisk.org/view.php?id=14426 – link to the issue
> >>
> >>
> >>
> >> Hope that helps.
> >>
> >> Dan Journo
> >>
> >>
> >>
> >> *From:* asterisk-users-boun...@lists.digium.com [mailto:
> >> asterisk-users-boun...@lists.digium.com] *On Behalf Of *ABBAS SHAKEEL
> >> *Sent:* 25 November 2009 09:59
> >> *To:* Asterisk Users Mailing List - Non-Commercial Discussion
> >> *Subject:* [asterisk-users] ChanIsAvail querry
> >>
> >>
> >>
> >> Hello
> >>
> >>
> >>
> >> We need to know if a channel is not in use and can be used to dial a
> >> number etc..
> >>
> >> I have tried the ChanIsAvail function with different parameters.
> >>
> >> ie ChanIsAvail(DAHDI/1&DAHDI/2) ,ChanIsAvail(DAHDI/1,s) etc
> >>
> >>
> >>
> >> no matter the channel is busy or not it always return 0 .
> >>
> >>
> >>
> >> Please suggest
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> FYI
> >>
> >>  ChanIsAvail(Technology/resource[&Technology2/resource2...][,options]):
> >>
> >> This application will check to see if any of the specified channels are
> >>
> >> available.
> >>
> >>   Options:
> >>
> >> a - Check for all available channels, not only the first one.
> >>
> >> s - Consider the channel unavailable if the channel is in use at all.
> >>
> >> t - Simply checks if specified channels exist in the channel list
> >>
> >> (implies option s).
> >>
> >> This application sets the following channel variable upon completion:
> >>
> >>   AVAILCHAN - the name of the available channel, if one exists
> >>
> >>   AVAILORIGCHAN - the canonical channel name that was used to create the
> >> channel
> >>
> >>   AVAILSTATUS   - the status code for the available channel
> >>
> >>
> >>
> >>
> >> --
> >> Best Regards
> >> Shakeel Abbas
> >>
> >> ___
> >> -- 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
> >>
> >
> >
> >
> > --
> > Best Regards
> > Shakeel Abbas
> >
> >
> 
> 
> -- 
> Best Regards
> Shakeel Abbas
> 
> 
> Alternatives:
> 
> 
> ___
> -- 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
-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com

___
-- 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] ChanIsAvail querry

2009-11-25 Thread Michiel van Baak
On 16:54, Wed 25 Nov 09, ABBAS SHAKEEL wrote:
> Dan I have reverted to 1.4.27 but got no success. Same behaviour
> Do anyone has any success with it ?

This ael snippet is working great for me on current -trunk.
I have been using this for some time now, it's from before 1.6 got
branched so it should work there as well I think.

Verbose(1,Routing call from ${CALLERID(num)} (${CALLERID(name)}) to 
${EXTEN} on channel ${CHANNEL});
ChanIsAvail(Skinny/6000&Skinny/6002&SIP/michiele71,a);
if ( "x${AVAILORIGCHAN}" != "x" ) {
Verbose(1,Calling available channels: ${AVAILORIGCHAN});
Dial(${AVAILORIGCHAN},45,htxk);
}

> 
> On Wed, Nov 25, 2009 at 3:54 PM, ABBAS SHAKEEL
> wrote:
> 
> > Thanks Michiel and Dan
> >
> > @ Michiel i have checked the variables but they dont contain any value.
> > @Dan I am using 1.6.1.2  May be some issue with it ... In the mean while
> > let me test with an older version of asterisk
> >
> >
> > On Wed, Nov 25, 2009 at 3:19 PM, Dan Journo 
> > wrote:
> >
> >>  What version of Asterisk are you using?
> >>
> >>
> >>
> >> I think this might be related to an issue that was resolved in version
> >> 1.4.27
> >>
> >>
> >>
> >>
> >> http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.4.27-summary.html-
> >>  look in the list of Closed Items, second one down.
> >>
> >> https://issues.asterisk.org/view.php?id=14426 ? link to the issue
> >>
> >>
> >>
> >> Hope that helps.
> >>
> >> Dan Journo
> >>
> >>
> >>
> >> *From:* asterisk-users-boun...@lists.digium.com [mailto:
> >> asterisk-users-boun...@lists.digium.com] *On Behalf Of *ABBAS SHAKEEL
> >> *Sent:* 25 November 2009 09:59
> >> *To:* Asterisk Users Mailing List - Non-Commercial Discussion
> >> *Subject:* [asterisk-users] ChanIsAvail querry
> >>
> >>
> >>
> >> Hello
> >>
> >>
> >>
> >> We need to know if a channel is not in use and can be used to dial a
> >> number etc..
> >>
> >> I have tried the ChanIsAvail function with different parameters.
> >>
> >> ie ChanIsAvail(DAHDI/1&DAHDI/2) ,ChanIsAvail(DAHDI/1,s) etc
> >>
> >>
> >>
> >> no matter the channel is busy or not it always return 0 .
> >>
> >>
> >>
> >> Please suggest
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> FYI
> >>
> >>  ChanIsAvail(Technology/resource[&Technology2/resource2...][,options]):
> >>
> >> This application will check to see if any of the specified channels are
> >>
> >> available.
> >>
> >>   Options:
> >>
> >> a - Check for all available channels, not only the first one.
> >>
> >> s - Consider the channel unavailable if the channel is in use at all.
> >>
> >> t - Simply checks if specified channels exist in the channel list
> >>
> >> (implies option s).
> >>
> >> This application sets the following channel variable upon completion:
> >>
> >>   AVAILCHAN - the name of the available channel, if one exists
> >>
> >>   AVAILORIGCHAN - the canonical channel name that was used to create the
> >> channel
> >>
> >>   AVAILSTATUS   - the status code for the available channel
> >>
> >>
> >>
> >>
> >> --
> >> Best Regards
> >> Shakeel Abbas
> >>
> >> ___
> >> -- 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
> >>
> >
> >
> >
> > --
> > Best Regards
> > Shakeel Abbas
> >
> >
> 
> 
> -- 
> Best Regards
> Shakeel Abbas

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


-- 

Michiel van Baak
mich...@vanbaak.eu
http://michiel.vanbaak.eu
GnuPG key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x71C946BD

"Why is it drug addicts and computer aficionados are both called users?"


___
-- 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] ChanIsAvail querry

2009-11-25 Thread ABBAS SHAKEEL
Dan I have reverted to 1.4.27 but got no success. Same behaviour
Do anyone has any success with it ?

On Wed, Nov 25, 2009 at 3:54 PM, ABBAS SHAKEEL
wrote:

> Thanks Michiel and Dan
>
> @ Michiel i have checked the variables but they dont contain any value.
> @Dan I am using 1.6.1.2  May be some issue with it ... In the mean while
> let me test with an older version of asterisk
>
>
> On Wed, Nov 25, 2009 at 3:19 PM, Dan Journo 
> wrote:
>
>>  What version of Asterisk are you using?
>>
>>
>>
>> I think this might be related to an issue that was resolved in version
>> 1.4.27
>>
>>
>>
>>
>> http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.4.27-summary.html-
>>  look in the list of Closed Items, second one down.
>>
>> https://issues.asterisk.org/view.php?id=14426 – link to the issue
>>
>>
>>
>> Hope that helps.
>>
>> Dan Journo
>>
>>
>>
>> *From:* asterisk-users-boun...@lists.digium.com [mailto:
>> asterisk-users-boun...@lists.digium.com] *On Behalf Of *ABBAS SHAKEEL
>> *Sent:* 25 November 2009 09:59
>> *To:* Asterisk Users Mailing List - Non-Commercial Discussion
>> *Subject:* [asterisk-users] ChanIsAvail querry
>>
>>
>>
>> Hello
>>
>>
>>
>> We need to know if a channel is not in use and can be used to dial a
>> number etc..
>>
>> I have tried the ChanIsAvail function with different parameters.
>>
>> ie ChanIsAvail(DAHDI/1&DAHDI/2) ,ChanIsAvail(DAHDI/1,s) etc
>>
>>
>>
>> no matter the channel is busy or not it always return 0 .
>>
>>
>>
>> Please suggest
>>
>>
>>
>>
>>
>>
>>
>> FYI
>>
>>  ChanIsAvail(Technology/resource[&Technology2/resource2...][,options]):
>>
>> This application will check to see if any of the specified channels are
>>
>> available.
>>
>>   Options:
>>
>> a - Check for all available channels, not only the first one.
>>
>> s - Consider the channel unavailable if the channel is in use at all.
>>
>> t - Simply checks if specified channels exist in the channel list
>>
>> (implies option s).
>>
>> This application sets the following channel variable upon completion:
>>
>>   AVAILCHAN - the name of the available channel, if one exists
>>
>>   AVAILORIGCHAN - the canonical channel name that was used to create the
>> channel
>>
>>   AVAILSTATUS   - the status code for the available channel
>>
>>
>>
>>
>> --
>> Best Regards
>> Shakeel Abbas
>>
>> ___
>> -- 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
>>
>
>
>
> --
> Best Regards
> Shakeel Abbas
>
>


-- 
Best Regards
Shakeel Abbas
___
-- 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] ChanIsAvail querry

2009-11-25 Thread ABBAS SHAKEEL
Thanks Michiel and Dan

@ Michiel i have checked the variables but they dont contain any value.
@Dan I am using 1.6.1.2  May be some issue with it ... In the mean while let
me test with an older version of asterisk


On Wed, Nov 25, 2009 at 3:19 PM, Dan Journo 
wrote:

>  What version of Asterisk are you using?
>
>
>
> I think this might be related to an issue that was resolved in version
> 1.4.27
>
>
>
>
> http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.4.27-summary.html-
>  look in the list of Closed Items, second one down.
>
> https://issues.asterisk.org/view.php?id=14426 – link to the issue
>
>
>
> Hope that helps.
>
> Dan Journo
>
>
>
> *From:* asterisk-users-boun...@lists.digium.com [mailto:
> asterisk-users-boun...@lists.digium.com] *On Behalf Of *ABBAS SHAKEEL
> *Sent:* 25 November 2009 09:59
> *To:* Asterisk Users Mailing List - Non-Commercial Discussion
> *Subject:* [asterisk-users] ChanIsAvail querry
>
>
>
> Hello
>
>
>
> We need to know if a channel is not in use and can be used to dial a number
> etc..
>
> I have tried the ChanIsAvail function with different parameters.
>
> ie ChanIsAvail(DAHDI/1&DAHDI/2) ,ChanIsAvail(DAHDI/1,s) etc
>
>
>
> no matter the channel is busy or not it always return 0 .
>
>
>
> Please suggest
>
>
>
>
>
>
>
> FYI
>
>  ChanIsAvail(Technology/resource[&Technology2/resource2...][,options]):
>
> This application will check to see if any of the specified channels are
>
> available.
>
>   Options:
>
> a - Check for all available channels, not only the first one.
>
> s - Consider the channel unavailable if the channel is in use at all.
>
> t - Simply checks if specified channels exist in the channel list
>
> (implies option s).
>
> This application sets the following channel variable upon completion:
>
>   AVAILCHAN - the name of the available channel, if one exists
>
>   AVAILORIGCHAN - the canonical channel name that was used to create the
> channel
>
>   AVAILSTATUS   - the status code for the available channel
>
>
>
>
> --
> Best Regards
> Shakeel Abbas
>
> ___
> -- 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
>



-- 
Best Regards
Shakeel Abbas
___
-- 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] ChanIsAvail querry

2009-11-25 Thread Dan Journo
What version of Asterisk are you using?

I think this might be related to an issue that was resolved in version 1.4.27

http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.4.27-summary.html
 - look in the list of Closed Items, second one down.
https://issues.asterisk.org/view.php?id=14426 - link to the issue

Hope that helps.
Dan Journo

From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of ABBAS SHAKEEL
Sent: 25 November 2009 09:59
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] ChanIsAvail querry

Hello

We need to know if a channel is not in use and can be used to dial a number 
etc..
I have tried the ChanIsAvail function with different parameters.
ie ChanIsAvail(DAHDI/1&DAHDI/2) ,ChanIsAvail(DAHDI/1,s) etc

no matter the channel is busy or not it always return 0 .

Please suggest



FYI
 ChanIsAvail(Technology/resource[&Technology2/resource2...][,options]):
This application will check to see if any of the specified channels are
available.
  Options:
a - Check for all available channels, not only the first one.
s - Consider the channel unavailable if the channel is in use at all.
t - Simply checks if specified channels exist in the channel list
(implies option s).
This application sets the following channel variable upon completion:
  AVAILCHAN - the name of the available channel, if one exists
  AVAILORIGCHAN - the canonical channel name that was used to create the channel
  AVAILSTATUS   - the status code for the available channel


--
Best Regards
Shakeel Abbas
___
-- 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] ChanIsAvail querry

2009-11-25 Thread Michiel van Baak
On 14:59, Wed 25 Nov 09, ABBAS SHAKEEL wrote:
> Hello
> 
> We need to know if a channel is not in use and can be used to dial a number
> etc..
> I have tried the ChanIsAvail function with different parameters.
> ie ChanIsAvail(DAHDI/1&DAHDI/2) ,ChanIsAvail(DAHDI/1,s) etc
> 
> no matter the channel is busy or not it always return 0 .
> 
> Please suggest

As the documentation will tell you:
 This application sets the following channel variable upon completion:
   AVAILCHAN - the name of the available channel, if one exists

So check the contents of that variable after running ChanIsAvail()



-- 

Michiel van Baak
mich...@vanbaak.eu
http://michiel.vanbaak.eu
GnuPG key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x71C946BD

"Why is it drug addicts and computer aficionados are both called users?"


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


[asterisk-users] ChanIsAvail querry

2009-11-25 Thread ABBAS SHAKEEL
Hello

We need to know if a channel is not in use and can be used to dial a number
etc..
I have tried the ChanIsAvail function with different parameters.
ie ChanIsAvail(DAHDI/1&DAHDI/2) ,ChanIsAvail(DAHDI/1,s) etc

no matter the channel is busy or not it always return 0 .

Please suggest



FYI
 ChanIsAvail(Technology/resource[&Technology2/resource2...][,options]):
This application will check to see if any of the specified channels are
available.
  Options:
a - Check for all available channels, not only the first one.
s - Consider the channel unavailable if the channel is in use at all.
t - Simply checks if specified channels exist in the channel list
(implies option s).
This application sets the following channel variable upon completion:
  AVAILCHAN - the name of the available channel, if one exists
  AVAILORIGCHAN - the canonical channel name that was used to create the
channel
  AVAILSTATUS   - the status code for the available channel


-- 
Best Regards
Shakeel Abbas
___
-- 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] ChanIsAvail kills dialplan processing when no Zap available on 1.2.14.

2007-01-24 Thread Gavin Hamill
On Wed, 24 Jan 2007 09:11:20 +
Gavin Hamill <[EMAIL PROTECTED]> wrote:

> Processing does not continue to the NoOp or Dial - what am I doing
> wrong? I've also tried with the 'j' option to 'jump to priority n+101'
> even though I'm using AEL, but it's made no difference. 

For the benefit of the archive

I got this working by using a 'catch h {...}' block
at the bottom of the macro rather than switch'ing on the variables
set by ChanIsAvail().

Cheers,
Gavin.
___
--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


[asterisk-users] ChanIsAvail kills dialplan processing when no Zap available on 1.2.14.

2007-01-24 Thread Gavin Hamill
Hi, I'm trying to use ChanIsAvail to build a resilient 'dialout' macro.
The logic is simple; try Zap/g1 (a group of two E1s), and if that
fails, try locating a channel via DUNDi. Here's a massively cut down version
to illustrate the problem I'm having.

macro dialout ( dest ) {
ChanIsAvail(Zap/g1);
noop(Value of AVAILCHAN is ${AVAILCHAN});
Dial(Zap/G1/${dest}||H);
};

Here's what happens when only the second bearer is connected:

-- Executing Macro("SIP/1210-082a9768", "dialout|0800789456") in new stack
-- Executing Set("SIP/1210-082a9768", "dest=0800789456") in new stack
-- Executing ChanIsAvail("SIP/1210-082a9768", "Zap/g1") in new stack
-- Hungup 'Zap/32-1'
-- Executing NoOp("SIP/1210-082a9768", "Value of AVAILCHAN is Zap/32-1") in 
new stack
-- Executing Dial("SIP/1210-082a9768", "Zap/G1/0800789456||H") in new stack
-- Requested transfer capability: 0x00 - SPEECH
-- Called G1/0800789456
-- Zap/62-1 is making progress passing it to SIP/1210-082a9768
-- Zap/62-1 answered SIP/1210-082a9768
-- Hungup 'Zap/62-1'
  == Spawn extension (macro-dialout, s, 4) exited non-zero on 
'SIP/1210-082a9768' in macro 'dialout'
  == Spawn extension (macro-dialout, s, 4) exited non-zero on 
'SIP/1210-082a9768'

i.e. perfect - it picks the first available channel on the second
bearer - Zap/32. If only the first bearer is connected, it picks Zap/1
as I'd expect.

The killer is if /neither/ bearer is connected, I get this:

-- Executing Macro("SIP/1210-08299328", "dialout|0800789456") in new stack
-- Executing Set("SIP/1210-08299328", "dest=0800789456") in new stack
-- Executing ChanIsAvail("SIP/1210-08299328", "Zap/g1") in new stack
  == Spawn extension (macro-dialout, s, 3) exited non-zero on 
'SIP/1210-08299328' in macro 'dialout'
  == Spawn extension (macro-dialout, s, 3) exited non-zero on 
'SIP/1210-08299328'

Processing does not continue to the NoOp or Dial - what am I doing
wrong? I've also tried with the 'j' option to 'jump to priority n+101'
even though I'm using AEL, but it's made no difference. 

Cheers,
Gavin.
___
--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


Re: [asterisk-users] ChanIsAvail() in 1.2.12.1

2006-10-07 Thread Thomas Winter
Am Friday 06 October 2006 23:03 schrieb Douglas Garstang:
> *CLI> -- Executing NoOp("SIP/3254101-0817a220", "*** Originated call
> "Chocolate Chip" <3254101> -> 3254103") in new stack -- Executing
> NoOp("SIP/3254101-0817a220", "FOO1") in new stack -- Executing
> ChanIsAvail("SIP/3254101-0817a220", "SIP/3254103") in new stack
>
> It never makes it past the call to ChanIsAvail(). Dialplan processing just
> completely stops at this point. What's up with that???

Asterisk SVN-tag-1.2.12.1

Its working fine. (Iam using Realtime)

best regards

Thomas



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


RE: [asterisk-users] ChanIsAvail() in 1.2.12.1

2006-10-06 Thread Douglas Garstang
That's not how it appears to have worked before. Previously, I was able to call 
it and then simply check the value of the ${AVAILCHAN} variable at n+1. The 
docs imply that jumping to n+101 only occurs if j is supplied, and I'm not 
passing a 'j'.

*CLI> show application chanisavail

  -= Info about application 'ChanIsAvail' =- 

[Synopsis]
Check channel availability

[Description]
  ChanIsAvail(Technology/resource[&Technology2/resource2...][|options]): 
This application will check to see if any of the specified channels are
available. The following variables will be set by this application:
  ${AVAILCHAN} - the name of the available channel, if one exists
  ${AVAILORIGCHAN} - the canonical channel name that was used to create the 
channel
  ${AVAILSTATUS}   - the status code for the available channel
  Options:
s - Consider the channel unavailable if the channel is in use at all
j - Support jumping to priority n+101 if no channel is available

Doug.

> -Original Message-
> From: Julian Lyndon-Smith [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 06, 2006 3:15 PM
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: Re: [asterisk-users] ChanIsAvail() in 1.2.12.1
> 
> 
> from http://www.asteriskguru.com/tutorials/chanisavail.html
> 
> If there is no available channel the ChanIsAvail application will 
> continue with the execution of the extension with priority n+101
> 
> Douglas Garstang wrote:
> > Is there something wrong with the chanisavail() application 
> in 1.2.12.1?
> > 
> > My dialplan has:
> > 
> > [syst_Route]
> > 
> > exten => _[*0123456789].,1,NoOp(*** Originated call 
> ${CALLERID} -> ${EXTEN})
> > exten => _[*0123456789].,n,NoOp(FOO1)
> > exten => _[*0123456789].,n,ChanIsAvail(SIP/${EXTEN})
> > exten => _[*0123456789].,n,NoOp(FOO2)
> > 
> > and the console is displaying...
> > 
> > *CLI> -- Executing NoOp("SIP/3254101-0817a220", "*** 
> Originated call "Chocolate Chip" <3254101> -> 3254103") in new stack
> > -- Executing NoOp("SIP/3254101-0817a220", "FOO1") in new stack
> > -- Executing ChanIsAvail("SIP/3254101-0817a220", 
> "SIP/3254103") in new stack
> > 
> > It never makes it past the call to ChanIsAvail(). Dialplan 
> processing just completely stops at this point.
> > What's up with that???
> > 
> > Doug.
> > ___
> > --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
> > 
> > 
> 
> ___
> --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
> 
___
--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


Re: [asterisk-users] ChanIsAvail() in 1.2.12.1

2006-10-06 Thread Julian Lyndon-Smith

from http://www.asteriskguru.com/tutorials/chanisavail.html

If there is no available channel the ChanIsAvail application will 
continue with the execution of the extension with priority n+101


Douglas Garstang wrote:

Is there something wrong with the chanisavail() application in 1.2.12.1?

My dialplan has:

[syst_Route]

exten => _[*0123456789].,1,NoOp(*** Originated call ${CALLERID} -> ${EXTEN})
exten => _[*0123456789].,n,NoOp(FOO1)
exten => _[*0123456789].,n,ChanIsAvail(SIP/${EXTEN})
exten => _[*0123456789].,n,NoOp(FOO2)

and the console is displaying...

*CLI> -- Executing NoOp("SIP/3254101-0817a220", "*** Originated call "Chocolate Chip" 
<3254101> -> 3254103") in new stack
-- Executing NoOp("SIP/3254101-0817a220", "FOO1") in new stack
-- Executing ChanIsAvail("SIP/3254101-0817a220", "SIP/3254103") in new stack

It never makes it past the call to ChanIsAvail(). Dialplan processing just 
completely stops at this point.
What's up with that???

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




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


[asterisk-users] ChanIsAvail() in 1.2.12.1

2006-10-06 Thread Douglas Garstang
Is there something wrong with the chanisavail() application in 1.2.12.1?

My dialplan has:

[syst_Route]

exten => _[*0123456789].,1,NoOp(*** Originated call ${CALLERID} -> ${EXTEN})
exten => _[*0123456789].,n,NoOp(FOO1)
exten => _[*0123456789].,n,ChanIsAvail(SIP/${EXTEN})
exten => _[*0123456789].,n,NoOp(FOO2)

and the console is displaying...

*CLI> -- Executing NoOp("SIP/3254101-0817a220", "*** Originated call 
"Chocolate Chip" <3254101> -> 3254103") in new stack
-- Executing NoOp("SIP/3254101-0817a220", "FOO1") in new stack
-- Executing ChanIsAvail("SIP/3254101-0817a220", "SIP/3254103") in new stack

It never makes it past the call to ChanIsAvail(). Dialplan processing just 
completely stops at this point.
What's up with that???

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


[asterisk-users] ChanIsAvail

2006-09-21 Thread Steve Kennedy
I managed to work around my Dialplan.

The ChanIsAvail application is great, except it only returns the 1st
available channel.

Could there be a ChansAreAvail which returns all the channels available
instead of just the first. I'm sure it could be implemented as a macro
or I guess a rewrite of the code. Anyone want a go?


Steve

-- 
NetTek Ltd  UK mob +44-(0)7775 755503
UK +44-(0)20 79932612 / US +1-(310)8577715 / Fax +44-(0)20 7483 2455
Skype/GoogleTalk/AIM/Gizmo/Mac stevekennedyuk / MSN [EMAIL PROTECTED]
Euro Tech News Blog http://eurotechnews.blogspot.com
___
--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


Re: [Asterisk-Users] ChanIsAvail

2006-02-15 Thread Eric \"ManxPower\" Wieling

Jayson Navitsky wrote:

See the problem is when I do
Dial(Local/[EMAIL PROTECTED]&Local/[EMAIL PROTECTED]&Local/[EMAIL 
PROTECTED]&Local/[EMAIL PROTECTED],30)

If someone is on the phone it returns Busy and then kills the incoming
call.  ChanIsAvail would work great if I was going out to the PSTN
looking for a channel, but the problem is that I need the reverse, I
need a "ChanNotAvail" basically saying not to ring that line.

Argh, this one has me really scratching my head.


It should not do that.  Maybe it's doing it because you are using Local/
___
--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


Re: [Asterisk-Users] ChanIsAvail

2006-02-15 Thread Tzafrir Cohen
On Tue, Feb 14, 2006 at 10:17:16AM -0500, Jayson Navitsky wrote:
> Hi,
> 
> So I've done my research on Chanisavail, read the wiki, checked the
> archive but can't seem to find anything to suit my scenario.  I've
> played around with it a lot, but I'm still scratching my head on what
> I need to do.
> 
> What I need is to be able to accept a call by SIP and ring all
> telephones that are not in use (which just so happen to be on Zap
> interfaces, but might be SIP in the future).
> 
> What I have now is this (I know it's really bad):
> 
> exten => 1646555,1,Answer()
> exten => 1646555,2,Dial(Local/[EMAIL PROTECTED]&Local/[EMAIL 
> PROTECTED]&Local/[EMAIL PROTECTED]&Local/[EMAIL PROTECTED],30)

Do you check the return status from Dial?

> exten => 1646555,3,ChanisAvail(Local/[EMAIL PROTECTED]&Local/[EMAIL 
> PROTECTED])

What should that return? Local/[EMAIL PROTECTED] should always be available, 
right?
(or maybe never, if that is how Local works).

I figure you need to use the actual channel name (Zap/nnn) if you want
to use ChanisAvail .

> exten => 1646555,4,Cut(DESK3=AVAILCHAN||1)
> exten => 1646555,5,ChanisAvail(Local/[EMAIL PROTECTED]&Local/[EMAIL 
> PROTECTED])
> exten => 1646555,6,Cut(DESK4=AVAILCHAN||1)
> exten => 1646555,7,Dial(${DESK3}&${DESK4},30,tr)
> exten => 1646555,8,Busy
> 
> (Each local is 1 zap interface)
> 
> Which is sort of my temporary work around to the problem for now,
> first if there are no phones in use all phones will ring, if not it
> will return busy and then it is checked to see if there is anything
> available to ring between those 2 "groups" there.  If only one phone
> is in use only 2 channels will ring right now (obviously).
> 
> What I need is for any available channel to ring.
> 
> Any thoughts?
> 
> Thanks,
> Jay
> ___
> --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

-- 
Tzafrir Cohen | [EMAIL PROTECTED] | VIM is
http://tzafrir.org.il |   | a Mutt's  
[EMAIL PROTECTED] |   |  best
ICQ# 16849755 |   | friend

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


Re: [Asterisk-Users] ChanIsAvail

2006-02-15 Thread Jayson Navitsky
See the problem is when I do
Dial(Local/[EMAIL PROTECTED]&Local/[EMAIL PROTECTED]&Local/[EMAIL 
PROTECTED]&Local/[EMAIL PROTECTED],30)

If someone is on the phone it returns Busy and then kills the incoming
call.  ChanIsAvail would work great if I was going out to the PSTN
looking for a channel, but the problem is that I need the reverse, I
need a "ChanNotAvail" basically saying not to ring that line.

Argh, this one has me really scratching my head.

Thanks for the info guys.

-J

>I was gonna say use a queue of sorts, throw the devices into the queue
>and tell it to ring all.  I haven't played with it, but I would assume
>that if a line's in use, it won't ring that person.
>
>Aaron
>
>Joseph Tanner wrote:
>> Perhaps I'm missing something here, but why not just have asterisk
>> dial all the phones regardless?  No need to check what's available or
>> not, just dial all of them.  If you don't want users on the phone to
>> hear a call-waiting beep, just make sure call-waiting is disabled.
>> Any phones that are able to ring will do so, the ones that are busy
>> obviously will not.
>>
>> If I am missing something, let me know, but this seems to be the
>> easiest solution and will do what you said you need.  Dial all phones,
>> and all that are available will ring, the rest will just return a busy
>> message which asterisk should ignore, as long as one phone somewhere
>> is not busy.  I haven't run into this, but I would assume if all
>> phones were busy that asterisk would then go to priority +101, so you
>> could send them straight to voicemail.
>>
>> Joseph Tanner
>>
>> On 2/14/06, Jayson Navitsky <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> So I've done my research on Chanisavail, read the wiki, checked the
>> archive but can't seem to find anything to suit my scenario.  I've
>> played around with it a lot, but I'm still scratching my head on what
>> I need to do.
>>
>> What I need is to be able to accept a call by SIP and ring all
>> telephones that are not in use (which just so happen to be on Zap
>> interfaces, but might be SIP in the future).
>>
>> What I have now is this (I know it's really bad):
>>
>> exten => 1646555,1,Answer()
>> exten => 1646555,2,Dial(Local/[EMAIL PROTECTED]&Local/[EMAIL 
>> PROTECTED]&Local/[EMAIL PROTECTED]&Local/[EMAIL PROTECTED],30)
>> exten => 1646555,3,ChanisAvail(Local/[EMAIL PROTECTED]&Local/[EMAIL 
>> PROTECTED])
>> exten => 1646555,4,Cut(DESK3=AVAILCHAN||1)
>> exten => 1646555,5,ChanisAvail(Local/[EMAIL PROTECTED]&Local/[EMAIL 
>> PROTECTED])
>> exten => 1646555,6,Cut(DESK4=AVAILCHAN||1)
>> exten => 1646555,7,Dial(${DESK3}&${DESK4},30,tr)
>> exten => 1646555,8,Busy
>>
>> (Each local is 1 zap interface)
>>
>> Which is sort of my temporary work around to the problem for now,
>> first if there are no phones in use all phones will ring, if not it
>> will return busy and then it is checked to see if there is anything
>> available to ring between those 2 "groups" there.  If only one phone
>> is in use only 2 channels will ring right now (obviously).
>>
>> What I need is for any available channel to ring.
>>
>> Any thoughts?
>>
>> Thanks,
>> Jay
>> __
___
--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


Re: [Asterisk-Users] ChanIsAvail

2006-02-14 Thread Aaron Daniel
I was gonna say use a queue of sorts, throw the devices into the queue 
and tell it to ring all.  I haven't played with it, but I would assume 
that if a line's in use, it won't ring that person.


Aaron

Joseph Tanner wrote:

Perhaps I'm missing something here, but why not just have asterisk
dial all the phones regardless?  No need to check what's available or
not, just dial all of them.  If you don't want users on the phone to
hear a call-waiting beep, just make sure call-waiting is disabled. 
Any phones that are able to ring will do so, the ones that are busy

obviously will not.

If I am missing something, let me know, but this seems to be the
easiest solution and will do what you said you need.  Dial all phones,
and all that are available will ring, the rest will just return a busy
message which asterisk should ignore, as long as one phone somewhere
is not busy.  I haven't run into this, but I would assume if all
phones were busy that asterisk would then go to priority +101, so you
could send them straight to voicemail.

Joseph Tanner

On 2/14/06, Jayson Navitsky <[EMAIL PROTECTED]> wrote:

Hi,

So I've done my research on Chanisavail, read the wiki, checked the
archive but can't seem to find anything to suit my scenario.  I've
played around with it a lot, but I'm still scratching my head on what
I need to do.

What I need is to be able to accept a call by SIP and ring all
telephones that are not in use (which just so happen to be on Zap
interfaces, but might be SIP in the future).

What I have now is this (I know it's really bad):

exten => 1646555,1,Answer()
exten => 1646555,2,Dial(Local/[EMAIL PROTECTED]&Local/[EMAIL 
PROTECTED]&Local/[EMAIL PROTECTED]&Local/[EMAIL PROTECTED],30)
exten => 1646555,3,ChanisAvail(Local/[EMAIL PROTECTED]&Local/[EMAIL 
PROTECTED])
exten => 1646555,4,Cut(DESK3=AVAILCHAN||1)
exten => 1646555,5,ChanisAvail(Local/[EMAIL PROTECTED]&Local/[EMAIL 
PROTECTED])
exten => 1646555,6,Cut(DESK4=AVAILCHAN||1)
exten => 1646555,7,Dial(${DESK3}&${DESK4},30,tr)
exten => 1646555,8,Busy

(Each local is 1 zap interface)

Which is sort of my temporary work around to the problem for now,
first if there are no phones in use all phones will ring, if not it
will return busy and then it is checked to see if there is anything
available to ring between those 2 "groups" there.  If only one phone
is in use only 2 channels will ring right now (obviously).

What I need is for any available channel to ring.

Any thoughts?

Thanks,
Jay
___
--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


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

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


Re: [Asterisk-Users] ChanIsAvail

2006-02-14 Thread Joseph Tanner
Eventually I will learn to read the message twice before responding. 
I see you are dialing all the phones first.  So if just one is busy
asterisk won't dial any?  That's odd.  Now, I don't have any phones on
a zaptel card (just an X101P for incoming), but when dialing multiple
sip phones, it'll ring the ones that are available no problem.  I can
call from one to the other, obviously the one I'm calling from can't
be rung and returns a busy message, but asterisk happily dials the
rest.  In fact, I have asterisk dial several extensions that aren't
even online (test extensions that are sometimes online, sometimes not)
and I've never had a problem.

Sorry I couldn't be of more help :(

Joseph Tanner

On 2/14/06, Joseph Tanner <[EMAIL PROTECTED]> wrote:
> Perhaps I'm missing something here, but why not just have asterisk
> dial all the phones regardless?  No need to check what's available or
> not, just dial all of them.  If you don't want users on the phone to
> hear a call-waiting beep, just make sure call-waiting is disabled.
> Any phones that are able to ring will do so, the ones that are busy
> obviously will not.
>
> If I am missing something, let me know, but this seems to be the
> easiest solution and will do what you said you need.  Dial all phones,
> and all that are available will ring, the rest will just return a busy
> message which asterisk should ignore, as long as one phone somewhere
> is not busy.  I haven't run into this, but I would assume if all
> phones were busy that asterisk would then go to priority +101, so you
> could send them straight to voicemail.
>
> Joseph Tanner
>
> On 2/14/06, Jayson Navitsky <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > So I've done my research on Chanisavail, read the wiki, checked the
> > archive but can't seem to find anything to suit my scenario.  I've
> > played around with it a lot, but I'm still scratching my head on what
> > I need to do.
> >
> > What I need is to be able to accept a call by SIP and ring all
> > telephones that are not in use (which just so happen to be on Zap
> > interfaces, but might be SIP in the future).
> >
> > What I have now is this (I know it's really bad):
> >
> > exten => 1646555,1,Answer()
> > exten => 1646555,2,Dial(Local/[EMAIL PROTECTED]&Local/[EMAIL 
> > PROTECTED]&Local/[EMAIL PROTECTED]&Local/[EMAIL PROTECTED],30)
> > exten => 1646555,3,ChanisAvail(Local/[EMAIL PROTECTED]&Local/[EMAIL 
> > PROTECTED])
> > exten => 1646555,4,Cut(DESK3=AVAILCHAN||1)
> > exten => 1646555,5,ChanisAvail(Local/[EMAIL PROTECTED]&Local/[EMAIL 
> > PROTECTED])
> > exten => 1646555,6,Cut(DESK4=AVAILCHAN||1)
> > exten => 1646555,7,Dial(${DESK3}&${DESK4},30,tr)
> > exten => 1646555,8,Busy
> >
> > (Each local is 1 zap interface)
> >
> > Which is sort of my temporary work around to the problem for now,
> > first if there are no phones in use all phones will ring, if not it
> > will return busy and then it is checked to see if there is anything
> > available to ring between those 2 "groups" there.  If only one phone
> > is in use only 2 channels will ring right now (obviously).
> >
> > What I need is for any available channel to ring.
> >
> > Any thoughts?
> >
> > Thanks,
> > Jay
> > ___
> > --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
> >
>
___
--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


Re: [Asterisk-Users] ChanIsAvail

2006-02-14 Thread Joseph Tanner
Perhaps I'm missing something here, but why not just have asterisk
dial all the phones regardless?  No need to check what's available or
not, just dial all of them.  If you don't want users on the phone to
hear a call-waiting beep, just make sure call-waiting is disabled. 
Any phones that are able to ring will do so, the ones that are busy
obviously will not.

If I am missing something, let me know, but this seems to be the
easiest solution and will do what you said you need.  Dial all phones,
and all that are available will ring, the rest will just return a busy
message which asterisk should ignore, as long as one phone somewhere
is not busy.  I haven't run into this, but I would assume if all
phones were busy that asterisk would then go to priority +101, so you
could send them straight to voicemail.

Joseph Tanner

On 2/14/06, Jayson Navitsky <[EMAIL PROTECTED]> wrote:
> Hi,
>
> So I've done my research on Chanisavail, read the wiki, checked the
> archive but can't seem to find anything to suit my scenario.  I've
> played around with it a lot, but I'm still scratching my head on what
> I need to do.
>
> What I need is to be able to accept a call by SIP and ring all
> telephones that are not in use (which just so happen to be on Zap
> interfaces, but might be SIP in the future).
>
> What I have now is this (I know it's really bad):
>
> exten => 1646555,1,Answer()
> exten => 1646555,2,Dial(Local/[EMAIL PROTECTED]&Local/[EMAIL 
> PROTECTED]&Local/[EMAIL PROTECTED]&Local/[EMAIL PROTECTED],30)
> exten => 1646555,3,ChanisAvail(Local/[EMAIL PROTECTED]&Local/[EMAIL 
> PROTECTED])
> exten => 1646555,4,Cut(DESK3=AVAILCHAN||1)
> exten => 1646555,5,ChanisAvail(Local/[EMAIL PROTECTED]&Local/[EMAIL 
> PROTECTED])
> exten => 1646555,6,Cut(DESK4=AVAILCHAN||1)
> exten => 1646555,7,Dial(${DESK3}&${DESK4},30,tr)
> exten => 1646555,8,Busy
>
> (Each local is 1 zap interface)
>
> Which is sort of my temporary work around to the problem for now,
> first if there are no phones in use all phones will ring, if not it
> will return busy and then it is checked to see if there is anything
> available to ring between those 2 "groups" there.  If only one phone
> is in use only 2 channels will ring right now (obviously).
>
> What I need is for any available channel to ring.
>
> Any thoughts?
>
> Thanks,
> Jay
> ___
> --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
>
___
--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


[Asterisk-Users] ChanIsAvail

2006-02-14 Thread Jayson Navitsky
Hi,

So I've done my research on Chanisavail, read the wiki, checked the
archive but can't seem to find anything to suit my scenario.  I've
played around with it a lot, but I'm still scratching my head on what
I need to do.

What I need is to be able to accept a call by SIP and ring all
telephones that are not in use (which just so happen to be on Zap
interfaces, but might be SIP in the future).

What I have now is this (I know it's really bad):

exten => 1646555,1,Answer()
exten => 1646555,2,Dial(Local/[EMAIL PROTECTED]&Local/[EMAIL 
PROTECTED]&Local/[EMAIL PROTECTED]&Local/[EMAIL PROTECTED],30)
exten => 1646555,3,ChanisAvail(Local/[EMAIL PROTECTED]&Local/[EMAIL 
PROTECTED])
exten => 1646555,4,Cut(DESK3=AVAILCHAN||1)
exten => 1646555,5,ChanisAvail(Local/[EMAIL PROTECTED]&Local/[EMAIL 
PROTECTED])
exten => 1646555,6,Cut(DESK4=AVAILCHAN||1)
exten => 1646555,7,Dial(${DESK3}&${DESK4},30,tr)
exten => 1646555,8,Busy

(Each local is 1 zap interface)

Which is sort of my temporary work around to the problem for now,
first if there are no phones in use all phones will ring, if not it
will return busy and then it is checked to see if there is anything
available to ring between those 2 "groups" there.  If only one phone
is in use only 2 channels will ring right now (obviously).

What I need is for any available channel to ring.

Any thoughts?

Thanks,
Jay
___
--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


RE: [Asterisk-Users] ChanIsAvail()

2005-12-15 Thread Alexander Lopez
I do not think that Chanisavail will work with a group...
If is does you still need to add the j option to it so that it will Jump


> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> [EMAIL PROTECTED]
> Sent: Thursday, December 15, 2005 9:14 AM
> To: asterisk-users@lists.digium.com
> Subject: [Asterisk-Users] ChanIsAvail()
> 
> Hello,
> 
> I configure a asterisk server with tdm400p .  I wish to set 
> chanisavail() in order to allow users or the hylafax server 
> to dial numbers to pstn .  however I can't write the rules  
> to forward requests to the dial pattern when channel is available.
> 
> I try this however priority 2 fail.
> how can i forward requests to outgoing-pstn  context ?
> 
> exten => s,1,ChanIsAvail(Zap/g1)
> exten => s,2,Goto(outgoing-pstn) ;n+1 Zap/g1 available exten 
> => s,102,Playback(all-circuits-busy-now) n+1 unavailable 
> exten => s,103,Hangup
> 
> Regards
> H.G
> 
> extension.conf
> 
> [sip]
> 
> exten => 84,1,Answer
> exten => 84,2,Dial(Sip/84,10,t)
> exten => 84,3,VoiceMail(u84)
> exten => 84,103,VoiceMail(b84)
> 
> [fax]
> exten => 80,1,Dial(Zap/2,40)
> exten => 80,2,Congestion
> exten => 80,102,Congestion
> 
> 
> [outgoing-pstn]
> ingnorepat => 0
> exten => _0,1,Dial(Zap/g1/${EXTEN:1}) exten => 
> _0.,1,Dial(Zap/g1/${EXTEN:1})
> 
> 
> 
>   
> 
>   
>   
> __
> _
> Nouveau : téléphonez moins cher avec Yahoo! Messenger ! 
> Découvez les tarifs exceptionnels pour appeler la France et 
> l'international.
> Téléchargez sur http://fr.messenger.yahoo.com 
> ___
> --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
> 
___
--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


Re: [Asterisk-Users] ChanIsAvail()

2005-12-15 Thread Jose Solares
On 12/15/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Hello,I configure a asterisk server with tdm400p .  I wishto set chanisavail() in order to allow users or the
hylafax server to dial numbers to pstn .  however Ican't write the rules  to forward requests to the dialpattern when channel is available.I try this however priority 2 fail.how can i forward requests to outgoing-pstn  context ?
exten => s,1,ChanIsAvail(Zap/g1)exten => s,2,Goto(outgoing-pstn) ;n+1 Zap/g1 availableexten => s,102,Playback(all-circuits-busy-now) n+1unavailableexten => s,103,HangupRegards
H.Gextension.conf[sip]exten => 84,1,Answerexten => 84,2,Dial(Sip/84,10,t)exten => 84,3,VoiceMail(u84)exten => 84,103,VoiceMail(b84)[fax]exten => 80,1,Dial(Zap/2,40)
exten => 80,2,Congestionexten => 80,102,Congestion[outgoing-pstn]ingnorepat => 0exten => _0,1,Dial(Zap/g1/${EXTEN:1})exten => _0.,1,Dial(Zap/g1/${EXTEN:1})
It's very important to know what version of asterisk you are using, since as of 1.2 it doesnt do priority jumping.

You'd have to use ChanIsAvail( Zap/g1, j ) if you're using 1.2+

also keep in mind that ${AVAILCHAN} will return something like Zap/2-1 indicating that Zap/2-1 is available in Zap/g1

Another thing is that you're making your incoming calls go to another
context with no idea of what to do there, you should use something like
background to let the users punch in the number they wish to call.
___
--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


[Asterisk-Users] ChanIsAvail()

2005-12-15 Thread hgaillac-sip
Hello,

I configure a asterisk server with tdm400p .  I wish
to set chanisavail() in order to allow users or the
hylafax server to dial numbers to pstn .  however I
can't write the rules  to forward requests to the dial
pattern when channel is available.

I try this however priority 2 fail.
how can i forward requests to outgoing-pstn  context ?

exten => s,1,ChanIsAvail(Zap/g1)
exten => s,2,Goto(outgoing-pstn) ;n+1 Zap/g1 available
exten => s,102,Playback(all-circuits-busy-now) n+1
unavailable
exten => s,103,Hangup

Regards
H.G

extension.conf

[sip]

exten => 84,1,Answer
exten => 84,2,Dial(Sip/84,10,t)
exten => 84,3,VoiceMail(u84)
exten => 84,103,VoiceMail(b84)

[fax]
exten => 80,1,Dial(Zap/2,40)
exten => 80,2,Congestion
exten => 80,102,Congestion


[outgoing-pstn]
ingnorepat => 0
exten => _0,1,Dial(Zap/g1/${EXTEN:1})
exten => _0.,1,Dial(Zap/g1/${EXTEN:1})







___ 
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs 
exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com
___
--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


Re: [Asterisk-Users] ChanIsAvail() and SIP

2005-12-14 Thread Jose Solares
I know, but that's what they answered to that bug report. they should atleast state that it's not working with sip, OR how to make it work with sip if perhaps its tricky to use.BTW, you're not using qualify right, i saw the code trying to figure out why it wasnt working, and if qualify is not set for the device it'll return a 0, if it's set then it'll use a pbx builtin to see if the channel is in use, but that's broken for sip as far as i can tell.
It should return in use if the sip device is in a call but can take another (if it hasnt met the call-limit), and busy if it has met call-limit. otherwise you'd have to rely on the return code from the phone when dialing, which in my case since turning off call waiting was indeed busy, but that messes up my PRI signalling since i send the busy with a no answer, instead of a termination.
For me it never returned 2 or 3, it always returns 1 (Available), if you do file a bug post the url, i'd rather use this app than having to turn off call waiting on the sip phones ( that's what i did before i read about groups )
On 12/14/05, Scott Maier <[EMAIL PROTECTED]> wrote:
On Dec 14, 2005, at 1:17 PM, Jose Solares wrote:According to this : 
http://bugs.digium.com/view.php?id=4506chanisavail is not intended to detect if a phone is in use or not at all, it's only intended to check if asterisk could send the call there.
Well, that would go against all of the documentation that I have seen which indicates that passing 's' as an option will "Consider the channel unavailable if the channel is in use at all".
Regardless, that still does not explain why the return code is 0 - I would expect 2 (in use) or 3 (busy) if the channel had an active call.I think I will file a bug to try and get some clarification.
Thanks for the alternate suggestion, I will look in to that. - Scott
I tried using call-limit and chanisavail, but it's broken in SIP. inuse gets applied only to peers, and when it gets an incomming call that is not answered it gets decremented and doesnt stay the same, which is a bug. 
You should consider using groups, http://www.voip-info.org/wiki-Asterisk+cmd+SetGroup
On 12/14/05,  Scott Maier <[EMAIL PROTECTED]
> wrote: Hi everyone,I have started trying to use ChanIsAvail() to detect when a phone is
in use (on any call) and my results are disappointing.Here are some examples out output to the console followed by the meaning of the return status code based on what I have found in thecomments on this page: <
http://www.voip-info.org/wiki/index.php?page=Asterisk+cmd+ChanIsAvail> Test using a real extension (224) that I know is in use at the time
of the test.  Calling from 227:-- Executing Playback("SIP/227-c825", "silence/1") in new stack-- Playing 'silence/1' (language 'en') -- Executing ChanIsAvail("SIP/227-c825", "SIP/224|sj") in new stack
-- Executing NoOp("SIP/227-c825", "SIP/224-08ce|SIP/224|0") in new stack-- Executing Dial("SIP/227-c825", "SIP/224|10") in new stack -- Called 224-- SIP/224-4fc4 is ringing
/* 0 AST_DEVICE_UNKNOWN */ "Unknown", /* Valid, but unknown state */Test using a fake extension (333) that doesn't exist and is notdefined anywhere.  Calling from 227: -- Executing Playback("SIP/227-e4d2", "sales") in new stack
-- Playing 'sales' (language 'en')-- Executing ChanIsAvail("SIP/227-e4d2", "SIP/333|sj") in new stack-- Executing NoOp("SIP/227-e4d2", "||4") in new stack -- Executing Hangup("SIP/227-e4d2", "") in new stack
/* 4 AST_DEVICE_INVALID */ "Invalid", /* Invalid - not known toAsterisk */Test using a real extension (206) that is defined, but not registered.  Calling from 227:-- Executing Playback("SIP/227-8a76", "sales") in new stack
-- Playing 'sales' (language 'en')-- Executing ChanIsAvail("SIP/227-8a76", "SIP/206|sj") in new stack -- Executing NoOp("SIP/227-8a76", "||5") in new stack-- Executing Hangup("SIP/227-8a76", "") in new stack
/* 5 AST_DEVICE_UNAVAILABLE */ "Unavailable", /* Unavailable (not registred) */This all seems to be fine, except for the 1st example where I amtesting a known, registered, in use Polycom 501.
Does anyone have any idea why Asterisk is returning 0 for that test? Is anyone else using ChanIsAvail() successfully?This is with Asterisk 1.2.0.  - Scott

___--Bandwidth and Colocation provided by Easynews.com --
Asterisk-Users mailing listTo UNSUBSCRIBE or update options visit:   http://lists.digium.com/mailman/listinfo/asterisk-users

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


Re: [Asterisk-Users] ChanIsAvail() and SIP

2005-12-14 Thread Scott Maier
On Dec 14, 2005, at 1:17 PM, Jose Solares wrote:According to this : http://bugs.digium.com/view.php?id=4506chanisavail is not intended to detect if a phone is in use or not at all, it's only intended to check if asterisk could send the call there.Well, that would go against all of the documentation that I have seen which indicates that passing 's' as an option will "Consider the channel unavailable if the channel is in use at all".Regardless, that still does not explain why the return code is 0 - I would expect 2 (in use) or 3 (busy) if the channel had an active call.I think I will file a bug to try and get some clarification.Thanks for the alternate suggestion, I will look in to that. - ScottI tried using call-limit and chanisavail, but it's broken in SIP. inuse gets applied only to peers, and when it gets an incomming call that is not answered it gets decremented and doesnt stay the same, which is a bug. You should consider using groups, http://www.voip-info.org/wiki-Asterisk+cmd+SetGroupOn 12/14/05,  Scott Maier <[EMAIL PROTECTED]> wrote: Hi everyone,I have started trying to use ChanIsAvail() to detect when a phone isin use (on any call) and my results are disappointing.Here are some examples out output to the console followed by the meaning of the return status code based on what I have found in thecomments on this page:  Test using a real extension (224) that I know is in use at the timeof the test.  Calling from 227:-- Executing Playback("SIP/227-c825", "silence/1") in new stack-- Playing 'silence/1' (language 'en') -- Executing ChanIsAvail("SIP/227-c825", "SIP/224|sj") in new stack-- Executing NoOp("SIP/227-c825", "SIP/224-08ce|SIP/224|0") in new stack-- Executing Dial("SIP/227-c825", "SIP/224|10") in new stack -- Called 224-- SIP/224-4fc4 is ringing/* 0 AST_DEVICE_UNKNOWN */ "Unknown", /* Valid, but unknown state */Test using a fake extension (333) that doesn't exist and is notdefined anywhere.  Calling from 227: -- Executing Playback("SIP/227-e4d2", "sales") in new stack-- Playing 'sales' (language 'en')-- Executing ChanIsAvail("SIP/227-e4d2", "SIP/333|sj") in new stack-- Executing NoOp("SIP/227-e4d2", "||4") in new stack -- Executing Hangup("SIP/227-e4d2", "") in new stack/* 4 AST_DEVICE_INVALID */ "Invalid", /* Invalid - not known toAsterisk */Test using a real extension (206) that is defined, but not registered.  Calling from 227:-- Executing Playback("SIP/227-8a76", "sales") in new stack-- Playing 'sales' (language 'en')-- Executing ChanIsAvail("SIP/227-8a76", "SIP/206|sj") in new stack -- Executing NoOp("SIP/227-8a76", "||5") in new stack-- Executing Hangup("SIP/227-8a76", "") in new stack/* 5 AST_DEVICE_UNAVAILABLE */ "Unavailable", /* Unavailable (not registred) */This all seems to be fine, except for the 1st example where I amtesting a known, registered, in use Polycom 501.Does anyone have any idea why Asterisk is returning 0 for that test? Is anyone else using ChanIsAvail() successfully?This is with Asterisk 1.2.0.  - Scott___
--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


Re: [Asterisk-Users] ChanIsAvail() and SIP

2005-12-14 Thread Jose Solares
According to this : http://bugs.digium.com/view.php?id=4506chanisavail is not intended to detect if a phone is in use or not at all, it's only intended to check if asterisk could send the call there.
I tried using call-limit and chanisavail, but it's broken in SIP. inuse gets applied only to peers, and when it gets an incomming call that is not answered it gets decremented and doesnt stay the same, which is a bug.
You should consider using groups, http://www.voip-info.org/wiki-Asterisk+cmd+SetGroupOn 12/14/05, 
Scott Maier <[EMAIL PROTECTED]> wrote:
Hi everyone,I have started trying to use ChanIsAvail() to detect when a phone isin use (on any call) and my results are disappointing.Here are some examples out output to the console followed by the
meaning of the return status code based on what I have found in thecomments on this page: 
Test using a real extension (224) that I know is in use at the timeof the test.  Calling from 227:-- Executing Playback("SIP/227-c825", "silence/1") in new stack-- Playing 'silence/1' (language 'en')
-- Executing ChanIsAvail("SIP/227-c825", "SIP/224|sj") in new stack-- Executing NoOp("SIP/227-c825", "SIP/224-08ce|SIP/224|0") in new stack-- Executing Dial("SIP/227-c825", "SIP/224|10") in new stack
-- Called 224-- SIP/224-4fc4 is ringing/* 0 AST_DEVICE_UNKNOWN */ "Unknown", /* Valid, but unknown state */Test using a fake extension (333) that doesn't exist and is notdefined anywhere.  Calling from 227:
-- Executing Playback("SIP/227-e4d2", "sales") in new stack-- Playing 'sales' (language 'en')-- Executing ChanIsAvail("SIP/227-e4d2", "SIP/333|sj") in new stack-- Executing NoOp("SIP/227-e4d2", "||4") in new stack
-- Executing Hangup("SIP/227-e4d2", "") in new stack/* 4 AST_DEVICE_INVALID */ "Invalid", /* Invalid - not known toAsterisk */Test using a real extension (206) that is defined, but not
registered.  Calling from 227:-- Executing Playback("SIP/227-8a76", "sales") in new stack-- Playing 'sales' (language 'en')-- Executing ChanIsAvail("SIP/227-8a76", "SIP/206|sj") in new stack
-- Executing NoOp("SIP/227-8a76", "||5") in new stack-- Executing Hangup("SIP/227-8a76", "") in new stack/* 5 AST_DEVICE_UNAVAILABLE */ "Unavailable", /* Unavailable (not
registred) */This all seems to be fine, except for the 1st example where I amtesting a known, registered, in use Polycom 501.Does anyone have any idea why Asterisk is returning 0 for that test?
Is anyone else using ChanIsAvail() successfully?This is with Asterisk 1.2.0.  - Scott___--Bandwidth and Colocation provided by 
Easynews.com --Asterisk-Users mailing listTo UNSUBSCRIBE or update options visit:   http://lists.digium.com/mailman/listinfo/asterisk-users

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


[Asterisk-Users] ChanIsAvail() and SIP

2005-12-14 Thread Scott Maier


Hi everyone,


I have started trying to use ChanIsAvail() to detect when a phone is  
in use (on any call) and my results are disappointing.


Here are some examples out output to the console followed by the  
meaning of the return status code based on what I have found in the  
comments on this page: 



Test using a real extension (224) that I know is in use at the time  
of the test.  Calling from 227:


-- Executing Playback("SIP/227-c825", "silence/1") in new stack
-- Playing 'silence/1' (language 'en')
-- Executing ChanIsAvail("SIP/227-c825", "SIP/224|sj") in new stack
-- Executing NoOp("SIP/227-c825", "SIP/224-08ce|SIP/224|0") in new stack
-- Executing Dial("SIP/227-c825", "SIP/224|10") in new stack
-- Called 224
-- SIP/224-4fc4 is ringing

/* 0 AST_DEVICE_UNKNOWN */ "Unknown", /* Valid, but unknown state */


Test using a fake extension (333) that doesn't exist and is not  
defined anywhere.  Calling from 227:


-- Executing Playback("SIP/227-e4d2", "sales") in new stack
-- Playing 'sales' (language 'en')
-- Executing ChanIsAvail("SIP/227-e4d2", "SIP/333|sj") in new stack
-- Executing NoOp("SIP/227-e4d2", "||4") in new stack
-- Executing Hangup("SIP/227-e4d2", "") in new stack

/* 4 AST_DEVICE_INVALID */ "Invalid", /* Invalid - not known to  
Asterisk */



Test using a real extension (206) that is defined, but not  
registered.  Calling from 227:


-- Executing Playback("SIP/227-8a76", "sales") in new stack
-- Playing 'sales' (language 'en')
-- Executing ChanIsAvail("SIP/227-8a76", "SIP/206|sj") in new stack
-- Executing NoOp("SIP/227-8a76", "||5") in new stack
-- Executing Hangup("SIP/227-8a76", "") in new stack

/* 5 AST_DEVICE_UNAVAILABLE */ "Unavailable", /* Unavailable (not  
registred) */



This all seems to be fine, except for the 1st example where I am  
testing a known, registered, in use Polycom 501.


Does anyone have any idea why Asterisk is returning 0 for that test?   
Is anyone else using ChanIsAvail() successfully?


This is with Asterisk 1.2.0.


 - Scott


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


[Asterisk-Users] chanisavail - queuing

2005-11-03 Thread Bill Michaelson
Is there anyway to code for queuing for an available trunk.  I thought 
of this while reading about Erlang C.


Basically, the idea is that when a caller at an internal extension tries 
to place a call via PSTN, but all available trunks are busy, the call is 
placed in a FIFO queue for the first available trunk while the caller 
hears an appropriate announcement.



___
--Bandwidth and Colocation sponsored by Easynews.com --

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


[Asterisk-Users] Chanisavail and IAX2

2005-10-29 Thread Jason Kim
Hi,

Im trying to do this:
exten => s,7,ChanIsAvail(IAX2/agent)

I searched google and found that on cvs-head
ChanisAvail(IAX2) is not working.
I need both cvs-head and ChanisAvail.
Any idea?

Thanks.


http://lists.digium.com/pipermail/asterisk-users/2005-March/096682.html




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com
___
--Bandwidth and Colocation sponsored by Easynews.com --

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


[Asterisk-Users] ChanIsAvail for IAX not working again/still? AKA Redundant IAX connections not working

2005-08-26 Thread Noah Miller

Hi -

I'm running CVS-HEAD from 2005-08-11 20:17:17 UTC, and I'm trying to  
set up some redundancy on IAX connections between locations.  I have  
two IAX peers set up that work correctly by themselves: "ast551-out"  
and "ast551-out-backup":


[ast551-out]
type=peer
secret=secret
username=ast551
host=X.X.X.X
qualify=1000
disallow=all
allow=gsm
allow=ulaw
trunk=no
tos=0x04

[ast551-out-backup]
type=peer
secret=secret
username=ast551-backup
host=Y.Y.Y.Y
qualify=1000
disallow=all
allow=gsm
allow=ulaw
trunk=no
tos=0x04

If one does become unavailable, I'd like the other to be used.  I  
tried to set that up like this:


exten => 145,1,ChanIsAvail(${IAX2/iax-in:[EMAIL PROTECTED]/$ 
{EXTEN})
exten => 145,2,Dial(${IAX2/iax-in:[EMAIL PROTECTED]/${EXTEN}, 
20,t)

exten => 145,102,Dial(${IAX2/iax-in:[EMAIL PROTECTED]/${EXTEN},20,t)

What is happening is that all calls are going out through "ast551-out- 
backup", even when I physically disable the connection.  The console  
shows this:


-- Hungup 'IAX2/ast551-out-backup-2'
-- Executing Dial("SIP/68-1c7a", "IAX2/iax-in:[EMAIL PROTECTED] 
backup/145|20|t") in new stack

-- Called iax-in:[EMAIL PROTECTED]/145
-- IAX2/ast551-out-backup-7 is circuit-busy
Aug 26 12:11:56 NOTICE[14283]: chan_iax2.c:2736 auto_congest: Auto- 
congesting call due to slow response

-- Hungup 'IAX2/ast551-out-backup-7'
  == Everyone is busy/congested at this time (1:0/1/0)

Doing an "iax2 show peers" shows ast551-out-backup to be offline:

ast33*CLI> iax2 show peers
Name/UsernameHost Mask Port   
Status
astnh-out/ast55  Z.Z.Z.Z   (S)  255.255.255.255  4569   
Unmonitored
ast551-out-back  Y.Y.Y.Y   (S)  255.255.255.255  4569   
UNREACHABLE
ast551-out/ast5  X.X.X.X   (S)  255.255.255.255  4569  OK (25  
ms)

3 iax2 peers [1 online, 1 offline, 1 unmonitored]


Have I bumbled a configuration, or is my method incorrect? Or is  
there a bug?  Should ChanIsAvail report that ast551-out-backup is  
unavailable if it fails to qualify?


Thanks,
Noah

___
--Bandwidth and Colocation sponsored by Easynews.com --

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


[Asterisk-Users] chanisavail...not workin with SIP and IAX

2005-06-19 Thread Dan Fernandez



all
 
I cannot get ChanIsAvail to work with sip or iax on 
v1.0.3. It does work fine on a zap channel. I am trying with Sipuras and 
PAP2s.
It appears I am not the only one having this 
problem. Has anyone gotten it to work?
 
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[Asterisk-Users] ChanIsAvail and SIP

2005-05-21 Thread Matt Schulte
All, I was reading over the chanisavail command in the wiki and was
wondering a couple things. 

First and foremost, what does this command do to determine if SIP is
available? All I could tell from a debug is that it simply checks to see
if the peer's port is open and doesn't run any callflows. Is this true?

Second, I understand that running Cut on SIP may be a little difficult.
Because the final destination becomes
SIP/peer- ..  = random characters, because they can be letters
and numbers applying a range in Cut wouldn't be possible. Any
suggestions on how to get by this? Is there any other var manipulation
command?
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[Asterisk-Users] ChanIsAvail for MGCP

2005-05-07 Thread Daniel Nyström
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
ChanIsAvail does not work with MGCP channels, as said in the wiki.
But other applications works simular, like Queue and Dial.
What's really the problem with ChanIsAvail?
Is it possible to use Queue and Dial to make a working ChanIsAvail?
I will take a better look in the source when back at work on monday,
but some tips and facts will help for sure.
- --
Daniel
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCfIIJ/4dZjWjLCy0RAgHpAJ9Vs6qWuzioOwvi8M/iFVLwC18Z1QCfdziU
G9bU7CzzFFiSP6Qz5LjcUCI=
=ZgJH
-END PGP SIGNATURE-
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Chanisavail and IAX2

2005-03-23 Thread Wojciech Tryc
Yes, there is more, but I don't remember of hand. I end up "downgradin" to 
the 1.0.7
W
- Original Message - 
From: "Anton Krall" <[EMAIL PROTECTED]>
To: "'Asterisk Users Mailing List - Non-Commercial Discussion'" 

Sent: Wednesday, March 23, 2005 12:29 PM
Subject: RE: [Asterisk-Users] Chanisavail and IAX2

Damn! First I see something doesn't work with cvs-head but does in stable :)
Any timeframe on when it will work again on cvs-head? Any other stuff like
this one that doesn't work on head?
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Wojciech Tryc
Sent: Miércoles, 23 de Marzo de 2005 11:16 a.m.
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [Asterisk-Users] Chanisavail and IAX2
it doesn't work with current CVS, it works with 1.0.7
- Original Message -
From: "Anton Krall" <[EMAIL PROTECTED]>
To: "'Asterisk Users Mailing List - Non-Commercial Discussion'"

Sent: Wednesday, March 23, 2005 9:59 AM
Subject: [Asterisk-Users] Chanisavail and IAX2

Guys.
Anybody doing ChanisAvail on IAX2 channels?
Im trying to do this:
exten => s,7,ChanIsAvail(IAX2/anton:[EMAIL PROTECTED])
But I get that the chan is unavailable eventhough I can make calls to that
channel. Is there any chatch?
The channels is defined as peer and Ialso tried doing a register on
iax.conf
for that channel. Everything is registering ok and I CAN make the call.
Any tips?
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] Chanisavail and IAX2

2005-03-23 Thread Anton Krall
Damn! First I see something doesn’t work with cvs-head but does in stable :)

Any timeframe on when it will work again on cvs-head? Any other stuff like
this one that doesn’t work on head? 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Wojciech Tryc
Sent: Miércoles, 23 de Marzo de 2005 11:16 a.m.
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [Asterisk-Users] Chanisavail and IAX2

it doesn't work with current CVS, it works with 1.0.7
- Original Message -
From: "Anton Krall" <[EMAIL PROTECTED]>
To: "'Asterisk Users Mailing List - Non-Commercial Discussion'" 

Sent: Wednesday, March 23, 2005 9:59 AM
Subject: [Asterisk-Users] Chanisavail and IAX2


> Guys.
>
> Anybody doing ChanisAvail on IAX2 channels?
>
> Im trying to do this:
> exten => s,7,ChanIsAvail(IAX2/anton:[EMAIL PROTECTED])
>
> But I get that the chan is unavailable eventhough I can make calls to that
> channel. Is there any chatch?
> The channels is defined as peer and Ialso tried doing a register on 
> iax.conf
> for that channel. Everything is registering ok and I CAN make the call.
>
> Any tips?
>
> ___
> Asterisk-Users mailing list
> Asterisk-Users@lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
> 

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


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


Re: [Asterisk-Users] Chanisavail and IAX2

2005-03-23 Thread Wojciech Tryc
it doesn't work with current CVS, it works with 1.0.7
- Original Message - 
From: "Anton Krall" <[EMAIL PROTECTED]>
To: "'Asterisk Users Mailing List - Non-Commercial Discussion'" 

Sent: Wednesday, March 23, 2005 9:59 AM
Subject: [Asterisk-Users] Chanisavail and IAX2


Guys.
Anybody doing ChanisAvail on IAX2 channels?
Im trying to do this:
exten => s,7,ChanIsAvail(IAX2/anton:[EMAIL PROTECTED])
But I get that the chan is unavailable eventhough I can make calls to that
channel. Is there any chatch?
The channels is defined as peer and Ialso tried doing a register on 
iax.conf
for that channel. Everything is registering ok and I CAN make the call.

Any tips?
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] Chanisavail and IAX2

2005-03-23 Thread Anton Krall
This is really weird.. Ive tried all combination for doing
ChanisAvail(IAX2/) with no luck.. * still thinks the channels is not
available eventhough I can dialout using it.

Any pointers? Anybody using this config? 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Anton Krall
Sent: Miércoles, 23 de Marzo de 2005 09:46 a.m.
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Subject: RE: [Asterisk-Users] Chanisavail and IAX2

Yep, I use qualify also with 1000 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Andrew
Kohlsmith
Sent: Miércoles, 23 de Marzo de 2005 09:15 a.m.
To: asterisk-users@lists.digium.com
Subject: Re: [Asterisk-Users] Chanisavail and IAX2

On March 23, 2005 09:59 am, Anton Krall wrote:
> But I get that the chan is unavailable eventhough I can make calls to 
> that channel. Is there any chatch?
> The channels is defined as peer and Ialso tried doing a register on 
> iax.conf for that channel. Everything is registering ok and I CAN make 
> the call.

Just a guess -- is there a "qualify" statement for that peer in iax.conf?  I
typically set my qualify to 500 or 1000ms  (acceptable lag between me and
them, it does NOT determine how often to "ping" them)

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


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


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


RE: [Asterisk-Users] Chanisavail and IAX2

2005-03-23 Thread Anton Krall
Yep, I use qualify also with 1000 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Andrew
Kohlsmith
Sent: Miércoles, 23 de Marzo de 2005 09:15 a.m.
To: asterisk-users@lists.digium.com
Subject: Re: [Asterisk-Users] Chanisavail and IAX2

On March 23, 2005 09:59 am, Anton Krall wrote:
> But I get that the chan is unavailable eventhough I can make calls to 
> that channel. Is there any chatch?
> The channels is defined as peer and Ialso tried doing a register on 
> iax.conf for that channel. Everything is registering ok and I CAN make 
> the call.

Just a guess -- is there a "qualify" statement for that peer in iax.conf?  I
typically set my qualify to 500 or 1000ms  (acceptable lag between me and
them, it does NOT determine how often to "ping" them)

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


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


Re: [Asterisk-Users] Chanisavail and IAX2

2005-03-23 Thread Andrew Kohlsmith
On March 23, 2005 09:59 am, Anton Krall wrote:
> But I get that the chan is unavailable eventhough I can make calls to that
> channel. Is there any chatch?
> The channels is defined as peer and Ialso tried doing a register on
> iax.conf for that channel. Everything is registering ok and I CAN make the
> call.

Just a guess -- is there a "qualify" statement for that peer in iax.conf?  I 
typically set my qualify to 500 or 1000ms  (acceptable lag between me and 
them, it does NOT determine how often to "ping" them)

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


[Asterisk-Users] Chanisavail and IAX2

2005-03-23 Thread Anton Krall
Guys.

Anybody doing ChanisAvail on IAX2 channels?

Im trying to do this:
exten => s,7,ChanIsAvail(IAX2/anton:[EMAIL PROTECTED])

But I get that the chan is unavailable eventhough I can make calls to that
channel. Is there any chatch? 
The channels is defined as peer and Ialso tried doing a register on iax.conf
for that channel. Everything is registering ok and I CAN make the call.

Any tips?

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


[Asterisk-Users] ChanIsAvail for IAX2 broken in CVS current?

2005-03-19 Thread Wojciech Tryc
Hi,
I am still looking for confirmation that ChanISAvail in CVS current doesn't 
work properly anymore.
My config hasn't changed (it worked for months)...
Right now, every time ChanIsAvail jumps to n+101 regardless if tested 
channel is available or not.
Is it broken? Maybe the syntax has changed?
BTW: it works like before in the 1.0.x.
Regards,
Wojtek 

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


[Asterisk-Users] ChanIsAvail not working anymore

2005-03-16 Thread Wojciech Tryc
Good Evening,
It seems that ChanIsAvail stopped working with the latest CVS, at least for 
IAX2 channels
My dial plan hasn't changed, but the ChanIsAvail always goes n+101, same 
dialplan works just fine with 1.0.7
Could anyone confirm that?
Regards,
Wojtek
snip...
exten => _XXX,1,Chanisavail(IAX2/pikatech)
exten => _XXX,2,Macro(enum-call-local,local,${EXTEN})
exten => _XXX,102,GoTo(local,${EXTEN},1)
...snip 

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


Re: [Asterisk-Users] ChanIsAvail not working

2005-01-28 Thread Philipp von Klitzing
Hi!

> I'm testing ChanIsAvail context and it is not working for me.
> 
> exten => 55,1,ChanIsAvail(SIP/11&SIP/21)
> exten => 55,2,Cut(theChannel=AVAILCHAN,,1)
> exten => 55,3,Dial(${theChannel},r)
> exten => 55,4,Hangup
> exten => 55,102,Goto(s,4)
> 
> According to notes:
> The channels are checked in the order listed, returning the first
> available channel in the list in ${AVAILCHAN}.
> 
> so when my SIP/21 is available, and it is, it should ring it but it is
> not.

This is a guess: "SIP/11" is not an appropriate channel name. Use "show 
channels" or "sip show channels" to see the difference.

Cheers, Philipp


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


[Asterisk-Users] ChanIsAvail not working

2005-01-27 Thread Joseph
I'm testing ChanIsAvail context and it is not working for me.

exten => 55,1,ChanIsAvail(SIP/11&SIP/21)
exten => 55,2,Cut(theChannel=AVAILCHAN,,1)
exten => 55,3,Dial(${theChannel},r)
exten => 55,4,Hangup
exten => 55,102,Goto(s,4)

It is not dialing SIP/21 when I'm talking on SIP/11, it execute
Hangup instruction instruction.

According to notes:
The channels are checked in the order listed, returning the first
available channel in the list in ${AVAILCHAN}.

so when my SIP/21 is available, and it is, it should ring it but it is
not.

-- 
#Joseph
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[Asterisk-Users] ChanIsAvail + Zap and SIP channels

2005-01-12 Thread Jan Jirasko
Hi,

if user is talking with Zap/1-1, ChanIsAvail(Zap/1) return Zap/1-2.
Is there function which returns 1 if user talking (and work with Zap and SIP 
channels) and returns 0 when channel is idle?

Thanks

Jan Jirasko

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


[Asterisk-Users] ChanIsAvail issue

2004-07-18 Thread Deepak Malhotra



Hello
 
I am trying to setup ChanIsAvail function in the 
extensions.conf file so that user should use the available channel to call out, 
but immediately after the function like, zap channel hangup. 
Here is the copy of my extensions.conf file and 
messages display on consol while making the call. 
 
Please help me to fingure out this 
issue.
 
Thanks
 
Deepak
 
Extension.conf :
 
exten => 
_9NXX,1,ChanIsAvail(${TRUNK})exten => 
_9NXX,2,NoOP,${AVAILCHAN}exten => 
_9NXX,3,Cut(TheChannel=AVAILCHAN,,1)exten => 
_9NXX,4,NoOP,${TheChannel}exten => 
_9NXX,5,Dial(${TheChannel}/${EXTEN:${TRUNKMSD}})exten => 
_9NXX,6,Hangup
Log File:
    -- Executing 
ChanIsAvail("SIP/201-57f5", "Zap/g1") in new stack    -- 
Hungup 'Zap/1-1'    -- Executing NoOp("SIP/201-57f5", 
"Zap/1-1") in new stack    -- Executing Cut("SIP/201-57f5", 
"TheChannel=AVAILCHAN||1") in new stack    -- Executing 
NoOp("SIP/201-57f5", "Zap/1") in new stack    -- Executing 
Dial("SIP/201-57f5", "Zap/1/2353070") in new stackJul 18 16:57:43 
NOTICE[1200825920]: app_dial.c:689 dial_exec: Unable to create channel of type 
'Zap'  == Everyone is busy/congested at this time    
-- Executing Hangup("SIP/201-57f5", "") in new stack  == Spawn 
extension (office, 92353070, 6) exited non-zero on 
'SIP/201-57f5'


Re: [Asterisk-Users] ChanIsAvail and SIP

2004-01-10 Thread Philipp von Klitzing
Hi!

> > Hello all.  Has anyone had any success using ChanIsAvail with only SIP 
> > channels?  Is there another, better way to check if an extension is busy 
> > without dialing it?
> 
> Well, SIP devices live their own life and should really handle this signalling
> themselves. That's why ChanIsAvail does not really work with SIP channels,
> Asterisk does not control what is happening out there in the wild.

With the Manager API you have lots of options - probably "ExtensionState" 
could be one way for you to get closer to a solution.

An easier solution might be to employ AGI and use "CHANNEL STATUS 
[]", provided this works with SIP and not only Zap (I just 
don't know). 

But first you'd need to find out about the channel name though since SIP 
channels have this random numbering: A "show channels" or "sip show 
inuse" at the CLI can provide that, and you can issue those commands also 
remotely from any script using "asterisk -rx " and parse the 
result.

You could also use "database show SIP/Registry" on the CLI to see who is 
registered and who is not before attempting to place a call.

I probably missed a million other ways (that could include your own 
little SIP protocol query sent to the desired destination, for example). 
Just keep in mind that the SIP client can be busy even though for 
Asterisk it is not.

Cheers, Philipp


___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] ChanIsAvail and SIP

2004-01-10 Thread Olle E. Johansson
B. J. Bomar wrote:

Hello all.  Has anyone had any success using ChanIsAvail with only SIP 
channels?  Is there another, better way to check if an extension is busy 
without dialing it?
Well, SIP devices live their own life and should really handle this signalling
themselves. That's why ChanIsAvail does not really work with SIP channels,
Asterisk does not control what is happening out there in the wild. The SIP
channel is really a compromise from a business PBX point of view, where you
want to know what is happening out there, which lines are occupied etc etc.
I think that you can use incominglimit and outgoinglimit to limit the number of
calls asterisk place to a SIP device and force busy if there's already a call
going on.
Remember that this limits the number of connections to/from Asterisk, not necessarily
the number of calls on the SIP device.
/O

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


[Asterisk-Users] ChanIsAvail and SIP

2004-01-09 Thread B. J. Bomar
Title: Message



Hello all.  Has 
anyone had any success using ChanIsAvail with only SIP channels?  Is there 
another, better way to check if an extension is busy without dialing 
it?
 
Thanks,
 
B. 
J.
 
 
 


Re: [Asterisk-Users] ChanIsAvail app setting ${AVAILCHAN} to an unusable value.

2003-10-07 Thread Tilghman Lesher
On Sunday 05 October 2003 17:43, Tilghman Lesher wrote:
> On Sunday 05 October 2003 16:41, Robert Hajime Lanning wrote:
> > I sent this earlier under "Editting variable contents" but no-one
> > has responded.  So, the subject is now more to the problem, instead
> > of the solution I was trying to implement.
> >
> > ChanIsAvail returns the channel ID plus "-".
> >
> > How can I edit ${AVAILCHAN} to remove this session ID, so I can use
> > its contents in a subsequent Dial statement?
>
> Oh, it's quite simple.  You just write your own application to remove
> the suffix.  Or you wait for someone else to write it.
>
> Untested code.  UAYOR.

Tested code.

-Tilghman
/*
 * Asterisk -- A telephony toolkit for Linux.
 *
 * Cut application
 * 
 * Copyright (c) 2003 Tilghman Lesher.  All rights reserved.
 *
 * Tilghman Lesher <[EMAIL PROTECTED]>
 *
 * This code is released by the author with no restrictions on usage.
 *
 */

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 


static char *tdesc = "Cuts up variables";

static char *app_cut = "Cut";

static char *cut_synopsis = "Cut(newvar=varname|delimiter|field)";

static char *cut_descrip =
"Cut(varname=wholestring,delimiter,field)\n"
"  newvar- result string is set to this variable\n"
"  varname   - variable you want cut\n"
"  delimiter - defaults to -\n"
"  field - number of the field you want (1-based offset)\n"
"  Returns 0 or -1 on hangup or error.\n";

STANDARD_LOCAL_USER;

LOCAL_USER_DECL;

static int cut_exec(struct ast_channel *chan, void *data)
{
	int res=0;
	struct localuser *u;
	char *s, *newvar, *varname, *delimiter, *field;
	int fieldnum, args_okay = 0;

	LOCAL_USER_ADD(u);

	/* Check and parse arguments */
	if (data) {
		s = strdupa((char *)data);
		if (s) {
			newvar = strsep(&s, "=");
			if (newvar && (newvar[0] != '\0')) {
varname = strsep(&s, "|");
if (varname && (varname[0] != '\0')) {
	delimiter = strsep(&s, "|");
	if (delimiter) {
		field = strsep(&s, "|");
		if (field && (sscanf(field,"%d",&fieldnum) == 1)) {
			args_okay = 1;
		}
	}
}
			}
		} else {
			ast_log(LOG_ERROR, "Out of memory\n");
			res = -1;
		}
	}

	if (args_okay) {
		char d;
		char *tmp = alloca(strlen(varname) + 4);
		char *tmp2 = alloca(1024);

		if (tmp && tmp2) {
			snprintf(tmp, strlen(varname) + 4, "${%s}", varname);
			memset(tmp2, 0, sizeof(tmp2));
		} else {
			ast_log(LOG_ERROR, "Out of memory");
			return -1;
		}

		if (delimiter[0])
			d = delimiter[0];
		else
			d = '-';

		pbx_substitute_variables_helper(chan, tmp, tmp2, 1024 - 1);

		if (tmp2) {
			int i;
			for (i=1;i NULL, but we don't care anymore) */
			char *value = strsep(&tmp2, &d);
			pbx_builtin_setvar_helper(chan, newvar, value);
		} else {
			pbx_builtin_setvar_helper(chan, newvar, NULL);
		}
	} else {
		ast_log(LOG_ERROR, "Usage: %s\n", cut_synopsis);
		res = -1;
	}

	LOCAL_USER_REMOVE(u);
	return res;
}

int unload_module(void)
{
	STANDARD_HANGUP_LOCALUSERS;
	return ast_unregister_application(app_cut);
}

int load_module(void)
{
	return ast_register_application(app_cut, cut_exec, cut_synopsis, cut_descrip);
}

char *description(void)
{
	return tdesc;
}

int usecount(void)
{
	int res;
	STANDARD_USECOUNT(res);
	return res;
}

char *key()
{
	return ASTERISK_GPL_KEY;
}


Re: [Asterisk-Users] ChanIsAvail app setting ${AVAILCHAN} to anunusable value.

2003-10-07 Thread Robert Hajime Lanning


>>On Sunday 05 October 2003 16:41, Robert Hajime Lanning wrote:
>>>  I sent this earlier under "Editting variable contents" but no-one
>>>  has responded.  So, the subject is now more to the problem, instead
>>>  of the solution I was trying to implement.
>>>
>>>  ChanIsAvail returns the channel ID plus "-".
>>>
>>>  How can I edit ${AVAILCHAN} to remove this session ID, so I can use
>>>  its contents in a subsequent Dial statement?
>>
>>Oh, it's quite simple.  You just write your own application to remove
>>the suffix.  Or you wait for someone else to write it.
>>
>>Untested code.  UAYOR.
>>
>>-Tilghman
>
> I don't recall if - is a fixe number of digits.  If so, you
> can use the string manipulation features within Asterisk to cut it
> off.  I don't have the manual reference right here with me, but note
> that you can put negative numbers for ${EXTEN:-1:-3} and the like,
> which will chop things up based on fixed positions within the string.
>
> JT

Not fixed length.  Well it maybe fixed per technology. (Zap vs. SIP...)

I ended up just writing an AGI script.
extensions.conf:
; Now we dial
exten => 8901,6,AGI(strip-sess,DIALCHANS)
exten => 8901,7,Macro(stdexten,8901,${DIALCHANS})

-
#! /usr/bin/perl

$|=1;

$variable = shift;

while ($line = ,$line =~ /[^ \n\r]/) { }

print STDOUT "GET VARIABLE $variable\n";
$response = ;
$response =~ /^\d+ +result=(\d+) +\((.*)\)\s*$/;
$response = $1;
$data = $2;

if ($response == 1) {
   $data = join("&",map {$_ =~ s/\-\w+$//;$_;} split(/&/,$data));
   print STDOUT "SET VARIABLE $variable \"$data\"\n";
   $response = ;
}

exit(0);
-

-- 
END OF LINE
___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] ChanIsAvail app setting ${AVAILCHAN} to an unusable value.

2003-10-06 Thread John Todd
On Sunday 05 October 2003 16:41, Robert Hajime Lanning wrote:
 I sent this earlier under "Editting variable contents" but no-one
 has responded.  So, the subject is now more to the problem, instead
 of the solution I was trying to implement.
 ChanIsAvail returns the channel ID plus "-".

 How can I edit ${AVAILCHAN} to remove this session ID, so I can use
 its contents in a subsequent Dial statement?
Oh, it's quite simple.  You just write your own application to remove
the suffix.  Or you wait for someone else to write it.
Untested code.  UAYOR.

-Tilghman

Attachment converted: PrivateSpace:app_cut.c (TEXT/ttxt) (69546196)
I don't recall if - is a fixe number of digits.  If so, you 
can use the string manipulation features within Asterisk to cut it 
off.  I don't have the manual reference right here with me, but note 
that you can put negative numbers for ${EXTEN:-1:-3} and the like, 
which will chop things up based on fixed positions within the string.

JT
___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] ChanIsAvail app setting ${AVAILCHAN} to an unusable value.

2003-10-05 Thread Tilghman Lesher
On Sunday 05 October 2003 16:41, Robert Hajime Lanning wrote:
> I sent this earlier under "Editting variable contents" but no-one
> has responded.  So, the subject is now more to the problem, instead
> of the solution I was trying to implement.
>
> ChanIsAvail returns the channel ID plus "-".
>
> How can I edit ${AVAILCHAN} to remove this session ID, so I can use
> its contents in a subsequent Dial statement?

Oh, it's quite simple.  You just write your own application to remove
the suffix.  Or you wait for someone else to write it.

Untested code.  UAYOR.

-Tilghman
/*
 * Asterisk -- A telephony toolkit for Linux.
 *
 * Cut application
 * 
 * Copyright (c) 2003 Tilghman Lesher.  All rights reserved.
 *
 * Tilghman Lesher <[EMAIL PROTECTED]>
 *
 * This code is released by the author with no restrictions on usage.
 *
 */

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 


static char *tdesc = "Cuts up variables";

static char *app_cut = "Cut";

static char *cut_synopsis = "Cut(newvar=varname|delimiter|field)";

static char *cut_descrip =
"Cut(varname=wholestring,delimiter,field)\n"
"  newvar- result string is set to this variable\n"
"  varname   - variable you want cut\n"
"  delimiter - defaults to -\n"
"  field - number of the field you want (1-based offset)\n"
"  Returns 0 or -1 on hangup or error.\n";

STANDARD_LOCAL_USER;

LOCAL_USER_DECL;

static int cut_exec(struct ast_channel *chan, void *data)
{
	int res=0;
	struct localuser *u;
	char *s, *newvar, *varname, *delimiter, *field;
	int fieldnum, args_okay = 0;

	LOCAL_USER_ADD(u);

	/* Check and parse arguments */
	if (data) {
		s = strdupa((char *)data);
		if (s) {
			newvar = strsep(&s, "=");
			if (newvar && (newvar[0] != '\0')) {
varname = strsep(&s, "|");
if (varname && (varname[0] != '\0')) {
	delimiter = strsep(&s, "|");
	if (delimiter) {
		field = strsep(&s, "|");
		if (field && (sscanf(field,"%d",&fieldnum) == 1)) {
			args_okay = 1;
		}
	}
}
			}
		} else {
			ast_log(LOG_ERROR, "Out of memory\n");
			res = -1;
		}
	}

	if (args_okay) {
		char d;
		char *tmp;

		if (delimiter[0])
			d = delimiter[0];
		else
			d = '-';

		tmp = pbx_builtin_getvar_helper(chan, varname);
		if (tmp) {
			tmp = strdupa(tmp);
			if (tmp) {
int i;
for (i=1;i NULL, but we don't care anymore) */
			char *value = strsep(&tmp, &d);
			pbx_builtin_setvar_helper(chan, newvar, value);
		}
	} else {
		ast_log(LOG_ERROR, "Usage: %s\n", cut_synopsis);
		res = -1;
	}

	LOCAL_USER_REMOVE(u);
	return res;
}

int unload_module(void)
{
	STANDARD_HANGUP_LOCALUSERS;
	return ast_unregister_application(app_cut);
}

int load_module(void)
{
	return ast_register_application(app_cut, cut_exec, cut_synopsis, cut_descrip);
}

char *description(void)
{
	return tdesc;
}

int usecount(void)
{
	int res;
	STANDARD_USECOUNT(res);
	return res;
}

char *key()
{
	return ASTERISK_GPL_KEY;
}


[Asterisk-Users] ChanIsAvail app setting ${AVAILCHAN} to an unusable value.

2003-10-05 Thread Robert Hajime Lanning
I sent this earlier under "Editting variable contents" but no-one
has responded.  So, the subject is now more to the problem, instead of
the solution I was trying to implement.

ChanIsAvail returns the channel ID plus "-".

How can I edit ${AVAILCHAN} to remove this session ID, so I can use its
contents in a subsequent Dial statement?

Dialing on Zap just gives a warning about unknown option "-", but
dialing a SIP channel completely errors out.

-- extensions.conf snippet-
;
; Main Home number (8901)
;
; Bedroom1
exten => 8901,1,Macro(twoline,Zap/1,Zap/2)
; Bedroom2
exten => 8901,2,Macro(twoline,Zap/3,Zap/4)
; Bedroom3
exten => 8901,3,Macro(twoline,Zap/5,Zap/6)
; Kitchen
exten => 8901,4,Macro(twoline,Zap/7,Zap/8)
; Familyroom
;exten => 8901,5,Macro(twoline,Zap/13,Zap/14)
exten => 8901,5,Macro(twoline,sip/set1,sip/set2)
; Now we dial
exten => 8901,6,Macro(stdexten,8901,${DIALCHANS})

[macro-twoline]
exten => s,1,SetVar(MACRO_OFFSET=0)
exten => s,2,ChanIsAvail(${ARG1}&${ARG2})
exten => s,3,GotoIf($["${DIALCHANS}" = ""]?s,6:s,4)
exten => s,4,SetVar(DIALCHANS=${DIALCHANS}&${AVAILCHAN})
exten => s,5,Goto(s,7)
exten => s,6,SetVar(DIALCHANS=${AVAILCHAN})
exten => s,7,Wait(0)

-- 
END OF LINE
___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users