[Asterisk-code-review] AST-2021-007 - res_pjsip_session: Don't offer if no channel exists. (asterisk[16.19])
George Joseph
asteriskteam at digium.com
Thu Jul 22 15:12:42 CDT 2021
George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/16202 )
Change subject: AST-2021-007 - res_pjsip_session: Don't offer if no channel exists.
......................................................................
AST-2021-007 - res_pjsip_session: Don't offer if no channel exists.
If a re-INVITE is received after we have sent a BYE request then it
is possible for no channel to be present on the session. If this
occurs we allow PJSIP to produce the offer instead. Since the call
is being hung up if it produces an incorrect offer it doesn't
actually matter. This also ensures that code which produces SDP
does not need to handle if a channel is not present.
ASTERISK-29381
Change-Id: I673cb88c432f38f69b2e0851d55cc57a62236042
---
M res/res_pjsip_session.c
1 file changed, 10 insertions(+), 0 deletions(-)
Approvals:
George Joseph: Looks good to me, approved; Approved for Submit
diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index 0753d8e..c8478d4 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -5201,6 +5201,16 @@
pjmedia_sdp_session *offer;
int i;
+ /* We allow PJSIP to produce an SDP if no channel is present. This may result
+ * in an incorrect SDP occurring, but if no channel is present then we are in
+ * the midst of a BYE and are hanging up. This ensures that all the code to
+ * produce an SDP doesn't need to worry about a channel being present or not,
+ * just in case.
+ */
+ if (!session->channel) {
+ return;
+ }
+
if (inv->neg) {
if (pjmedia_sdp_neg_was_answer_remote(inv->neg)) {
pjmedia_sdp_neg_get_active_remote(inv->neg, &previous_sdp);
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16202
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 16.19
Gerrit-Change-Id: I673cb88c432f38f69b2e0851d55cc57a62236042
Gerrit-Change-Number: 16202
Gerrit-PatchSet: 2
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-CC: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210722/f9f90913/attachment-0001.html>
More information about the asterisk-code-review
mailing list