Mon Sep 20 2010 00:35:11

Asterisk developer's documentation


Data Fields

sip_request Struct Reference

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

Collaboration diagram for sip_request:
Collaboration graph
[legend]

Data Fields

struct ast_strdata
char debug
char has_to_tag
ptrdiff_t header [SIP_MAX_HEADERS]
int headers
char ignore
int len
ptrdiff_t line [SIP_MAX_LINES]
int lines
int method
struct {
   struct sip_request *   next
next
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 1203 of file chan_sip.c.


Field Documentation

struct ast_str* data
char debug
char has_to_tag

non-zero if packet has To: tag

Definition at line 1213 of file chan_sip.c.

Referenced by find_call(), and handle_incoming().

ptrdiff_t header[SIP_MAX_HEADERS]
int headers
char ignore
int len

bytes used in data[], excluding trailing null terminator. Rarely used.

Definition at line 1206 of file chan_sip.c.

Referenced by _sip_tcp_helper_thread(), add_blank(), add_header(), add_line(), handle_request_cancel(), handle_request_do(), init_req(), init_resp(), send_request(), send_response(), and sipsock_read().

ptrdiff_t line[SIP_MAX_LINES]

Definition at line 1218 of file chan_sip.c.

Referenced by add_line(), and parse_request().

int lines
int method
struct sip_request* next

Definition at line 1222 of file chan_sip.c.

struct { ... } next
ptrdiff_t rlPart1

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

Definition at line 1204 of file chan_sip.c.

Referenced by determine_firstline_parts(), handle_incoming(), handle_request_do(), send_request(), and send_response().

ptrdiff_t rlPart2

Offset of the Request URI or Response Status

Definition at line 1205 of file chan_sip.c.

Referenced by determine_firstline_parts(), get_destination(), handle_incoming(), handle_request_do(), handle_request_invite(), reqprep(), and send_response().

unsigned int sdp_count

the number of lines of SDP

Definition at line 1211 of file chan_sip.c.

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

unsigned int sdp_start

the line number where the SDP begins

Definition at line 1210 of file chan_sip.c.

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


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