#include "../../dprint.h"
#include "../../config.h"
#include "../../ut.h"
#include "../../dset.h"
#include "../../timer.h"
#include "../../hash_func.h"
#include "../../globals.h"
#include "../../action.h"
#include "../../data_lump.h"
#include "../../blacklists.h"
#include "../../usr_avp.h"
#include "../../mem/mem.h"
#include "../../parser/parser_f.h"
#include "t_funcs.h"
#include "t_hooks.h"
#include "t_msgbuilder.h"
#include "ut.h"
#include "t_cancel.h"
#include "t_lookup.h"
#include "t_fwd.h"
#include "fix_lumps.h"
#include "config.h"

Go to the source code of this file.
Functions | |
| int | add_blind_uac (void) |
| introduce a new uac, which is blind | |
| static int | add_uac (struct cell *t, struct sip_msg *request, str *uri, str *next_hop, str *path, struct proxy_l *proxy) |
| Introduce a new UAC to transaction. | |
| void | cancel_invite (struct sip_msg *cancel_msg, struct cell *t_cancel, struct cell *t_invite) |
| static unsigned int | count_local_rr (struct sip_msg *req) |
| int | e2e_cancel_branch (struct sip_msg *cancel_msg, struct cell *t_cancel, struct cell *t_invite, int branch) |
| unsigned int | get_on_branch (void) |
| static void | post_print_uac_request (struct sip_msg *request, str *org_uri, str *org_dst) |
| static int | pre_print_uac_request (struct cell *t, int branch, struct sip_msg *request) |
| static char * | print_uac_request (struct sip_msg *i_req, unsigned int *len, struct socket_info *send_sock, enum sip_protos proto) |
| be aware and use it *all* the time between pre_* and post_* functions! | |
| static struct proxy_l * | shm_clone_proxy (struct proxy_l *sp, unsigned int move_dn) |
| int | t_forward_nonack (struct cell *t, struct sip_msg *p_msg, struct proxy_l *proxy) |
| void | t_on_branch (unsigned int go_to) |
| int | t_replicate (struct sip_msg *p_msg, str *dst, int flags) |
| Relay a replicated message. | |
| static int | update_uac_dst (struct sip_msg *request, struct ua_client *uac) |
Variables | |
| int | _tm_branch_index = 0 |
| static int | goto_on_branch |
Definition in file t_fwd.c.
| int add_blind_uac | ( | void | ) |
introduce a new uac, which is blind
This UA only creates the data structures and starts FR timer, but that's it; it does not print messages and send anything anywhere; that is good for FIFO apps -- the transaction must look operationally and FR must be ticking, whereas the request is "forwarded" using a non-SIP way and will be replied the same way
Definition at line 278 of file t_fwd.c.
References cell::flags, get_t(), LM_ERR, MAX_BRANCHES, cell::nr_of_outgoings, REQ_FWDED, ua_client::request, set_kr(), start_retr(), T_BLIND_UAC, T_UNDEFINED, and cell::uac.
Referenced by load_tm(), t_write_req(), and t_write_unix().
| static int add_uac | ( | struct cell * | t, | |
| struct sip_msg * | request, | |||
| str * | uri, | |||
| str * | next_hop, | |||
| str * | path, | |||
| struct proxy_l * | proxy | |||
| ) | [static] |
Introduce a new UAC to transaction.
Introduce a new UAC to a transaction. It doesn't send a message yet -- a reply to it might interfere with the processes of adding multiple branches.
Definition at line 376 of file t_fwd.c.
References ua_client::added_rr, proxy_l::addr_idx, ua_client::br_flags, retr_buf::buffer, count_local_rr(), retr_buf::dst, sip_msg::dst_uri, E_BAD_ADDRESS, E_BUG, E_CFG, E_OUT_OF_MEM, sip_msg::first_line, cell::flags, free_proxy(), getb0flags(), proxy_l::host, hostent2su(), _str::len, LM_CRIT, LM_ERR, MAX_BRANCHES, sip_msg::new_uri, cell::nr_of_outgoings, NULL, sip_msg::parsed_uri_ok, sip_msg::path_vec, pkg_free, proxy_l::port, post_print_uac_request(), pre_print_uac_request(), proxy_l::proto, dest_info::proto, PROTO_NONE, ua_client::proxy, msg_start::request, ua_client::request, _str::s, ser_error, shm_clone_proxy(), SIP_PORT, T_NO_DNS_FAILOVER_FLAG, dest_info::to, msg_start::u, cell::uac, update_uac_dst(), ua_client::uri, and uri2proxy().
Referenced by t_forward_nonack().
Definition at line 531 of file t_fwd.c.
References cancel_uacs(), CANCELING, FAKED_REPLY, cell::first_branch, retr_buf::fr_timer, ua_client::last_received, _str::len, LOCK_REPLIES, relay_reply(), ua_client::request, reset_timer(), retr_buf::retr_timer, RPS_ERROR, _str::s, t_reply(), cell::uac, and which_cancel().
Referenced by t_forward_nonack().
| static unsigned int count_local_rr | ( | struct sip_msg * | req | ) | [inline, static] |
Definition at line 347 of file t_fwd.c.
References sip_msg::add_rm, lump::after, lump::flags, HDR_RECORDROUTE_T, LUMP_ADD_OPT, LUMP_NOP, LUMPFLAG_COND_TRUE, lump::next, lump::op, and lump::type.
Referenced by add_uac().
| int e2e_cancel_branch | ( | struct sip_msg * | cancel_msg, | |
| struct cell * | t_cancel, | |||
| struct cell * | t_invite, | |||
| int | branch | |||
| ) |
Definition at line 462 of file t_fwd.c.
References ua_client::br_flags, retr_buf::buffer, retr_buf::dst, sip_msg::dst_uri, E_BUG, E_OUT_OF_MEM, sip_msg::first_line, sip_msg::flags, _str::len, len, LM_CRIT, LM_ERR, sip_msg::new_uri, sip_msg::parsed_uri_ok, ua_client::path_vec, sip_msg::path_vec, pkg_free, post_print_uac_request(), pre_print_uac_request(), print_uac_request(), dest_info::proto, msg_start::request, ua_client::request, _str::s, dest_info::send_sock, ser_error, msg_start::u, cell::uac, and ua_client::uri.
| unsigned int get_on_branch | ( | void | ) |
Definition at line 89 of file t_fwd.c.
References goto_on_branch.
Referenced by init_new_t(), and t_forward_nonack().
| static void post_print_uac_request | ( | struct sip_msg * | request, | |
| str * | org_uri, | |||
| str * | org_dst | |||
| ) | [inline, static] |
Definition at line 200 of file t_fwd.c.
References sip_msg::add_rm, sip_msg::body_lumps, del_flaged_lumps(), sip_msg::dst_uri, _str::len, LUMPFLAG_BRANCH, sip_msg::new_uri, sip_msg::parsed_uri_ok, pkg_free, reset_init_lump_flags, and _str::s.
Referenced by add_uac(), and e2e_cancel_branch().
| static int pre_print_uac_request | ( | struct cell * | t, | |
| int | branch, | |||
| struct sip_msg * | request | |||
| ) | [inline, static] |
Definition at line 95 of file t_fwd.c.
References _tm_branch_index, ACT_FL_DROP, sip_msg::add_to_branch_len, sip_msg::add_to_branch_s, branch_rlist, BRANCH_ROUTE, check_hdrs_changes(), sip_msg::dst_uri, E_OUT_OF_MEM, _str::len, LM_DBG, LM_ERR, LUMPFLAG_BRANCH, sip_msg::msg_flags, sip_msg::new_uri, NULL, cell::on_branch, sip_msg::parsed_uri_ok, ua_client::path_vec, sip_msg::path_vec, pkg_malloc, ua_server::request, run_top_route(), run_trans_callbacks(), _str::s, ser_error, set_avp_list(), set_init_lump_flags, set_route_type, shm_resize, swap_route_type, t_calc_branch(), TMCB_REQUEST_FWDED, cell::uac, cell::uas, and cell::user_avps.
Referenced by add_uac(), and e2e_cancel_branch().
| static char* print_uac_request | ( | struct sip_msg * | i_req, | |
| unsigned int * | len, | |||
| struct socket_info * | send_sock, | |||
| enum sip_protos | proto | |||
| ) | [inline, static] |
be aware and use it *all* the time between pre_* and post_* functions!
Definition at line 182 of file t_fwd.c.
References buf, build_req_buf_from_sip_req(), E_OUT_OF_MEM, LM_ERR, MSG_TRANS_SHM_FLAG, NULL, and ser_error.
Referenced by e2e_cancel_branch(), and update_uac_dst().
Definition at line 225 of file t_fwd.c.
References proxy_l::addr_idx, proxy_l::dn, dns_res_copy(), proxy_l::flags, free_shm_hostent(), proxy_l::host, hostent_shm_cpy(), LM_ERR, NULL, proxy_l::port, proxy_l::proto, PROXY_SHM_FLAG, shm_free, and shm_malloc().
Referenced by add_uac().
Definition at line 571 of file t_fwd.c.
References add_uac(), retr_buf::buffer, cancel_invite(), check_blacklists(), clear_branches(), retr_buf::dst, sip_msg::dst_uri, E_BUG, E_IP_BLOCKED, E_NO_DESTINATION, E_SEND, cell::first_branch, sip_msg::flags, cell::flags, sip_msg::force_send_socket, get_branch(), get_next_su(), get_on_branch(), GET_RURI, getb0flags(), has_tran_tmcbs, ua_client::last_received, _str::len, LM_DBG, LM_ERR, METHOD_CANCEL, METHOD_INVITE, sip_msg::new_uri, no_new_branches, cell::nr_of_outgoings, cell::on_branch, sip_msg::parsed_uri_ok, sip_msg::path_vec, proxy_l::proto, dest_info::proto, ua_client::proxy, REQ_FWDED, ua_client::request, ua_server::request, run_trans_callbacks(), _str::s, SEND_BUFFER, ser_error, set_extra_tmcb_params(), set_kr(), setb0flags(), start_retr(), t_lookupOriginalT(), T_NULL_CELL, T_WAS_CANCELLED_FLAG, TMCB_REQUEST_BUILT, dest_info::to, cell::uac, cell::uas, update_uac_dst(), and was_cancelled.
Referenced by do_dns_failover(), t_relay_to(), and w_t_relay().
| void t_on_branch | ( | unsigned int | go_to | ) |
Definition at line 75 of file t_fwd.c.
References BRANCH_ROUTE, get_t(), goto_on_branch, cell::on_branch, route_type, and T_UNDEFINED.
Referenced by script_init(), and w_t_on_branch().
Relay a replicated message.
Relay a replicated message. We just take the message as is, including Route-s, Record-route-s, and Vias, forward it downstream and prevent replies received from relaying by setting the replication/local_trans bit.
| p_msg | replicated message | |
| dst | destination | |
| flags | message flags |
Definition at line 750 of file t_fwd.c.
References branch_uri2dset(), GET_RURI, LM_ERR, set_dst_uri(), t_relay_to(), and TM_T_REPLY_repl_FLAG.
Referenced by w_t_replicate().
Definition at line 308 of file t_fwd.c.
References retr_buf::buffer, retr_buf::dst, E_NO_SOCKET, E_OUT_OF_MEM, get_send_socket(), _str::len, len, LM_ERR, print_uac_request(), dest_info::proto, dest_info::proto_reserved1, ua_client::request, _str::s, sockaddr_union::s, dest_info::send_sock, ser_error, shm_free, and dest_info::to.
Referenced by add_uac(), and t_forward_nonack().
| int _tm_branch_index = 0 |
int goto_on_branch [static] |
1.5.6