<HTML>
<HEAD>
<TITLE>Re: [Freeswitch-users] CDR generated on maximum sessions reach</TITLE>
</HEAD>
<BODY>
<FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><B>From: </B>Michael Collins &lt;msc@freeswitch.org&gt;<BR>
<B>Reply-To: </B>&lt;freeswitch-users@lists.freeswitch.org&gt;<BR>
<B>Date: </B>Wed, 3 Dec 2008 11:41:04 -0800<BR>
<B>To: </B>&lt;freeswitch-users@lists.freeswitch.org&gt;<BR>
<B>Subject: </B>Re: [Freeswitch-users] CDR generated on maximum sessions reach<BR>
<BR>
<BR>
<BR>
On Wed, Dec 3, 2008 at 10:27 AM, Lachezar Valchev &lt;lachezar.valchev@gmail.com&gt; wrote:<BR>
</SPAN></FONT></FONT><BLOCKQUOTE><FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hello everybody,<BR>
<BR>
I am new to the list and I hope I can find some help here, regarding an issue I am experiencing with the CDRs written by Freeswitch.<BR>
<BR>
The thing is, I am using the &quot;max-sessions&quot; and the &quot;sessions-per-second&quot; parameters in switch.conf.xml to limit the maximum number of simultaneous calls, I want to go through my Freeswitch server.<BR>
<BR>
These options are working well, but I was expecting to have CDRs generated for the calls, that are dropped when the limit is reached.<BR>
Unfortunately there is no such one.<BR>
<BR>
My question is: Is there an option, which allows the generation of CDR, when a call is dropped, because the maximum sessions limit is reached?<BR>
</SPAN></FONT></FONT></BLOCKQUOTE><FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
This is not possible. A CDR cannot be generated without a session, and a session will not be generated if the max sessions limit has already been reached...<BR>
&nbsp;<BR>
</SPAN></FONT></FONT><BLOCKQUOTE><FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
<BR>
If there is no such option, is there any way to achieve it? Probably by using the the mod_limit module? Can you, please tell me how to do it?<BR>
</SPAN></FONT></FONT></BLOCKQUOTE><FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
mod_limit is most definitely your best option at this point. If you haven't read this yet please do:<BR>
<a href="http://wiki.freeswitch.org/wiki/Mod_limit">http://wiki.freeswitch.org/wiki/Mod_limit</a><BR>
<BR>
In the example on that page, you have a &quot;limit_exceeded&quot; extension which would show up in your CDR, or you can set a specific channel variable which will magically show up in an XML CDR. (You can modify CSV CDRs to have any custom channel variables as well. See <a href="http://wiki.freeswitch.org/wiki/Cdr">http://wiki.freeswitch.org/wiki/Cdr</a> which refers to the &lt;templates&gt; section of conf/autoload_configs/cdr_csv.conf.xml)<BR>
<BR>
Try adding the limit app in your dialplan and have the limit_exceeded extension as well. You could set the limit really low for the sake of testing before setting it to the value necessary for your production deployment.<BR>
<BR>
------SNIP-------<BR>
<BR>
Michael&#8217;s advise here is dead on... The whole point of the session limiter (and SPS limiters) is to keep the box from melting down... Say in the event of a DoS (or a telemarketer)... If you want to do a soft limit that&#8217;s just want mod_limit is for and will allow you to do 2 things when used in conjunction with the max_sessions and sps limits... 1) Soft Limit and still log the calls 2) still have a hard limit that keeps the box for falling over dead... <BR>
<BR>
You can do this with a simple step at the top of your dialplan that mod_limits everything together...<BR>
<BR>
K</SPAN></FONT></FONT>
</BODY>
</HTML>