summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 91fb0b546..cbbda4e73 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -35170,17 +35170,19 @@ 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, INET6_ADDRSTRLEN - 1,
- "port", RQ_UINTEGER2, 5,
- "regseconds", RQ_INTEGER4, 11,
- "defaultuser", RQ_CHAR, 10,
- "fullcontact", RQ_CHAR, 35,
- "regserver", RQ_CHAR, 20,
- "useragent", RQ_CHAR, 20,
- "lastms", RQ_INTEGER4, 11,
- SENTINEL);
+ if (sip_cfg.peer_rtupdate) {
+ ast_realtime_require_field(ast_check_realtime("sipregs") ? "sipregs" : "sippeers",
+ "name", RQ_CHAR, 10,
+ "ipaddr", RQ_CHAR, INET6_ADDRSTRLEN - 1,
+ "port", RQ_UINTEGER2, 5,
+ "regseconds", RQ_INTEGER4, 11,
+ "defaultuser", RQ_CHAR, 10,
+ "fullcontact", RQ_CHAR, 35,
+ "regserver", RQ_CHAR, 20,
+ "useragent", RQ_CHAR, 20,
+ "lastms", RQ_INTEGER4, 11,
+ SENTINEL);
+ }
sip_register_tests();
@@ -35199,7 +35201,7 @@ static int unload_module(void)
struct sip_pvt *p;
struct sip_threadinfo *th;
struct ao2_iterator i;
- int wait_count;
+ struct timeval start;
ast_sip_api_provider_unregister();
@@ -35349,11 +35351,11 @@ static int unload_module(void)
* joinable. They can die on their own and remove themselves
* from the container thus resulting in a huge memory leak.
*/
- wait_count = 1000;
- while (ao2_container_count(threadt) && --wait_count) {
+ start = ast_tvnow();
+ while (ao2_container_count(threadt) && (ast_tvdiff_sec(ast_tvnow(), start) < 5)) {
sched_yield();
}
- if (!wait_count) {
+ if (ao2_container_count(threadt)) {
ast_debug(2, "TCP/TLS thread container did not become empty :(\n");
}