[Freeswitch-users] DETECT ACTIVE CHANNELS
Shan Randhawa
randhawaay at gmail.com
Tue Jan 26 19:07:17 MSK 2016
It works.Thnaks Marcel for the support.I m very grateful to your help.
Regards,
Shan Randhawa
On Tue, Jan 26, 2016 at 7:34 PM, Marcel Haldemann <
marcel.haldemann at convercom.ch> wrote:
> For LUA it’s (FS 1.6):
>
> api = freeswitch.API();
>
> num_channels = api:executeString("show channels count");
>
> digits = api:execute("regex", num_channels .. "|/([0-9]*)/|$1");
>
> freeswitch.consoleLog("info", "num channels is: " .. digits .. "\n")
>
>
>
> to get the number of active channels.
>
>
>
>
>
> in Dialplan it could be done like this:
>
>
>
> <action application="set" data="foo=${regex(${show channels
> count}|/([0-9]*)/|%1)}"/>
>
> <action application="log" data="INFO foo: ${foo}" />
>
>
>
>
>
> PS: If you only want outbound calls you could try:
>
>
>
> Show channels like external
>
>
>
> as command, you then however must have a sip profile that is only for
> outbound (in this case named external).
>
>
>
>
>
> *Von:* freeswitch-users-bounces at lists.freeswitch.org [mailto:
> freeswitch-users-bounces at lists.freeswitch.org] *Im Auftrag von *Shan
> Randhawa
> *Gesendet:* Montag, 25. Januar 2016 20:58
> *An:* FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
> *Betreff:* Re: [Freeswitch-users] DETECT ACTIVE CHANNELS
>
>
>
> Hi,
>
>
>
> i need some help.
>
> Basically i need a way to get info about active no of active outbound
> sessions in lua .
>
>
>
>
> Thanks.
>
>
>
>
>
> Regards,
>
> Shan randhawa
>
>
>
>
>
> On Mon, Jan 25, 2016 at 10:03 PM, Shan Randhawa <randhawaay at gmail.com>
> wrote:
>
>
> Hi,
>
>
>
> i need some help.
>
> Is there a way in scripting like in lua like using freeswitch.API()
> through which i can get active channels .
>
>
>
> I can get active channels in fs cli by running command "active
> channels".But how to do it in scripts.
>
>
>
> Thanks.
>
>
>
>
>
> Regards,
>
> Shan randhawa
>
>
>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20160126/79ab7a50/attachment.html
Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users
mailing list