[Freeswitch-users] DETECT ACTIVE CHANNELS

Marcel Haldemann marcel.haldemann at convercom.ch
Tue Jan 26 14:03:35 MSK 2016


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: Marcel Haldemann
Gesendet: Dienstag, 26. Januar 2016 11:39
An: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
Betreff: AW: [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}" />

Von: freeswitch-users-bounces at lists.freeswitch.org<mailto: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<mailto: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

[https://mailtrack.io/trace/mail/b549f1756837c458a4ac23786cf74b4359f1fd02326470.png]

On Mon, Jan 25, 2016 at 10:03 PM, Shan Randhawa <randhawaay at gmail.com<mailto: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


[X]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20160126/3a499b40/attachment-0001.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list