[Home]

Summary:ASTERISK-14972: Asterisk 1.6.1.6 not closing RTP ports after connection
Reporter:Alex Recarey (alexrecarey)Labels:
Date Opened:2009-10-11 18:53:50Date Closed:2011-06-07 14:00:27
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/Channels
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) core-channels.txt
( 1) core-threads.txt
Description:At the start of the day, asterisk is using a couple of ports and filehandles. After every call, the number of used file handles (lsof) increases, and the number of open ports (netstat -a) also increases. At the end of the day, with no calls in the system, after one full day of traffic, the system shows 13000 open files and 12500 open ports. When asterisk is restarted (not reloaded, it must be closed and reopened) all of the ports and file handles are closed. If this is not done every night the system will run out of ports and stop accepting calls.

****** ADDITIONAL INFORMATION ******

(This is the first time I post a bug and the Bug Guidelines link is broken, so please forgive me if I miss anything)

I am using Debian 5.0, updated. The server is a Dell PowerEdge 1950 with two dual core Xeon and 4Gb of RAM.

Any other questions I would be delighted to answer.

Regards,

Alex

Comments:By: Elazar Broad (ebroad) 2009-10-12 09:53:55

We are looking in to why the bug guidelines link is down, thanks for the heads up! In the meantime, out of curiosity, are you using sip timers?

By: Alex Recarey (alexrecarey) 2009-10-12 12:36:45

I am sorry, I don't understand what you mean by SIP timers.

I have the kernel timer set to 1000Mhz. My sip.conf is as follows:

[general]
context=default    
realm=asterisk
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes
disallow=all                
allow=g729
allow=gsm
mohinterpret=default
mohsuggest=default
language=es
callevents=no
matchexterniplocally = no
maxexpiry=7250      
defaultexpiry=1200            
amaflags=billing
trustrpid=yes
generaterpid=yes
sendrpid=yes
maxexpirey=7250
defaultexpirey=1200
notifymimetype=text/plain
rtptimeout=60
rtpholdtimeout=300
notifyringing=yes
localnet=130.117.110.0/25
rtcachefriends=yes
rtupdate=yes
allowexternaldomains=yes
progressinband=yes


My rtp.conf

[general]
rtpstart=5000
rtpend=64000


If you point me in the right direction I'll investigate the sip timers issue.



By: Elazar Broad (ebroad) 2009-10-12 13:24:14

Can you post the output of:

core show channels
core show threads

when this occurs. You will need to run these commands from the CLI(asterisk -r).

Additionally, do you have anything in your sip.conf under SIP Session Timers, specifically:

;session-timers=originate
;session-expires=600
;session-minse=90
;session-refresher=uas

if none of those options are set, can you please set 'session-timers' to refuse and reply with the results. Thanks!

By: Alex Recarey (alexrecarey) 2009-10-12 14:21:15

I have attached the output of core show channels and core show threads. This was taken at around 21:00h, close to peak hour.

None of the session options are set at the moment. Since the server is in production, I will set session-timers to "refuse" tonight and reply with the results.

Thank you!

By: Alex Recarey (alexrecarey) 2009-10-12 19:29:55

Preliminary testing (a couple of calls made by myself) with session-timers=refuse seems to indicate that ports and filehandles are closing as expected. I will subject the server to a full day of traffic and report back in 24 hours.

After reading up on session-timers it seems that my endpoints clearly do not support them, although I did not know that they would be required to tear down the session. Maybe it was because of the lack of the other settings in sip.conf? Is there anywhere I can read more about session timers? I like to learn from my mistakes.

Thanks for the help!



By: Elazar Broad (ebroad) 2009-10-12 20:30:58

Your welcome! There are actually several bugs filed regarding session timers and channel tear down, though if you are not using/supporting them, it is best to just disable them. I will keep the issue open until you report back.



By: Alex Recarey (alexrecarey) 2009-10-13 18:17:30

Yes, I can confirm that it was a configuration issue regarding sip-timers, sessions are now closing normally.

Perhaps session-expires should also have a default value?

I am pasting the error messages that asterisk threw up at the console just in case somebody with the same problem does a search on the bugtracker. If it's not appropriate please say so and I'll remove them.

Again, thank you for the prompt replies!

WARNING[15784]: channel.c:828 __ast_channel_alloc_ap: Channel allocation failed: Can't create alert pipe!
WARNING[15784]: chan_sip.c:5865 sip_new: Unable to allocate AST channel structure for SIP channel
WARNING[15784]: app_dial.c:1528 dial_exec_full: Unable to create channel of type 'SIP' (cause 0 - Unknown)
WARNING[15796]: res_agi.c:636 launch_script: unable to create fromast pipe: Too many open files
WARNING[3034]: rtp.c:2445 rtp_socket: Unable to allocate RTCP socket: Too many open files
WARNING[3034]: channel.c:828 __ast_channel_alloc_ap: Channel allocation failed: Can't create alert pipe!
WARNING[3034]: chan_sip.c:5865 sip_new: Unable to allocate AST channel structure for SIP channel
NOTICE[3034]: chan_sip.c:18817 handle_request_invite: Unable to create/find SIP channel for this INVITE
WARNING[3051]: pbx_spool.c:464 scan_thread: Unable to open directory /var/spool/asterisk/outgoing: Too many open files
ERROR[3034]: acl.c:472 ast_ouraddrfor: Cannot create socket

By: Elazar Broad (ebroad) 2009-10-13 19:48:54

Thanks for the response. I a going to close this issue as disabling session timers resolves your issue. With that said, I will ping the Asterisk developers and let them know we have another session timer issue.