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

call: Fix delayed (auto) answer if awaiting PRACK #2473

Merged
merged 1 commit into from
Mar 1, 2023

Conversation

maximilianfridrich
Copy link
Contributor

@maximilianfridrich maximilianfridrich commented Mar 1, 2023

On an incoming call, if autoanwer is configured and we have sent a 183 containing SDP, we have to await the PRACK before we are allowed to send a 200 OK (RFC 3262 section 3 - last paragraph).

With autoanswer configured, it could happen that we try to call call_answer while we are still awaiting a PRACK. This commit fixes this.

@maximilianfridrich
Copy link
Contributor Author

maximilianfridrich commented Mar 1, 2023

I hate to say it, but I was not able to reproduce the failing thread sanitizer check on my machine and neither by running the workflow in a docker container with act.

I am not as familiar with this new check, but the output seems to hint at fakevideo.c, not anything PRACK related.

@cspiel1 cspiel1 mentioned this pull request Mar 1, 2023
@maximilianfridrich
Copy link
Contributor Author

Ok, the data race is because the sdp_media->raddr is written in msg.c:media_decode() (e.g. when an INVITE is received) by the main thread and is read in the fakevideo thread when sending a video in video.c:encode_rtp_send()->packet_handler(). In this function, the mutex vtx->lock_tx is locked before reading the sdp_media->raddr, but the main thread doesn't know anything about this mutex.

Still, this doesn't have anything to do with this small fix for the autoanswer handling.

@sreimers
Copy link
Member

sreimers commented Mar 1, 2023

Should be fixed by: #2474

On an incoming call, if autoanwer is configured and we have sent a 183
containing SDP, we have to await the PRACK before we are allowed to send
a 200 OK (RFC 3262).
@maximilianfridrich
Copy link
Contributor Author

Thanks for the fix @sreimers. I rebased and it is working now.

@sreimers sreimers merged commit 7dd7eb8 into baresip:main Mar 1, 2023
@maximilianfridrich maximilianfridrich deleted the autoanswer_fix branch March 21, 2023 14:18
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

Successfully merging this pull request may close these issues.

2 participants