[asterisk-commits] tilghman: trunk r284628 - in /trunk: ./ apps/ channels/ funcs/ include/asteri...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 2 00:28:02 CDT 2010


Author: tilghman
Date: Thu Sep  2 00:27:53 2010
New Revision: 284628

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=284628
Log:
Merged revisions 284610 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r284610 | tilghman | 2010-09-02 00:20:59 -0500 (Thu, 02 Sep 2010) | 10 lines
  
  When optional_api is non-optional, force dependent modules to be loaded.
  
  (closes issue #17707)
   Reported by: ira
   Patches: 
         20100819__issue17707__asterisk1.8.diff.txt uploaded by tilghman (license 14)
   Tested by: tilghman
   
  Review: https://reviewboard.asterisk.org/r/876/
........

Modified:
    trunk/   (props changed)
    trunk/apps/app_adsiprog.c
    trunk/apps/app_followme.c
    trunk/apps/app_getcpeid.c
    trunk/apps/app_queue.c
    trunk/apps/app_speech_utils.c
    trunk/apps/app_stack.c
    trunk/apps/app_voicemail.c
    trunk/channels/chan_agent.c
    trunk/channels/chan_dahdi.c
    trunk/channels/chan_iax2.c
    trunk/channels/chan_mgcp.c
    trunk/channels/chan_sip.c
    trunk/funcs/func_aes.c
    trunk/include/asterisk/module.h
    trunk/main/loader.c
    trunk/pbx/pbx_dundi.c
    trunk/pbx/pbx_loopback.c
    trunk/pbx/pbx_realtime.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/apps/app_adsiprog.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_adsiprog.c?view=diff&rev=284628&r1=284627&r2=284628
==============================================================================
--- trunk/apps/app_adsiprog.c (original)
+++ trunk/apps/app_adsiprog.c Thu Sep  2 00:27:53 2010
@@ -1591,4 +1591,8 @@
 	return AST_MODULE_LOAD_SUCCESS;
 }
 
-AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Asterisk ADSI Programming Application");
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Asterisk ADSI Programming Application",
+		.load = load_module,
+		.unload = unload_module,
+		.nonoptreq = "res_adsi",
+		);

Modified: trunk/apps/app_followme.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_followme.c?view=diff&rev=284628&r1=284627&r2=284628
==============================================================================
--- trunk/apps/app_followme.c (original)
+++ trunk/apps/app_followme.c Thu Sep  2 00:27:53 2010
@@ -51,7 +51,6 @@
 #include "asterisk/cli.h"
 #include "asterisk/manager.h"
 #include "asterisk/config.h"
-#include "asterisk/monitor.h"
 #include "asterisk/utils.h"
 #include "asterisk/causes.h"
 #include "asterisk/astdb.h"

Modified: trunk/apps/app_getcpeid.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_getcpeid.c?view=diff&rev=284628&r1=284627&r2=284628
==============================================================================
--- trunk/apps/app_getcpeid.c (original)
+++ trunk/apps/app_getcpeid.c Thu Sep  2 00:27:53 2010
@@ -132,4 +132,8 @@
 	return ast_register_application_xml(app, cpeid_exec);
 }
 
-AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Get ADSI CPE ID");
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Get ADSI CPE ID",
+		.load = load_module,
+		.unload = unload_module,
+		.nonoptreq = "res_adsi",
+		);

Modified: trunk/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_queue.c?view=diff&rev=284628&r1=284627&r2=284628
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Thu Sep  2 00:27:53 2010
@@ -57,7 +57,7 @@
  */
 
 /*** MODULEINFO
-	<depend>res_monitor</depend>
+	<use>res_monitor</use>
  ***/
 
 #include "asterisk.h"
@@ -8197,5 +8197,6 @@
 		.unload = unload_module,
 		.reload = reload,
 		.load_pri = AST_MODPRI_DEVSTATE_CONSUMER,
+		.nonoptreq = "res_monitor",
 	       );
 

Modified: trunk/apps/app_speech_utils.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_speech_utils.c?view=diff&rev=284628&r1=284627&r2=284628
==============================================================================
--- trunk/apps/app_speech_utils.c (original)
+++ trunk/apps/app_speech_utils.c Thu Sep  2 00:27:53 2010
@@ -955,4 +955,8 @@
 	return res;
 }
 
-AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Dialplan Speech Applications");
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Dialplan Speech Applications",
+		.load = load_module,
+		.unload = unload_module,
+		.nonoptreq = "res_speech",
+		);

