void _eXosip_call_free (struct eXosip_t *excontext, eXosip_call_t * jc) { eXosip_dialog_t *jd; if (jc->c_inc_tr != NULL && jc->c_inc_tr->orig_request != NULL && jc->c_inc_tr->orig_request->call_id != NULL && jc->c_inc_tr->orig_request->call_id->number != NULL) _eXosip_delete_nonce (excontext, jc->c_inc_tr->orig_request->call_id->number); else if (jc->c_out_tr != NULL && jc->c_out_tr->orig_request != NULL && jc->c_out_tr->orig_request->call_id != NULL && jc->c_out_tr->orig_request->call_id->number != NULL) _eXosip_delete_nonce (excontext, jc->c_out_tr->orig_request->call_id->number); for (jd = jc->c_dialogs; jd != NULL; jd = jc->c_dialogs) { REMOVE_ELEMENT (jc->c_dialogs, jd); _eXosip_dialog_free (excontext, jd); } _eXosip_delete_reserved (jc->c_inc_tr); _eXosip_delete_reserved (jc->c_out_tr); if (jc->c_inc_tr != NULL) osip_list_add (&excontext->j_transactions, jc->c_inc_tr, 0); if (jc->c_out_tr != NULL) osip_list_add (&excontext->j_transactions, jc->c_out_tr, 0); osip_free (jc); #ifndef MINISIZE excontext->statistics.allocated_calls--; #endif }
void eXosip_subscribe_free (eXosip_subscribe_t * js) { /* ... */ eXosip_dialog_t *jd; if (js->s_inc_tr != NULL && js->s_inc_tr->orig_request != NULL && js->s_inc_tr->orig_request->call_id != NULL && js->s_inc_tr->orig_request->call_id->number != NULL) _eXosip_delete_nonce (js->s_inc_tr->orig_request->call_id->number); else if (js->s_out_tr != NULL && js->s_out_tr->orig_request != NULL && js->s_out_tr->orig_request->call_id != NULL && js->s_out_tr->orig_request->call_id->number != NULL) _eXosip_delete_nonce (js->s_out_tr->orig_request->call_id->number); for (jd = js->s_dialogs; jd != NULL; jd = js->s_dialogs) { REMOVE_ELEMENT (js->s_dialogs, jd); eXosip_dialog_free (jd); } __eXosip_delete_jinfo (js->s_inc_tr); __eXosip_delete_jinfo (js->s_out_tr); if (js->s_inc_tr != NULL) osip_list_add (&eXosip.j_transactions, js->s_inc_tr, 0); if (js->s_out_tr != NULL) osip_list_add (&eXosip.j_transactions, js->s_out_tr, 0); osip_free (js); }
void _eXosip_subscribe_free(struct eXosip_t *excontext, eXosip_subscribe_t * js) { /* ... */ eXosip_dialog_t *jd; if (js->s_inc_tr != NULL && js->s_inc_tr->orig_request != NULL && js->s_inc_tr->orig_request->call_id != NULL && js->s_inc_tr->orig_request->call_id->number != NULL) _eXosip_delete_nonce(excontext, js->s_inc_tr->orig_request->call_id->number); else if (js->s_out_tr != NULL && js->s_out_tr->orig_request != NULL && js->s_out_tr->orig_request->call_id != NULL && js->s_out_tr->orig_request->call_id->number != NULL) _eXosip_delete_nonce(excontext, js->s_out_tr->orig_request->call_id->number); for (jd = js->s_dialogs; jd != NULL; jd = js->s_dialogs) { REMOVE_ELEMENT(js->s_dialogs, jd); _eXosip_dialog_free(excontext, jd); } _eXosip_delete_reserved(js->s_inc_tr); _eXosip_delete_reserved(js->s_out_tr); if (js->s_inc_tr != NULL) osip_list_add(&excontext->j_transactions, js->s_inc_tr, 0); if (js->s_out_tr != NULL) osip_list_add(&excontext->j_transactions, js->s_out_tr, 0); osip_free(js); }
void eXosip_reg_free(eXosip_reg_t * jreg) { osip_free(jreg->r_aor); osip_free(jreg->r_contact); osip_free(jreg->r_registrar); if (jreg->r_last_tr != NULL) { if (jreg->r_last_tr != NULL && jreg->r_last_tr->orig_request != NULL && jreg->r_last_tr->orig_request->call_id != NULL && jreg->r_last_tr->orig_request->call_id->number != NULL) _eXosip_delete_nonce(jreg->r_last_tr->orig_request->call_id->number); if (jreg->r_last_tr->state == IST_TERMINATED || jreg->r_last_tr->state == ICT_TERMINATED || jreg->r_last_tr->state == NICT_TERMINATED || jreg->r_last_tr->state == NIST_TERMINATED) { OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_INFO1, NULL, "Release a terminated transaction\n")); __eXosip_delete_jinfo(jreg->r_last_tr); if (jreg->r_last_tr != NULL) osip_list_add(&eXosip.j_transactions, jreg->r_last_tr, 0); } else { OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_INFO1, NULL, "Release a non-terminated transaction\n")); __eXosip_delete_jinfo(jreg->r_last_tr); if (jreg->r_last_tr != NULL) osip_list_add(&eXosip.j_transactions, jreg->r_last_tr, 0); } } osip_free(jreg); }
void _eXosip_pub_free (struct eXosip_t *excontext, eXosip_pub_t * pub) { if (pub->p_last_tr != NULL) { if (pub->p_last_tr != NULL && pub->p_last_tr->orig_request != NULL && pub->p_last_tr->orig_request->call_id != NULL && pub->p_last_tr->orig_request->call_id->number != NULL) _eXosip_delete_nonce (excontext, pub->p_last_tr->orig_request->call_id->number); osip_list_add (&excontext->j_transactions, pub->p_last_tr, 0); } osip_free (pub); }