/** * Comparison function which compares current status and last status * in current branch. * It is a simplified method how to detect incoming retransmited responses. * @return 1 if @status is less or equal @tm.uac.last_status (retransmited response) * otherwise returns -1 (not retransmited response). * @see get_last_status */ static int select_tm_uac_response_retransmission(str* res, select_t* s, struct sip_msg* msg) { int last_status, rv; if (get_last_status(msg, &last_status) < 0) return -1; rv = msg->first_line.u.reply.statuscode <= last_status ? 1 : -1; /* DBG("select_tm_uac_response_retransmission: %d\n", rv); */ return int_to_static_buffer(res, rv); }
/* TODO: implement a general select function that works with any * kind of requests not only with negative ACKs */ static int select_tm_uas_request_neg_ack_retransmission(str* res, select_t* s, struct sip_msg* msg) { int rv; SELECT_check(msg); rv = ((msg->REQ_METHOD == METHOD_ACK) && (t->uas.status >= 300) /* Misuse the timer flag of the 200 retransmission buffer * to check whether or not this is an ACK retransmission. * Warning: this check is not 100% fail-safe because two * ACKs can be processed in parallel and none of them * may be considered a retransmission - Miklos */ && (t->uas.response.t_active == 0)) ? 1 : -1; return int_to_static_buffer(res, rv); }
int select_sys_server_id(str* res, select_t* s, struct sip_msg* msg) { return int_to_static_buffer(res, server_id); }
static int select_tm_uas_status(str* res, select_t* s, struct sip_msg* msg) { SELECT_check(msg); return int_to_static_buffer(res, t->uas.status); }
static int select_tm_uac_status(str* res, select_t* s, struct sip_msg* msg) { SELECT_check_branch(s, msg); return int_to_static_buffer(res, t->uac[BRANCH_NO(s)].last_received); }
/** * Get last status in current branch. */ static int select_tm_uac_last_status(str* res, select_t* s, struct sip_msg* msg) { int last_status; if (get_last_status(msg, &last_status) < 0) return -1; return int_to_static_buffer(res, last_status); }
static int select_tm_uac_relayed(str* res, select_t* s, struct sip_msg* msg) { SELECT_check(msg); return int_to_static_buffer(res, t->relayed_reply_branch); }
static int select_tm_uac_count(str* res, select_t* s, struct sip_msg* msg) { SELECT_check(msg); return int_to_static_buffer(res, t->nr_of_outgoings); }