action.c File Reference

Kamailio Generic functions. More...

#include "action.h"
#include "config.h"
#include "error.h"
#include "dprint.h"
#include "proxy.h"
#include "forward.h"
#include "udp_server.h"
#include "route.h"
#include "parser/msg_parser.h"
#include "parser/parse_uri.h"
#include "ut.h"
#include "sr_module.h"
#include "mem/mem.h"
#include "globals.h"
#include "dset.h"
#include "flags.h"
#include "errinfo.h"
#include "blacklists.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>

Include dependency graph for action.c:

Go to the source code of this file.

Functions

int do_action (struct action *a, struct sip_msg *msg)
 Exectute actions on a SIP message, used e.g. from modules.
int do_assign (struct sip_msg *msg, struct action *a)
 execute assignment operation
int run_action_list (struct action *a, struct sip_msg *msg)
 Run a list of actions.
static int run_actions (struct action *a, struct sip_msg *msg)
 Run actions from a route.
int run_top_route (struct action *a, struct sip_msg *msg)
 Run top (aka main) route from script.

Variables

err_info_t _oser_err_info
int action_flags = 0
int max_while_loops = 100
static int rec_lev = 0
int return_code = 0


Detailed Description

Kamailio Generic functions.

Definition in file action.c.


Function Documentation

int do_action ( struct action a,
struct sip_msg msg 
)

Exectute actions on a SIP message, used e.g. from modules.

Returns:
0 if action -> end of list(e.g DROP), > 0 to continue processing next actions and <0 on error

Definition at line 282 of file action.c.

References ACT_FL_DROP, ACT_FL_EXIT, ACT_FL_RETURN, action_flags, ACTIONS_ST, proxy_l::addr_idx, append_branch(), APPEND_BRANCH_T, BANDEQ_T, BOREQ_T, sip_msg::buf, BXOREQ_T, CMD_ST, COLONEQ_T, action_elem_::data, DEFAULT_T, DIVEQ_T, do_assign(), DROP_T, sip_msg::dst_uri, E_BAD_ADDRESS, E_BUG, E_CFG, E_OUT_OF_MEM, E_UNSPEC, action::elem, EQ_T, ERROR_T, eval_expr(), EXIT_T, EXPR_DROP, EXPR_ST, sip_msg::first_line, FL_FORCE_LOCAL_RPORT, FL_FORCE_RPORT, _pv_value::flags, FORCE_LOCAL_RPORT_T, FORCE_RPORT_T, sip_msg::force_send_socket, FORCE_SEND_SOCKET_T, FORCE_TCP_ALIAS_T, forward_request(), FORWARD_T, free_proxy(), getb0flags(), sip_uri::headers, proxy_l::host, sip_uri::host, hostent2su(), IF_T, isbflagset(), ISBFLAGSET_T, ISDSTURISET_T, isflagset(), ISFLAGSET_T, issflagset(), ISSFLAGSET_T, sip_msg::len, _str::len, len, LEN_GT_T, action::line, LM_ALERT, LM_DBG, LM_ERR, LM_GEN1, LM_INFO, LM_WARN, LOG_T, mark_for_search(), MAX_URI_SIZE, max_while_loops, MINUSEQ_T, mk_proxy(), MODULE_T, MODULOEQ_T, sip_msg::msg_flags, msg_send(), MULTEQ_T, sip_msg::new_uri, action::next, NOSUBTYPE, NULL, action_elem_::number, NUMBER_ST, sip_uri::params, parse_sip_msg_uri(), parse_uri(), sip_msg::parsed_uri, sip_msg::parsed_uri_ok, sip_uri::passwd, sip_msg::path_vec, pkg_free, pkg_malloc, PLUSEQ_T, via_body::port, sip_uri::port, proxy_l::port, port, sip_uri::port_no, PREFIX_T, prev_ser_error, receive_info::proto, proxy_l::proto, sip_uri::proto, receive_info::proto_reserved1, PROTO_TCP, PROTO_TLS, PROXY_ST, pv_get_spec_value(), pv_is_w, pv_printf_s(), PV_PRINTF_T, PV_VAL_INT, PV_VAL_NULL, PV_VAL_STR, pv_value_destroy(), _pv_spec::pvp, sip_msg::rcv, msg_start::request, RESET_DSTURI_T, reset_proc_debug_level(), resetbflag(), RESETBFLAG_T, resetflag(), RESETFLAG_T, resetsflag(), RESETSFLAG_T, return_code, RETURN_T, REVERT_URI_T, _pv_value::ri, rlist, ROUTE_T, _pv_value::rs, RT_NO, run_action_list(), run_actions(), action_elem_::s, _str::s, SCRIPTVAR_ST, SEND_T, ser_error, SET_ADV_ADDR_T, SET_ADV_PORT_T, SET_DEBUG_T, set_dst_uri(), SET_DSTURI_T, sip_msg::set_global_address, sip_msg::set_global_port, SET_HOST_T, SET_HOSTALL_T, SET_HOSTPORT_T, SET_PORT_T, set_proc_debug_level(), SET_URI_T, SET_USER_T, SET_USERPASS_T, setb0flags(), setbflag(), SETBFLAG_T, _pv_spec::setf, setflag(), SETFLAG_T, setsflag(), SETSFLAG_T, SIP_PORT, SIPS_URI_T, SOCKETINFO_ST, STR_ST, action_elem_::string, STRING_ST, STRIP_T, STRIP_TAIL_T, SWITCH_T, tcpconn_add_alias(), sip_uri::type, action_elem_::type, action::type, msg_start::u, action_elem_::u, UNUSE_BLACKLIST_T, USE_BLACKLIST_T, sip_uri::user, user, sip_msg::via1, and WHILE_T.

