#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <sys/uio.h>
#include <unistd.h>
#include <sys/un.h>
#include <ctype.h>
#include "../../str.h"
#include "../../ut.h"
#include "../../dprint.h"
#include "../../pvar.h"
#include "../../mem/mem.h"
#include "../../parser/parser_f.h"
#include "../../parser/parse_from.h"
#include "../../parser/parse_rr.h"
#include "../../parser/contact/parse_contact.h"
#include "../../tsend.h"
#include "t_lookup.h"
#include "t_fwd.h"
#include "t_fifo.h"

Go to the source code of this file.
Data Structures | |
| struct | append_elem |
| struct | tw_append |
| struct | tw_info |
Defines | |
| #define | AF_LOCAL AF_UNIX |
| #define | APPEND_BUFFER_MAX 4096 |
| #define | CMD_BUFFER_MAX 128 |
| #define | copy_route(s, len, rs, rlen) |
| #define | eol_line(_i_) ( lines_eol[2*(_i_)] ) |
| #define | IDBUF_LEN 128 |
| #define | PF_LOCAL PF_UNIX |
| #define | ROUTE_BUFFER_MAX 512 |
| #define | SUN_LEN(sa) |
| #define | TWRITE_PARAMS 20 |
| #define | TWRITE_VERSION_LEN (sizeof(TWRITE_VERSION_S)-1) |
| #define | TWRITE_VERSION_S "0.3" |
Functions | |
| static char * | add2buf (char *buf, char *end, str *name, str *value) |
| static char * | append2buf (char *buf, int len, struct sip_msg *req, struct append_elem *elem) |
| static int | assemble_msg (struct sip_msg *msg, struct tw_info *twi) |
| Assemble a message. | |
| int | fixup_t_write (void **param, int param_no) |
| int | init_twrite_lines (void) |
| int | init_twrite_sock (void) |
| int | parse_tw_append (modparam_t type, void *val) |
| tw_append syntax: tw_append = name:element[;element] element = (title=pseudo_variable) | msg(body) | |
| static struct tw_append * | search_tw_append (char *name, int len) |
| int | t_write_req (struct sip_msg *msg, char *vm_fifo, char *info) |
| int | t_write_unix (struct sip_msg *msg, char *socket, char *info) |
| static int | write_to_fifo (char *fifo, int cnt) |
| static int | write_to_unixsock (char *sockname, int cnt) |
Variables | |
| static str | eol = {"\n",1} |
| static str | lines_eol [2 *TWRITE_PARAMS] |
| static int | sock |
| int | tm_unix_tx_timeout = 2 |
| static struct tw_append * | tw_appends |
Definition in file t_fifo.c.
| #define APPEND_BUFFER_MAX 4096 |
| #define CMD_BUFFER_MAX 128 |
| #define eol_line | ( | _i_ | ) | ( lines_eol[2*(_i_)] ) |
| #define IDBUF_LEN 128 |
| #define ROUTE_BUFFER_MAX 512 |
| #define SUN_LEN | ( | sa | ) |
| #define TWRITE_PARAMS 20 |
Definition at line 83 of file t_fifo.c.
Referenced by init_twrite_lines(), t_write_req(), and t_write_unix().
| #define TWRITE_VERSION_LEN (sizeof(TWRITE_VERSION_S)-1) |
| #define TWRITE_VERSION_S "0.3" |
Definition at line 421 of file t_fifo.c.
References _str::len, and _str::s.
Referenced by append2buf().
| static char* append2buf | ( | char * | buf, | |
| int | len, | |||
| struct sip_msg * | req, | |||
| struct append_elem * | elem | |||
| ) | [inline, static] |
Definition at line 437 of file t_fifo.c.
References add2buf(), _pv_value::flags, _str::len, LM_ERR, append_elem::name, append_elem::next, pv_get_spec_value(), PV_VAL_NULL, _pv_value::rs, _str::s, and append_elem::spec.
Referenced by assemble_msg().
Assemble a message.
Assemble a message A return code of 0 would lead to immediate script exit -- -1 return value means 'false' to script processing
Definition at line 478 of file t_fifo.c.
References tw_info::action, tw_append::add_body, socket_info::address_str, tw_info::append, append2buf(), APPEND_BUFFER_MAX, append_chr, append_str, receive_info::bind_address, hdr_field::body, sip_msg::buf, sip_msg::callid, cb, CLASS_URI, CMD_BUFFER_MAX, sip_msg::contact, contact_body::contacts, copy_route, receive_info::dst_port, tw_append::elems, eol_line, find_not_quoted(), sip_msg::first_line, sip_msg::from, get_body(), get_cseq, get_from, GET_RURI, get_to, HDR_EOH_F, HDR_RECORDROUTE_T, sip_uri::host, IDBUF_LEN, int2reverse_hex(), int2str(), len, sip_msg::len, _str::len, LM_DBG, LM_ERR, uri_hooks::lr, METHOD_INVITE, sip_msg::msg_flags, rr::nameaddr, rr::next, hdr_field::next, rr::params, parse_contact(), parse_from_header(), parse_headers(), parse_nameaddr(), parse_params(), parse_rr(), parse_sip_msg_uri(), hdr_field::parsed, sip_msg::parsed_uri, sip_msg::parsed_uri_ok, socket_info::port_no_str, sip_msg::rcv, sip_msg::record_route, record_route(), REQ_LINE, ROUTE_BUFFER_MAX, _str::s, s, SIP_PORT, SIP_REQUEST, t_get_trans_ident(), sip_msg::to, hdr_field::type, msg_start::type, param_hooks::uri, name_addr::uri, contact::uri, and sip_uri::user.
Referenced by t_write_req(), and t_write_unix().
| int fixup_t_write | ( | void ** | param, | |
| int | param_no | |||
| ) |
Definition at line 293 of file t_fifo.c.
References tw_info::action, tw_info::append, E_CFG, E_OUT_OF_MEM, _str::len, LM_ERR, pkg_malloc, _str::s, s, and search_tw_append().
| int init_twrite_lines | ( | void | ) |
Definition at line 363 of file t_fifo.c.
References eol_line, _str::len, _str::s, TWRITE_PARAMS, TWRITE_VERSION_LEN, and TWRITE_VERSION_S.
Referenced by mod_init().
| int init_twrite_sock | ( | void | ) |
| int parse_tw_append | ( | modparam_t | type, | |
| void * | val | |||
| ) |
tw_append syntax: tw_append = name:element[;element] element = (title=pseudo_variable) | msg(body)
Definition at line 139 of file t_fifo.c.
References tw_append::add_body, tw_append::elems, _str::len, LM_ERR, append_elem::name, tw_append::name, append_elem::next, tw_append::next, pkg_malloc, pv_parse_spec(), PVT_MSG_BODY, _str::s, s, append_elem::spec, and _pv_spec::type.
| static struct tw_append* search_tw_append | ( | char * | name, | |
| int | len | |||
| ) | [static, read] |
Definition at line 282 of file t_fifo.c.
References _str::len, tw_append::name, tw_append::next, and _str::s.
Referenced by fixup_t_write().
| int t_write_req | ( | struct sip_msg * | msg, | |
| char * | vm_fifo, | |||
| char * | info | |||
| ) |
Definition at line 762 of file t_fifo.c.
References add_blind_uac(), assemble_msg(), LM_ERR, TWRITE_PARAMS, and write_to_fifo().
| int t_write_unix | ( | struct sip_msg * | msg, | |
| char * | socket, | |||
| char * | info | |||
| ) |
Definition at line 784 of file t_fifo.c.
References add_blind_uac(), assemble_msg(), LM_ERR, TWRITE_PARAMS, and write_to_unixsock().
| static int write_to_fifo | ( | char * | fifo, | |
| int | cnt | |||
| ) | [inline, static] |
Definition at line 383 of file t_fifo.c.
References LM_DBG, and LM_ERR.
Referenced by t_write_req().
| static int write_to_unixsock | ( | char * | sockname, | |
| int | cnt | |||
| ) | [static] |
Definition at line 710 of file t_fifo.c.
References E_UNSPEC, len, LM_ERR, PF_LOCAL, sock, SUN_LEN, tm_unix_tx_timeout, and tsend_dgram_ev().
Referenced by t_write_unix().
int sock [static] |
Definition at line 111 of file t_fifo.c.
Referenced by create_socket_info(), get_all_db_ucontacts(), get_sock_hdr(), init_twrite_sock(), mi_tm_uac_dlg(), new_as_connect(), serve_stats(), t_load_contacts(), t_next_contacts(), write_to_unixsock(), and xj_jcon_connect().
| int tm_unix_tx_timeout = 2 |
struct tw_append* tw_appends [static] |
1.5.6