<!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>Asterisk SIP Problem</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Hi. I am having a problem with asterisk. When I have a big number of simultaneous SIP clients (>70) connecting to asterisk, I start having file limit (rlimit) problems and the clients can't connect:</FONT></P>
<P> <FONT SIZE=2>Jun 9 12:16:06 WARNING[5126]: Unexpected bind error: Invalid argument</FONT>
<BR> <FONT SIZE=2>Jun 9 12:16:06 WARNING[5126]: Unable to create RTP session: Invalid argument</FONT>
<BR> <FONT SIZE=2>Jun 9 12:16:06 WARNING[5126]: Unable to get IP of eth0: Bad file descriptor</FONT>
<BR> <FONT SIZE=2>Jun 9 12:16:06 WARNING[17422]: Couldn't open file /home/pbg/meteo/meteomain.alaw</FONT>
<BR> <FONT SIZE=2>Jun 9 12:16:06 WARNING[17422]: Unable to open /home/pbg/meteo/meteomain (format ALAW): No such file or directory</FONT></P>
<P> <FONT SIZE=2>Jun 9 12:16:06 WARNING[17422]: ast_streamfile failed on 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 many open files</FONT>
<BR> <FONT SIZE=2>Jun 9 12:16:06 WARNING[5126]: Unable to allocate socket: Too many open files</FONT>
<BR> <FONT SIZE=2>Jun 9 12:16:06 WARNING[5126]: Unable to allocate socket: Too many open files</FONT>
<BR> <FONT SIZE=2>Jun 9 12:16:06 WARNING[5126]: Unable to allocate socket: Too many open files</FONT>
<BR> <FONT SIZE=2>Jun 9 12:16:06 WARNING[5126]: Unable to create RTP session: Too many open files</FONT>
<BR> <FONT SIZE=2>Jun 9 12:16:06 WARNING[5126]: Unable to allocate socket: Too many open files</FONT>
<BR> <FONT SIZE=2>Jun 9 12:16:06 WARNING[5126]: Unable to allocate socket: Too many open files</FONT>
</P>
<P><FONT SIZE=2>I have also tried applied the following code in asterisk.c but still had no luck:</FONT>
</P>
<P> <FONT SIZE=2>struct rlimit l;</FONT>
</P>
<P> <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>
</P>
<P> <FONT SIZE=2>if (setrlimit(RLIMIT_NOFILE, &l)) {</FONT>
<BR> <FONT SIZE=2>ast_log(LOG_WARNING, "Unable to change opened files limit: %s\n", strerror(errno));</FONT>
<BR> <FONT SIZE=2>}</FONT>
</P>
<P><FONT SIZE=2>Can anyone help me??</FONT>
</P>
<P><FONT SIZE=2>Pedro Goncalves</FONT>
<BR><FONT SIZE=2>www.ptinovacao.pt</FONT>
</P>
</BODY>
</HTML>