From 3551e6c0d8db4921fa46c1a6d587077329dec05a Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Wed, 5 Jul 2017 13:42:33 -0500 Subject: [PATCH] FS-10430: [mod_amqp] fix support for libamqp version .0.5.2. Change to api actually happend in v0.6.0 --- src/mod/event_handlers/mod_amqp/mod_amqp_command.c | 2 +- src/mod/event_handlers/mod_amqp/mod_amqp_logging.c | 4 ++-- src/mod/event_handlers/mod_amqp/mod_amqp_producer.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mod/event_handlers/mod_amqp/mod_amqp_command.c b/src/mod/event_handlers/mod_amqp/mod_amqp_command.c index 3efd97cc38..851f52c46f 100644 --- a/src/mod/event_handlers/mod_amqp/mod_amqp_command.c +++ b/src/mod/event_handlers/mod_amqp/mod_amqp_command.c @@ -280,7 +280,7 @@ void * SWITCH_THREAD_FUNC mod_amqp_command_thread(switch_thread_t *thread, void } /* Check if exchange already exists */ -#if AMQP_VERSION_MAJOR == 0 && (AMQP_VERSION_MINOR > 5 || (AMQP_VERSION_MINOR == 5 && AMQP_VERSION_PATCH >= 2 )) +#if AMQP_VERSION_MAJOR == 0 && AMQP_VERSION_MINOR >= 6 amqp_exchange_declare(profile->conn_active->state, 1, amqp_cstring_bytes(profile->exchange), amqp_cstring_bytes("topic"), diff --git a/src/mod/event_handlers/mod_amqp/mod_amqp_logging.c b/src/mod/event_handlers/mod_amqp/mod_amqp_logging.c index 0085c99ddd..dd6fa599d9 100644 --- a/src/mod/event_handlers/mod_amqp/mod_amqp_logging.c +++ b/src/mod/event_handlers/mod_amqp/mod_amqp_logging.c @@ -244,7 +244,7 @@ switch_status_t mod_amqp_logging_create(char *name, switch_xml_t cfg) goto err; } -#if AMQP_VERSION_MAJOR == 0 && (AMQP_VERSION_MINOR > 5 || (AMQP_VERSION_MINOR == 5 && AMQP_VERSION_PATCH >= 2 )) +#if AMQP_VERSION_MAJOR == 0 && AMQP_VERSION_MINOR >= 6 amqp_exchange_declare(profile->conn_active->state, 1, amqp_cstring_bytes(profile->exchange), amqp_cstring_bytes(profile->exchange_type), @@ -353,7 +353,7 @@ void * SWITCH_THREAD_FUNC mod_amqp_logging_thread(switch_thread_t *thread, void status = mod_amqp_connection_open(profile->conn_root, &(profile->conn_active), profile->name, profile->custom_attr); if ( status == SWITCH_STATUS_SUCCESS ) { // Ensure that the exchange exists, and is of the correct type -#if AMQP_VERSION_MAJOR == 0 && (AMQP_VERSION_MINOR > 5 || (AMQP_VERSION_MINOR == 5 && AMQP_VERSION_PATCH >= 2 )) +#if AMQP_VERSION_MAJOR == 0 && AMQP_VERSION_MINOR >= 6 amqp_exchange_declare(profile->conn_active->state, 1, amqp_cstring_bytes(profile->exchange), amqp_cstring_bytes(profile->exchange_type), diff --git a/src/mod/event_handlers/mod_amqp/mod_amqp_producer.c b/src/mod/event_handlers/mod_amqp/mod_amqp_producer.c index d74776f564..0c3bc4e22e 100644 --- a/src/mod/event_handlers/mod_amqp/mod_amqp_producer.c +++ b/src/mod/event_handlers/mod_amqp/mod_amqp_producer.c @@ -325,7 +325,7 @@ switch_status_t mod_amqp_producer_create(char *name, switch_xml_t cfg) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Profile[%s] was unable to connect to any connection\n", profile->name); goto err; } -#if AMQP_VERSION_MAJOR == 0 && (AMQP_VERSION_MINOR > 5 || (AMQP_VERSION_MINOR == 5 && AMQP_VERSION_PATCH >= 2 )) +#if AMQP_VERSION_MAJOR == 0 && AMQP_VERSION_MINOR >= 6 amqp_exchange_declare(profile->conn_active->state, 1, amqp_cstring_bytes(profile->exchange), amqp_cstring_bytes(profile->exchange_type), @@ -468,7 +468,7 @@ void * SWITCH_THREAD_FUNC mod_amqp_producer_thread(switch_thread_t *thread, void status = mod_amqp_connection_open(profile->conn_root, &(profile->conn_active), profile->name, profile->custom_attr); if ( status == SWITCH_STATUS_SUCCESS ) { // Ensure that the exchange exists, and is of the correct type -#if AMQP_VERSION_MAJOR == 0 && (AMQP_VERSION_MINOR > 5 || (AMQP_VERSION_MINOR == 5 && AMQP_VERSION_PATCH >= 2 )) +#if AMQP_VERSION_MAJOR == 0 && AMQP_VERSION_MINOR >= 6 amqp_exchange_declare(profile->conn_active->state, 1, amqp_cstring_bytes(profile->exchange), amqp_cstring_bytes(profile->exchange_type),