[Asterisk-Users] ChanIsAvail()

Jose Solares jsolares.lists at gmail.com
Thu Dec 15 07:31:37 MST 2005


On 12/15/05, hgaillac-sip at yahoo.fr <hgaillac-sip at yahoo.fr> wrote:
>
> 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 => _0XXXX,1,Dial(Zap/g1/${EXTEN:1})
> exten => _0XXXX.,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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20051215/696f770d/attachment.htm


More information about the asterisk-users mailing list