<div dir="ltr">What exactly was the original issue that was trying to be resolved that required the session count?</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 26, 2016 at 10:03 AM, Marcel Haldemann <span dir="ltr"><<a href="mailto:marcel.haldemann@convercom.ch" target="_blank">marcel.haldemann@convercom.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">small correction for my previous answer:<br>
<br>
For "outbound" only channels the command would have to be like:<br>
<br>
Show channels count like external<br>
<br>
What would result in:<br>
<br>
api = freeswitch.API();<br>
filter = " like external"; -- set this as needed or let empty for no filter<br>
num_channels = api:executeString("show channels count" .. filter);<br>
<span class="">digits = api:execute("regex", num_channels .. "|/([0-9]*)/|$1");<br>
</span>freeswitch.consoleLog("info", "num channels is: " .. digits .. "\n");<br>
<br>
as already mentioned this would expect a profile for outbound calls "only", called external.<br>
More info about the filter see here:<br>
<a href="https://freeswitch.org/confluence/display/FREESWITCH/mod_commands" rel="noreferrer" target="_blank">https://freeswitch.org/confluence/display/FREESWITCH/mod_commands</a> and search for "show channels"<br>
This applys to FreeSwitch 1.6/1.7<br>
<br>
-----Ursprüngliche Nachricht-----<br>
Von: <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a>] Im Auftrag von Marcel Haldemann<br>
Gesendet: Dienstag, 26. Januar 2016 15:38<br>
<span class="im HOEnZb">An: FreeSWITCH Users Help <<a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a>><br>
Betreff: Re: [Freeswitch-users] DETECT ACTIVE CHANNELS<br>
<br>
</span><div class="HOEnZb"><div class="h5">For LUA it's (FS 1.6):<br>
api = freeswitch.API();<br>
num_channels = api:executeString("show channels count");<br>
digits = api:execute("regex", num_channels .. "|/([0-9]*)/|$1");<br>
freeswitch.consoleLog("info", "num channels is: " .. digits .. "\n")<br>
<br>
to get the number of active channels.<br>
<br>
<br>
in Dialplan it could be done like this:<br>
<br>
<action application="set" data="foo=${regex(${show channels count}|/([0-9]*)/|%1)}"/><br>
<action application="log" data="INFO foo: ${foo}" /><br>
<br>
<br>
PS: If you only want outbound calls you could try:<br>
<br>
Show channels like external<br>
<br>
as command, you then however must have a sip profile that is only for outbound (in this case named external).<br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">
<p><font face="courier new, monospace"><b><i><font size="4">Brian West</font></i></b><br><span style="font-size:x-small"><a href="mailto:brian@freeswitch.org" target="_blank">brian@freeswitch.org</a></span></font></p>
<p><font size="1" face="courier new, monospace"><img src="http://billing.freeswitch.org/templates/default/img/whmcslogo.png"><br></font></p><p><font size="2" face="monospace, monospace"><b><i>Twitter: @FreeSWITCH , @briankwest</i></b><br><a href="http://www.freeswitchbook.com" target="_blank">http://www.freeswitchbook.com</a><br><a href="http://www.freeswitchcookbook.com" target="_blank">http://www.freeswitchcookbook.com</a></font></p><p><font face="monospace, monospace">Got Bugs? Report them <a href="https://freeswitch.org/jira" target="_blank">here</a>! | Reddit: <a href="https://www.reddit.com/r/freeswitch" target="_blank">/r/freeswitch</a></font></p>
<p><font size="2" face="monospace, monospace"><b>T:</b>+19184209001 | <b>F:</b>+19184209002 | <b>M:</b>+1918424WEST (9378)<br><b>iNUM:</b>+883 5100 1420 9001 | <b>ISN:</b>410*543 | <b>Skype:</b>briankwest</font></p></div></div></div></div></div></div></div></div></div></div>
</div>