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 rulesto forward requests to the dialpattern when channel is available.I try this however priority 2 fail.how can i forward requests to outgoing-pstncontext ?
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


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


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 willConsiderthechannelunavailableifthechannelisinuseatall.
http://www.voip-info.org/wiki/index.php?page=Asterisk+cmd+ChanIsAvail
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] Context Picker for interception and redirection

2005-12-14 Thread Jose Solares
You could also use macros, looks a bit cleaner perhaps.exten = _9NXXNX,1,Macro(local-outbound-test,${EXTEN:1})exten = _91NXXNX,1,Macro(cheapprovider-outbound,${EXTEN:1})exten = _8., 1, Macro( ioc, ${EXTEN:1})
[macro-local-outbound-test]exten = s,1,Dial(${LOCALIAXOUT}/${ARG1},,r)exten = s,2,Playback(last-error-was)exten = s,3,SayDigits(${CAUSECODE})exten = s,4,Playback(tt-somethingwrong)
exten = s,5,Hangupexten = s,102,NoOp(seq 102 check)[macro-cheapprovider-outbound]...[macro-ioc]...On 12/14/05, Jason Lixfeld
 [EMAIL PROTECTED] wrote:
Got it working.. wow..didn't think it would be this easy:[test]; Test SIP user's contextinclude = contextpicker[contextpicker]exten = _9NXXNXX,1,Set(LOCALEXT=${EXTEN:1})exten = _9NXXNXX,2,GoTo(local-outbound-test,localout,1)
exten = _9NXXNXX,102,NoOp(seq 102 check)exten = _91NXXNXX,1,Set(LDEXT=${EXTEN:1})exten = _91NXXNXX,2,GoTo(cheapldprovider-outbound-test,ldout,1)exten = _91NXXNXX,102,NoOp(seq 102 check)
exten = _8.,1,Set(INOCEXT={$EXTEN:1})exten = _8.,2,GoTo(inoc-dba,s,1)exten = _8.,102,NoOp(seq 102 check)[local-outbound-test]exten = localout,1,Dial(${LOCALIAXOUT}/${LOCALEXT},,r)
exten = localout,2,Playback(last-error-was)exten = localout,3,SayDigits(${CAUSECODE})exten = localout,4,Playback(tt-somethingwrong)exten = localout,5,Hangupexten = localout,102,NoOp(seq 102 check)
[cheapldprovider-outbound-test]exten = ldout,1,Dial(${LDIAXOUT}/${LDEXT},,r)exten = ldout,2,Playback(last-error-was)exten = ldout,3,SayDigits(${CAUSECODE})exten = ldout,4,Playback(tt-somethingwrong)
exten = ldout,5,Hangupexten = ldout,102,NoOp(seq 102 check)On 14-Dec-05, at 5:56 PM, Jason Lixfeld wrote: Going try my best to explain this and hopefully it will make sense:
 We're trying to come up with something that we can only refer to as a context picker.The idea is that if someone dials 98625551212, the context picker will direct the call to the proper context
 based on the dialing prefix, in this case 9.The context picker would then re-write the extension and then Goto the proper context based on the prefix.The context would need to miraculously read a
 variable set by the context picker to match the dialed number pattern and execute the proper Dial.The thing I can't seem to figure out is how to get the context to read this variable set by the context picker as a dialstring.For example (not syntactically
 correct, I know): [contextpicker] exten = _9NXXNXX,1,SetVar(L-EXT=${EXTEN:1}) exten = _9NXXNXX,2,GoTo(localoutbound,${L-EXT}) exten = _91NXXNXX,1,SetVar(LD-EXT=${EXTEN:1})
 exten = _91NXXNXX,2,GoTo(ldoutbound,${LD-EXT}) exten = _8.,1,SetVar(INOC-EXT=${EXTEN:1}) exten = _8.,2,GoTo(inoc-dba,${INOC-EXT}) [localoutbound] exten = ${L-EXT},1,Dial(SIP/localdump)
 [ldoutbound] exten = ${L-EXT},1,Dial(SIP/lddump) [inoc-dba] exten = ${INOC-EXT},1,Dial(SIP/inocdump) Does this make sense?Is there a better way to achieve this?
 ___ --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 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