AC_MSG_ERROR([no usable spandsp; please install spandsp3 devel package or equivalent])
])
-PKG_CHECK_MODULES([SOFIA_SIP], [sofia-sip-ua >= 1.12.12],[
+PKG_CHECK_MODULES([SOFIA_SIP], [sofia-sip-ua >= 1.13.3],[
AM_CONDITIONAL([HAVE_SOFIA_SIP],[true])],[
AC_MSG_ERROR([no usable sofia-sip; please install sofia-sip-ua devel package or equivalent])
])
uuid-dev, libexpat1-dev, libgdbm-dev, libdb-dev,
# used by many modules
libcurl4-openssl-dev | libcurl4-gnutls-dev | libcurl-dev,
- bison, zlib1g-dev, libsofia-sip-ua-dev (>= 1.12.12),
+ bison, zlib1g-dev, libsofia-sip-ua-dev (>= 1.13.3),
libspandsp3-dev,
# used to format the private freeswitch apt-repo key properly
gnupg,
BuildRequires: gcc-c++
BuildRequires: libtool >= 1.5.17
BuildRequires: openssl-devel >= 1.0.1e
-BuildRequires: sofia-sip-devel >= 1.12.12
+BuildRequires: sofia-sip-devel >= 1.13.3
BuildRequires: spandsp3-devel >= 3.0
BuildRequires: pcre-devel
BuildRequires: speex-devel
de->session = session;
}
- sofia_process_dispatch_event(&de);
+ sofia_process_dispatch_event(&de, SWITCH_FALSE);
switch_mutex_unlock(tech_pvt->sofia_mutex);
TAG_IF(call_info, SIPTAG_CALL_INFO_STR(call_info)), TAG_IF(!zstr(body), SIPTAG_PAYLOAD_STR(body)), TAG_END());
if (call_id && nh) {
- nua_handle_unref(nh);
+ nua_handle_unref_user(nh);
}
done:
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);
+void sofia_process_dispatch_event(sofia_dispatch_event_t **dep, switch_bool_t stack_thread);
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);
+ sofia_process_dispatch_event(&de, SWITCH_FALSE);
}
if (pool) {
switch_thread_pool_launch_thread(&td);
}
-void sofia_process_dispatch_event(sofia_dispatch_event_t **dep)
+void sofia_process_dispatch_event(sofia_dispatch_event_t **dep, switch_bool_t stack_thread)
{
sofia_dispatch_event_t *de = *dep;
nua_handle_t *nh = de->nh;
profile->queued_events--;
switch_mutex_unlock(profile->flag_mutex);
- if (nh) nua_handle_unref(nh);
- nua_unref(nua);
+ 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);
+ }
}
if (pop) {
sofia_dispatch_event_t *de = (sofia_dispatch_event_t *) pop;
- sofia_process_dispatch_event(&de);
+ sofia_process_dispatch_event(&de, SWITCH_FALSE);
} else {
break;
}
int launch = 0;
if (mod_sofia_globals.running == 0 || !mod_sofia_globals.msg_queue) {
- sofia_process_dispatch_event(&de);
+ /* Calling with SWITCH_TRUE as we are sure this is the stack's thread */
+ sofia_process_dispatch_event(&de, SWITCH_TRUE);
return;
}
switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "ATTENDED_TRANSFER_ERROR");
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
}
- nua_handle_unref(bnh);
+ nua_handle_unref_user(bnh);
}
su_home_unref(home);
home = NULL;
}
switch_core_session_rwunlock(b_session);
}
- nua_handle_unref(bnh);
+ nua_handle_unref_user(bnh);
} else { /* the other channel is on a different box, we have to go find them */
if (exten && (br_a = switch_channel_get_partner_uuid(channel_a))) {
switch_core_session_t *a_session;
switch_core_session_rwunlock(b_session);
}
}
- nua_handle_unref(bnh);
+ nua_handle_unref_user(bnh);
} else if (sip->sip_replaces && sip->sip_replaces->rp_call_id) {
switch_core_session_t *b_session = NULL;
if ((b_session = switch_core_session_locate((char*) sip->sip_replaces->rp_call_id))) {
switch_mutex_lock(profile->flag_mutex);
if ((hnh = switch_core_hash_find(profile->reg_nh_hash, key))) {
switch_core_hash_delete(profile->reg_nh_hash, key);
- nua_handle_unref(hnh);
+ nua_handle_unref_user(hnh);
nua_handle_destroy(hnh);
}
switch_mutex_unlock(profile->flag_mutex);
for (hi = switch_core_hash_first_iter( profile->reg_nh_hash, hi); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, &var, NULL, &val);
if ((nh = (nua_handle_t *) val)) {
- nua_handle_unref(nh);
+ nua_handle_unref_user(nh);
nua_handle_destroy(nh);
switch_core_hash_delete(profile->reg_nh_hash, (char *) var);
goto top;