p_usrloc_mod.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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 P_USRLOC - P-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. #include "../../lib/kmi/mi.h"
  36. #include "../usrloc/usrloc.h"
  37. /*
  38. * Module parameters
  39. */
  40. #define UL_TABLE_VERSION 1004
  41. /*
  42. * Matching algorithms
  43. */
  44. #define CONTACT_ONLY (0)
  45. #define CONTACT_CALLID (1)
  46. #define CONTACT_PATH (2)
  47. #define REG_TABLE "locdb"
  48. #define URL_COL "url"
  49. #define ID_COL "id"
  50. #define NUM_COL "no"
  51. #define STATUS_COL "status"
  52. #define FAILOVER_T_COL "failover"
  53. #define SPARE_COL "spare"
  54. #define ERROR_COL "errors"
  55. #define RISK_GROUP_COL "rg"
  56. #define DEFAULT_EXPIRE 3600
  57. #define DEFAULT_ERR_THRESHOLD 50
  58. #define DB_RETRY 10
  59. #define DB_DEFAULT_POLICY 0
  60. #define DEFAULT_FAILOVER_LEVEL 1
  61. #define DB_DEFAULT_TRANSACTION_LEVEL "READ UNCOMMITED"
  62. #define DB_DEFAULT_CONNECTION_EXPIRES 300
  63. #define DEFAULT_DB_TYPE "single"
  64. #define DEFAULT_DOMAIN_DB "location=cluster,cfa=single"
  65. extern str ruid_col;
  66. extern str user_col;
  67. extern str domain_col;
  68. extern str contact_col;
  69. extern str expires_col;
  70. extern str q_col;
  71. extern str callid_col;
  72. extern str cseq_col;
  73. extern str flags_col;
  74. extern str cflags_col;
  75. extern str user_agent_col;
  76. extern str received_col;
  77. extern str path_col;
  78. extern str sock_col;
  79. extern str methods_col;
  80. extern str instance_col;
  81. extern str reg_id_col;
  82. extern str last_mod_col;
  83. extern int db_mode;
  84. extern int use_domain;
  85. extern int desc_time_order;
  86. extern int cseq_delay;
  87. extern int ul_fetch_rows;
  88. extern int ul_hash_size;
  89. extern str default_db_url;
  90. extern str default_db_type;
  91. extern int default_dbt;
  92. extern str domain_db;
  93. extern int expire;
  94. extern int matching_mode;
  95. struct mi_root* mi_ul_db_refresh(struct mi_root* cmd, void* param);
  96. struct mi_root* mi_loc_nr_refresh(struct mi_root* cmd, void* param);
  97. extern str write_db_url;
  98. extern str read_db_url;
  99. extern str reg_table;
  100. extern str id_col;
  101. extern str url_col;
  102. extern str num_col;
  103. extern str status_col;
  104. extern str failover_time_col;
  105. extern str spare_col;
  106. extern str error_col;
  107. extern str risk_group_col;
  108. extern int expire_time;
  109. extern int db_error_threshold;
  110. extern int failover_level;
  111. extern int retry_interval;
  112. extern int policy;
  113. extern int db_write;
  114. extern int db_master_write;
  115. extern int db_use_transactions;
  116. extern str db_transaction_level;
  117. extern char * isolation_level;
  118. extern int connection_expires;
  119. extern int alg_location;
  120. extern int max_loc_nr;
  121. #endif /* UL_MOD_H */