1sip_get_header(3SISPe)ssion Initiation Protocol Library Functisoinps_get_header(3SIP)
2
3
4
6 sip_get_header - get a SIP header from a message
7
9 cc [ flag ... ] file ... -lsip [ library ... ]
10 #include <sip.h>
11
12 const struct sip_header *sip_get_header(sip_msg_t sip_msg,
13 char *header_name, sip_header_t old_header, int *error);
14
15
17 The sip_get_header() function returns the header specified by
18 header_name (long or compact form) from the SIP message sip_msg. If
19 header_name is NULL, the first header in the SIP message is returned.
20 The old_header, if non-null, specifies the starting position in sip_msg
21 from which the search is started. Otherwise, the search begins at the
22 start of the SIP message. For example, to get the first VIA header from
23 the SIP message sip_msg:
24
25 via_hdr = sip_get_header(sip_msg, "VIA", NULL, &error);
26
27
28
29 To get the next VIA header from sip_msg:
30
31 via_hdr = sip_get_header(sip_msg, "VIA", via_hdr, &error);
32
33
34
35 The sip_get_header() function ignores any header that is marked as
36 deleted.
37
39 On success, the sip_get_header() function returns the queried header.
40 On failure, it returns NULL.
41
42
43 The value of errno is not changed by these calls in the event of an
44 error.
45
47 The following value may be returned:
48
49 EINVAL The header_name specified in the SIP message is not present
50 or has been deleted; or, the header_name is not specified and
51 there are no "un-deleted" headers in the SIP message.
52
53
55 See attributes(5) for descriptions of the following attributes:
56
57
58
59
60 ┌─────────────────────────────┬─────────────────────────────┐
61 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
62 ├─────────────────────────────┼─────────────────────────────┤
63 │Interface Stability │Committed │
64 ├─────────────────────────────┼─────────────────────────────┤
65 │MT-Level │MT-Safe │
66 └─────────────────────────────┴─────────────────────────────┘
67
69 libsip(3LIB)
70
71
72
73SunOS 5.11 09 Feb 2007 sip_get_header(3SIP)