|
44 | 44 | #include "ulcb.h"
|
45 | 45 |
|
46 | 46 | #include "../../lib/reg/rerrno.h"
|
| 47 | +#include "../../lib/reg/config.h" |
47 | 48 | #include "../../lib/reg/sip_msg.h"
|
48 | 49 | #include "../../lib/reg/regtime.h"
|
49 | 50 |
|
@@ -76,6 +77,9 @@ int max_expires = 3600;
|
76 | 77 |
|
77 | 78 | int max_contacts = 0; /*!< Maximum number of contacts per AOR
|
78 | 79 | (0=no checking) */
|
| 80 | +int max_username_len = USERNAME_MAX_SIZE; |
| 81 | +int max_domain_len = DOMAIN_MAX_SIZE; |
| 82 | +int max_aor_len = MAX_AOR_LEN; |
79 | 83 | int retry_after = 0; /*!< The value of Retry-After HF in 5xx replies */
|
80 | 84 |
|
81 | 85 | qvalue_t default_q = Q_UNSPECIFIED; /*!< Default q value multiplied by 1000 */
|
@@ -106,8 +110,7 @@ str rcv_param = str_init(RCV_NAME);
|
106 | 110 | int case_sensitive = 1; /*!< If set to 0, username in aor will be case insensitive */
|
107 | 111 | str gruu_secret = {0,0};
|
108 | 112 | int disable_gruu = 1;
|
109 |
| -char* realm_pref = ""; |
110 |
| -str realm_prefix; |
| 113 | +str realm_prefix = str_init(""); |
111 | 114 | int reg_use_domain = 0;
|
112 | 115 |
|
113 | 116 | static int mod_init(void);
|
@@ -155,11 +158,14 @@ static param_export_t mod_params[] = {
|
155 | 158 | { "max_expires", INT_PARAM, &max_expires },
|
156 | 159 | { "default_q", INT_PARAM, &default_q },
|
157 | 160 | { "tcp_persistent_flag", STR_PARAM, &tcp_persistent_flag_s },
|
158 |
| - { "realm_prefix", STR_PARAM, &realm_pref }, |
| 161 | + { "realm_prefix", STR_PARAM, &realm_prefix.s }, |
159 | 162 | { "case_sensitive", INT_PARAM, &case_sensitive },
|
160 | 163 | { "received_avp", STR_PARAM, &rcv_avp_param },
|
161 | 164 | { "received_param", STR_PARAM, &rcv_param.s },
|
162 | 165 | { "max_contacts", INT_PARAM, &max_contacts },
|
| 166 | + { "max_username_len", INT_PARAM, &max_username_len }, |
| 167 | + { "max_domain_len", INT_PARAM, &max_domain_len }, |
| 168 | + { "max_aor_len", INT_PARAM, &max_aor_len }, |
163 | 169 | { "retry_after", INT_PARAM, &retry_after },
|
164 | 170 | { "gruu_secret", STR_PARAM, &gruu_secret.s },
|
165 | 171 | { "disable_gruu", INT_PARAM, &disable_gruu },
|
@@ -317,8 +323,7 @@ static int mod_init(void)
|
317 | 323 | return -1;
|
318 | 324 | }
|
319 | 325 |
|
320 |
| - realm_prefix.s = realm_pref; |
321 |
| - realm_prefix.len = strlen(realm_pref); |
| 326 | + realm_prefix.len = strlen(realm_prefix.s); |
322 | 327 |
|
323 | 328 | if (gruu_secret.s)
|
324 | 329 | gruu_secret.len = strlen(gruu_secret.s);
|
|
0 commit comments