Modified: trunk/apps/app_stack.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_stack.c?view=diff&rev=284628&r1=284627&r2=284628
==============================================================================
--- trunk/apps/app_stack.c (original)
+++ trunk/apps/app_stack.c Thu Sep  2 00:27:53 2010
@@ -704,4 +704,8 @@
 	return 0;
 }
 
-AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Dialplan subroutines (Gosub, Return, etc)");
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Dialplan subroutines (Gosub, Return, etc)",
+		.load = load_module,
+		.unload = unload_module,
+		.nonoptreq = "res_agi",
+		);

Modified: trunk/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=284628&r1=284627&r2=284628
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Thu Sep  2 00:27:53 2010
@@ -38,7 +38,8 @@
  */
 
 /*** MODULEINFO
-	<depend>res_smdi</depend>
+	<use>res_adsi</use>
+	<use>res_smdi</use>
  ***/
 
 /*** MAKEOPTS
@@ -13085,4 +13086,5 @@
 		.load = load_module,
 		.unload = unload_module,
 		.reload = reload,
+		.nonoptreq = "res_adsi,res_smdi",
 		);

Modified: trunk/channels/chan_agent.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_agent.c?view=diff&rev=284628&r1=284627&r2=284628
==============================================================================
--- trunk/channels/chan_agent.c (original)
+++ trunk/channels/chan_agent.c Thu Sep  2 00:27:53 2010
@@ -32,6 +32,7 @@
  */
 /*** MODULEINFO
         <depend>chan_local</depend>
+        <depend>res_monitor</depend>
  ***/
 
 #include "asterisk.h"
@@ -2484,4 +2485,5 @@
 		.unload = unload_module,
 		.reload = reload,
 		.load_pri = AST_MODPRI_CHANNEL_DRIVER,
+		.nonoptreq = "res_monitor,chan_local",
 	       );

Modified: trunk/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=284628&r1=284627&r2=284628
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Thu Sep  2 00:27:53 2010
@@ -38,7 +38,7 @@
  */
 
 /*** MODULEINFO
-	<depend>res_smdi</depend>
+	<use>res_smdi</use>
 	<depend>dahdi</depend>
 	<depend>tonezone</depend>
 	<use>pri</use>
@@ -17941,4 +17941,5 @@
 	.unload = unload_module,
 	.reload = reload,
 	.load_pri = AST_MODPRI_CHANNEL_DRIVER,
+		.nonoptreq = "res_smdi",
 	);

Modified: trunk/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=284628&r1=284627&r2=284628
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Thu Sep  2 00:27:53 2010
@@ -14620,4 +14620,5 @@
 		.unload = unload_module,
 		.reload = reload,
 		.load_pri = AST_MODPRI_CHANNEL_DRIVER,
+		.nonoptreq = "res_crypto",
 		);

Modified: trunk/channels/chan_mgcp.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_mgcp.c?view=diff&rev=284628&r1=284627&r2=284628
==============================================================================
--- trunk/channels/chan_mgcp.c (original)
+++ trunk/channels/chan_mgcp.c Thu Sep  2 00:27:53 2010
@@ -30,7 +30,7 @@
  */
 
 /*** MODULEINFO
-        <depend>res_pktccops</depend>
+        <use>res_pktccops</use>
  ***/
 
 #include "asterisk.h"
@@ -4915,4 +4915,5 @@
 		.unload = unload_module,
 		.reload = reload,
 		.load_pri = AST_MODPRI_CHANNEL_DRIVER,
+		.nonoptreq = "res_pktccops",
 	       );

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=284628&r1=284627&r2=284628
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Thu Sep  2 00:27:53 2010
@@ -162,6 +162,7 @@
  */
 
 /*** MODULEINFO
+	<depend>res_crypto</depend>
 	<depend>chan_local</depend>
  ***/
 
@@ -28623,4 +28624,5 @@
 		.unload = unload_module,
 		.reload = reload,
 		.load_pri = AST_MODPRI_CHANNEL_DRIVER,
+		.nonoptreq = "res_crypto,chan_local",
 	       );

