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

Function t_check_trans

modules/tm/tm.c:1125–1165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1123
1124
1125static int t_check_trans(struct sip_msg* msg)
1126{
1127 struct cell *trans;
1128
1129 if (msg->REQ_METHOD==METHOD_CANCEL) {
1130 /* parse needed hdrs*/
1131 if (check_transaction_quadruple(msg)==0) {
1132 LM_ERR("too few headers\n");
1133 return 0; /*drop request!*/
1134 }
1135 if (!msg->hash_index)
1136 msg->hash_index = tm_hash(msg->callid->body,get_cseq(msg)->number);
1137 /* performe lookup */
1138 trans = t_lookupOriginalT( msg );
1139 return trans?1:-1;
1140 } else {
1141 trans = get_t();
1142 if (trans==NULL)
1143 return -1;
1144 if (trans!=T_UNDEFINED)
1145 return 1;
1146 switch ( t_lookup_request( msg , 0) ) {
1147 case 1:
1148 /* transaction found -> is it local ACK? */
1149 if (msg->REQ_METHOD==METHOD_ACK)
1150 return 1;
1151 /* .... else -> retransmission */
1152 trans = get_t();
1153 t_retransmit_reply(trans);
1154 UNREF(trans);
1155 set_t(0);
1156 return 0;
1157 case -2:
1158 /* e2e ACK found */
1159 return -2;
1160 default:
1161 /* notfound */
1162 return -1;
1163 }
1164 }
1165}
1166
1167
1168static int t_flush_flags(struct sip_msg* msg)

Callers

nothing calls this directly

Calls 6

t_lookupOriginalTFunction · 0.85
get_tFunction · 0.85
t_lookup_requestFunction · 0.85
t_retransmit_replyFunction · 0.85
set_tFunction · 0.85

Tested by

no test coverage detected