Thu Jul 9 13:41:42 2009

Asterisk developer's documentation


sip_request Struct Reference

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


Data Fields

char data [SIP_MAX_PACKET]
char debug
char has_to_tag
char * header [SIP_MAX_HEADERS]
int headers
char ignore
int len
char * line [SIP_MAX_LINES]
int lines
int method
struct {
   sip_request *   next
next
char * rlPart1
char * rlPart2
unsigned int sdp_end
unsigned int sdp_start
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 814 of file chan_sip.c.


Field Documentation

char data[SIP_MAX_PACKET]

Definition at line 828 of file chan_sip.c.

Referenced by _sip_tcp_helper_thread(), add_blank(), add_header(), add_line(), handle_request_do(), parse_copy(), parse_request(), process_sdp(), send_request(), and send_response().

char debug

print extra debugging if non zero

Definition at line 823 of file chan_sip.c.

Referenced by _sip_tcp_helper_thread(), handle_incoming(), handle_request_do(), handle_request_message(), handle_request_refer(), handle_request_subscribe(), handle_response(), initialize_initreq(), and sip_sendtext().

char has_to_tag

non-zero if packet has To: tag

Definition at line 824 of file chan_sip.c.

Referenced by handle_incoming().

char* header[SIP_MAX_HEADERS]

Definition at line 826 of file chan_sip.c.

Referenced by __get_header(), add_header(), determine_firstline_parts(), func_header_read(), handle_incoming(), and parse_request().

int headers

# of SIP Headers

Definition at line 818 of file chan_sip.c.

Referenced by __get_header(), add_header(), create_addr_from_peer(), handle_incoming(), handle_request_do(), handle_request_invite(), handle_request_subscribe(), initialize_initreq(), parse_request(), transmit_invite(), transmit_notify_with_mwi(), transmit_notify_with_sipfrag(), transmit_refer(), transmit_register(), and transmit_sip_request().

char ignore

if non-zero This is a re-transmit, ignore it

Definition at line 825 of file chan_sip.c.

Referenced by _sip_tcp_helper_thread(), check_auth(), check_peer_ok(), check_user_ok(), handle_incoming(), handle_invite_replaces(), handle_request_bye(), handle_request_invite(), handle_request_message(), handle_request_refer(), handle_request_subscribe(), handle_response(), handle_response_invite(), register_verify(), transmit_fake_auth_response(), and transmit_response_reliable().

int len

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

Definition at line 817 of file chan_sip.c.

Referenced by _sip_tcp_helper_thread(), add_blank(), add_header(), add_line(), handle_request_do(), method_match(), parse_copy(), send_request(), and send_response().

char* line[SIP_MAX_LINES]

Definition at line 827 of file chan_sip.c.

Referenced by add_line(), find_sdp(), get_body(), get_msg_text(), get_sdp_iterate(), and parse_request().

int lines

Body Content

Definition at line 820 of file chan_sip.c.

Referenced by add_blank(), add_header(), add_line(), find_sdp(), get_body(), get_msg_text(), handle_request_do(), initialize_initreq(), and transmit_register().

int method

Method of this request

Definition at line 819 of file chan_sip.c.

Referenced by __sip_pretend_ack(), find_call(), get_destination(), handle_incoming(), handle_request_bye(), handle_request_do(), handle_request_invite(), handle_request_register(), handle_request_subscribe(), initialize_initreq(), send_request(), send_response(), and transmit_invite().

struct { ... } next

struct sip_request* next

Definition at line 831 of file chan_sip.c.

Referenced by __sip_destroy(), parse_sip_options(), process_request_queue(), and queue_request().

char* rlPart1

SIP Method Name or "SIP/2.0" protocol version

Definition at line 815 of file chan_sip.c.

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

char* rlPart2

The Request URI or Response Status

Definition at line 816 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_end

the line number where the SDP ends

Definition at line 822 of file chan_sip.c.

Referenced by find_sdp().

unsigned int sdp_start

the line number where the SDP begins

Definition at line 821 of file chan_sip.c.

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

struct sip_socket socket

The socket used for this request

Definition at line 830 of file chan_sip.c.

Referenced by _sip_tcp_helper_thread(), handle_request_do(), parse_register_contact(), set_socket_transport(), sip_alloc(), and transmit_response_using_temp().


The documentation for this struct was generated from the following file:
Generated on Thu Jul 9 13:41:42 2009 for Asterisk - the Open Source PBX by  doxygen 1.4.7