[asterisk-commits] file: branch 12 r403179 - /branches/12/res/res_pjsip/pjsip_configuration.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Nov 27 10:09:51 CST 2013
Author: file
Date: Wed Nov 27 10:09:48 2013
New Revision: 403179
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=403179
Log:
res_pjsip: Fix crash when reloading certain configurations.
Certain options available that specify a SIP URI perform validation
on the provided URI using the PJSIP URI parser. This operation
requires that the thread executing it be registered with the PJLIB
library. During reloads this was done on a thread which was NOT
registered with it.
This fixes the problem by creating a task which reloads the
configuration on a PJSIP thread.
(closes issue ASTERISK-22923)
Reported by: Anthony Messina
Modified:
branches/12/res/res_pjsip/pjsip_configuration.c
Modified: branches/12/res/res_pjsip/pjsip_configuration.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_pjsip/pjsip_configuration.c?view=diff&rev=403179&r1=403178&r2=403179
==============================================================================
--- branches/12/res/res_pjsip/pjsip_configuration.c (original)
+++ branches/12/res/res_pjsip/pjsip_configuration.c Wed Nov 27 10:09:48 2013
@@ -1404,11 +1404,24 @@
ast_sorcery_unref(sip_sorcery);
}
-int ast_res_pjsip_reload_configuration(void)
+/*!
+ * \internal
+ * \brief Reload configuration within a PJSIP thread
+ */
+static int reload_configuration_task(void *obj)
{
if (sip_sorcery) {
ast_sorcery_reload(sip_sorcery);
}
+ return 0;
+}
+
+int ast_res_pjsip_reload_configuration(void)
+{
+ if (ast_sip_push_task(NULL, reload_configuration_task, NULL)) {
+ ast_log(LOG_WARNING, "Failed to reload PJSIP configuration\n");
+ }
+
return 0;
}
More information about the asterisk-commits
mailing list