evsub_msg.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
  3. * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
  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. * @file evsub_msg.h
  23. * @brief SIP Event Notification Headers (RFC 3265)
  24. */
  25. #include <pjsip/sip_msg.h>
  26. /**
  27. * @defgroup PJSIP_EVENT_HDRS Additional Header Fields
  28. * @ingroup PJSIP_EVENT_NOT
  29. * @{
  30. */
  31. PJ_BEGIN_DECL
  32. /** Max events in Allow-Events header. */
  33. #define PJSIP_MAX_ALLOW_EVENTS 16
  34. /**
  35. * This structure describes Event header.
  36. */
  37. typedef struct pjsip_event_hdr
  38. {
  39. /** Standard header fields. */
  40. PJSIP_DECL_HDR_MEMBER(struct pjsip_event_hdr);
  41. pj_str_t event_type; /**< Event name. */
  42. pj_str_t id_param; /**< Optional event ID parameter. */
  43. pjsip_param other_param; /**< Other parameter. */
  44. } pjsip_event_hdr;
  45. /**
  46. * Create an Event header.
  47. *
  48. * @param pool The pool.
  49. *
  50. * @return New Event header instance.
  51. */
  52. PJ_DECL(pjsip_event_hdr*) pjsip_event_hdr_create(pj_pool_t *pool);
  53. /**
  54. * This structure describes Allow-Events header.
  55. */
  56. typedef pjsip_generic_array_hdr pjsip_allow_events_hdr;
  57. /**
  58. * Create a new Allow-Events header.
  59. *
  60. * @param pool The pool.
  61. *
  62. * @return Allow-Events header.
  63. */
  64. PJ_DECL(pjsip_allow_events_hdr*)
  65. pjsip_allow_events_hdr_create(pj_pool_t *pool);
  66. /**
  67. * This structure describes Subscription-State header.
  68. */
  69. typedef struct pjsip_sub_state_hdr
  70. {
  71. /** Standard header fields. */
  72. PJSIP_DECL_HDR_MEMBER(struct pjsip_sub_state_hdr);
  73. pj_str_t sub_state; /**< Subscription state. */
  74. pj_str_t reason_param; /**< Optional termination reason. */
  75. unsigned expires_param; /**< Expires param, or
  76. PJSIP_EXPIRES_NOT_SPECIFIED. */
  77. int retry_after; /**< Retry after param, or -1. */
  78. pjsip_param other_param; /**< Other parameters. */
  79. } pjsip_sub_state_hdr;
  80. /**
  81. * Create new Subscription-State header.
  82. *
  83. * @param pool The pool.
  84. *
  85. * @return Subscription-State header.
  86. */
  87. PJ_DECL(pjsip_sub_state_hdr*) pjsip_sub_state_hdr_create(pj_pool_t *pool);
  88. /**
  89. * Initialize parser for event notify module.
  90. */
  91. PJ_DECL(pj_status_t) pjsip_evsub_init_parser(void);
  92. PJ_END_DECL
  93. /**
  94. * @}
  95. */
  96. #endif /* __PJSIP_SIMPLE_EVENT_NOTIFY_MSG_H__ */