Asterisk - The Open Source Telephony Project  18.5.0
Data Fields
sip_request Struct Reference

sip_request: The data grabbed from the UDP socket More...

#include <sip.h>

Collaboration diagram for sip_request:
Collaboration graph
[legend]

Data Fields

char authenticated
 
struct ast_strcontent
 
struct ast_strdata
 
char debug
 
char has_to_tag
 
ptrdiff_t header [SIP_MAX_HEADERS]
 
int headers
 
char ignore
 
ptrdiff_t line [SIP_MAX_LINES]
 
int lines
 
int method
 
struct {
   struct sip_request *   next
 
next
 
unsigned int reqsipoptions
 
ptrdiff_t rlpart1
 
ptrdiff_t rlpart2
 
unsigned int sdp_count
 
unsigned int sdp_start
 
struct sip_socket socket
 

Detailed Description

sip_request: The data grabbed from the UDP socket

* Incoming messages: we first store the data from the socket in data[],
* adding a trailing \0 to make string parsing routines happy.
* Then call parse_request() and req.method = find_sip_method();
* to initialize the other fields. The \r\n at the end of each line is
* replaced by \0, so that data[] is not a conforming SIP message anymore.
* After this processing, rlpart1 is set to non-NULL to remember
* that we can run get_header() on this kind of packet.
*
* parse_request() splits the first line as follows:
* Requests have in the first line      method uri SIP/2.0
*      rlpart1 = method; rlpart2 = uri;
* Responses have in the first line     SIP/2.0 NNN description
*      rlpart1 = SIP/2.0; rlpart2 = NNN + description;
*
* For outgoing packets, we initialize the fields with init_req() or init_resp()
* (which fills the first line to "METHOD uri SIP/2.0" or "SIP/2.0 code text"),
* and then fill the rest with add_header() and add_line().
* The \r\n at the end of the line are still there, so the get_header()
* and similar functions don't work on these packets.
* 

Definition at line 829 of file sip.h.

Field Documentation

◆ authenticated

char authenticated

non-zero if this request was authenticated

Definition at line 840 of file sip.h.

Referenced by _sip_tcp_helper_thread(), handle_request_do(), handle_request_invite(), and handle_request_register().

◆ content

struct ast_str* content

Definition at line 844 of file sip.h.

Referenced by add_content(), copy_request(), deinit_req(), finalize_content(), init_req(), and init_resp().

◆ data

struct ast_str* data

◆ debug

char debug

◆ has_to_tag

char has_to_tag

non-zero if packet has To: tag

Definition at line 838 of file sip.h.

Referenced by __find_call(), and handle_incoming().

◆ header

ptrdiff_t header[SIP_MAX_HEADERS]

Array of offsets into the request string of each SIP header

Definition at line 841 of file sip.h.

Referenced by add_header(), init_req(), init_resp(), and parse_request().

◆ headers

int headers

◆ ignore

char ignore

◆ line

ptrdiff_t line[SIP_MAX_LINES]

Array of offsets into the request string of each SDP line

Definition at line 842 of file sip.h.

Referenced by parse_request().

◆ lines

int lines

◆ method

int method

◆ next [1/2]

struct sip_request* next

Definition at line 847 of file sip.h.

◆ next [2/2]

struct { ... } next

◆ reqsipoptions

unsigned int reqsipoptions

Items needed for Required header in responses

Definition at line 848 of file sip.h.

Referenced by add_required_respheader(), and respprep().

◆ rlpart1

ptrdiff_t rlpart1

Offset of the SIP Method Name or "SIP/2.0" protocol version

Definition at line 830 of file sip.h.

Referenced by determine_firstline_parts().

◆ rlpart2

ptrdiff_t rlpart2

Offset of the Request URI or Response Status

Definition at line 831 of file sip.h.

Referenced by determine_firstline_parts(), and get_destination().

◆ sdp_count

unsigned int sdp_count

the number of lines of SDP

Definition at line 836 of file sip.h.

Referenced by find_sdp(), get_sdp_iterate(), and get_sdp_line().

◆ sdp_start

unsigned int sdp_start

the line number where the SDP begins

Definition at line 835 of file sip.h.

Referenced by find_sdp(), get_sdp_iterate(), get_sdp_line(), and process_sdp().

◆ socket

struct sip_socket socket

The documentation for this struct was generated from the following file: