[svn-commits] file: trunk r403180 - in /trunk: ./ res/res_pjsip/pjsip_configuration.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Nov 27 10:12:58 CST 2013


Author: file
Date: Wed Nov 27 10:12:56 2013
New Revision: 403180

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=403180
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
........

Merged revisions 403179 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/res/res_pjsip/pjsip_configuration.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Wed Nov 27 10:12:56 2013
@@ -1,1 +1,1 @@
-/branches/12:1-398558,398560-398577,398579-399305,399307-401390,401392-403175
+/branches/12:1-398558,398560-398577,398579-399305,399307-401390,401392-403175,403179

Modified: trunk/res/res_pjsip/pjsip_configuration.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip/pjsip_configuration.c?view=diff&rev=403180&r1=403179&r2=403180
==============================================================================
--- trunk/res/res_pjsip/pjsip_configuration.c (original)
+++ trunk/res/res_pjsip/pjsip_configuration.c Wed Nov 27 10:12:56 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 svn-commits mailing list