ul_mod.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * $Id$
  3. *
  4. * User location module interface
  5. *
  6. * Copyright (C) 2001-2003 FhG Fokus
  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. */
  27. /*! \file
  28. * \brief USRLOC - Usrloc module interface
  29. * \ingroup usrloc
  30. */
  31. #ifndef UL_MOD_H
  32. #define UL_MOD_H
  33. #include "../../lib/srdb1/db.h"
  34. #include "../../str.h"
  35. /*
  36. * Module parameters
  37. */
  38. #define UL_TABLE_VERSION 6
  39. extern str ruid_col;
  40. extern str user_col;
  41. extern str domain_col;
  42. extern str contact_col;
  43. extern str expires_col;
  44. extern str q_col;
  45. extern str callid_col;
  46. extern str cseq_col;
  47. extern str flags_col;
  48. extern str cflags_col;
  49. extern str user_agent_col;
  50. extern str received_col;
  51. extern str path_col;
  52. extern str sock_col;
  53. extern str methods_col;
  54. extern str instance_col;
  55. extern str reg_id_col;
  56. extern str last_mod_col;
  57. extern str ulattrs_user_col;
  58. extern str ulattrs_domain_col;
  59. extern str ulattrs_ruid_col;
  60. extern str ulattrs_aname_col;
  61. extern str ulattrs_atype_col;
  62. extern str ulattrs_avalue_col;
  63. extern str ulattrs_last_mod_col;
  64. extern str db_url;
  65. extern int timer_interval;
  66. extern int db_mode;
  67. extern int use_domain;
  68. extern int desc_time_order;
  69. extern int cseq_delay;
  70. extern int ul_fetch_rows;
  71. extern int ul_hash_size;
  72. extern int ul_db_update_as_insert;
  73. extern int ul_db_check_update;
  74. extern int ul_keepalive_timeout;
  75. extern int handle_lost_tcp;
  76. /*! nat branch flag */
  77. extern unsigned int nat_bflag;
  78. /*! flag to protect against wrong initialization */
  79. extern unsigned int init_flag;
  80. extern str ul_xavp_contact_name;
  81. extern db1_con_t* ul_dbh; /* Database connection handle */
  82. extern db_func_t ul_dbf;
  83. /*
  84. * Matching algorithms
  85. */
  86. #define CONTACT_ONLY (0)
  87. #define CONTACT_CALLID (1)
  88. #define CONTACT_PATH (2)
  89. extern int matching_mode;
  90. extern int ul_db_ops_ruid;
  91. extern int ul_expires_type;
  92. #define UL_DB_EXPIRES_SET(r, v) do { \
  93. if(ul_expires_type==1) { \
  94. (r)->type = DB1_BIGINT; \
  95. (r)->val.ll_val = (long long)(v); \
  96. } else { \
  97. (r)->type = DB1_DATETIME; \
  98. (r)->val.time_val = (time_t)(v); \
  99. } \
  100. } while(0)
  101. #define UL_DB_EXPIRES_GET(r) ((ul_expires_type==1)?(time_t)VAL_BIGINT(r):VAL_TIME(r))
  102. #endif /* UL_MOD_H */