[asterisk-users] Best way to limit outgoing calls per trunk
Helius Ferreira
helius at adinet.com.uy
Mon May 31 21:29:23 CDT 2010
Using in you dialplan..
GROUP
GROUP_LIST
GROUP_MATCH_COUNT
to limit outgoing calls per trunk
CLI> show function GROUP_LIST
Returns a space separated list of all the groups set on a channel.
Helius
On Monday 31 May 2010 22:38:52 Vardan Harutyunyan wrote:
> A ok, I think I have understand what you want.
> The first, are you want that a2b calculate the buying price?
> If it for you not so important, the you can use failover trunk in a2b.
> Try this.
> If no, then you can you dialplan to explain what he must do on hangup
> cause.
>
> I use AEL. For example,
>
> Dial(SIP/${AGENTSPHONE});
> Noop(${DIALSTATUS});
> switch(${DIALSTATUS}) {
> case BUSY:
> Noop(================ Busy);
> Playback(${AGENT_ALLBUSY_MESSAGE});
> break;
> case CHANUNAVAIL:
> Noop(================ Channel Unavailable);
> Playback(${AGENT_UNAVAILABLE_MESSAGE});
> break;
> case NOANSWER:
> Noop(================ No answer);
> Playback(${AGENT_ALLBUSY_MESSAGE});
> break;
> case CANCEL:
> Noop(================ Cancel);
> Playback(${AGENT_ALLBUSY_MESSAGE});
> break;
> case CONGESTION:
> Noop(================ Congestion);
> Playback(${AGENT_UNAVAILABLE_MESSAGE});
> break;
> case ANSWER:
> Noop(================ Answer);
> break;
> default:
> Noop(================ Default);
> Playback(${AGENT_UNAVAILABLE_MESSAGE});
> break;
> };
>
> > Hi Vardan,
> >
> > I am using use_dnid=yes and then setting the Account Code in Asterisk
> > dialplan before sending the call to A2Billing _x. context which
> > automatically dials. So, before the call goes to A2Billing, I can check
> > to see if there is a channel up or not. I am not sure how the local
> > channel you mentioned works. Would appreciate it if you share.
> >
> > Can you determine the number of channels in the queue?
> >
> > One of my trunks allows for 3 calls certain time of the day and sometime
> > it allows for only 1 channel. Hence the need for this.
> >
> > Thanks,
> >
> >
> > On Mon, May 31, 2010 at 11:39 AM, Vardan Harutyunyan
> >
> > <hvardan71 at gmail.com <mailto:hvardan71 at gmail.com>> wrote:
> > No, if You use call-limit the call will be dropped.
> > How you put your customer on hold?
> > If you use queue and the customer hear the music onhold, he will be
> > billed for this connection
> > I have try use queue and a2b, and I have do all connection using
> > local channel, so I have become all is works, and the customer after
> > speaking with agents and transferred to international number, is
> > billed only for international call.
> >
> > Sorry for my english, if any question, please write. I will try to
> > explain.
> >
> >
> > Thanks
> >
> > --
> > Vardan Harutyunyan,
> > Senior System Administrator
> >
> > Enterprise Incubator Foundation
> > 123 Hovsep Emin Street,
> > Yerevan 0051, Republic of Armenia
> > Tel: + 374 10 219735
> > Fax: + 374 10 219777
> > E-mail: info at eif.am <mailto:info at eif.am>
> > www.eif-it.com <http://www.eif-it.com>
> >
> > bruce bruce wrote:
> > > Thanks for the advice, but I have to keep the customer on hold
> >
> > till the
> >
> > > line becomes available. Is that possible by the method you
> >
> > mentioned? I
> >
> > > am using A2B 1.7 and Asterisk 1.4.
> > >
> > > Thanks,
> > >
> > >
> > > On Mon, May 31, 2010 at 2:27 AM, Vardan Harutyunyan
> >
> > <hvardan71 at gmail.com <mailto:hvardan71 at gmail.com>
> >
> > > <mailto:hvardan71 at gmail.com <mailto:hvardan71 at gmail.com>>> wrote:
> > > Hello,
> > >
> > > What version of Asterisk You are use?
> > > And what version of A2Billing You are use?
> > > If You use version 1.4.X of Asterisk You can put call-limit
> >
> > string in
> >
> > > sip.conf for this trunk
> > >
> > > If You use A2B ver 1.7 and Asterk 1.4 you can announce this
> >
> > trunk using
> >
> > > sip config in A2B, and the are call-limit via web.
> > >
> > > And how I know, in 1.6 is no more call-limit in sip.conf
> > >
> > >
> > > --
> > > Vardan Harutyunyan,
> > > Senior System Administrator
> > >
> > > Enterprise Incubator Foundation
> > > 123 Hovsep Emin Street,
> > > Yerevan 0051, Republic of Armenia
> > > Tel: + 374 10 219735
> > > Fax: + 374 10 219777
> > > E-mail: info at eif.am <mailto:info at eif.am> <mailto:info at eif.am
> >
> > <mailto:info at eif.am>>
> >
> > > www.eif-it.com <http://www.eif-it.com> <http://www.eif-it.com>
> > >
> > > bruce bruce wrote:
> > > > Thanks for that. It very well detailed.
> > > >
> > > > I am not sure if I can use GROUP and GROUP_COUNT now that I see
> > > >
> > > how it's
> > > >
> > > > used. You see, the call is placed by A2Billing so I don't have a
> > > >
> > > control
> > > >
> > > > over setting GROUP increase and so if there is a call
> > > > GROUP_COUNT
> > > >
> > > won't
> > > >
> > > > work.
> > > >
> > > > I might resort back to using "sed" and "awk" to take output of
> >
> > "core
> >
> > > > show channels" and check for it's state. I will appreciate some
> > > >
> > > guru of
> > > >
> > > > "sed" to to give me a true false for a channel up or not using
> > >
> > > "sed" and
> > >
> > > > "core show channels"
> > > >
> > > > Thanks,
> > > > Bruce
> > > >
> > > > On Sun, May 30, 2010 at 1:47 PM, Jonathan Thurman
> > > > <jonathan at thurmantech.com <mailto:jonathan at thurmantech.com>
> >
> > <mailto:jonathan at thurmantech.com <mailto:jonathan at thurmantech.com>>
> >
> > > <mailto:jonathan at thurmantech.com
> >
> > <mailto:jonathan at thurmantech.com> <mailto:jonathan at thurmantech.com
> > <mailto:jonathan at thurmantech.com>>>>
> >
> > > wrote:
> > > > On Sun, May 30, 2010 at 9:37 AM, bruce bruce
> > >
> > > <bruceb444 at gmail.com <mailto:bruceb444 at gmail.com>
> >
> > <mailto:bruceb444 at gmail.com <mailto:bruceb444 at gmail.com>>
> >
> > > > <mailto:bruceb444 at gmail.com <mailto:bruceb444 at gmail.com>
> >
> > <mailto:bruceb444 at gmail.com <mailto:bruceb444 at gmail.com>>>> wrote:
> > > > > Thanks for the tip. I have been checking those two options.
> > > > > Would
> > > > >
> > > > you be
> > > > >
> > > > > able to provide an example of how GROUP or GROUP_COUNT may
> > > > > check
> > > > >
> > > > for a trunk
> > > > >
> > > > > usuage?
> > > > >
> > > > Here is how I do it. It is based on Asterisk 1.6.1.x, and I
> > >
> > > created a
> > >
> > > > generic sub-routine to call for limiting trunks to a
> > > > specific
> > >
> > > number
> > >
> > > > of calls. The code is documented, so it should give you a
> > >
> > > good idea
> > >
> > > > of how to use it.
> > > >
> > > > http://thurmantech.com/node/7
> > > >
> > > > -Jonathan
> > > > >
> > > > >From what I see is that you have to assing certain routes a
> > > > >group
> > > > >
> > > > > and then count the group, but how I do include a trunk in the
> > > > >
> > > group?
> > >
> > > > > Thanks
> > > > >
> > > > > On Sat, May 29, 2010 at 7:07 PM, Steve Edwards <asterisk.org
> >
> > <http://asterisk.org>
> >
> > > <http://asterisk.org>
> > >
> > > > <http://asterisk.org>@sedwards.com <http://sedwards.com>
> >
> > <http://sedwards.com>
> >
> > > <http://sedwards.com>>
> > >
> > > > > wrote:
> > > > >> On Sat, 29 May 2010, bruce bruce wrote:
> > > > >> > I am looking to use System() function along with some bash
> > > >
> > > > scripting to
> > > >
> > > > >> > determine if a Trunk is being used during certain time of
> > > > >> > the
> > > >
> > > > day or
> > > >
> > > > >> > not. Here is what I have in mind. Please guide me if you
> > > > >> > know
> > > >
> > > > a better
> > > >
> > > > >> > way:
> > > > >> Using the GROUP/GROUP_COUNT functions in the dialplan is a
> > > > >>
> > > > better way.
> > > > >>
> > > > >> Using system() will mean creating a bunch of processes (each
> > > > >> sed/awk/cut/etc command).
> > > > >>
> > > > >> --
> > > > >> Thanks in advance,
> >
> > ---------------------------------------------------------------------
> > ----
> >
> > > > >> Steve Edwards sedwards at sedwards.com
> >
> > <mailto:sedwards at sedwards.com> <mailto:sedwards at sedwards.com
> > <mailto:sedwards at sedwards.com>>
> >
> > > > <mailto:sedwards at sedwards.com <mailto:sedwards at sedwards.com>
> >
> > <mailto:sedwards at sedwards.com <mailto:sedwards at sedwards.com>>>
> >
> > > Voice: +1-760-468-3867 PST
> > > > >>
> > > > >> Newline Fax:
> > > > +1-760-731-3000
> > > > >>
> > > > >> --
> >
> > _____________________________________________________________________
> >
> > > > >> -- 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
> > > > >
> > > > > --
> >
> > _____________________________________________________________________
> >
> > > > > -- 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
> > > > >
> > > > --
> >
> > _____________________________________________________________________
> >
> > > > -- 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
> > > >
> > > --
> >
> > _____________________________________________________________________
> >
> > > -- 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
> >
> > --
> > _____________________________________________________________________
> > -- 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
More information about the asterisk-users
mailing list