sip 1.12.11devel
Loading...
Searching...
No Matches
Files | Variables
SIP Tags

SIP headers in tag item lists and tagged argument lists. More...

Files

file  sip_tag_class.h
 \ @{
 

Variables

tag_class_t sipexthdrtag_class [1]
 \
 

Detailed Description

SIP headers in tag item lists and tagged argument lists.

The include file <sofia-sip/sip_tag.h> defines tags and tag items for including SIP headers in tag item lists or tagged argument lists. For each header, there is a tag for pointer to header object and an another tag for string containing header value. For example, From header has tags SIPTAG_FROM() and SIPTAG_FROM_STR().

It is also possible to include user-defined headers or non-standard headers using SIPTAG_HEADER_STR().

A function taking SIP headers as arguments could be called like this:

sip_payload_t *payload;
...
sip_add_tl(msg, sip,
SIPTAG_CONTENT_TYPE_STR("text/plain"),
SIPTAG_USER_AGENT(agent->user_agent),
SIPTAG_PAYLOAD(payload),
SIPTAG_HEADER_STR("X-Header: contents\nP-Header: bar"),
TAG_END());
...
#define SIPTAG_CONTENT_TYPE_STR(s)
Tag list item for string with Content-Type header value.
Definition sip_tag.h:4563
#define SIPTAG_PAYLOAD(x)
Tag list item for pointer to a message payload structure sip_payload_t.
Definition sip_tag.h:5092
#define SIPTAG_USER_AGENT(x)
Tag list item for pointer to a User-Agent header structure sip_user_agent_t.
Definition sip_tag.h:2082
#define SIPTAG_HEADER_STR(s)
Tag list item for header string.
Definition sip_tag.h:168
#define TAG_END()

In the above fragment, the function sip_add_tl() will add Content-Type and User-Agent headers along with message payload to the SIP message. The Content-Type header is made with value "text/plain".

Variable Documentation

◆ sipexthdrtag_class

tag_class_t sipexthdrtag_class[1]

\

Tag class using SIP header structure.

Tag class for tags containing SIP headers.

Tags in this class are not automatically added to the message with sip_add_tl() or sip_add_tagis().


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