<h1>Project "FreeSWITCH Source" received a push.</h1>
<h2>branch: master updated</h2>
<pre>
via: e7acd4d138e0faa6b4a3cec1667015c430e8f3f6 (commit)
from: 079f3f73ed63733b5642ae3b49ec5cf66db2d6dc (commit)
</pre>= COMMIT LOG ===========================================================
<div class="highlight"><pre>committer: Anthony Minessale
comments:
FS-3054 re-open if this does not fix it.
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c</span>
<span style="color: #000080; font-weight: bold">index 9fb1f39..f9f0788 100644</span>
<span style="color: #A00000">--- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c</span>
<span style="color: #00A000">+++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c</span>
<span style="color: #800080; font-weight: bold">@@ -596,9 +596,9 @@ static void ipchanged_event_handler(switch_event_t *event)</span>
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "EVENT_TRAP: IP change detected\n");
<span style="color: #A00000">-        if (cond && !strcmp(cond, "network-address-change")) {</span>
<span style="color: #A00000">-                const char *old_ip4 = switch_event_get_header_nil(event, "network-address-previous-v4");</span>
<span style="color: #A00000">-                const char *new_ip4 = switch_event_get_header_nil(event, "network-address-change-v4");</span>
<span style="color: #00A000">+        if (cond && !strcmp(cond, "network-external-address-change")) {</span>
<span style="color: #00A000">+                const char *old_ip4 = switch_event_get_header_nil(event, "network-external-address-previous-v4");</span>
<span style="color: #00A000">+                const char *new_ip4 = switch_event_get_header_nil(event, "network-external-address-change-v4");</span>
                switch_hash_index_t *hi;
                void *val;
                char *tmp;
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c</span>
<span style="color: #000080; font-weight: bold">index 7125bce..dff33ee 100644</span>
<span style="color: #A00000">--- a/src/mod/endpoints/mod_sofia/mod_sofia.c</span>
<span style="color: #00A000">+++ b/src/mod/endpoints/mod_sofia/mod_sofia.c</span>
<span style="color: #800080; font-weight: bold">@@ -4587,17 +4587,42 @@ static void general_event_handler(switch_event_t *event)</span>
        case SWITCH_EVENT_TRAP:
                {
                        const char *cond = switch_event_get_header(event, "condition");
<span style="color: #00A000">+                        switch_hash_index_t *hi;</span>
<span style="color: #00A000">+                        const void *var;</span>
<span style="color: #00A000">+                        void *val;</span>
<span style="color: #00A000">+                        sofia_profile_t *profile;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        if (zstr(cond)) {</span>
<span style="color: #00A000">+                                cond = "";</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        if (!strcmp(cond, "network-external-address-change") && mod_sofia_globals.auto_restart) {</span>
<span style="color: #00A000">+                                const char *old_ip4 = switch_event_get_header_nil(event, "network-external-address-previous-v4");</span>
<span style="color: #00A000">+                                const char *new_ip4 = switch_event_get_header_nil(event, "network-external-address-change-v4");</span>
<span style="color: #00A000">+                                </span>
<span style="color: #00A000">+                                switch_mutex_lock(mod_sofia_globals.hash_mutex);</span>
<span style="color: #00A000">+                                if (mod_sofia_globals.profile_hash) {</span>
<span style="color: #00A000">+                                        for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {</span>
<span style="color: #00A000">+                                                switch_hash_this(hi, &var, NULL, &val);</span>
<span style="color: #00A000">+                                                if ((profile = (sofia_profile_t *) val)) {</span>
<span style="color: #00A000">+                                                        if (!strcmp(profile->extsipip, old_ip4)) {</span>
<span style="color: #00A000">+                                                                profile->extsipip = switch_core_strdup(profile->pool, new_ip4);</span>
<span style="color: #00A000">+                                                        }</span>
<span style="color: #A00000">-                        if (cond && !strcmp(cond, "network-address-change") && mod_sofia_globals.auto_restart) {</span>
<span style="color: #00A000">+                                                        if (!strcmp(profile->extrtpip, old_ip4)) {</span>
<span style="color: #00A000">+                                                                profile->extrtpip = switch_core_strdup(profile->pool, new_ip4);</span>
<span style="color: #00A000">+                                                        }</span>
<span style="color: #00A000">+                                                }</span>
<span style="color: #00A000">+                                        }</span>
<span style="color: #00A000">+                                }</span>
<span style="color: #00A000">+                                switch_mutex_unlock(mod_sofia_globals.hash_mutex);</span>
<span style="color: #00A000">+                                sofia_glue_restart_all_profiles();                                </span>
<span style="color: #00A000">+                        } else if (!strcmp(cond, "network-address-change") && mod_sofia_globals.auto_restart) {</span>
                                const char *old_ip4 = switch_event_get_header_nil(event, "network-address-previous-v4");
                                const char *new_ip4 = switch_event_get_header_nil(event, "network-address-change-v4");
                                const char *old_ip6 = switch_event_get_header_nil(event, "network-address-previous-v6");
                                const char *new_ip6 = switch_event_get_header_nil(event, "network-address-change-v6");
<span style="color: #A00000">-                                switch_hash_index_t *hi;</span>
<span style="color: #A00000">-                                const void *var;</span>
<span style="color: #A00000">-                                void *val;</span>
<span style="color: #A00000">-                                sofia_profile_t *profile;</span>
                                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);
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_nat.c b/src/switch_nat.c</span>
<span style="color: #000080; font-weight: bold">index 85b0247..d9110ef 100644</span>
<span style="color: #A00000">--- a/src/switch_nat.c</span>
<span style="color: #00A000">+++ b/src/switch_nat.c</span>
<span style="color: #800080; font-weight: bold">@@ -325,9 +325,9 @@ static void *SWITCH_THREAD_FUNC switch_nat_multicast_runtime(switch_thread_t * t</span>
                        do_repub = SWITCH_TRUE;
                        switch_event_create(&event, SWITCH_EVENT_TRAP);
<span style="color: #A00000">-                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "condition", "network-address-change");</span>
<span style="color: #A00000">-                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "network-address-previous-v4", nat_globals.pub_addr);</span>
<span style="color: #A00000">-                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "network-address-change-v4", newip);</span>
<span style="color: #00A000">+                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "condition", "network-external-address-change");</span>
<span style="color: #00A000">+                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "network-external-address-previous-v4", nat_globals.pub_addr);</span>
<span style="color: #00A000">+                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "network-external-address-change-v4", newip);</span>
                        switch_event_fire(&event);
                        switch_set_string(nat_globals.pub_addr, newip);
</pre></div>
========================================================================<pre>
Summary of changes:
src/mod/endpoints/mod_dingaling/mod_dingaling.c | 6 ++--
src/mod/endpoints/mod_sofia/mod_sofia.c | 35 +++++++++++++++++++---
src/switch_nat.c | 6 ++--
3 files changed, 36 insertions(+), 11 deletions(-)
</pre>
<p>this email was generated because of /git/your-repo.git/hooks/post-receive by the file /git-core/contrib/hooks/post-receive-email<br />
For more info, see <a href="http://blog.chomperstomp.com/?p=630">http://blog.chomperstomp.com/?p=630</a>
-- <br />
FreeSWITCH Source</p>