bruce bruce
2010-May-29 21:02 UTC
[asterisk-users] Best way to limit outgoing calls per trunk
Hi Guys, 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: exten => s,1,answer exten => s,n,System(/tmp/check.sh) check.sh: check EPOCH time => do an IF for certain times => Allow mutiple calls in certain times and only single call at certain times return back to Asterisk context and report if Trunk would allow more channels or not... Something along those lines. Should this be a solid thing to do? I am looking to use GotoIF and `asterisk -rx "sip show channels"` to grab results or `asterisk -rx "core show channels"` Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100529/2f406ee3/attachment.htm
Zeeshan Zakaria
2010-May-29 21:28 UTC
[asterisk-users] Best way to limit outgoing calls per trunk
Should be solid. After all munin also works on the same lines and it works solid. Zeeshan A Zakaria -- Sent from my Android phone with K-9 Mail. On 2010-05-29 5:12 PM, "bruce bruce" <bruceb444 at gmail.com> wrote: Hi Guys, 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: exten => s,1,answer exten => s,n,System(/tmp/check.sh) check.sh: check EPOCH time => do an IF for certain times => Allow mutiple calls in certain times and only single call at certain times return back to Asterisk context and report if Trunk would allow more channels or not... Something along those lines. Should this be a solid thing to do? I am looking to use GotoIF and `asterisk -rx "sip show channels"` to grab results or `asterisk -rx "core show channels"` Thanks -- _____________________________________________________________________ -- 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100529/aa951ce0/attachment.htm
Jonathan Thurman
2010-May-29 21:35 UTC
[asterisk-users] Best way to limit outgoing calls per trunk
On Sat, May 29, 2010 at 2:02 PM, bruce bruce <bruceb444 at gmail.com> wrote:> Hi Guys, > 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:I don't know what version you are running, but check out GotoIfTime. I use it frequently for office hours. GROUP, and GROUP_COUNT can help with limiting on a trunk too> exten => s,1,answer > exten => s,n,System(/tmp/check.sh)exten => _X.,n,GotoIfTime(7:30-16:30,mon-fri,*,*?multicall) ; Within this time, go to the label 'multicall' <code to limit to one call> exten => _X.,n(multicall),Verbose(3,We can call more than once) <code to call multiple times) http://www.voip-info.org/wiki/view/Asterisk+cmd+GotoIfTime http://www.voip-info.org/wiki/view/Asterisk+func+group> check.sh: > check EPOCH time => do an IF for certain times => Allow mutiple calls in > certain times and only single call at certain times > return back to Asterisk context and report if Trunk would allow more > channels or not... > Something along those lines. Should this be a solid thing to do? I am > looking to use GotoIF and `asterisk -rx "sip show channels"` to grab results > or `asterisk -rx "core show channels"` > Thanks > -- > _____________________________________________________________________ > -- 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 >
bruce bruce
2010-May-29 22:44 UTC
[asterisk-users] Best way to limit outgoing calls per trunk
Thanks for the input. Is there no Asterisk command in dialplan to return true or false or number of channels per trunk rather than going to bash script? And if I do the bash script how can I use "sed" and "awk" to search for the right words to see if trunk is in use or not. A bit detail would be really helpful. Thanks, Bruce On Sat, May 29, 2010 at 5:28 PM, Zeeshan Zakaria <zishanov at gmail.com> wrote:> Should be solid. After all munin also works on the same lines and it works > solid. > > Zeeshan A Zakaria > > -- > Sent from my Android phone with K-9 Mail. > > On 2010-05-29 5:12 PM, "bruce bruce" <bruceb444 at gmail.com> wrote: > > Hi Guys, > > 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: > > exten => s,1,answer > exten => s,n,System(/tmp/check.sh) > > check.sh: > check EPOCH time => do an IF for certain times => Allow mutiple calls in > certain times and only single call at certain times > return back to Asterisk context and report if Trunk would allow more > channels or not... > > Something along those lines. Should this be a solid thing to do? I am > looking to use GotoIF and `asterisk -rx "sip show channels"` to grab results > or `asterisk -rx "core show channels"` > > Thanks > > -- > _____________________________________________________________________ > -- 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 >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100529/ef2b4247/attachment.htm
Steve Edwards
2010-May-29 23:07 UTC
[asterisk-users] Best way to limit outgoing calls per trunk
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 Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000
bruce bruce
2010-May-30 16:37 UTC
[asterisk-users] Best way to limit outgoing calls per trunk
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? 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 at 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 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 >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100530/9c79d5b4/attachment.htm
Jonathan Thurman
2010-May-30 17:47 UTC
[asterisk-users] Best way to limit outgoing calls per trunk
On Sun, May 30, 2010 at 9:37 AM, bruce bruce <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 at 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 ? ? ?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 >
Reasonably Related Threads
- URGENT - How to exclude one ZAP channel for outgoin and incoming calls
- Error of FreePBX after installing from Yum Repository of Asterisk
- Conference Meetme
- GotoIfTime Function
- No SIP requests coming in with Allow Anonymous SIP set to OFF - If set to ON it all SIP DEBUG show the requests just fine - Where is the problem?