[Asterisk-Users] HELP - How Do I Separate incoming channels
from the others on a PRI
Adam Goryachev
mailinglists at websitemanagers.com.au
Sun Sep 4 10:00:39 MST 2005
On Sun, 2005-09-04 at 07:39 -0500, Derrick Stensrud wrote:
Re-sending your message every 12 hours isn't "nice".... wait at least a
couple of days, and while you wait, try to read/test more things, so
that the second time around, you can actually demonstrate that you have
progressed somewhat....
> Okay, here is the background. I have a PRI with 15 active channels on
> it. I originally setup all of them in group=1 and all outgoing and
> incoming calls used this group. The phone number that I have associated
> with these channels ends with 750 and that is how I direct the calls.
> i.e. In my extensions.conf I have:
>
> exten => 750,1,Dial(SIP/120,20)
>
> All this works fine.
Great...
> Now I have the need to separate out three of the
> channels (13-15). I am using the associated phone number ending in 767
> for this purpose. I have currently changed the zapata.conf to look like
> this:
>
> group=1
> context=default
> channel=>1-12
> group=2
> context=fax
> channel=>13-15
>
> To my understanding this is supposed to separate channels 1-12 into
> group 1 and channels 13-15 into group 2. If that is true, that's fine,
> but it doesn't help me with my current issue. This is what I would
> like... When a call comes into the phone number ending in 750 it uses
> up the 12 channels in the first group, and when a call comes into the
> phone number ending in 767 it uses the 3 channels in group 2 AND USES NO
> MORE CHANNELS, only those three. The reason for all of this is that I
> have faxing through asterisk working and want those last three channels
> used for faxing but I do not want the fax lines eating up all my
> channels and leaving none for voice calls. My Company has evacuated from Hurricane Katrina and any help you can provide would be greatly appreciated. Thanks in advance.
The above will ensure that you never have more than 12 outgoing voice
calls, or 3 outbound fax calls, but it doesn't do anything at all for
your inbound calls...
What you want is some way to indicate to the dialplan that your outbound
calls are either voice or fax, and then do something like this:
exten => _X.,1,SetGroup(${CALLTYPE}) ; This is either VOICE or FAX
exten => _X.,2,gotoif(${CALLTYPE}=VOICE,10,20)
exten => _X.,10,CheckGroup(12) ; Make sure voice calls max 12
exten => _X.,11,Goto(30)
exten => _X.,20,CheckGroup(3) ; Make sure fax calls max 3
exten => _X.,21,Goto(30)
exten => _X.,30,Dial(Zap/g1/${EXTEN})
basically, you use the setgroup/checkgroup to ensure you aren't going
over the quota for voice/fax calls. Check the syntax/etc of all the
above functions, since I am sure a lot is wrong, but it should be more
than enough to give you the right idea.
Also, for your inbound calls:
exten => 750,1,SetGroup(VOICE)
exten => 750,2,CheckGroup(12)
exten => 750,3,Dial(SIP/120,20)
exten => 750,103,Congestion
exten => 750,104,Wait(10) ; Don't need this if you use OOB indication
exten => 750,105,Hangup
exten => 767,1,SetGroup(FAX)
exten => 767,2,CheckGroup(3)
exten => 767,3,Goto(faxes,s,1)
exten => 767,103,Congestion
exten => 767,104,Wait(10) ; Don't need this if you use OOB indication
exten => 767,105,Hangup
Hope that gets you on the right track.
Basically, the thing you got wrong is that on these sorts of lines,
there is no 'connection' between the channel and the phone number. The
call arrives on the signalling channel, and a voice channel is
dynamically/randomly assigned for the call if there is one available.
Regards,
Adam
More information about the asterisk-users
mailing list