blob: f1c3f4b7d5b4541f87423dc734882afb1061a75a [file] [log] [blame]
Benny Prijono5dcb38d2005-11-21 01:55:47 +00001/* $Id$ */
2/*
Benny Prijonoa771a512007-02-19 01:13:53 +00003 * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
Benny Prijono5dcb38d2005-11-21 01:55:47 +00004 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#ifndef __PJSIP_SIMPLE_EVENT_NOTIFY_MSG_H__
20#define __PJSIP_SIMPLE_EVENT_NOTIFY_MSG_H__
21
22/**
23 * @file event_notify_msg.h
24 * @brief SIP Event Notification Headers (RFC 3265)
25 */
26#include <pjsip/sip_msg.h>
27
28/**
Benny Prijono312aff92006-06-17 04:08:30 +000029 * @defgroup PJSIP_EVENT_HDRS Additional Header Fields
Benny Prijono5dcb38d2005-11-21 01:55:47 +000030 * @ingroup PJSIP_EVENT_NOT
31 * @{
32 */
33
34PJ_BEGIN_DECL
35
36
37/** Max events in Allow-Events header. */
38#define PJSIP_MAX_ALLOW_EVENTS 16
39
40/**
41 * This structure describes Event header.
42 */
43typedef struct pjsip_event_hdr
44{
Benny Prijono312aff92006-06-17 04:08:30 +000045 /** Standard header fields. */
Benny Prijono834aee32006-02-19 01:38:06 +000046 PJSIP_DECL_HDR_MEMBER(struct pjsip_event_hdr);
Benny Prijono312aff92006-06-17 04:08:30 +000047
Benny Prijono5dcb38d2005-11-21 01:55:47 +000048 pj_str_t event_type; /**< Event name. */
49 pj_str_t id_param; /**< Optional event ID parameter. */
Benny Prijono834aee32006-02-19 01:38:06 +000050 pjsip_param other_param; /**< Other parameter. */
Benny Prijono5dcb38d2005-11-21 01:55:47 +000051} pjsip_event_hdr;
52
53/**
54 * Create an Event header.
55 *
56 * @param pool The pool.
57 *
58 * @return New Event header instance.
59 */
60PJ_DECL(pjsip_event_hdr*) pjsip_event_hdr_create(pj_pool_t *pool);
61
62
63/**
64 * This structure describes Allow-Events header.
65 */
Benny Prijono834aee32006-02-19 01:38:06 +000066typedef pjsip_generic_array_hdr pjsip_allow_events_hdr;
Benny Prijono5dcb38d2005-11-21 01:55:47 +000067
68
69/**
70 * Create a new Allow-Events header.
71 *
Benny Prijono312aff92006-06-17 04:08:30 +000072 * @param pool The pool.
Benny Prijono5dcb38d2005-11-21 01:55:47 +000073 *
74 * @return Allow-Events header.
75 */
Benny Prijono312aff92006-06-17 04:08:30 +000076PJ_DECL(pjsip_allow_events_hdr*)
77pjsip_allow_events_hdr_create(pj_pool_t *pool);
Benny Prijono5dcb38d2005-11-21 01:55:47 +000078
79
80/**
81 * This structure describes Subscription-State header.
82 */
83typedef struct pjsip_sub_state_hdr
84{
Benny Prijono312aff92006-06-17 04:08:30 +000085 /** Standard header fields. */
Benny Prijono834aee32006-02-19 01:38:06 +000086 PJSIP_DECL_HDR_MEMBER(struct pjsip_sub_state_hdr);
Benny Prijono312aff92006-06-17 04:08:30 +000087
Benny Prijono5dcb38d2005-11-21 01:55:47 +000088 pj_str_t sub_state; /**< Subscription state. */
89 pj_str_t reason_param; /**< Optional termination reason. */
90 int expires_param; /**< Expires param, or -1. */
91 int retry_after; /**< Retry after param, or -1. */
Benny Prijono834aee32006-02-19 01:38:06 +000092 pjsip_param other_param; /**< Other parameters. */
Benny Prijono5dcb38d2005-11-21 01:55:47 +000093} pjsip_sub_state_hdr;
94
95/**
96 * Create new Subscription-State header.
97 *
98 * @param pool The pool.
99 *
100 * @return Subscription-State header.
101 */
102PJ_DECL(pjsip_sub_state_hdr*) pjsip_sub_state_hdr_create(pj_pool_t *pool);
103
104/**
105 * Initialize parser for event notify module.
106 */
Benny Prijono1f61a8f2007-08-16 10:11:44 +0000107PJ_DECL(void) pjsip_evsub_init_parser(void);
Benny Prijono5dcb38d2005-11-21 01:55:47 +0000108
109
110PJ_END_DECL
111
112
113/**
114 * @}
115 */
116
117#endif /* __PJSIP_SIMPLE_EVENT_NOTIFY_MSG_H__ */
118