[svn-commits] kmoore: branch kmoore/parking_unload r396874 - in /team/kmoore/parking_unload...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Aug 16 14:53:32 CDT 2013


Author: kmoore
Date: Fri Aug 16 14:53:30 2013
New Revision: 396874

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=396874
Log:
Allow application loading to take advantage of the new module info accessor

Modified:
    team/kmoore/parking_unload/res/parking/parking_applications.c
    team/kmoore/parking_unload/res/parking/parking_bridge_features.c
    team/kmoore/parking_unload/res/parking/res_parking.h
    team/kmoore/parking_unload/res/res_parking.c

Modified: team/kmoore/parking_unload/res/parking/parking_applications.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/parking_unload/res/parking/parking_applications.c?view=diff&rev=396874&r1=396873&r2=396874
==============================================================================
--- team/kmoore/parking_unload/res/parking/parking_applications.c (original)
+++ team/kmoore/parking_unload/res/parking/parking_applications.c Fri Aug 16 14:53:30 2013
@@ -861,8 +861,10 @@
 	return res;
 }
 
-int load_parking_applications(const struct ast_module_info *ast_module_info)
-{
+int load_parking_applications(void)
+{
+	const struct ast_module_info *ast_module_info = parking_get_module_info();
+
 	if (ast_register_application_xml(PARK_APPLICATION, park_app_exec)) {
 		return -1;
 	}

Modified: team/kmoore/parking_unload/res/parking/parking_bridge_features.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/parking_unload/res/parking/parking_bridge_features.c?view=diff&rev=396874&r1=396873&r2=396874
==============================================================================
--- team/kmoore/parking_unload/res/parking/parking_bridge_features.c (original)
+++ team/kmoore/parking_unload/res/parking/parking_bridge_features.c Fri Aug 16 14:53:30 2013
@@ -241,7 +241,7 @@
 	struct ast_exten *exten_obj;
 	struct pbx_find_info info = { .stacklen = 0 }; /* the rest is reset in pbx_find_extension */
 	const char *app_at_exten;
-	SCOPED_MODULE_USE(parking_get_module());
+	SCOPED_MODULE_USE(parking_get_module_info()->self);
 
 	ast_debug(4, "Checking if %s@%s is a parking exten\n", exten, context);
 	exten_obj = pbx_find_extension(NULL, NULL, &info, context, exten, 1, NULL, NULL, E_MATCH);
@@ -279,7 +279,7 @@
 {
 	RAII_VAR(struct ast_bridge_channel *, other, NULL, ao2_cleanup);
 	int peer_count;
-	SCOPED_MODULE_USE(parking_get_module());
+	SCOPED_MODULE_USE(parking_get_module_info()->self);
 
 	if (ast_strlen_zero(context) || ast_strlen_zero(exten)) {
 		return -1;
@@ -356,7 +356,7 @@
 	RAII_VAR(struct ast_bridge *, parking_bridge, NULL, ao2_cleanup);
 	RAII_VAR(struct ast_bridge *, original_bridge, NULL, ao2_cleanup);
 	RAII_VAR(struct ast_channel *, parker, NULL, ao2_cleanup);
-	SCOPED_MODULE_USE(parking_get_module());
+	SCOPED_MODULE_USE(parking_get_module_info()->self);
 
 	if (strcmp(ast_channel_uniqueid(bridge_channel->chan), uuid_parkee)) {
 		/* We aren't the parkee, so ignore this action. */
@@ -421,7 +421,7 @@
 {
 	RAII_VAR(struct parking_lot *, lot, NULL, ao2_cleanup);
 	const char *lot_name = NULL;
-	SCOPED_MODULE_USE(parking_get_module());
+	SCOPED_MODULE_USE(parking_get_module_info()->self);
 
 	ast_channel_lock(parker->chan);
 	lot_name = find_channel_parking_lot_name(parker->chan);
@@ -450,7 +450,7 @@
 static int feature_park_call(struct ast_bridge_channel *bridge_channel, void *hook_pvt)
 {
 	int res;
-	SCOPED_MODULE_USE(parking_get_module());
+	SCOPED_MODULE_USE(parking_get_module_info()->self);
 
 	res = parking_park_call(bridge_channel, NULL, 0);
 

Modified: team/kmoore/parking_unload/res/parking/res_parking.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/parking_unload/res/parking/res_parking.h?view=diff&rev=396874&r1=396873&r2=396874
==============================================================================
--- team/kmoore/parking_unload/res/parking/res_parking.h (original)
+++ team/kmoore/parking_unload/res/parking/res_parking.h Fri Aug 16 14:53:30 2013
@@ -467,12 +467,10 @@
  * \since 12.0.0
  * \brief Register parking applications
  *
- * \param ast_module_info The module's ast_module_info
- *
  * \retval 0 if successful
  * \retval -1 on failure
  */
-int load_parking_applications(const struct ast_module_info *ast_module_info);
+int load_parking_applications(void);
 
 /*!
  * \since 12.0.0
@@ -553,8 +551,8 @@
 
 /*!
  * \since 12.0.0
- * \brief Get res_parking's module for module ref counting purposes
+ * \brief Get res_parking's module info
  *
  * \retval res_parking's ast_module
  */
-struct ast_module *parking_get_module(void);
+const struct ast_module_info *parking_get_module_info(void);

Modified: team/kmoore/parking_unload/res/res_parking.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/parking_unload/res/res_parking.c?view=diff&rev=396874&r1=396873&r2=396874
==============================================================================
--- team/kmoore/parking_unload/res/res_parking.c (original)
+++ team/kmoore/parking_unload/res/res_parking.c Fri Aug 16 14:53:30 2013
@@ -1153,9 +1153,9 @@
 	disable_marked_lots();
 }
 
-struct ast_module *parking_get_module(void)
-{
-	return ast_module_info->self;
+const struct ast_module_info *parking_get_module_info(void)
+{
+	return ast_module_info;
 }
 
 static int unload_module(void)
@@ -1216,7 +1216,7 @@
 		goto error;
 	}
 
-	if (load_parking_applications(ast_module_info)) {
+	if (load_parking_applications()) {
 		goto error;
 	}
 




More information about the svn-commits mailing list