[Freeswitch-users] DETECT ACTIVE CHANNELS

Marcel Haldemann marcel.haldemann at convercom.ch
Tue Jan 26 18:04:08 MSK 2016


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).



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