enum.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * $Id$
  3. *
  4. * Header file for Enum and E164 related functions
  5. *
  6. * Copyright (C) 2002-2008 Juha Heinanen
  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. /*!
  25. * \file
  26. * \brief SIP-router enum :: Header file for Enum and E164 related functions (module interface)
  27. * \ingroup enum
  28. * Module: \ref enum
  29. */
  30. #ifndef ENUM_H
  31. #define ENUM_H
  32. #include "../../parser/msg_parser.h"
  33. #define MAX_DOMAIN_SIZE 256
  34. #define MAX_NUM_LEN 22
  35. #define MAX_COMPONENT_SIZE (MAX_NUM_LEN * 2) /* separator, apex, ... This simplifies checks */
  36. /*
  37. * Check if from user is an e164 number and has a naptr record
  38. */
  39. int is_from_user_enum_0(struct sip_msg* _msg, char* _str1, char* _str2);
  40. int is_from_user_enum_1(struct sip_msg* _msg, char* _suffix, char* _str2);
  41. int is_from_user_enum_2(struct sip_msg* _msg, char* _suffix, char* _service);
  42. /*
  43. * do source number destination routing.
  44. * that is, make the ruri based on the from number
  45. * this is like source ip policy routing
  46. */
  47. int enum_pv_query_1(struct sip_msg* _msg, char* _sp);
  48. int enum_pv_query_2(struct sip_msg* _msg, char* _sp, char* _suffix);
  49. int enum_pv_query_3(struct sip_msg* _msg, char* _sp, char* _suffix,
  50. char* _service);
  51. /*
  52. * Make enum query and if query succeeds, replace current uri with the
  53. * result of the query
  54. */
  55. int enum_query(struct sip_msg* _msg, str* suffix, str* service);
  56. int enum_query_0(struct sip_msg* _msg, char* _str1, char* _str2);
  57. int enum_query_1(struct sip_msg* _msg, char* _suffix, char* _str2);
  58. int enum_query_2(struct sip_msg* _msg, char* _suffix, char* _service);
  59. /*
  60. * Infrastructure ENUM versions.
  61. */
  62. int i_enum_query_0(struct sip_msg* _msg, char* _str1, char* _str2);
  63. int i_enum_query_1(struct sip_msg* _msg, char* _suffix, char* _str2);
  64. int i_enum_query_2(struct sip_msg* _msg, char* _suffix, char* _service);
  65. #endif /* ENUM_H */