#include <osp/osp.h>#include <osp/ospb64.h>#include "../../forward.h"#include "../../parser/parse_from.h"#include "../../parser/parse_rpid.h"#include "../../parser/parse_rr.h"#include "../../parser/parse_uri.h"#include "../../data_lump.h"#include "../../mem/mem.h"#include "osp_mod.h"#include "sipheader.h"

Go to the source code of this file.
Functions | |
| int | ospAddOspHeader (struct sip_msg *msg, unsigned char *token, unsigned int tokensize) |
| static int | ospAppendHeader (struct sip_msg *msg, str *header) |
| void | ospCopyStrToBuffer (str *source, char *buffer, int buffersize) |
| int | ospGetCallId (struct sip_msg *msg, OSPTCALLID **callid) |
| int | ospGetFromUserpart (struct sip_msg *msg, char *fromuser, int buffersize) |
| void | ospGetNextHop (struct sip_msg *msg, char *nexthop, int buffersize) |
| int | ospGetOspHeader (struct sip_msg *msg, unsigned char *token, unsigned int *tokensize) |
| int | ospGetRouteParameters (struct sip_msg *msg, char *routeparameters, int buffersize) |
| int | ospGetRpidUserpart (struct sip_msg *msg, char *rpiduser, int buffersize) |
| int | ospGetSourceAddress (struct sip_msg *msg, char *sourceaddress, int buffersize) |
| int | ospGetToUserpart (struct sip_msg *msg, char *touser, int buffersize) |
| int | ospGetUriUserpart (struct sip_msg *msg, char *uriuser, int buffersize) |
| int | ospRebuildDestionationUri (str *newuri, char *called, char *dest, char *port, int format) |
| static void | ospSkipPlus (char *e164) |
Variables | |
| int | _osp_use_rpid |
| int ospAddOspHeader | ( | struct sip_msg * | msg, | |
| unsigned char * | token, | |||
| unsigned int | tokensize | |||
| ) |
Definition at line 286 of file sipheader.c.
References _str::len, LM_DBG, LM_ERR, OSP_HEADERBUF_SIZE, OSP_TOKEN_HEADER, OSP_TOKENBUF_SIZE, ospAppendHeader(), _str::s, and snprintf.
Referenced by ospPrepareDestination().
Definition at line 239 of file sipheader.c.
References anchor_lump(), sip_msg::buf, HDR_EOH_F, insert_new_lump_before(), _str::len, LM_ERR, parse_headers(), pkg_free, pkg_malloc, _str::s, s, and sip_msg::unparsed.
Referenced by ospAddOspHeader().
| void ospCopyStrToBuffer | ( | str * | source, | |
| char * | buffer, | |||
| int | buffersize | |||
| ) |
Definition at line 54 of file sipheader.c.
References _str::len, LM_ERR, and _str::s.
Referenced by ospGetFromUserpart(), ospGetNextHop(), ospGetRouteParameters(), ospGetRpidUserpart(), ospGetSourceAddress(), ospGetToUserpart(), and ospGetUriUserpart().
| int ospGetCallId | ( | struct sip_msg * | msg, | |
| OSPTCALLID ** | callid | |||
| ) |
Definition at line 405 of file sipheader.c.
References hdr_field::body, sip_msg::callid, _str::len, LM_ERR, NULL, and _str::s.
Referenced by ospReportUsage(), ospRequestRouting(), and ospValidateHeader().
| int ospGetFromUserpart | ( | struct sip_msg * | msg, | |
| char * | fromuser, | |||
| int | buffersize | |||
| ) |
Definition at line 95 of file sipheader.c.
References sip_msg::from, get_from, _str::len, LM_ERR, NULL, ospCopyStrToBuffer(), ospSkipPlus(), parse_from_header(), parse_uri(), _str::s, to_body::uri, and sip_uri::user.
Referenced by ospReportUsageFromCookie(), ospRequestRouting(), ospSetRpid(), and ospValidateHeader().
| void ospGetNextHop | ( | struct sip_msg * | msg, | |
| char * | nexthop, | |||
| int | buffersize | |||
| ) |
Definition at line 581 of file sipheader.c.
References check_self(), HDR_ROUTE_T, sip_msg::headers, sip_uri::host, _str::len, LM_DBG, LM_ERR, hdr_field::next, ospCopyStrToBuffer(), parse_uri(), hdr_field::parsed, sip_msg::parsed_uri, sip_uri::port_no, PROTO_NONE, _str::s, SIP_PORT, and hdr_field::type.
Referenced by ospReportUsageFromCookie().
| int ospGetOspHeader | ( | struct sip_msg * | msg, | |
| unsigned char * | token, | |||
| unsigned int * | tokensize | |||
| ) |
Definition at line 334 of file sipheader.c.
References hdr_field::body, HDR_EOH_F, HDR_OTHER_T, sip_msg::headers, _str::len, LM_ERR, hdr_field::name, hdr_field::next, OSP_HEADER_SIZE, OSP_TOKEN_HEADER, parse_headers(), _str::s, and hdr_field::type.
Referenced by ospCheckHeader(), and ospValidateHeader().
| int ospGetRouteParameters | ( | struct sip_msg * | msg, | |
| char * | routeparameters, | |||
| int | buffersize | |||
| ) |
Definition at line 434 of file sipheader.c.
References check_self(), sip_uri::host, _str::len, LM_DBG, LM_ERR, rr::nameaddr, ospCopyStrToBuffer(), sip_uri::params, parse_uri(), hdr_field::parsed, sip_msg::parsed_uri, sip_uri::port_no, PROTO_NONE, sip_msg::route, _str::s, SIP_PORT, and name_addr::uri.
Referenced by ospReportUsage().
| int ospGetRpidUserpart | ( | struct sip_msg * | msg, | |
| char * | rpiduser, | |||
| int | buffersize | |||
| ) |
Definition at line 133 of file sipheader.c.
References _osp_use_rpid, get_rpid, _str::len, LM_DBG, LM_ERR, NULL, ospCopyStrToBuffer(), ospSkipPlus(), parse_rpid_header(), parse_uri(), sip_msg::rpid, _str::s, to_body::uri, and sip_uri::user.
Referenced by ospRequestRouting(), ospSetRpid(), and ospValidateHeader().
| int ospGetSourceAddress | ( | struct sip_msg * | msg, | |
| char * | sourceaddress, | |||
| int | buffersize | |||
| ) |
Definition at line 370 of file sipheader.c.
References HDR_VIA_T, sip_msg::headers, via_body::host, LM_DBG, hdr_field::next, ospCopyStrToBuffer(), hdr_field::parsed, and hdr_field::type.
Referenced by ospReportUsageFromCookie(), ospRequestRouting(), and ospValidateHeader().
| int ospGetToUserpart | ( | struct sip_msg * | msg, | |
| char * | touser, | |||
| int | buffersize | |||
| ) |
Definition at line 175 of file sipheader.c.
References get_to, HDR_TO_F, _str::len, LM_ERR, NULL, ospCopyStrToBuffer(), ospSkipPlus(), parse_headers(), parse_uri(), _str::s, sip_msg::to, to_body::uri, and sip_uri::user.
Referenced by ospReportUsageFromCookie(), ospRequestRouting(), and ospValidateHeader().
| int ospGetUriUserpart | ( | struct sip_msg * | msg, | |
| char * | uriuser, | |||
| int | buffersize | |||
| ) |
Definition at line 213 of file sipheader.c.
References LM_ERR, ospCopyStrToBuffer(), ospSkipPlus(), parse_sip_msg_uri(), sip_msg::parsed_uri, and sip_uri::user.
Referenced by ospRequestRouting(), and ospValidateHeader().
| int ospRebuildDestionationUri | ( | str * | newuri, | |
| char * | called, | |||
| char * | dest, | |||
| char * | port, | |||
| int | format | |||
| ) |
Definition at line 487 of file sipheader.c.
References _str::len, LM_DBG, LM_ERR, NULL, pkg_malloc, and _str::s.
Referenced by ospPrepareDestination().
| static void ospSkipPlus | ( | char * | e164 | ) | [static] |
Definition at line 79 of file sipheader.c.
Referenced by ospGetFromUserpart(), ospGetRpidUserpart(), ospGetToUserpart(), and ospGetUriUserpart().
| int _osp_use_rpid |
Definition at line 58 of file globals.c.
Referenced by ospDumpParameters(), and ospGetRpidUserpart().
1.5.6