sip_tag_class.c File Reference


Detailed Description

SIP Tag classes.

Author:
Pekka Pessi <Pekka.Pessi@nokia-email.address.hidden>.
Date:
Created: Fri Feb 23 12:46:42 2001 ppessi

#include "config.h"
#include "sofia-sip/sip_parser.h"
#include <sofia-sip/su_tag_class.h>
#include <sofia-sip/su_tag_inline.h>
#include <sofia-sip/sip_tag_class.h>
#include <sofia-sip/sip_tag.h>
#include <sofia-sip/su_tagarg.h>
#include <sofia-sip/su_strlst.h>
#include <ctype.h>
#include <assert.h>
#include <stddef.h>
#include <string.h>
#include <limits.h>

Include dependency graph for sip_tag_class.c:

Functions

tagi_tsiptag_filter (tagi_t *dst, tagi_t const f[], tagi_t const *src, void **bb)
 Filter a for SIP header tag.
int sip_add_tl (msg_t *msg, sip_t *sip, tag_type_t tag, tag_value_t value,...)
 Add duplicates of headers from taglist to the SIP message.
int sip_add_tagis (msg_t *msg, sip_t *sip, tagi_t const **inout_list)
 Add duplicates of headers from taglist to the SIP message.
char * sip_headers_as_url_query (su_home_t *home, tag_type_t tag, tag_value_t value,...)
 Convert headers from taglist as URL query.
tagi_tsip_url_query_as_taglist (su_home_t *home, char const *query, msg_mclass_t const *parser)
 Convert URL query to a tag list.

Variables

tag_class_t siphdrtag_class [1]
 Tag class for SIP headers.
tag_class_t sipstrtag_class [1]
 Tag class for string values of SIP headers.
tag_class_t sipmsgtag_class [1]
 Tag class for SIP message.


Function Documentation

char* sip_headers_as_url_query ( su_home_t *  home,
tag_type_t  tag,
tag_value_t  value,
  ... 
)

Convert headers from taglist as URL query.

The SIP URI can contain a query part separated with the "?", which specifies SIP headers that are included in the request constructed from the URI. For example, using URI

 <sip:example.com?subject=test>
 would include @Subject header with value "test" in the request.

 @param home memory home used to allocate query string (if NULL, use malloc)
 @param tag, value, ... list of tagged arguments

 @bug This function returns NULL if SIPTAG_REQUEST(), SIPTAG_STATUS(),
 SIPTAG_HEADER(), SIPTAG_UNKNOWN(), SIPTAG_ERROR(), SIPTAG_SEPARATOR(), or
 any corresponding string tag is included in the tag list. It ignores
 SIPTAG_SIP().

 @par Example
 @code
 url->url_headers = 
   sip_headers_as_url_query(home, SIPTAG_REPLACES(replaces), TAG_END());

Since:
New in 1.12.4.
See also:
url_query_as_header_string(), sip_url_query_as_taglist(), nta_msg_request_complete(), RFC 3261 section 19.1.1 "Headers", url_t, url_s::url_headers

tagi_t* sip_url_query_as_taglist ( su_home_t *  home,
char const *  query,
msg_mclass_t const *  parser 
)

Convert URL query to a tag list.

SIP headers encoded as URL query is parsed returned as a tag list. Unknown headers are encoded as SIPTAG_HEADER_STR().

Parameters:
home memory home used to alloate string (if NULL, malloc() it)
query query part from SIP URL
parser optional SIP parser used
See also:
sip_add_tl(), sip_add_tagis(), SIPTAG_HEADER_STR(), sip_headers_as_url_query(), url_query_as_header_string(), RFC 3261 section 19.1.1 "Headers", url_t, url_s::url_headers
Since:
New in 1.12.4.
Bug:
Extension headers are ignored. The parser parameter is not used at the moment.

tagi_t* siptag_filter ( tagi_t dst,
tagi_t const   f[],
tagi_t const *  src,
void **  bb 
)

Filter a for SIP header tag.

Parameters:
[in] dst tag list for filtering result. May be NULL.
[in] f filter tag
[in] src tag item from source list.
[in,out] bb pointer to pointer of mempory area used to dup the filtering result
This function is also used to calculate size for filtering result.


Sofia-SIP 1.12.6work - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.