'\" te .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved .TH sip_get_header 3SIP "09 Feb 2007" "SunOS 5.11" "Session Initiation Protocol Library Functions" .SH NAME sip_get_header \- get a SIP header from a message .SH SYNOPSIS .LP .nf \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lsip\fR [ \fIlibrary\fR ... ] #include \fBconst struct sip_header *\fR\fIsip_get_header\fR(\fBsip_msg_t\fR \fIsip_msg\fR, \fBchar *\fR\fIheader_name\fR, \fBsip_header_t\fR \fIold_header\fR, \fBint *\fR\fIerror\fR); .fi .SH DESCRIPTION .sp .LP The \fBsip_get_header()\fR function returns the header specified by \fIheader_name\fR (long or compact form) from the \fBSIP\fR message \fIsip_msg\fR. If \fIheader_name\fR is \fBNULL\fR, the first header in the \fBSIP\fR message is returned. The \fBold_header\fR, if non-null, specifies the starting position in \fIsip_msg\fR from which the search is started. Otherwise, the search begins at the start of the \fBSIP\fR message. For example, to get the first \fBVIA\fR header from the \fBSIP\fR message \fIsip_msg\fR: .sp .in +2 .nf via_hdr = sip_get_header(sip_msg, "VIA", NULL, &error); .fi .in -2 .sp .LP To get the next \fBVIA\fR header from \fIsip_msg\fR: .sp .in +2 .nf via_hdr = sip_get_header(sip_msg, "VIA", via_hdr, &error); .fi .in -2 .sp .LP The \fBsip_get_header()\fR function ignores any header that is marked as deleted. .SH RETURN VALUES .sp .LP On success, the \fBsip_get_header()\fR function returns the queried header. On failure, it returns \fBNULL\fR. .sp .LP The value of \fBerrno\fR is not changed by these calls in the event of an error. .SH ERRORS .sp .LP The following value may be returned: .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 10n .rt The \fIheader_name\fR specified in the \fBSIP\fR message is not present or has been deleted; or, the \fIheader_name\fR is not specified and there are no "un-deleted" headers in the \fBSIP\fR message. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelMT-Safe .TE .SH SEE ALSO .sp .LP \fBlibsip\fR(3LIB)