cdpeventprocessor.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * $Id$
  3. *
  4. * Copyright (C) 2012 Smile Communications, [email protected]
  5. * Copyright (C) 2012 Smile Communications, [email protected]
  6. *
  7. * The initial version of this code was written by Dragos Vingarzan
  8. * (dragos(dot)vingarzan(at)fokus(dot)fraunhofer(dot)de and the
  9. * Fruanhofer Institute. It was and still is maintained in a separate
  10. * branch of the original SER. We are therefore migrating it to
  11. * Kamailio/SR and look forward to maintaining it from here on out.
  12. * 2011/2012 Smile Communications, Pty. Ltd.
  13. * ported/maintained/improved by
  14. * Jason Penton (jason(dot)penton(at)smilecoms.com and
  15. * Richard Good (richard(dot)good(at)smilecoms.com) as part of an
  16. * effort to add full IMS support to Kamailio/SR using a new and
  17. * improved architecture
  18. *
  19. * NB: Alot of this code was originally part of OpenIMSCore,
  20. * FhG Fokus.
  21. * Copyright (C) 2004-2006 FhG Fokus
  22. * Thanks for great work! This is an effort to
  23. * break apart the various CSCF functions into logically separate
  24. * components. We hope this will drive wider use. We also feel
  25. * that in this way the architecture is more complete and thereby easier
  26. * to manage in the Kamailio/SR environment
  27. *
  28. * This file is part of Kamailio, a free SIP server.
  29. *
  30. * Kamailio is free software; you can redistribute it and/or modify
  31. * it under the terms of the GNU General Public License as published by
  32. * the Free Software Foundation; either version 2 of the License, or
  33. * (at your option) any later version
  34. *
  35. * Kamailio is distributed in the hope that it will be useful,
  36. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  37. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  38. * GNU General Public License for more details.
  39. *
  40. * You should have received a copy of the GNU General Public License
  41. * along with this program; if not, write to the Free Software
  42. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  43. *
  44. */
  45. #ifndef CDPEVENTPROCESSOR
  46. #define CDPEVENTPROCESSOR
  47. #include "../../locking.h"
  48. #include "sem.h"
  49. #include "rx_authdata.h"
  50. typedef struct _cdp_cb_event{
  51. int event; /* event id */
  52. time_t registered; /* time event was added to list - useful if we want to report on things that have taken too long to process */
  53. rx_authsessiondata_t *session_data; /* associated auth session data - can be null */
  54. str rx_session_id;
  55. struct _cdp_cb_event *next;
  56. } cdp_cb_event_t;
  57. typedef struct {
  58. gen_lock_t *lock;
  59. cdp_cb_event_t *head;
  60. cdp_cb_event_t *tail;
  61. gen_sem_t *empty;
  62. } cdp_cb_event_list_t;
  63. int init_cdp_cb_event_list();
  64. void destroy_cdp_cb_event_list();
  65. cdp_cb_event_t* new_cdp_cb_event (int event, str *rx_session_id, rx_authsessiondata_t *session_data); /*create new event*/
  66. void push_cdp_cb_event(cdp_cb_event_t* event); /*add event to stack*/
  67. cdp_cb_event_t* pop_cdp_cb_event(); /*pop next (head) event off list*/
  68. void free_cdp_cb_event(cdp_cb_event_t*); /*free memory allocated for event*/
  69. void cdp_cb_event_process();
  70. #endif