Benny Prijono | 5dcb38d | 2005-11-21 01:55:47 +0000 | [diff] [blame] | 1 | /* $Id$ */ |
| 2 | /* |
Benny Prijono | a771a51 | 2007-02-19 01:13:53 +0000 | [diff] [blame] | 3 | * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> |
Benny Prijono | 5dcb38d | 2005-11-21 01:55:47 +0000 | [diff] [blame] | 4 | * |
| 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 Prijono | 312aff9 | 2006-06-17 04:08:30 +0000 | [diff] [blame] | 29 | * @defgroup PJSIP_EVENT_HDRS Additional Header Fields |
Benny Prijono | 5dcb38d | 2005-11-21 01:55:47 +0000 | [diff] [blame] | 30 | * @ingroup PJSIP_EVENT_NOT |
| 31 | * @{ |
| 32 | */ |
| 33 | |
| 34 | PJ_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 | */ |
| 43 | typedef struct pjsip_event_hdr |
| 44 | { |
Benny Prijono | 312aff9 | 2006-06-17 04:08:30 +0000 | [diff] [blame] | 45 | /** Standard header fields. */ |
Benny Prijono | 834aee3 | 2006-02-19 01:38:06 +0000 | [diff] [blame] | 46 | PJSIP_DECL_HDR_MEMBER(struct pjsip_event_hdr); |
Benny Prijono | 312aff9 | 2006-06-17 04:08:30 +0000 | [diff] [blame] | 47 | |
Benny Prijono | 5dcb38d | 2005-11-21 01:55:47 +0000 | [diff] [blame] | 48 | pj_str_t event_type; /**< Event name. */ |
| 49 | pj_str_t id_param; /**< Optional event ID parameter. */ |
Benny Prijono | 834aee3 | 2006-02-19 01:38:06 +0000 | [diff] [blame] | 50 | pjsip_param other_param; /**< Other parameter. */ |
Benny Prijono | 5dcb38d | 2005-11-21 01:55:47 +0000 | [diff] [blame] | 51 | } pjsip_event_hdr; |
| 52 | |
| 53 | /** |
| 54 | * Create an Event header. |
| 55 | * |
| 56 | * @param pool The pool. |
| 57 | * |
| 58 | * @return New Event header instance. |
| 59 | */ |
| 60 | PJ_DECL(pjsip_event_hdr*) pjsip_event_hdr_create(pj_pool_t *pool); |
| 61 | |
| 62 | |
| 63 | /** |
| 64 | * This structure describes Allow-Events header. |
| 65 | */ |
Benny Prijono | 834aee3 | 2006-02-19 01:38:06 +0000 | [diff] [blame] | 66 | typedef pjsip_generic_array_hdr pjsip_allow_events_hdr; |
Benny Prijono | 5dcb38d | 2005-11-21 01:55:47 +0000 | [diff] [blame] | 67 | |
| 68 | |
| 69 | /** |
| 70 | * Create a new Allow-Events header. |
| 71 | * |
Benny Prijono | 312aff9 | 2006-06-17 04:08:30 +0000 | [diff] [blame] | 72 | * @param pool The pool. |
Benny Prijono | 5dcb38d | 2005-11-21 01:55:47 +0000 | [diff] [blame] | 73 | * |
| 74 | * @return Allow-Events header. |
| 75 | */ |
Benny Prijono | 312aff9 | 2006-06-17 04:08:30 +0000 | [diff] [blame] | 76 | PJ_DECL(pjsip_allow_events_hdr*) |
| 77 | pjsip_allow_events_hdr_create(pj_pool_t *pool); |
Benny Prijono | 5dcb38d | 2005-11-21 01:55:47 +0000 | [diff] [blame] | 78 | |
| 79 | |
| 80 | /** |
| 81 | * This structure describes Subscription-State header. |
| 82 | */ |
| 83 | typedef struct pjsip_sub_state_hdr |
| 84 | { |
Benny Prijono | 312aff9 | 2006-06-17 04:08:30 +0000 | [diff] [blame] | 85 | /** Standard header fields. */ |
Benny Prijono | 834aee3 | 2006-02-19 01:38:06 +0000 | [diff] [blame] | 86 | PJSIP_DECL_HDR_MEMBER(struct pjsip_sub_state_hdr); |
Benny Prijono | 312aff9 | 2006-06-17 04:08:30 +0000 | [diff] [blame] | 87 | |
Benny Prijono | 5dcb38d | 2005-11-21 01:55:47 +0000 | [diff] [blame] | 88 | 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 Prijono | 834aee3 | 2006-02-19 01:38:06 +0000 | [diff] [blame] | 92 | pjsip_param other_param; /**< Other parameters. */ |
Benny Prijono | 5dcb38d | 2005-11-21 01:55:47 +0000 | [diff] [blame] | 93 | } 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 | */ |
| 102 | PJ_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 Prijono | 1f61a8f | 2007-08-16 10:11:44 +0000 | [diff] [blame] | 107 | PJ_DECL(void) pjsip_evsub_init_parser(void); |
Benny Prijono | 5dcb38d | 2005-11-21 01:55:47 +0000 | [diff] [blame] | 108 | |
| 109 | |
| 110 | PJ_END_DECL |
| 111 | |
| 112 | |
| 113 | /** |
| 114 | * @} |
| 115 | */ |
| 116 | |
| 117 | #endif /* __PJSIP_SIMPLE_EVENT_NOTIFY_MSG_H__ */ |
| 118 | |