<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 <msc@freeswitch.org><BR>
<B>Reply-To: </B><freeswitch-users@lists.freeswitch.org><BR>
<B>Date: </B>Wed, 3 Dec 2008 11:41:04 -0800<BR>
<B>To: </B><freeswitch-users@lists.freeswitch.org><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 <lachezar.valchev@gmail.com> 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 "max-sessions" and the "sessions-per-second" 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>
<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 "limit_exceeded" 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 <templates> 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’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’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>