Skip to content

Fix for SIP plugin not offering SRTP in response to offerless INVITEs#3618

Merged
lminiero merged 2 commits intomasterfrom
srtp-offerless
Feb 3, 2026
Merged

Fix for SIP plugin not offering SRTP in response to offerless INVITEs#3618
lminiero merged 2 commits intomasterfrom
srtp-offerless

Conversation

@lminiero
Copy link
Copy Markdown
Member

A post on our Discourse group pointed out a bug in the SIP plugin: specifically, when receiving an offerless INVITE and sending an accept with a srtp: "sdes_mandatory", still results in a plain SDP being sent, while it should contain crypto attributes.

Checking the code, this was because normally an accept expects that an SDP to refer to exists (the offer) when deciding whether or not to add some properties at the time of manipulating the WebRTC SDP to an SDP one. For SRTP, it was indeed checking the current status of the session->media object, which in case of offerless INVITEs is wrong, though, as the state is still "clean". This patch tries to address that, and make sure that SRTP attributes are correctly generated in that case.

I don't have a quick or easy way to test this, so please let me know if that works for you, and more importantly if you notice any regression that this may introduce. If this works as expected, I'll backport it to 0.x as well.

@lminiero lminiero added the multistream Related to Janus 1.x label Jan 23, 2026
@RiteshTDC
Copy link
Copy Markdown

Hi Lorenzo,

I can confirm that the PR3618 fix works.

  • Now, in response to a ‘secure’ offerless SIP Invite, the Janus WebRTC server includes the SDES in the offer SIP 200OK with SDP.
  • The Janus WebRTC server continues to include SDES in the offer SIP 200OK with SDP for a ‘secure’ offerless SIP Re-Invite.
  • The Janus WebRTC server continues to include SDES in the offer SDP of 'secure' SIP Invite/Re-Invite.
  • In response to a 'secure' SIP Invite/Re-Invite with SDP/SDES, the Janus WebRTC server continues to include SDES in the answer SDP of 'secure' SIP 200OK.

Do you know by when this PR3618 would be merged in the official/main branch?

The below mentioned scenarios have been successfully tested:

  1. Unsecure SIP Register (using Janus Sip plugin parameters: “sips”:false and “outbound_proxy”: unsecure_Sip_Sbc_IP/FQDN)
  2. Unsecure Outbound SIP call ( by not using the Janus Sip plugin parameters: "srtp" in the Request)
  3. Unsecure Inbound SIP call ( by not using the Janus Sip plugin parameters: "srtp" in the Request)
  4. Secure SIP Register (using Janus Sip plugin parameters: “sips”:true and “outbound_proxy”: secure_Sip_Sbc_IP/FQDN)
  5. Secure Outbound SIP call ( by using the Janus Sip plugin parameters: "srtp":"sdes_mandatory" in the Request)
  6. Secure Inbound SIP call ( by using the Janus Sip plugin parameters: "srtp":"sdes_mandatory" in the Request)

Though the PR3618 fix is working nicely, during the installation, the below mentioned warning message was displayed when we had used the command 'make' to start building Janus:

CC plugins/libjanus_recordplay_la-janus_recordplay.lo
CCLD plugins/libjanus_recordplay.la
CC plugins/libjanus_sip_la-janus_sip.lo
plugins/janus_sip.c: In function 'janus_sip_handler':
plugins/janus_sip.c:4166:75: warning: comparison between pointer and integer
4166 | if(!answer && session->media.srtp_profile == NULL) {
| ^~
CCLD plugins/libjanus_sip.la
CC plugins/libjanus_nosip_la-janus_nosip.lo
CCLD plugins/libjanus_nosip.la
CC plugins/libjanus_streaming_la-janus_streaming.lo

Thanks.

Best Regards,
Ritesh

@lminiero
Copy link
Copy Markdown
Member Author

Do you know by when this PR3618 would be merged in the official/main branch?

Since you mentioned performing many tests successfully, I think we can merge it pretty much right away. I'll check the warning you mentioned, and fix it before merging. Thanks for reporting the issue and for the quick feedback!

@lminiero lminiero merged commit d50a3fe into master Feb 3, 2026
8 checks passed
@lminiero lminiero deleted the srtp-offerless branch February 3, 2026 09:58
@lminiero
Copy link
Copy Markdown
Member Author

lminiero commented Feb 3, 2026

Merged, I'll backport to 0.x too now.

mwalbeck pushed a commit to mwalbeck/docker-janus-gateway that referenced this pull request Feb 14, 2026
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [meetecho/janus-gateway](https://github.com/meetecho/janus-gateway) | minor | ` v1.3.3` -> `v1.4.0` |

---

### Release Notes

<details>
<summary>meetecho/janus-gateway (meetecho/janus-gateway)</summary>

### [`v1.4.0`](https://github.com/meetecho/janus-gateway/blob/HEAD/CHANGELOG.md#v140---2026-02-06)

[Compare Source](meetecho/janus-gateway@v1.3.3...v1.4.0)

- Generate a pkg-config .pc file when installing Janus \[[PR-3596](meetecho/janus-gateway#3596)]
- Implemented compound RTCP reports (thanks [@&#8203;addisonpolcyn](https://github.com/addisonpolcyn)!) \[[PR-3585](meetecho/janus-gateway#3585)]
- Fixed when to negotiate the rtcp-fb transport-cc SDP attribute \[[PR-3595](meetecho/janus-gateway#3595)]
- Strip some WebRTC-specific SDP attributes in SIP and NoSIP plugins
- Added RTP forwarders support to SIP and NoSIP plugins (thanks [@&#8203;WebTrit](https://github.com/WebTrit)!) \[[PR-3583](meetecho/janus-gateway#3583)]
- Fixed subscription renewal possibly going to the wrong host in the SIP plugin (thanks [@&#8203;digiboridev](https://github.com/digiboridev)!) \[[PR-3602](meetecho/janus-gateway#3602)]
- Laid foundations for plugin-specific unique session ID in SIP and NoSIP plugins \[[PR-3607](meetecho/janus-gateway#3607)]
- Fixed 'use-after-free' in SIP session helpers (thanks [@&#8203;oleksandr-mihal-zultys](https://github.com/oleksandr-mihal-zultys)!) \[[PR-3613](meetecho/janus-gateway#3613)]
- Fixed SIP plugin not offering SRTP in response to offerless INVITEs \[[PR-3618](meetecho/janus-gateway#3618)]
- Added new janus-pp-rec option to ignore RTP headers for timing purposes
- Other smaller fixes and improvements (thanks to all who contributed pull requests and reported issues!)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNDYuMCIsInVwZGF0ZWRJblZlciI6IjQxLjE0Ni4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://git.walbeck.it/walbeck-it/docker-janus-gateway/pulls/202
Co-authored-by: renovate-bot <bot@walbeck.it>
Co-committed-by: renovate-bot <bot@walbeck.it>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

multistream Related to Janus 1.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants