SIP-router core ::Module: SIP-router core. More...
#include <sys/types.h>#include <sys/socket.h>#include <netdb.h>#include <string.h>#include <stdio.h>#include <stdlib.h>#include "comp_defs.h"#include "msg_translator.h"#include "globals.h"#include "error.h"#include "mem/mem.h"#include "dprint.h"#include "config.h"#include "md5utils.h"#include "data_lump.h"#include "data_lump_rpl.h"#include "ip_addr.h"#include "resolve.h"#include "ut.h"#include "pt.h"#include "cfg/cfg.h"#include "parser/parse_to.h"#include "forward.h"
Go to the source code of this file.
Definition in file msg_translator.c.
| char* build_req_buf_from_sip_req | ( | struct sip_msg * | msg, | |
| unsigned int * | returned_len, | |||
| struct dest_info * | send_info, | |||
| unsigned int | mode | |||
| ) |
Side-effects: - it adds lumps to the msg which are _not_ cleaned. The added lumps are HDR_VIA_T (almost always added), HDR_CONTENLENGTH_T and HDR_ROUTE_T (when a Route: header is added as a result of a non-null msg->path_vec).
Uses also global_req_flags ( OR'ed with msg->msg_flags, see send_info below).
| msg | - sip message structure, complete with lumps | |
| returned_len | - result length (filled in) | |
| send_info | - dest_info structure (value/result), contains where the packet will be sent to (it's needed for building a correct via, fill RR lumps a.s.o.). If MTU based protocol fall-back is enabled (see flags below), send_info->proto might be updated with the new protocol. msg->msg_flags used:
| |
| mode | - flags for building the message, can be a combination of: * BUILD_NO_LOCAL_VIA - don't add a local via * BUILD_NO_VIA1_UPDATE - don't update first via (rport, received a.s.o) * BUILD_NO_PATH - don't add a Route: header with the msg->path_vec content. * BUILD_IN_SHM - build the result in shm memory |
Definition at line 1586 of file msg_translator.c.
References sip_msg::add_rm, sip_msg::add_to_branch_s, anchor_lump(), sip_msg::body_lumps, sip_msg::buf, sip_msg::first_line, FL_FORCE_RPORT, global_req_flags, HDR_ROUTE_T, HDR_VIA_T, sip_msg::headers, _str::len, sip_msg::len, sip_msg::msg_flags, hdr_field::name, sip_msg::new_uri, _str::s, and sip_msg::via1.

cfg framework fixup
It should be called from the configuration framework.
Definition at line 164 of file msg_translator.c.
References global_req_flags.
1.7.1