Merge "asterisk.c: When astcanary dies on linux, reset priority on all threads."
[asterisk/asterisk.git] / main / parking.c
index 9a92e6e..61a4896 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+ASTERISK_REGISTER_FILE()
 
 #include "asterisk/_private.h"
 #include "asterisk/astobj2.h"
@@ -134,15 +134,17 @@ int ast_parking_park_bridge_channel(struct ast_bridge_channel *parkee, const cha
                return -1;
        }
 
-       if (table->module_info) {
-               SCOPED_MODULE_USE(table->module_info->self);
+       if (table->module) {
+               SCOPED_MODULE_USE(table->module);
                return table->parking_park_bridge_channel(parkee, parkee_uuid, parker_uuid, app_data);
        }
 
        return table->parking_park_bridge_channel(parkee, parkee_uuid, parker_uuid, app_data);
 }
 
-int ast_parking_blind_transfer_park(struct ast_bridge_channel *parker, const char *context, const char *exten)
+int ast_parking_blind_transfer_park(struct ast_bridge_channel *parker,
+       const char *context, const char *exten, transfer_channel_cb parked_channel_cb,
+       struct transfer_channel_data *parked_channel_data)
 {
        RAII_VAR(struct ast_parking_bridge_feature_fn_table *, table,
                ao2_global_obj_ref(parking_provider), ao2_cleanup);
@@ -151,12 +153,12 @@ int ast_parking_blind_transfer_park(struct ast_bridge_channel *parker, const cha
                return -1;
        }
 
-       if (table->module_info) {
-               SCOPED_MODULE_USE(table->module_info->self);
-               return table->parking_blind_transfer_park(parker, context, exten);
+       if (table->module) {
+               SCOPED_MODULE_USE(table->module);
+               return table->parking_blind_transfer_park(parker, context, exten, parked_channel_cb, parked_channel_data);
        }
 
-       return table->parking_blind_transfer_park(parker, context, exten);
+       return table->parking_blind_transfer_park(parker, context, exten, parked_channel_cb, parked_channel_data);
 }
 
 int ast_parking_park_call(struct ast_bridge_channel *parker, char *exten, size_t length)
@@ -168,8 +170,8 @@ int ast_parking_park_call(struct ast_bridge_channel *parker, char *exten, size_t
                return -1;
        }
 
-       if (table->module_info) {
-               SCOPED_MODULE_USE(table->module_info->self);
+       if (table->module) {
+               SCOPED_MODULE_USE(table->module);
                return table->parking_park_call(parker, exten, length);
        }
 
@@ -185,8 +187,8 @@ int ast_parking_is_exten_park(const char *context, const char *exten)
                return -1;
        }
 
-       if (table->module_info) {
-               SCOPED_MODULE_USE(table->module_info->self);
+       if (table->module) {
+               SCOPED_MODULE_USE(table->module);
                return table->parking_is_exten_park(context, exten);
        }
 
@@ -200,7 +202,7 @@ int ast_parking_register_bridge_features(struct ast_parking_bridge_feature_fn_ta
 
        if (fn_table->module_version != PARKING_MODULE_VERSION) {
                ast_log(AST_LOG_WARNING, "Parking module provided incorrect parking module "
-                       "version: %d (expected: %d)\n", fn_table->module_version, PARKING_MODULE_VERSION);
+                       "version: %u (expected: %d)\n", fn_table->module_version, PARKING_MODULE_VERSION);
                return -1;
        }
 
@@ -216,7 +218,7 @@ int ast_parking_register_bridge_features(struct ast_parking_bridge_feature_fn_ta
        }
        *wrapper = *fn_table;
 
-       ao2_global_obj_replace(parking_provider, wrapper);
+       ao2_global_obj_replace_unref(parking_provider, wrapper);
        return 0;
 }
 
@@ -234,7 +236,7 @@ int ast_parking_unregister_bridge_features(const char *module_name)
                return -1;
        }
 
-       ao2_global_obj_replace_unref(parking_provider, NULL);
+       ao2_global_obj_release(parking_provider);
        return 0;
 }