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

SIP plugin: Save codec name on update request #2417

Merged
merged 1 commit into from
Nov 3, 2020
Merged

SIP plugin: Save codec name on update request #2417

merged 1 commit into from
Nov 3, 2020

Conversation

ihusejnovic
Copy link
Contributor

Hi,

I noticed that recording is not working for stream added with "update" request because codec name was missing.
Here is the fix.

@lminiero
Copy link
Member

lminiero commented Nov 3, 2020

I'm not sure that's a proper fix. The audio and video payload types are updated when we get the remote SDP (see lines 5798 and 5800, which seem not to be constrained by update). As such, it looks like you're simply starting the recording too soon, before the other party accepts the new stream? (which might be rejected).

@lminiero
Copy link
Member

lminiero commented Nov 3, 2020

Unless of course the browser is the one answering here, and so the payload types we took note of when processing the remote offer are not the same as the ones the browser answering eventually chose. Is this your case?

@ihusejnovic
Copy link
Contributor Author

Unless of course the browser is the one answering here, and so the payload types we took note of when processing the remote offer are not the same as the ones the browser answering eventually chose. Is this your case?

Yes, this is the case when the browser is sending an answer on reinvite. But, the payload types (and payload/codec names) are not changed, they are missing for streams added in reinvite. In this PR I have added it in "update" request as it's done for "accept" request (see lines 3648 and 3652). Also, I have added additional check if they are already set to not override it.

@lminiero
Copy link
Member

lminiero commented Nov 3, 2020

But, the payload types (and payload/codec names) are not changed, they are missing for streams added in reinvite.

But that's what puzzles me: if the browser that is answering is confirming the new choices made by the offerer, then we should have those payload types already, as they're updated here:
https://github.com/meetecho/janus-gateway/blob/master/plugins/janus_sip.c#L5798
https://github.com/meetecho/janus-gateway/blob/master/plugins/janus_sip.c#L5800

Since you have a testbed to replicate this scenario, could you check what those lines are doing, if anything, and why they're not updating payload types as needed? I'd say that, if there's an issue there, this should be fixed too.

@ihusejnovic
Copy link
Contributor Author

But, the payload types (and payload/codec names) are not changed, they are missing for streams added in reinvite.

But that's what puzzles me: if the browser that is answering is confirming the new choices made by the offerer, then we should have those payload types already, as they're updated here:
https://github.com/meetecho/janus-gateway/blob/master/plugins/janus_sip.c#L5798
https://github.com/meetecho/janus-gateway/blob/master/plugins/janus_sip.c#L5800

Since you have a testbed to replicate this scenario, could you check what those lines are doing, if anything, and why they're not updating payload types as needed? I'd say that, if there's an issue there, this should be fixed too.

That's not where they are updated since the offerer is sending an offer, not an answer. (see line https://github.com/meetecho/janus-gateway/blob/master/plugins/janus_sip.c#L5791).

Payload types are updated only when you are sending or receiving an answer.
In this case, payload types are updated in the function janus_sip_sdp_manipulate when we get an answer from the browser, but payload names are not.

@lminiero
Copy link
Member

lminiero commented Nov 3, 2020

That's not where they are updated since the offerer is sending an offer, not an answer.

Oh you're right! Maybe I should start drinking coffee in the morning again... 🤭
Then your fix is indeed needed and I'll merge it right away, thanks 👍 I'm pretty sure the same fix will be needed in the NoSIP plugin too, I'll take care of that myself after this is merged.

@lminiero lminiero merged commit ca14882 into meetecho:master Nov 3, 2020
@lminiero
Copy link
Member

lminiero commented Nov 3, 2020

Looks like the NoSIP plugin isn't affected, so no additional commit is needed.

@ihusejnovic
Copy link
Contributor Author

Thank you :)

@ihusejnovic ihusejnovic deleted the sip-plugin-save-codec-name-on-update-request branch November 3, 2020 10:51
PauKerr pushed a commit to caffeinetv/janus-gateway that referenced this pull request Nov 11, 2020
Co-authored-by: ihusejnovic <imer.husejnovic@infobip.com>
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.

None yet

2 participants