'\" te .\" Copyright (c) 2007 Sun Microsystems, Inc. All Rights Reserved .TH sip_create_response 3SIP "25 Jan 2007" "SunOS 5.11" "Session Initiation Protocol Library Functions" .SH NAME sip_create_response \- create a response for a SIP request .SH SYNOPSIS .LP .nf \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lsip\fR [ \fIlibrary\fR ... ] #include \fBsip_msg_t\fR \fIsip_create_response\fR(\fBsip_msg_t\fR \fIsip_request\fR, \fBint\fR \fIresponse_code\fR, \fBchar *\fR\fIresponse_phase\fR, \fBchar *\fR\fItotag\fR, \fBchar *\fR\fIcontact_uri\fR); .fi .SH DESCRIPTION .sp .LP The \fBsip_create_response()\fR function creates and returns a \fBSIP\fR message in response to the \fBSIP\fR request \fIsip_request\fR. The response line in the resulting \fBSIP\fR message is created using the response code in \fIresponse_code\fR and the phrase in \fIresponse_phrase\fR. The response line has the \fBSIP\fR-Version of "2.0". If a non-null \fItotag\fR is specified, the resulting \fBSIP\fR response has a \fBTO\fR header with a tag value from \fItotag\fR. If \fItotag\fR is null and the \fIresponse_code\fR is anything other than \fB100\fR (\fBTRYING\fR), \fBsip_create_response()\fR adds a \fBTO\fR header with a randomly generated tag value. If the \fIresponse_code\fR is \fB100\fR and \fItotag\fR is null, the \fBSIP\fR response has a \fBTO\fR header without a tag parameter. If \fIcontact_uri\fR is non-null, a \fBCONTACT\fR header is added to the \fBSIP\fR response with the \fBURI\fR specified in \fIcontact_uri\fR. The \fBSIP\fR response has the following headers copied from \fIsip_request\fR: .br .in +2 All \fBVIA\fR headers .in -2 .br .in +2 \fBFROM\fR header .in -2 .br .in +2 \fBTO\fR header (with tag added, if required, as stated above) .in -2 .br .in +2 \fBCALL-ID\fR header .in -2 .br .in +2 \fBCSEQ\fR header .in -2 .br .in +2 All \fBRECORD-ROUTE\fR headers .in -2 .SH RETURN VALUES .sp .LP The \fBsip_create_response()\fR function returns the resulting \fBSIP\fR message on success and \fBNULL\fR on failure. .sp .LP The value of \fBerrno\fR is not changed by these calls in the event of an error. .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)