<h1>Project "FreeSWITCH Source" received a push.</h1>

<h2>branch: master updated</h2>
<pre>
       via: 0f7682a27c04dbc979cd5cba8aafd0c70caac8eb (commit)
      from: e318e3eb91810cc8ed0e9af30d7c81d19e4cd21b (commit)


</pre>= COMMIT LOG ===========================================================
<div class="highlight"><pre>committer: Mathieu Parent
comments: 
Skinny: don&#39;t crash when requesting an RTP port while the profile is listening on all ips
And store some more ip infos in the listener struct

<span style="color: #000080; font-weight: bold">diff --git a/src/mod/endpoints/mod_skinny/mod_skinny.c b/src/mod/endpoints/mod_skinny/mod_skinny.c</span>
<span style="color: #000080; font-weight: bold">index 071e8c5..32b4ef8 100644</span>
<span style="color: #A00000">--- a/src/mod/endpoints/mod_skinny/mod_skinny.c</span>
<span style="color: #00A000">+++ b/src/mod/endpoints/mod_skinny/mod_skinny.c</span>
<span style="color: #800080; font-weight: bold">@@ -1598,9 +1598,14 @@ new_socket:</span>
 
                 switch_mutex_init(&amp;listener-&gt;flag_mutex, SWITCH_MUTEX_NESTED, listener-&gt;pool);
 
<span style="color: #A00000">-                switch_socket_addr_get(&amp;listener-&gt;sa, SWITCH_TRUE, listener-&gt;sock);</span>
<span style="color: #A00000">-                switch_get_addr(listener-&gt;remote_ip, sizeof(listener-&gt;remote_ip), listener-&gt;sa);</span>
<span style="color: #A00000">-                listener-&gt;remote_port = switch_sockaddr_get_port(listener-&gt;sa);</span>
<span style="color: #00A000">+                switch_socket_addr_get(&amp;listener-&gt;remote_sa, SWITCH_TRUE, listener-&gt;sock);</span>
<span style="color: #00A000">+                switch_get_addr(listener-&gt;remote_ip, sizeof(listener-&gt;remote_ip), listener-&gt;remote_sa);</span>
<span style="color: #00A000">+                listener-&gt;remote_port = switch_sockaddr_get_port(listener-&gt;remote_sa);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                switch_socket_addr_get(&amp;listener-&gt;local_sa, SWITCH_FALSE, listener-&gt;sock);</span>
<span style="color: #00A000">+                switch_get_addr(listener-&gt;local_ip, sizeof(listener-&gt;local_ip), listener-&gt;local_sa);</span>
<span style="color: #00A000">+                listener-&gt;local_port = switch_sockaddr_get_port(listener-&gt;local_sa);</span>
<span style="color: #00A000">+</span>
                 launch_listener_thread(listener);
 
         }
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/endpoints/mod_skinny/mod_skinny.h b/src/mod/endpoints/mod_skinny/mod_skinny.h</span>
<span style="color: #000080; font-weight: bold">index 20d68fa..bf59c67 100644</span>
<span style="color: #A00000">--- a/src/mod/endpoints/mod_skinny/mod_skinny.h</span>
<span style="color: #00A000">+++ b/src/mod/endpoints/mod_skinny/mod_skinny.h</span>
<span style="color: #800080; font-weight: bold">@@ -143,11 +143,14 @@ struct listener {</span>
     switch_socket_t *sock;
     switch_memory_pool_t *pool;
     switch_thread_rwlock_t *rwlock;
<span style="color: #A00000">-    switch_sockaddr_t *sa;</span>
<span style="color: #00A000">+    switch_sockaddr_t *remote_sa;</span>
     char remote_ip[50];
<span style="color: #00A000">+    switch_port_t remote_port;</span>
<span style="color: #00A000">+    switch_sockaddr_t *local_sa;</span>
<span style="color: #00A000">+    char local_ip[50];</span>
<span style="color: #00A000">+    switch_port_t local_port;</span>
     switch_mutex_t *flag_mutex;
     uint32_t flags;
<span style="color: #A00000">-    switch_port_t remote_port;</span>
     uint32_t id;
     time_t expire_time;
     struct listener *next;
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/endpoints/mod_skinny/skinny_server.c b/src/mod/endpoints/mod_skinny/skinny_server.c</span>
<span style="color: #000080; font-weight: bold">index 5381003..0aafb98 100644</span>
<span style="color: #A00000">--- a/src/mod/endpoints/mod_skinny/skinny_server.c</span>
<span style="color: #00A000">+++ b/src/mod/endpoints/mod_skinny/skinny_server.c</span>
<span style="color: #800080; font-weight: bold">@@ -1660,12 +1660,12 @@ switch_status_t skinny_handle_open_receive_channel_ack_message(listener_t *liste</span>
                         goto end;
                 }
 
<span style="color: #00A000">+                tech_pvt-&gt;local_sdp_audio_ip = listener-&gt;local_ip;</span>
                 /* Request a local port from the core&#39;s allocator */
<span style="color: #A00000">-                if (!(tech_pvt-&gt;local_sdp_audio_port = switch_rtp_request_port(listener-&gt;profile-&gt;ip))) {</span>
<span style="color: #00A000">+                if (!(tech_pvt-&gt;local_sdp_audio_port = switch_rtp_request_port(tech_pvt-&gt;local_sdp_audio_ip))) {</span>
                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_CRIT, &quot;No RTP ports available!\n&quot;);
                         return SWITCH_STATUS_FALSE;
                 }
<span style="color: #A00000">-                tech_pvt-&gt;local_sdp_audio_ip = switch_core_strdup(switch_core_session_get_pool(session), listener-&gt;profile-&gt;ip);</span>
 
                 tech_pvt-&gt;remote_sdp_audio_ip = inet_ntoa(request-&gt;data.open_receive_channel_ack.ip);
                 tech_pvt-&gt;remote_sdp_audio_port = request-&gt;data.open_receive_channel_ack.port;
</pre></div>
========================================================================<pre>

Summary of changes:
 src/mod/endpoints/mod_skinny/mod_skinny.c    |   11 ++++++++---
 src/mod/endpoints/mod_skinny/mod_skinny.h    |    7 +++++--
 src/mod/endpoints/mod_skinny/skinny_server.c |    4 ++--
 3 files changed, 15 insertions(+), 7 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>