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

SRF never gets cancel event if call is cancelled before being handled by SRF #113

Open
jonastelzio opened this issue Oct 5, 2021 · 4 comments

Comments

@jonastelzio
Copy link
Contributor

Greetings Dave! Hope you're well!

I'm having some fun with extremely early cancels of calls, and I've got two observations. It's worth noting that I'm using outbound mode, which is perhaps related to the first, the first being:

  1. It seems like it's possible for a call to cancel before drachtio server has set up it's outbound tcp connection to SRF, in which case the cancel event is never received by SRF, and when then using createB2BUA, the outbound leg becomes a 'ghost call'. I simply have no way to detect that the incoming invite has been cancelled.

  2. This one is a little more tricky, but there seems to be an extremely narrow race condition inside createB2BUA where a call can cancel before createB2BUA has subscribed to req.on('cancel'), causing the cancellation to never abort the outgoing UAC leg.

Testing this seems to be very sensitive to network latency, so it's very finnicky to test it. But looking at the code inside createB2BUA, it definitely looks like (2) could be possible. As for 1, it's speculation on my behalf, but it from the behavior and my logging, it seems like the 'cancel' event is never fired if the cancel is extreeeeemely early.

@davehorton
Copy link
Collaborator

Hi there! These definitely seem like possible race conditions. I had not considered (1) before, and (2) sounds like an oversight on my part. Will look into them and update here..

@jonastelzio
Copy link
Contributor Author

Awesome! let me know if you need anything from me.

@jonastelzio
Copy link
Contributor Author

Hi @davehorton, have you had a chance to look into this by chance?

@dualtone-tony
Copy link
Contributor

Was there ever any progress on this? We're now suffering with the same issue whereby the cancel comes in before being able to subscribe to cancel in the srf app, and therefore carrying on assuming things are good to go

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

No branches or pull requests

3 participants