fix jira issue FSCORE-164
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9204 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
76965f9c09
commit
e40ab4966b
|
@ -111,6 +111,7 @@ struct sofia_private {
|
|||
char gateway_name[512];
|
||||
int destroy_nh;
|
||||
int destroy_me;
|
||||
int is_call;
|
||||
};
|
||||
|
||||
#define set_param(ptr,val) if (ptr) {free(ptr) ; ptr = NULL;} if (val) {ptr = strdup(val);}
|
||||
|
|
|
@ -205,6 +205,8 @@ void sofia_event_callback(nua_event_t event,
|
|||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel is already hungup.\n");
|
||||
goto done;
|
||||
}
|
||||
} else if (sofia_private && sofia_private->is_call) {
|
||||
sofia_private->destroy_me = 22;
|
||||
}
|
||||
|
||||
if ((profile->pflags & PFLAG_AUTH_ALL) && tech_pvt && tech_pvt->key && sip) {
|
||||
|
@ -353,6 +355,7 @@ void sofia_event_callback(nua_event_t event,
|
|||
nua_handle_bind(nh, NULL);
|
||||
}
|
||||
sofia_private->destroy_me = 12;
|
||||
|
||||
free(sofia_private);
|
||||
sofia_private = NULL;
|
||||
}
|
||||
|
@ -3559,6 +3562,7 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
|
|||
}
|
||||
|
||||
memset(sofia_private, 0, sizeof(*sofia_private));
|
||||
sofia_private->is_call++;
|
||||
tech_pvt->sofia_private = sofia_private;
|
||||
|
||||
if ((profile->pflags & PFLAG_PRESENCE)) {
|
||||
|
|
|
@ -1206,7 +1206,10 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
|
|||
if (!(sofia_private = malloc(sizeof(*sofia_private)))) {
|
||||
abort();
|
||||
}
|
||||
|
||||
memset(sofia_private, 0, sizeof(*sofia_private));
|
||||
sofia_private->is_call++;
|
||||
|
||||
tech_pvt->sofia_private = sofia_private;
|
||||
switch_copy_string(tech_pvt->sofia_private->uuid, switch_core_session_get_uuid(session), sizeof(tech_pvt->sofia_private->uuid));
|
||||
nua_handle_bind(tech_pvt->nh, tech_pvt->sofia_private);
|
||||
|
|
Loading…
Reference in New Issue