1
/* $Id: rpid.h 3553 2011-05-05 06:14:19Z nanang $ */
3
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
#ifndef __PJSIP_SIMPLE_RPID_H__
21
#define __PJSIP_SIMPLE_RPID_H__
25
* @brief RPID: Rich Presence Extensions to the PIDF (RFC 4480)
27
#include <pjsip-simple/types.h>
28
#include <pjsip-simple/pidf.h>
34
* @defgroup PJSIP_SIMPLE_RPID RPID/Rich Presence Extensions to PIDF (RFC 4480)
35
* @ingroup PJSIP_SIMPLE
36
* @brief RPID/Rich Presence Extensions to PIDF (RFC 4480)
39
* This file provides tools for managing subset of RPID elements into
44
* This enumeration describes subset of standard activities as
45
* described by RFC 4880, RPID: Rich Presence Extensions to the
46
* Presence Information Data Format (PIDF).
48
typedef enum pjrpid_activity
50
/** Activity is unknown. The activity would then be conceived
51
* in the "note" field.
53
PJRPID_ACTIVITY_UNKNOWN,
55
/** The person is away */
58
/** The person is busy */
65
* This enumeration describes types of RPID element.
67
typedef enum pjrpid_element_type
69
/** RPID <person> element */
70
PJRPID_ELEMENT_TYPE_PERSON
72
} pjrpid_element_type;
76
* This structure describes person information in RPID document.
78
typedef struct pjrpid_element
81
pjrpid_element_type type;
83
/** Optional id to set on the element. */
87
pjrpid_activity activity;
89
/** Optional text describing the person/element. */
96
* Duplicate RPID element.
99
* @param dst Destination structure.
100
* @param src Source structure.
102
PJ_DECL(void) pjrpid_element_dup(pj_pool_t *pool, pjrpid_element *dst,
103
const pjrpid_element *src);
107
* Add RPID element information into existing PIDF document. This will also
108
* add the appropriate XML namespace attributes into the presence's XML
109
* node, if the attributes are not already present, and also a <note> element
110
* to the first <tuple> element of the PIDF document.
112
* @param pres The PIDF presence document.
114
* @param options Currently unused, and must be zero.
115
* @param elem RPID element information to be added into the PIDF
118
* @return PJ_SUCCESS on success.
120
PJ_DECL(pj_status_t) pjrpid_add_element(pjpidf_pres *pres,
123
const pjrpid_element *elem);
126
* Get RPID element information from PIDF document, if any.
128
* @param pres The PIDF document containing RPID elements.
129
* @param pool Pool to duplicate the information.
130
* @param elem Structure to receive the element information.
132
* @return PJ_SUCCESS if the document does contain RPID element
133
* and the information has been parsed successfully.
135
PJ_DECL(pj_status_t) pjrpid_get_element(const pjpidf_pres *pres,
137
pjrpid_element *elem);
148
#endif /* __PJSIP_SIMPLE_RPID_H__ */