Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom timeout for RTP Session #1303

Open
nganju98 opened this issue Jan 30, 2025 · 7 comments
Open

Custom timeout for RTP Session #1303

nganju98 opened this issue Jan 30, 2025 · 7 comments

Comments

@nganju98
Copy link
Contributor

I'm working with a VOIP provider that doesn't send any packets if there's silence on the other end, i.e. if the counterparty is not speaking. This causes RTCP/RTP session timeout if the caller doesn't speak for 30 seconds.

Can I change the timeout to like 5 mins? Happy to make a PR, I can see that the code in RTCPSession uses a constant (NO_ACTIVITY_TIMEOUT_MILLISECONDS), I could make it a mutable member variable.

Or is there a better solution? Have any of you encountered this type of VOIP behavior before?

@sipsorcery
Copy link
Member

Can't say I've heard of that behaviour before. Some NATs will delete a mapping after as little as 30s of inactivity so calls are likely to drop with that approach.

You're welcome to add a PR to add a confgurable timeout limit but please make sure the current behaviour remains as the default.

@nganju98
Copy link
Contributor Author

Awesome! Added a PR, please let me know if I can do anything better in the PR. Also thanks for this amazing library!

@nganju98
Copy link
Contributor Author

Thanks for the merge. Any chance you could make a point release out of it? So I can fetch it from nuget in my project? Thanks.

@nganju98
Copy link
Contributor Author

nganju98 commented Feb 3, 2025

Sorry just bumping this, is there any way we could get a point release? Like 8.0.8 just with my fix? Thanks!

@sipsorcery
Copy link
Member

There should be a release this week. I'm waiting for confirmation of another in-train fix.

@nick-zocdoc
Copy link

Thanks for the release! Just to close the loop here, it looks like the official RTP spec supports pausing transmission during silence:

Image

Spec is here: https://datatracker.ietf.org/doc/rfc5459/ . Do you detect this SID (silence insertion descriptor) frame? If you google it there's quite a few voip products mentioning that they use SID. Maybe if there's SID frames we should pause the timeout counter?

@sipsorcery
Copy link
Member

No, nothing like that is done by this library. The preferred approach is to send silence. If you really wanted to stop sending RTP the event handler could just be unhooked. Definitely not recommended it there's a NAT anywhere on the path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants