enum.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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_COMPONENT_SIZE 32 /* separator, apex, ... This simplifies checks */
  35. /*
  36. * Check if from user is an e164 number and has a naptr record
  37. */
  38. int is_from_user_enum_0(struct sip_msg* _msg, char* _str1, char* _str2);
  39. int is_from_user_enum_1(struct sip_msg* _msg, char* _suffix, char* _str2);
  40. int is_from_user_enum_2(struct sip_msg* _msg, char* _suffix, char* _service);
  41. /*
  42. * do source number destination routing.
  43. * that is, make the ruri based on the from number
  44. * this is like source ip policy routing
  45. */
  46. int enum_pv_query_1(struct sip_msg* _msg, char* _sp);
  47. int enum_pv_query_2(struct sip_msg* _msg, char* _sp, char* _suffix);
  48. int enum_pv_query_3(struct sip_msg* _msg, char* _sp, char* _suffix,
  49. char* _service);
  50. /*
  51. * Make enum query and if query succeeds, replace current uri with the
  52. * result of the query
  53. */
  54. int enum_query(struct sip_msg* _msg, str* suffix, str* service);
  55. int enum_query_0(struct sip_msg* _msg, char* _str1, char* _str2);
  56. int enum_query_1(struct sip_msg* _msg, char* _suffix, char* _str2);
  57. int enum_query_2(struct sip_msg* _msg, char* _suffix, char* _service);
  58. /*
  59. * Infrastructure ENUM versions.
  60. */
  61. int i_enum_query_0(struct sip_msg* _msg, char* _str1, char* _str2);
  62. int i_enum_query_1(struct sip_msg* _msg, char* _suffix, char* _str2);
  63. int i_enum_query_2(struct sip_msg* _msg, char* _suffix, char* _service);
  64. #endif /* ENUM_H */