void sofia_glue_build_vid_refresh_message(switch_core_session_t *session, const char *pl);
char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, nua_handle_t *nh, sofia_dispatch_event_t *de, sofia_nat_parse_t *np);
void sofia_glue_pause_jitterbuffer(switch_core_session_t *session, switch_bool_t on);
-void sofia_process_dispatch_event(sofia_dispatch_event_t **dep, switch_bool_t stack_thread);
+void sofia_process_dispatch_event(sofia_dispatch_event_t **dep);
void sofia_process_dispatch_event_in_thread(sofia_dispatch_event_t **dep);
char *sofia_glue_get_host(const char *str, switch_memory_pool_t *pool);
void sofia_presence_check_subscriptions(sofia_profile_t *profile, time_t now);
if (de) {
pool = de->pool;
de->pool = NULL;
- sofia_process_dispatch_event(&de, SWITCH_FALSE);
+ sofia_process_dispatch_event(&de);
}
if (pool) {
switch_thread_pool_launch_thread(&td);
}
-void sofia_process_dispatch_event(sofia_dispatch_event_t **dep, switch_bool_t stack_thread)
+void sofia_process_dispatch_event(sofia_dispatch_event_t **dep)
{
sofia_dispatch_event_t *de = *dep;
nua_handle_t *nh = de->nh;
profile->queued_events--;
switch_mutex_unlock(profile->flag_mutex);
- if (stack_thread) {
- /* Safe to unref directly */
- if (nh) nua_handle_unref(nh);
- nua_unref(nua);
- } else {
- /* This is not a stack thread, need to call via stack (_user) using events */
- if (nh) nua_handle_unref_user(nh);
- nua_unref_user(nua);
- }
+ /* This is not a stack thread, need to call via stack (_user) using events */
+ if (nh) nua_handle_unref_user(nh);
+ nua_unref_user(nua);
}
if (pop) {
sofia_dispatch_event_t *de = (sofia_dispatch_event_t *) pop;
- sofia_process_dispatch_event(&de, SWITCH_FALSE);
+ sofia_process_dispatch_event(&de);
} else {
break;
}
if (mod_sofia_globals.running == 0 || !mod_sofia_globals.msg_queue) {
/* Calling with SWITCH_TRUE as we are sure this is the stack's thread */
- sofia_process_dispatch_event(&de, SWITCH_TRUE);
+ sofia_process_dispatch_event(&de);
return;
}