de->session = session;
}
- if (de->data->e_event == nua_i_cancel || de->data->e_event == nua_i_bye) {
- sofia_set_flag(tech_pvt, TFLAG_SIGDEAD);
- }
+ sofia_process_dispatch_event(&de);
- if (!sofia_test_flag(tech_pvt, TFLAG_SIGDEAD) && (switch_channel_media_up(channel) || switch_channel_get_state(channel) > CS_ROUTING)) {
- sofia_queue_message(de);
- } else {
- sofia_process_dispatch_event(&de);
- }
switch_mutex_unlock(tech_pvt->sofia_mutex);
goto end;
char *inner_post_trans_execute;
switch_memory_pool_t *pool;
uint32_t max_trans;
+ uint32_t confirm;
};
static int qm_wake(switch_sql_queue_manager_t *qm)
}
switch_mutex_lock(qm->mutex);
+ qm->confirm++;
switch_queue_push(qm->sql_queue[pos], dup ? strdup(sql) : (char *)sql);
written = qm->pre_written[pos];
size = switch_sql_queue_manager_size(qm, pos);
}
}
+ switch_mutex_lock(qm->mutex);
+ qm->confirm--;
+ switch_mutex_unlock(qm->mutex);
+
return SWITCH_STATUS_SUCCESS;
}
switch_thread_cond_wait(qm->cond, qm->cond_mutex);
}
- i = 4;
+ i = 40;
- while (--i > 0 && (lc = qm_ttl(qm)) < qm->max_trans / 4) {
- switch_yield(50000);
+ while (--i > 0 && (lc = qm_ttl(qm)) < qm->max_trans / 4 && !qm->confirm) {
+ switch_yield(5000);
}
+
+
}
switch_mutex_unlock(qm->cond_mutex);