[Asterisk-Dev] PRI/Zap

Alexander Lopez alex.lopez at opsys.com
Wed May 4 07:38:11 MST 2005


No need to do this it is already done.  If you are dialing using groups
as in Zap/g1, look for the group options in zap channels on the wiki.
There is a difference b/w g and G, top to bottom and bottom to top and R
and r random.

The Wiki has been slow lately so I'll post relevant information...


From: http://www.voip-info.org/wiki-Asterisk+ZAP+channels

Dialing a Group 
In the Zap Channel Module's configuration file (zapata.conf), you can
define groups of Zap channels that get treated as a single channel as
far as the Dial command is concerned. You specify which of four methods
the Zap channel module is to use to select a non-busy channel from the
channel group by prefixing the group number with one of the letters g,
G, r, or R: 


g: select the lowest-numbered non-busy Zap channel (aka. ascending
sequential hunt group). 
G: select the highest-numbered non-busy Zap channel (aka. descending
sequential hunt group). 
r: use a round-robin search, starting at the next highest channel than
last time (aka. ascending rotary hunt group). 
R: use a round-robin search, starting at the next lowest channel than
last time (aka. descending rotary hunt group). 

The round-robin searches make the Zap channel module start looking for
an available channel from a different channel number each time. For each
channel group, the Zap channel module keeps track of the last
round-robin start point, and this time starts checking availability from
either the next (lowercase r)) or the previous uppercase R channel in
the group. Which channel it actually finds available (if any) does not
affect the starting point for the next round-robin search. Calls to the
Dial command using ordinary (g or G) group selections do not affect
future round-robin starting points either. 

For example, if you have defined channel group 2 as containing Zap
channels 1, 2, 5 and 8, and the last round-robin search for this group
(group 2) began searching from channel 5, this is the order of searching
that the Zap channel module will use for the four possible selection
methods: 


Dial(Zap/g2...): Looks in order 1, 2, 5, 8 
Dial(Zap/G2...): Looks in order 8, 5, 2, 1 
Dial(Zap/r2...): Looks in order 8, 1, 2, 5 
Dial(Zap/R2...): Looks in order 2, 1, 8, 5
-----Original Message-----
From: asterisk-dev-bounces at lists.digium.com
[mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of Tais M.
Hansen
Sent: Wednesday, May 04, 2005 10:14 AM
To: asterisk-dev at lists.digium.com
Cc: Peter Svensson
Subject: Re: [Asterisk-Dev] PRI/Zap

On Wednesday 04 May 2005 14:11, Peter Svensson wrote:
> > Also, my provider told me that we were always using "explicit" when
> > choosing channels, instead of "preferred", which they recommend. I
> > haven't looked into that yet, so I can only guess what it means. I
have a
> > feeling it's closely related.
> The problem is that Asterisk treats a PRI link like a lot of
independant
> channels which happen to share a signalling channel. Asterisk will
first
> select a B-channel for a call and then use that channel in the setup
> message.
>
> The net end is free to reject a specific B channel. Most telecom cpe
> equipment leave the B-channel selection to the net end, or is at least
> capable of retrying using a different channel. Unfortunatly this is
not
> possible to implement with the current zap channel implementation in
> Asterisk.

That's very bad news.

Do you (or someone else on this list) know where Asterisk chooses the
what 
B-channel to use? I'm thinking about hacking this to use random channels
or 
at least do round-robin instead of what seems like fifo. Then I could
make 
some dialanswer/cause check in the dialplan to retry the call. I believe
that 
would work.

-- 
Regards,
Tais M. Hansen
ComX Networks A/S
Tel: +45-70257474
Fax: +45-70257374



More information about the asterisk-dev mailing list