summaryrefslogtreecommitdiffstats
path: root/main/freeswitch/0001-mod_sofia-update-mod_sofia_globals.guess_ip-on-addre.patch
blob: ccf4e5c6e9f55db29f920c5f5929af5deac8ba8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From 67a60b5bf50fbfdf184dc4cb20a88d8d88ff59ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Fri, 10 Jun 2011 11:58:19 +0300
Subject: [PATCH 1/2] mod_sofia: update mod_sofia_globals.guess_ip on address change

So that we rebind to the new IP-address after reloading
configuration. Fixes FS-3336.
---
 src/mod/endpoints/mod_sofia/mod_sofia.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c
index 86fa140..b06eacb 100644
--- a/src/mod/endpoints/mod_sofia/mod_sofia.c
+++ b/src/mod/endpoints/mod_sofia/mod_sofia.c
@@ -4889,6 +4889,8 @@ static void general_event_handler(switch_event_t *event)
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "EVENT_TRAP: IP change detected\n");
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "IP change detected [%s]->[%s] [%s]->[%s]\n", old_ip4, new_ip4, old_ip6, new_ip6);
 
+				strncpy(mod_sofia_globals.guess_ip, new_ip4, sizeof(mod_sofia_globals.guess_ip));
+
 				switch_mutex_lock(mod_sofia_globals.hash_mutex);
 				if (mod_sofia_globals.profile_hash) {
 					for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
-- 
1.7.1