aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-05 19:07:27 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-05 19:07:27 +0000
commit13366a3a41485cc4a8aadcd81eb99b674c0f2abf (patch)
tree587127c83bf7f01e5c281920e0b216eec48c8344 /channels
parent18a9621da9bf0d4e71480a50d0534d5743bb1a4c (diff)
Merge the adaptive realtime branch, which will make adding new required fields
to realtime less painful in the future. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@120789 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_iax2.c5
-rw-r--r--channels/chan_sip.c15
2 files changed, 18 insertions, 2 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index ce8553f15..e7b2d5595 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -11284,6 +11284,7 @@ static int reload_config(void)
reload_firmware(0);
iax_provision_reload(1);
+ ast_unload_realtime("iaxpeers");
return 0;
}
@@ -12034,7 +12035,7 @@ static int __unload_module(void)
con = ast_context_find(regcontext);
if (con)
ast_context_destroy(con, "IAX2");
-
+ ast_unload_realtime("iaxpeers");
return 0;
}
@@ -12187,6 +12188,8 @@ static int load_module(void)
reload_firmware(0);
iax_provision_reload(0);
+ ast_realtime_require_field("iaxpeers", "name", RQ_CHAR, 10, "ipaddr", RQ_CHAR, 15, "port", RQ_INTEGER, 5, "regseconds", RQ_INTEGER, 6, NULL);
+
return AST_MODULE_LOAD_SUCCESS;
}
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 737927918..b8e695200 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -21334,7 +21334,8 @@ static int reload_config(enum channelreloadreason reason)
time_t run_start, run_end;
run_start = time(0);
-
+ ast_unload_realtime("sipregs");
+ ast_unload_realtime("sippeers");
cfg = ast_config_load(config, config_flags);
/* We *must* have a config file otherwise stop immediately */
@@ -22766,6 +22767,16 @@ static int load_module(void)
/* And start the monitor for the first time */
restart_monitor();
+ ast_realtime_require_field(ast_check_realtime("sipregs") ? "sipregs" : "sippeers",
+ "name", RQ_CHAR, 10,
+ "ipaddr", RQ_CHAR, 15,
+ "port", RQ_INTEGER, 5,
+ "regseconds", RQ_INTEGER, 5,
+ "defaultuser", RQ_CHAR, 10,
+ "fullcontact", RQ_CHAR, 20,
+ "regserver", RQ_CHAR, 20,
+ NULL);
+
return AST_MODULE_LOAD_SUCCESS;
}
@@ -22879,6 +22890,8 @@ static int unload_module(void)
con = ast_context_find(used_context);
if (con)
ast_context_destroy(con, "SIP");
+ ast_unload_realtime("sipregs");
+ ast_unload_realtime("sippeers");
return 0;
}