[Asterisk-code-review] res pjsip: Patch for res pjsip * module load/reload crash (asterisk[13])
Jenkins2
asteriskteam at digium.com
Mon Dec 3 09:09:18 CST 2018
Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/10716 )
Change subject: res_pjsip: Patch for res_pjsip_* module load/reload crash
......................................................................
res_pjsip: Patch for res_pjsip_* module load/reload crash
The session_supplements for the pjsip makes crashes when the module
load/unload.
ASTERISK-28157
Change-Id: I5b82be3a75d702cf1933d8d1417f44aa10ad1029
---
M include/asterisk/res_pjsip_session.h
M res/res_pjsip/pjsip_session.c
2 files changed, 15 insertions(+), 2 deletions(-)
Approvals:
Benjamin Keith Ford: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Jenkins2: Approved for Submit
diff --git a/include/asterisk/res_pjsip_session.h b/include/asterisk/res_pjsip_session.h
index 0c2b1e3..e2d4fcd 100644
--- a/include/asterisk/res_pjsip_session.h
+++ b/include/asterisk/res_pjsip_session.h
@@ -533,10 +533,14 @@
* a module could reject an incoming request if desired.
*
* \param supplement The supplement to register
+ * \param module Referenced module(NULL safe)
* \retval 0 Success
* \retval -1 Failure
*/
-int ast_sip_session_register_supplement(struct ast_sip_session_supplement *supplement);
+int ast_sip_session_register_supplement_with_module(struct ast_module *module, struct ast_sip_session_supplement *supplement);
+
+#define ast_sip_session_register_supplement(supplement) \
+ ast_sip_session_register_supplement_with_module(ast_module_info->self, supplement)
/*!
* \brief Unregister a an supplement to SIP session processing
diff --git a/res/res_pjsip/pjsip_session.c b/res/res_pjsip/pjsip_session.c
index 074ec4e..2002bbd 100644
--- a/res/res_pjsip/pjsip_session.c
+++ b/res/res_pjsip/pjsip_session.c
@@ -56,10 +56,11 @@
}
}
-int ast_sip_session_register_supplement(struct ast_sip_session_supplement *supplement)
+int ast_sip_session_register_supplement_with_module(struct ast_module *module, struct ast_sip_session_supplement *supplement)
{
internal_sip_session_register_supplement(supplement);
internal_res_pjsip_ref();
+ ast_module_shutdown_ref(module);
return 0;
}
@@ -118,3 +119,11 @@
return 0;
}
+
+/* This stub is for ABI compatibility. */
+#undef ast_sip_session_register_supplement
+int ast_sip_session_register_supplement(struct ast_sip_session_supplement *supplement);
+int ast_sip_session_register_supplement(struct ast_sip_session_supplement *supplement)
+{
+ return ast_sip_session_register_supplement_with_module(NULL, supplement);
+}
--
To view, visit https://gerrit.asterisk.org/10716
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: I5b82be3a75d702cf1933d8d1417f44aa10ad1029
Gerrit-Change-Number: 10716
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181203/8825ef98/attachment.html>
More information about the asterisk-code-review
mailing list