Referenced by cpl_proxy_to_loc_set(), cr_do_route(), ds_update_dst(), exec_str(), next_gw(), ops_pushto_avp(), rewrite_ruri(), run_action_list(), subst_user_f(), and update_new_uri().

int do_assign ( struct sip_msg msg,
struct action a 
)

execute assignment operation

Parameters:
msg SIP message
a assignment operation action
Returns:
1 on success, -1 on errors

Definition at line 211 of file action.c.

References BANDEQ_T, BOREQ_T, BXOREQ_T, COLONEQ_T, action_elem_::data, DIVEQ_T, action::elem, EQ_T, eval_expr(), _pv_value::flags, action::line, LM_ALERT, LM_ERR, MINUSEQ_T, MODULOEQ_T, MULTEQ_T, NULLV_ST, PLUSEQ_T, pv_is_w, pv_set_spec_value(), PV_VAL_INT, PV_VAL_STR, pv_value_destroy(), action::type, action_elem_::type, and action_elem_::u.

Referenced by do_action().

int run_action_list ( struct action a,
struct sip_msg msg 
)

Run a list of actions.

Parameters:
a exectuted list of actions
msg SIP message

Definition at line 140 of file action.c.

References ACT_FL_EXIT, ACT_FL_RETURN, action_flags, do_action(), E_UNSPEC, err_info_::eclass, error_rlist, ERROR_ROUTE, init_err_info(), is_route_type, LM_DBG, LOCAL_ROUTE, action::next, NULL, ONREPLY_ROUTE, route_type, run_actions(), and set_route_type.

Referenced by do_action(), eval_elem(), and run_actions().

static int run_actions ( struct action a,
struct sip_msg msg 
) [inline, static]

Run actions from a route.

Parameters:
a executed actions
msg SIP message
Returns:
0, or 1 on success, negative on error (0 if drop or break encountered, 1 if not)

Definition at line 101 of file action.c.

References ACT_FL_RETURN, action_flags, E_UNSPEC, LM_ERR, LM_WARN, rec_lev, ROUTE_MAX_REC_LEV, and run_action_list().

Referenced by do_action(), run_action_list(), and run_top_route().

int run_top_route ( struct action a,
struct sip_msg msg 
)

Run top (aka main) route from script.

Parameters:
a exectuted action
msg SIP message

Definition at line 179 of file action.c.

References action_flags, init_err_info(), rec_lev, reset_bl_markers(), resetsflag(), and run_actions().

Referenced by cpl_proxy_to_loc_set(), dlg_ontimeout(), pre_print_uac_request(), receive_msg(), reply_received(), run_failure_handlers(), and t_uac().


Variable Documentation

global error info

Definition at line 36 of file errinfo.c.

int action_flags = 0

Definition at line 85 of file action.c.

Referenced by do_action(), run_action_list(), run_actions(), and run_top_route().

int max_while_loops = 100

Definition at line 87 of file action.c.

Referenced by do_action().

int rec_lev = 0 [static]

Definition at line 89 of file action.c.

Referenced by eval_expr(), run_actions(), and run_top_route().

int return_code = 0

Definition at line 86 of file action.c.

Referenced by do_action(), and eval_elem().


Generated on Thu May 17 12:00:34 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6