switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Mod starting shutting down\n");
switch_event_unbind_callback(mod_amqp_producer_event_handler);
- for (hi = switch_core_hash_first(globals.producer_hash); hi; hi = switch_core_hash_next(&hi)) {
+ while ((hi = switch_core_hash_first(globals.producer_hash))) {
switch_core_hash_this(hi, NULL, NULL, (void **)&producer);
mod_amqp_producer_destroy(&producer);
}
- for (hi = switch_core_hash_first(globals.command_hash); hi; hi = switch_core_hash_next(&hi)) {
+ while ((hi = switch_core_hash_first(globals.command_hash))) {
switch_core_hash_this(hi, NULL, NULL, (void **)&command);
mod_amqp_command_destroy(&command);
}
if ( mod_amqp_connection_open(profile->conn_root, &(profile->conn_active), profile->name, profile->custom_attr) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Profile[%s] was unable to connect to any connection\n", profile->name);
+ goto err;
}
amqp_exchange_declare(profile->conn_active->state, 1,