[asterisk-users] SIP RTP ports not released when channel is hung up

Klaus Darilion klaus.mailinglists at pernau.at
Mon Feb 15 09:17:23 CST 2010



Am 13.02.2010 09:26, schrieb Olle E. Johansson:
>
> 12 feb 2010 kl. 16.43 skrev Klaus Darilion:
>
>>
>>
>> Am 11.02.2010 21:09, schrieb Olle E. Johansson:
>>>
>>> 11 feb 2010 kl. 13.30 skrev Klaus Darilion:
>>>
>>>> Am 11.02.2010 11:21, schrieb Armin Schindler:
>>>>> Hello,
>>>>>
>>>>> using Asterisk 1.4.28, I encountered a problem with SIP
>>>>> RTP port allocation.
>>>>>
>>>>> I found some entries in mailinglist and bugtracker regarding
>>>>> this issue, but only old ones.
>>>>>
>>>>> My rtp.conf has
>>>>>    [general]
>>>>>    rtpstart=30000
>>>>>    rtpend=30100
>>>>>
>>>>> so 100 ports available. I know that up to 4 ports per channel can be used
>>>>> and so up to 25 channels are possible.
>>> 4 ports only if you use audio and video. We use two ports per RTP stream - and send on two ports, but this is for incoming media.
>>> So 100 ports is enough for 50 audio calls.
>>>
>>>>> But even earlier I often get the error about "No RTP ports remaining".
>>>>>
>>>>> I had a look at
>>>>>    netstat -nuap
>>>>> and it shows that a lot of ports are still assigned, even if there is no
>>>>> channel in use.
>>>>> But "sip show channels" show a lot of (unused) entries with no
>>>>> codec/Format and "Last Message" like INVITE, REGISTER, OPTIONS.
>>> REGISTER and OPTIONS allocate no RTP ports, so those are not a problem. If you have a SIP channel that has a last message being INVITE and still say you have no calls, you have a problem right there.
>>>>
>>>> If the channels exists even after 32 seconds after BYE, and BYE was
>>>> signaled correctly, I would file a bug report.
>>>
>>> Yes, the RTP ports should be closed at least at that point, when we destroy the SIP channel. Anything else is a bug. I am not really sure about when they're closed, but I'm trying to understand that in my RTCP adventures since I want to change it.
>>>
>>> While we are discussing this, I would like some feedback.
>>>
>>> If we receive RTCP bye from the other end, we can close the port at that point.
>>> When we hang up the call, we send RTCP BYE and a final RTCP report.
>>>
>>> If we don't receive the RTCP BYE or a final report - I would like to keep the RTCP port open a bit longer - but at maximum up to the destruction of the SIP channel - so I can have a chance of receiving a final RTCP report from the other end or/and RTCP BYE.
>>>
>>> What do you think?
>>
>> Will the channel only be kept alive in chan_sip or also in the core? Somehow we need a method to export the data received in the final reply, otherwise it makes no sense to wait.
>
> We have already come to the conclusion that there's no way to get this into the CDRs, so in my pinefrog branch I'm sending the data over the manager interface and storing it in a realtime storage facility - so it makes sense.

Then implement it! :-)

klaus



More information about the asterisk-users mailing list