Commit 8fe82e74 authored by Pekka Pessi's avatar Pekka Pessi

Removed sip_complete_response().

darcs-hash:20051107183436-65a35-63188d6b9b0ac665017d01327011cc310caa562c.gz
parent 73da86f7
......@@ -554,50 +554,3 @@ int sip_complete_message(msg_t *msg)
return 0;
}
/** Add headers from the request to the response message. */
int sip_complete_response(msg_t *msg,
int status, char const *phrase,
sip_t const *request)
{
su_home_t *home = msg_home(msg);
sip_t *sip = msg_object(msg);
int incomplete = 0;
if (!sip || !request || !request->sip_request)
return -1;
if (!sip->sip_status)
sip->sip_status = sip_status_create(home, status, phrase, NULL);
if (!sip->sip_via)
sip->sip_via = sip_via_dup(home, request->sip_via);
if (!sip->sip_from)
sip->sip_from = sip_from_dup(home, request->sip_from);
if (!sip->sip_to)
sip->sip_to = sip_to_dup(home, request->sip_to);
if (!sip->sip_call_id)
sip->sip_call_id = sip_call_id_dup(home, request->sip_call_id);
if (!sip->sip_cseq)
sip->sip_cseq = sip_cseq_dup(home, request->sip_cseq);
if (!sip->sip_record_route && request->sip_record_route)
sip_add_dup(msg, sip, (void*)request->sip_record_route);
incomplete = sip_complete_message(msg) < 0;
sip_serialize(msg, sip);
if (incomplete ||
!sip->sip_status ||
!sip->sip_via ||
!sip->sip_from ||
!sip->sip_to ||
!sip->sip_call_id ||
!sip->sip_cseq ||
!sip->sip_content_length ||
!sip->sip_separator ||
(request->sip_record_route && !sip->sip_record_route))
return -1;
return 0;
}
......@@ -76,13 +76,6 @@ url_t *sip_url_dup(su_home_t *sh, url_t const *o);
int sip_addr_match(sip_addr_t const *a, sip_addr_t const *b);
/** Complete a SIP response with status line and headers from @a request. */
int sip_complete_response(msg_t *msg,
int status, char const *phrase,
sip_t const *request);
#define sip_message_complete sip_complete_message
/* ----------------------------------------------------------------------
* Header-specific functions below
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment