'\" te .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved .TH sip_add_request_line 3SIP "25 Jan 2007" "SunOS 5.11" "Session Initiation Protocol Library Functions" .SH NAME sip_add_request_line, sip_add_response_line \- add a request/response line to a SIP message .SH SYNOPSIS .LP .nf \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lsip\fR [ \fIlibrary\fR ... ] #include \fBint\fR \fBsip_add_request_line\fR(\fBsip_msg_t\fR \fIsip_request\fR, \fBsip_method_t\fR \fImethod\fR, \fBchar *\fR\fIrequest_uri\fR); .fi .LP .nf \fBint\fR \fIsip_add_response_line\fR(\fBsip_msg_t\fR \fIsip_response\fR, \fBint\fR \fIresponse_code\fR, \fBchar *\fR\fIresponse_phase\fR); .fi .SH DESCRIPTION .sp .LP The \fBsip_add_request_line()\fR function adds a request line to the \fBSIP\fR message \fIsip_request\fR. The request line is created using the \fBSIP\fR method specified in \fImethod\fR and the \fBURI\fR in \fIrequest_uri\fR. The \fBSIP\fR method can be one of the following: .br .in +2 \fBINVITE\fR .in -2 .br .in +2 \fBACK\fR .in -2 .br .in +2 \fBOPTIONS\fR .in -2 .br .in +2 \fBBYE\fR .in -2 .br .in +2 \fBCANCEL\fR .in -2 .br .in +2 \fBREGISTER\fR .in -2 .br .in +2 \fBREFER\fR .in -2 .br .in +2 \fBSUBSCRIBE\fR .in -2 .br .in +2 \fBNOTIFY\fR .in -2 .br .in +2 \fBPRACK\fR .in -2 .br .in +2 \fBINFO\fR .in -2 .sp .LP The resulting request line has the \fBSIP\fR-Version of "2.0". .sp .LP The \fBsip_add_response_line()\fR function adds a response line to the \fBSIP\fR message \fIsip_response\fR. The response line is created using the response code \fIresponse_code\fR and the phrase in \fIresponse_phrase\fR. If the \fIresponse_code\fR is one that is listed in RFC 3261, \fBsip_get_resp_desc()\fR can be used to get the response phase for the \fIresponse_code\fR. The resulting response line has the \fBSIP\fR-Version of "2.0". .SH RETURN VALUES .sp .LP The \fBsip_add_response_line()\fR and \fBsip_add_request_line()\fR functions return \fB0\fR on success and the appropriate error value in case of failure. .sp .LP The value of \fBerrno\fR is not changed by these calls in the event of an error. .SH ERRORS .sp .LP On failure, the \fBsip_add_response_line()\fR and \fBsip_add_request_line()\fR functions could return one of the following errors: .sp .ne 2 .mk .na \fBEINVAL\fR .ad .RS 11n .rt If mandatory input is not provided or if the input is invalid. .RE .sp .ne 2 .mk .na \fBENOTSUP\fR .ad .RS 11n .rt If the input \fBSIP\fR message cannot be modified. .RE .sp .ne 2 .mk .na \fBENOMEM\fR .ad .RS 11n .rt If memory allocation fails when creating the request/response line or when creating headers in the \fBACK\fR request. .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)