<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2658.2">
<TITLE>RE: [Asterisk-Dev] Asterisk SIP Problem</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>I tried ulimit -n 10000 in the shell, before running asterisk, and now it works. Thank you :)</FONT>
</P>
<P><FONT SIZE=2>Pedro Goncalves</FONT>
</P>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: asterisk-dev-admin@lists.digium.com [<A HREF="mailto:asterisk-dev-admin@lists.digium.com">mailto:asterisk-dev-admin@lists.digium.com</A>] On Behalf Of Adam Hart</FONT>
<BR><FONT SIZE=2>Sent: quarta-feira, 9 de Junho de 2004 12:48</FONT>
<BR><FONT SIZE=2>To: asterisk-dev@lists.digium.com</FONT>
<BR><FONT SIZE=2>Subject: Re: [Asterisk-Dev] Asterisk SIP Problem</FONT>
</P>
<P><FONT SIZE=2>tried ulimit -n 10000 ? (in safe_asterisk)</FONT>
</P>
<P><FONT SIZE=2>Pedro Bessa Goncalves wrote:</FONT>
<BR><FONT SIZE=2>> Hi. I am having a problem with asterisk. When I have a big number of </FONT>
<BR><FONT SIZE=2>> simultaneous SIP clients (>70) connecting to asterisk, I start having </FONT>
<BR><FONT SIZE=2>> file limit (rlimit) problems and the clients can't connect:</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Jun 9 12:16:06 WARNING[5126]: Unexpected bind error: Invalid </FONT>
<BR><FONT SIZE=2>> argument</FONT>
<BR><FONT SIZE=2>> Jun 9 12:16:06 WARNING[5126]: Unable to create RTP session: </FONT>
<BR><FONT SIZE=2>> Invalid argument</FONT>
<BR><FONT SIZE=2>> Jun 9 12:16:06 WARNING[5126]: Unable to get IP of eth0: Bad </FONT>
<BR><FONT SIZE=2>> file descriptor</FONT>
<BR><FONT SIZE=2>> Jun 9 12:16:06 WARNING[17422]: Couldn't open file </FONT>
<BR><FONT SIZE=2>> /home/pbg/meteo/meteomain.alaw</FONT>
<BR><FONT SIZE=2>> Jun 9 12:16:06 WARNING[17422]: Unable to open </FONT>
<BR><FONT SIZE=2>> /home/pbg/meteo/meteomain (format ALAW): No such file or directory</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Jun 9 12:16:06 WARNING[17422]: ast_streamfile failed on </FONT>
<BR><FONT SIZE=2>> SIP/4000-ce60 for /home/pbg/meteo/meteomain</FONT>
<BR><FONT SIZE=2>> Jun 9 12:16:06 WARNING[5126]: Alert pipe creation failed!</FONT>
<BR><FONT SIZE=2>> Jun 9 12:16:06 WARNING[5126]: Unable to allocate channel structure</FONT>
<BR><FONT SIZE=2>> Jun 9 12:16:06 NOTICE[5126]: Unable to create/find channel</FONT>
<BR><FONT SIZE=2>> Jun 9 12:16:06 WARNING[5126]: Unable to allocate socket: Too </FONT>
<BR><FONT SIZE=2>> many open files</FONT>
<BR><FONT SIZE=2>> Jun 9 12:16:06 WARNING[5126]: Unable to allocate socket: Too </FONT>
<BR><FONT SIZE=2>> many open files</FONT>
<BR><FONT SIZE=2>> Jun 9 12:16:06 WARNING[5126]: Unable to allocate socket: Too </FONT>
<BR><FONT SIZE=2>> many open files</FONT>
<BR><FONT SIZE=2>> Jun 9 12:16:06 WARNING[5126]: Unable to allocate socket: Too </FONT>
<BR><FONT SIZE=2>> many open files</FONT>
<BR><FONT SIZE=2>> Jun 9 12:16:06 WARNING[5126]: Unable to create RTP session: Too </FONT>
<BR><FONT SIZE=2>> many open files</FONT>
<BR><FONT SIZE=2>> Jun 9 12:16:06 WARNING[5126]: Unable to allocate socket: Too </FONT>
<BR><FONT SIZE=2>> many open files</FONT>
<BR><FONT SIZE=2>> Jun 9 12:16:06 WARNING[5126]: Unable to allocate socket: Too </FONT>
<BR><FONT SIZE=2>> many open files</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> I have also tried applied the following code in asterisk.c but still had </FONT>
<BR><FONT SIZE=2>> no luck:</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> struct rlimit l;</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> memset(&l, 0, sizeof(l));</FONT>
<BR><FONT SIZE=2>> l.rlim_cur = RLIM_INFINITY;</FONT>
<BR><FONT SIZE=2>> l.rlim_max = RLIM_INFINITY;</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> if (setrlimit(RLIMIT_NOFILE, &l)) {</FONT>
<BR><FONT SIZE=2>> ast_log(LOG_WARNING, "Unable to change opened files </FONT>
<BR><FONT SIZE=2>> limit: %s\n", strerror(errno));</FONT>
<BR><FONT SIZE=2>> }</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Can anyone help me??</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Pedro Goncalves</FONT>
<BR><FONT SIZE=2>> www.ptinovacao.pt</FONT>
<BR><FONT SIZE=2>> </FONT>
</P>
<P><FONT SIZE=2>_______________________________________________</FONT>
<BR><FONT SIZE=2>Asterisk-Dev mailing list</FONT>
<BR><FONT SIZE=2>Asterisk-Dev@lists.digium.com</FONT>
<BR><FONT SIZE=2><A HREF="http://lists.digium.com/mailman/listinfo/asterisk-dev" TARGET="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</A></FONT>
<BR><FONT SIZE=2>To UNSUBSCRIBE or update options visit:</FONT>
<BR><FONT SIZE=2> <A HREF="http://lists.digium.com/mailman/listinfo/asterisk-dev" TARGET="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</A></FONT>
</P>
</BODY>
</HTML>