Exemple #1
0
/**
 * 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);
}
Exemple #2
0
/* 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);
}
Exemple #3
0
int select_sys_server_id(str* res, select_t* s, struct sip_msg* msg) {
	return int_to_static_buffer(res, server_id);
}
Exemple #4
0
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);
}
Exemple #5
0
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);
}
Exemple #6
0
/**
 * 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);
}
Exemple #7
0
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);
}
Exemple #8
0
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);
}