Modified: trunk/funcs/func_aes.c
URL: http://svnview.digium.com/svn/asterisk/trunk/funcs/func_aes.c?view=diff&rev=284628&r1=284627&r2=284628
==============================================================================
--- trunk/funcs/func_aes.c (original)
+++ trunk/funcs/func_aes.c Thu Sep  2 00:27:53 2010
@@ -163,4 +163,8 @@
 	return res ? AST_MODULE_LOAD_DECLINE : AST_MODULE_LOAD_SUCCESS;
 }
 
-AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "AES dialplan functions");
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "AES dialplan functions",
+		.load = load_module,
+		.unload = unload_module,
+		.nonoptreq = "res_crypto",
+	);

Modified: trunk/include/asterisk/module.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/module.h?view=diff&rev=284628&r1=284627&r2=284628
==============================================================================
--- trunk/include/asterisk/module.h (original)
+++ trunk/include/asterisk/module.h Thu Sep  2 00:27:53 2010
@@ -242,6 +242,11 @@
 	 *  this value will never be read and the module will be given the lowest possible priority
 	 *  on load. */
 	unsigned char load_pri;
+
+	/*! Modules which should be loaded first, in comma-separated string format.
+	 * These are only required for loading, when the optional_api header file
+	 * detects that the compiler does not support the optional API featureset. */
+	const char *nonoptreq;
 };
 
 void ast_module_register(const struct ast_module_info *);

Modified: trunk/main/loader.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/loader.c?view=diff&rev=284628&r1=284627&r2=284628
==============================================================================
--- trunk/main/loader.c (original)
+++ trunk/main/loader.c Thu Sep  2 00:27:53 2010
@@ -414,6 +414,26 @@
 		return NULL;
 	}
 
+	/* This section is a workaround for a gcc 4.1 bug that has already been
+	 * fixed in later versions.  Unfortunately, some distributions, such as
+	 * RHEL/CentOS 5, distribute gcc 4.1, so we're stuck with having to deal
+	 * with this issue.  This basically ensures that optional_api modules are
+	 * loaded before any module which requires their functionality. */
+#if !defined(HAVE_ATTRIBUTE_weak_import) && !defined(HAVE_ATTRIBUTE_weakref)
+	if (!ast_strlen_zero(mod->info->nonoptreq)) {
+		/* Force any required dependencies to load */
+		char *each, *required_resource = ast_strdupa(mod->info->nonoptreq);
+		while ((each = strsep(&required_resource, ","))) {
+			each = ast_strip(each);
+
+			/* Is it already loaded? */
+			if (!find_resource(each, 0)) {
+				load_dynamic_module(each, global_symbols_only);
+			}
+		}
+	}
+#endif
+
 	while (!dlclose(lib));
 	resource_being_loaded = NULL;
 

Modified: trunk/pbx/pbx_dundi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/pbx/pbx_dundi.c?view=diff&rev=284628&r1=284627&r2=284628
==============================================================================
--- trunk/pbx/pbx_dundi.c (original)
+++ trunk/pbx/pbx_dundi.c Thu Sep  2 00:27:53 2010
@@ -4880,5 +4880,6 @@
 		.load = load_module,
 		.unload = unload_module,
 		.reload = reload,
+		.nonoptreq = "res_crypto",
 	       );
 

Modified: trunk/pbx/pbx_loopback.c
URL: http://svnview.digium.com/svn/asterisk/trunk/pbx/pbx_loopback.c?view=diff&rev=284628&r1=284627&r2=284628
==============================================================================
--- trunk/pbx/pbx_loopback.c (original)
+++ trunk/pbx/pbx_loopback.c Thu Sep  2 00:27:53 2010
@@ -41,7 +41,6 @@
 #include "asterisk/sched.h"
 #include "asterisk/io.h"
 #include "asterisk/utils.h"
-#include "asterisk/crypto.h"
 #include "asterisk/astdb.h"
 
 

Modified: trunk/pbx/pbx_realtime.c
URL: http://svnview.digium.com/svn/asterisk/trunk/pbx/pbx_realtime.c?view=diff&rev=284628&r1=284627&r2=284628
==============================================================================
--- trunk/pbx/pbx_realtime.c (original)
+++ trunk/pbx/pbx_realtime.c Thu Sep  2 00:27:53 2010
@@ -46,7 +46,6 @@
 #include "asterisk/sched.h"
 #include "asterisk/io.h"
 #include "asterisk/utils.h"
-#include "asterisk/crypto.h"
 #include "asterisk/astdb.h"
 #include "asterisk/app.h"
 #include "asterisk/astobj2.h"




More information about the asterisk-commits mailing list