提交 cbdcbcf8 authored 作者: Anthony Minessale's avatar Anthony Minessale

update

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3214 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 90297aa7
OS_ARCH := $(subst /,_,$(shell uname -s | sed /\ /s//_/)) OS_ARCH := $(subst /,_,$(shell uname -s | sed /\ /s//_/))
VERSION = sofia-sip-1.12 VERSION = sofia-sip-1.12
TARBALL = sofia-sip-1.12.3.5.tar.gz TARBALL = sofia-sip-1.12.3.4.tar.gz
CFLAGS += -I. -I$(PREFIX)/include/$(VERSION) CFLAGS += -I. -I$(PREFIX)/include/$(VERSION)
LDFLAGS += -lsofia-sip-ua LDFLAGS += -lsofia-sip-ua
LINKER=$(CC) LINKER=$(CC)
......
...@@ -1145,17 +1145,13 @@ static switch_status_t sofia_on_hangup(switch_core_session_t *session) ...@@ -1145,17 +1145,13 @@ static switch_status_t sofia_on_hangup(switch_core_session_t *session)
tech_pvt = (private_object_t *) switch_core_session_get_private(session); tech_pvt = (private_object_t *) switch_core_session_get_private(session);
assert(tech_pvt != NULL); assert(tech_pvt != NULL);
if (switch_test_flag(tech_pvt, TFLAG_BYE)) {
return SWITCH_STATUS_SUCCESS;
}
cause = switch_channel_get_cause(channel); cause = switch_channel_get_cause(channel);
sip_cause = hangup_cause_to_sip(cause); sip_cause = hangup_cause_to_sip(cause);
deactivate_rtp(tech_pvt); deactivate_rtp(tech_pvt);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel %s hanging up, cause: %s\n", switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel %s hanging up, cause: %s\n",
switch_channel_get_name(channel), switch_channel_cause2str(cause), sip_cause); switch_channel_get_name(channel), switch_channel_cause2str(cause), sip_cause);
if (tech_pvt->hash_key) { if (tech_pvt->hash_key) {
switch_core_hash_delete(tech_pvt->profile->chat_hash, tech_pvt->hash_key); switch_core_hash_delete(tech_pvt->profile->chat_hash, tech_pvt->hash_key);
...@@ -1181,16 +1177,14 @@ static switch_status_t sofia_on_hangup(switch_core_session_t *session) ...@@ -1181,16 +1177,14 @@ static switch_status_t sofia_on_hangup(switch_core_session_t *session)
nua_cancel(tech_pvt->nh, TAG_END()); nua_cancel(tech_pvt->nh, TAG_END());
} }
} }
switch_set_flag_locked(tech_pvt, TFLAG_BYE);
} }
nua_handle_destroy(tech_pvt->nh);
tech_pvt->nh = NULL;
} }
if (tech_pvt->from_str) { if (tech_pvt->from_str) {
switch_safe_free(tech_pvt->from_str); switch_safe_free(tech_pvt->from_str);
} }
switch_set_flag_locked(tech_pvt, TFLAG_BYE);
switch_clear_flag_locked(tech_pvt, TFLAG_IO); switch_clear_flag_locked(tech_pvt, TFLAG_IO);
if (tech_pvt->home) { if (tech_pvt->home) {
...@@ -1425,14 +1419,14 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session) ...@@ -1425,14 +1419,14 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
switch_channel_get_name(channel), switch_channel_get_name(channel),
tech_pvt->local_sdp_str); tech_pvt->local_sdp_str);
nua_respond(tech_pvt->nh, SIP_200_OK, nua_respond(tech_pvt->nh, SIP_200_OK,
SIPTAG_CONTACT_STR(tech_pvt->profile->url), SIPTAG_CONTACT_STR(tech_pvt->profile->url),
SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
SOATAG_AUDIO_AUX("cn telephone-event"), SOATAG_AUDIO_AUX("cn telephone-event"),
NUTAG_INCLUDE_EXTRA_SDP(1), NUTAG_INCLUDE_EXTRA_SDP(1),
TAG_END()); TAG_END());
} }
} }
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
...@@ -1877,7 +1871,7 @@ static void logger(void *logarg, char const *fmt, va_list ap) ...@@ -1877,7 +1871,7 @@ static void logger(void *logarg, char const *fmt, va_list ap)
#endif #endif
} }
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, (char*) "%s", data); switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_CONSOLE, (char*) "%s", data);
free(data); free(data);
} }
...@@ -2435,6 +2429,7 @@ static void sip_i_state(int status, ...@@ -2435,6 +2429,7 @@ static void sip_i_state(int status,
switch_channel_set_variable(channel, "endpoint_disposition", "RECEIVED"); switch_channel_set_variable(channel, "endpoint_disposition", "RECEIVED");
switch_channel_set_state(channel, CS_INIT); switch_channel_set_state(channel, CS_INIT);
switch_set_flag_locked(tech_pvt, TFLAG_READY); switch_set_flag_locked(tech_pvt, TFLAG_READY);
//sofia_answer_channel(session);//XXX TMP
switch_core_session_thread_launch(session); switch_core_session_thread_launch(session);
if (replaces_str && (replaces = sip_replaces_make(tech_pvt->home, replaces_str)) && (bnh = nua_handle_by_replaces(nua, replaces))) { if (replaces_str && (replaces = sip_replaces_make(tech_pvt->home, replaces_str)) && (bnh = nua_handle_by_replaces(nua, replaces))) {
...@@ -2573,14 +2568,16 @@ static void sip_i_state(int status, ...@@ -2573,14 +2568,16 @@ static void sip_i_state(int status,
switch_set_flag_locked(tech_pvt, TFLAG_BYE); switch_set_flag_locked(tech_pvt, TFLAG_BYE);
if (switch_test_flag(tech_pvt, TFLAG_NOHUP)) { if (switch_test_flag(tech_pvt, TFLAG_NOHUP)) {
switch_clear_flag_locked(tech_pvt, TFLAG_NOHUP); switch_clear_flag_locked(tech_pvt, TFLAG_NOHUP);
nua_handle_destroy(tech_pvt->nh);
tech_pvt->nh = NULL;
} else { } else {
snprintf(st, sizeof(st), "%d", status); snprintf(st, sizeof(st), "%d", status);
switch_channel_set_variable(channel, "sip_term_status", st); switch_channel_set_variable(channel, "sip_term_status", st);
terminate_session(&session, sip_cause_to_freeswitch(status), __LINE__); terminate_session(&session, sip_cause_to_freeswitch(status), __LINE__);
} }
} }
tech_pvt->nh = NULL;
}
if (nh) {
nua_handle_destroy(nh);
} }
break; break;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论