1sip_get_request_meStehsosdi(o3nSIIPn)itiation Protocol LibrarsyipF_ugnectt_iroenqsuest_method(3SIP)
2
3
4

NAME

6       sip_get_request_method, sip_get_response_code, sip_get_response_phrase,
7       sip_get_sip_version - obtain attributes from the start line  in  a  SIP
8       message
9

SYNOPSIS

11       cc [ flag ... ] file ... -lsip [ library ... ]
12       #include <sip.h>
13
14       sip_method_t sip_get_request_method(const sip_msg_t sip_msg,
15            int *error);
16
17
18       int sip_get_response_code(sip_msg_t sip_msg,
19            int *error);
20
21
22       const sip_str_t *sip_get_response_phrase(sip_msg_t sip_msg,
23            int *error);
24
25
26       const sip_str_t*sip_get_sip_version(sip_msg_t sip_msg,
27            int *error);
28
29

DESCRIPTION

31       For  functions  that  return  a pointer of type sip_str_t, sip_str_t is
32       supplied by:
33
34         typedef struct sip_str {
35              char *sip_str_ptr;
36              int  sip_str_len;
37         }sip_str_t;
38
39
40
41       The sip_str_ptr parameter points to the start of the returned value and
42       sip_str_len supplies the length of the returned value.
43
44
45       For  example, given the following request line in a SIP message sip_msg
46       that is input to sip_get_request_uri_str():
47
48         FROM : <Alice sip:alice@atlanta.com>;tag=1928301774
49
50
51
52       the return is a pointer to sip_str_t with the sip_str_ptr member point‐
53       ing  to  "A"  of  Alice  and  sip_str_len being set to 5, the length of
54       Alice.
55
56
57       Access functions for headers that can have  multiple  values  take  the
58       value  as  the input, while those that can have only one value take the
59       SIP message sip_msg as the input.
60
61
62       The sip_get_request_method() function will return the SIP  method  from
63       the  request line in the  SIP message sip_msg. The method can be one of
64       the following:
65         INVITE
66         ACK
67         OPTIONS
68         BYE
69         CANCEL
70         REGISTER
71         REFER
72         INFO
73         SUBSCRIBE
74         NOTIFY
75         PRACK
76         UNKNOWN
77
78
79       The sip_get_response_code() function  will  return  the  response  code
80       response from the request line in the  SIP message sip_msg.
81
82
83       The  sip_get_respose_phrase()  function will return the response phrase
84       response from the request line in the  SIP message sip_msg.
85
86
87       The sip_get_sip_version() function will return the version of  the  SIP
88       protocol  from  the  request  or  the  response line in the SIP message
89       sip_msg.
90

RETURN VALUES

92       For functions that return a pointer to sip_str_t, the return  value  is
93       the  specified value on success or NULL in case of error. For functions
94       that return an integer, the return value is the specified value on suc‐
95       cess and -1 on error.
96
97
98       The  value  of  errno  is not changed by these calls in the event of an
99       error.
100

ERRORS

102       These functions take a pointer to an integer error as an  argument.  If
103       the error is non-null, one of the following values is set:
104
105       EINVAL    The input SIP message sip_msg or the header value is null; or
106                 the specified header/header value is deleted.
107
108
109       EPROTO    The header value is not present or invalid. The parser  could
110                 not parse it correctly.
111
112
113       ENOMEM    There is an error allocating memory for the return value.
114
115
116
117       On success, the value of the location pointed to by error is set to 0.
118

ATTRIBUTES

120       See attributes(5) for descriptions of the following attributes:
121
122
123
124
125       ┌─────────────────────────────┬─────────────────────────────┐
126       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
127       ├─────────────────────────────┼─────────────────────────────┤
128       │Interface Stability          │Committed                    │
129       ├─────────────────────────────┼─────────────────────────────┤
130       │MT-Level                     │MT-Safe                      │
131       └─────────────────────────────┴─────────────────────────────┘
132

SEE ALSO

134       libsip(3LIB)
135
136
137
138SunOS 5.11                        25 Jan 2007     sip_get_request_method(3SIP)
Impressum