xcap_callbacks.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * $Id: xcap_callback.h,v 1.2 2007/02/20 13:40:09 anca_vamanu Exp $
  3. *
  4. * xcap_client module - Kamailio xcap client module
  5. *
  6. * Copyright (C) 2007 Voice Sistem S.R.L.
  7. *
  8. * This file is part of Kamailio, a free SIP server.
  9. *
  10. * Kamailio is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version
  14. *
  15. * Kamailio is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. *
  24. *History:
  25. *--------
  26. * 2007-08-30 initial version (anca)
  27. */
  28. #ifndef XCAP_CBACK
  29. #define XCAP_CBACK
  30. #include "../../str.h"
  31. #define PRES_RULES 1<<1
  32. #define RESOURCE_LIST 1<<2
  33. #define RLS_SERVICE 1<<3
  34. #define PIDF_MANIPULATION 1<<4
  35. #define XCAP_CAPS 1<<5
  36. #define USER_PROFILE 1<<6
  37. #define PRES_CONTENT 1<<7
  38. #define SEARCH 1<<8
  39. #define DIRECTORY 1<<9
  40. /* callback function prototype */
  41. typedef int (xcap_cb)(int doc_type, str xid, char* doc);
  42. /* register callback function prototype */
  43. typedef int (*register_xcapcb_t)(int types, xcap_cb f);
  44. typedef struct xcap_callback {
  45. int types; /* types of events that trigger the callback*/
  46. xcap_cb* callback; /* callback function */
  47. struct xcap_callback* next;
  48. }xcap_callback_t;
  49. /* destroy registered callback list */
  50. void destroy_xcapcb_list(void);
  51. /* register a callback for several types of events */
  52. int register_xcapcb( int types, xcap_cb f);
  53. /* run all transaction callbacks for an composed type */
  54. void run_xcap_update_cb(int type, str xid, char* stream);
  55. #endif