Re: [Freeswitch-users] DETECT ACTIVE CHANNELS
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@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] Im Auftrag von Shan Randhawa Gesendet: Montag, 25. Januar 2016 20:58 An: FreeSWITCH Users Help <freeswitch-users@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 [https://mailtrack.io/trace/mail/b549f1756837c458a4ac23786cf74b4359f1fd023264...] On Mon, Jan 25, 2016 at 10:03 PM, Shan Randhawa <randhawaay@gmail.com<mailto:randhawaay@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 [X]
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@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@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *Im Auftrag von *Shan Randhawa *Gesendet:* Montag, 25. Januar 2016 20:58 *An:* FreeSWITCH Users Help <freeswitch-users@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@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@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (2)
-
Marcel Haldemann
-
Shan Randhawa