ring.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * $Id$
  3. *
  4. * Copyright (C) 2008-2009 1&1 Internet AG
  5. *
  6. * This file is part of SIP-router, a free SIP server.
  7. *
  8. * SIP-router is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version
  12. *
  13. * SIP-router is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. /**
  23. * \file
  24. * \brief SIP-utils :: Module with several utiltity functions related to SIP messages handling
  25. * \ingroup siputils
  26. * - Module; \ref siputils
  27. */
  28. #ifndef RING_H
  29. #define RING_H
  30. #define HASHTABLEBITS 13
  31. #define HASHTABLESIZE (((unsigned int)1) << HASHTABLEBITS)
  32. #define HASHTABLEMASK (HASHTABLESIZE - 1)
  33. #define MAXCALLIDLEN 255
  34. extern gen_lock_t *ring_lock;
  35. /*!
  36. * \brief Inserts callid of message into hashtable
  37. *
  38. * Inserts callid of message into hashtable. Any 183 messages with
  39. * this callid that occur in the next ring_timeout seconds, will be
  40. * converted to 180.
  41. * \param msg SIP message
  42. * \param unused1 unused
  43. * \param unused2 unused
  44. * \return 1 on success, -1 otherwise
  45. */
  46. int ring_insert_callid(struct sip_msg *msg, char *unused1, char *unused2);
  47. /*!
  48. * \brief Initialize the ring hashtable in shared memory
  49. */
  50. void ring_init_hashtable(void);
  51. /*!
  52. * \brief Destroy the ring hashtable
  53. */
  54. void ring_destroy_hashtable(void);
  55. /*!
  56. * \brief Callback function that does the work inside the server.
  57. * \param msg SIP message
  58. * \param flags unused
  59. * \param bar unused
  60. * \return 1 on success, -1 on failure
  61. */
  62. int ring_filter(struct sip_msg *msg, unsigned int flags, void *bar);
  63. /*!
  64. * \brief Fixup function for the ring_insert_callid function
  65. * \param param unused
  66. * \param param_no unused
  67. * \return 0
  68. */
  69. int ring_fixup(void ** param, int param_no);
  70. #endif