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 fd71f2b7a8..29760d4271 100644 --- a/src/mod/event_handlers/mod_amqp/mod_amqp_command.c +++ b/src/mod/event_handlers/mod_amqp/mod_amqp_command.c @@ -184,6 +184,7 @@ static void mod_amqp_command_response(mod_amqp_command_profile_t *profile, char char *json_output = NULL; amqp_basic_properties_t props; cJSON *message = NULL; + int amqp_status = AMQP_STATUS_OK; if (! profile->conn_active) { /* No connection, so we can not send the message. */ @@ -207,7 +208,7 @@ static void mod_amqp_command_response(mod_amqp_command_profile_t *profile, char props._flags = AMQP_BASIC_CONTENT_TYPE_FLAG; props.content_type = amqp_cstring_bytes("text/json"); - status = amqp_basic_publish( + amqp_status = amqp_basic_publish( profile->conn_active->state, 1, amqp_cstring_bytes(fs_resp_exchange), @@ -219,8 +220,8 @@ static void mod_amqp_command_response(mod_amqp_command_profile_t *profile, char switch_safe_free(json_output); - if (status != AMQP_STATUS_OK) { - const char *errstr = amqp_error_string2(-status); + if (amqp_status != AMQP_STATUS_OK) { + const char *errstr = amqp_error_string2(-amqp_status); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Profile[%s] failed to send event on connection[%s]: %s\n", profile->name, profile->conn_active->name, errstr);