FS-4079 please try this
This commit is contained in:
parent
da18061744
commit
5867d0424d
|
@ -1 +1 @@
|
|||
Wed Jul 11 16:48:51 CDT 2012
|
||||
Wed Jul 18 21:45:15 CDT 2012
|
||||
|
|
|
@ -295,31 +295,43 @@ int nua_base_server_preprocess(nua_server_request_t *sr)
|
|||
|
||||
void nua_server_request_destroy(nua_server_request_t *sr)
|
||||
{
|
||||
nua_server_request_t *sr0 = NULL;
|
||||
|
||||
if (sr == NULL)
|
||||
return;
|
||||
|
||||
if (SR_HAS_SAVED_SIGNAL(sr))
|
||||
nua_destroy_signal(sr->sr_signal);
|
||||
|
||||
if (sr->sr_irq) {
|
||||
if (sr->sr_method == sip_method_bye && sr->sr_status < 200) {
|
||||
nta_incoming_treply(sr->sr_irq, SIP_200_OK, TAG_END());
|
||||
}
|
||||
nta_incoming_destroy(sr->sr_irq), sr->sr_irq = NULL;
|
||||
}
|
||||
|
||||
if (sr->sr_request.msg)
|
||||
msg_destroy(sr->sr_request.msg), sr->sr_request.msg = NULL;
|
||||
|
||||
if (sr->sr_response.msg)
|
||||
msg_destroy(sr->sr_response.msg), sr->sr_response.msg = NULL;
|
||||
|
||||
if (sr->sr_prev) {
|
||||
/* Allocated from heap */
|
||||
if ((*sr->sr_prev = sr->sr_next))
|
||||
sr->sr_next->sr_prev = sr->sr_prev;
|
||||
su_free(sr->sr_owner->nh_home, sr);
|
||||
sr0 = sr;
|
||||
}
|
||||
|
||||
if (sr->sr_irq) {
|
||||
nta_incoming_t *irq = sr->sr_irq;
|
||||
if (sr->sr_method == sip_method_bye && sr->sr_status < 200) {
|
||||
nta_incoming_treply(sr->sr_irq, SIP_200_OK, TAG_END());
|
||||
}
|
||||
sr->sr_irq = NULL;
|
||||
nta_incoming_destroy(irq);
|
||||
}
|
||||
|
||||
if (sr->sr_request.msg) {
|
||||
msg_t *msg = sr->sr_request.msg;
|
||||
sr->sr_request.msg = NULL;
|
||||
msg_destroy(msg);
|
||||
}
|
||||
|
||||
if (sr->sr_response.msg) {
|
||||
msg_t *msg = sr->sr_response.msg;
|
||||
sr->sr_response.msg = NULL;
|
||||
msg_destroy(msg);
|
||||
}
|
||||
|
||||
if (sr0) su_free(sr->sr_owner->nh_home, sr0);
|
||||
}
|
||||
|
||||
/**@fn void nua_respond(nua_handle_t *nh, int status, char const *phrase, tag_type_t tag, tag_value_t value, ...);
|
||||
|
|
|
@ -2321,19 +2321,6 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
|||
|
||||
if (!zstr(msg->string_arg)) {
|
||||
|
||||
int status = 0;
|
||||
|
||||
if (tech_pvt->nh && tech_pvt->nh->nh_ds && tech_pvt->nh->nh_ds->ds_sr && nua_server_request_is_pending(tech_pvt->nh->nh_ds->ds_sr)) {
|
||||
status = tech_pvt->nh->nh_ds->ds_sr->sr_status;
|
||||
}
|
||||
|
||||
if (status == 0 || status > 199 || tech_pvt->nh->nh_destroyed) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s Cannot call respond on handle at status %d\n",
|
||||
switch_channel_get_name(channel), status);
|
||||
goto end_lock;
|
||||
}
|
||||
|
||||
|
||||
if (!switch_channel_test_flag(channel, CF_ANSWERED) && !sofia_test_flag(tech_pvt, TFLAG_BYE)) {
|
||||
char *dest = (char *) msg->string_arg;
|
||||
char *argv[128] = { 0 };
|
||||
|
@ -2417,17 +2404,6 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
|||
|
||||
case SWITCH_MESSAGE_INDICATE_RESPOND:
|
||||
{
|
||||
int status = 0;
|
||||
|
||||
if (tech_pvt->nh && tech_pvt->nh->nh_ds && tech_pvt->nh->nh_ds->ds_sr && nua_server_request_is_pending(tech_pvt->nh->nh_ds->ds_sr)) {
|
||||
status = tech_pvt->nh->nh_ds->ds_sr->sr_status;
|
||||
}
|
||||
|
||||
if (status == 0 || status > 199 || tech_pvt->nh->nh_destroyed) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s Cannot call respond on handle at status %d\n",
|
||||
switch_channel_get_name(channel), status);
|
||||
goto end_lock;
|
||||
}
|
||||
|
||||
if (msg->numeric_arg || msg->string_arg) {
|
||||
int code = msg->numeric_arg;
|
||||
|
|
Loading…
Reference in New Issue