MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / do_t_cleanup

Function do_t_cleanup

modules/tm/tm.c:832–860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

830
831
832static int do_t_cleanup( struct sip_msg *req, void *bar)
833{
834 struct cell *t;
835
836 empty_tmcb_list(&tmcb_pending_hl);
837
838 t = get_cancelled_t();
839 if (t!=NULL && t!=T_UNDEFINED)
840 t_unref_cell(t);
841
842 t = get_e2eack_t();
843 if (t!=NULL && t!=T_UNDEFINED)
844 t_unref_cell(t);
845
846 reset_e2eack_t();
847
848 if ( (t=get_t())!=NULL && t!=T_UNDEFINED && /* we have a transaction */
849 t->uas.request && req->REQ_METHOD==t->uas.request->REQ_METHOD) {
850 /* check the UAS request not yet updated from script msg */
851 LOCK_REPLIES(t);
852 if (t->uas.request->msg_flags & FL_SHM_UPDATED)
853 LM_DBG("transaction %p already updated! Skipping update!\n", t);
854 else
855 update_cloned_msg_from_msg( t->uas.request, req);
856 UNLOCK_REPLIES(t);
857 }
858
859 return t_unref(req) == 0 ? SCB_DROP_MSG : SCB_RUN_ALL;
860}
861
862
863static int script_init( struct sip_msg *msg, void *bar)

Callers

nothing calls this directly

Calls 8

empty_tmcb_listFunction · 0.85
get_cancelled_tFunction · 0.85
t_unref_cellFunction · 0.85
get_e2eack_tFunction · 0.85
reset_e2eack_tFunction · 0.85
get_tFunction · 0.85
t_unrefFunction · 0.85

Tested by

no test coverage detected