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

<h2>branch: master updated</h2>
<pre>
       via: 05a8a9455695ae8e6b63fe78bead1a92bee9183b (commit)
       via: 4b941542a309a8c7f7ad5d01cfef9d1c487376a8 (commit)
       via: b889b44f1d632810662359f6becce869056a076c (commit)
       via: 22c05ad542e3a36dd7dbb71bef5aca5ff009b1b9 (commit)
       via: 008e527c0f5c86e20521c4ebacf69adcb269b08a (commit)
       via: 425df0c78389d30561a7f025a1a3e3b2fbc5e413 (commit)
       via: a01814794c1fb49b77a6015edc8e1ad6c925bae3 (commit)
       via: 9ffca057f109725986b741cb6019dce620c056b7 (commit)
       via: 6f58e6aa425283137effa286d7f8638aa035aff4 (commit)
       via: 0e0431ecc66d04236cf4940b65977bad424fdc86 (commit)
       via: 7c624767116b30dc9074c1cfbbe7c3a5771950f9 (commit)
       via: 83d5cd6ff6f2f6e23c09ee387098a59d7764a84f (commit)
       via: 4b731fd64c1bf16a0da20f1c10de8d382faed3a4 (commit)
       via: 636c1ecb4e9cace5967390a8a8125fa783f6d0b9 (commit)
       via: 02d1af647bac6b937de02608d53ea1831f51b968 (commit)
       via: 28465f38a08df99a76864bbf6a9ae5e4e7bcd720 (commit)
       via: d164a79764c49dd11bbffcd26d6ca98770181c67 (commit)
       via: e78f2bfb5d5f17d0646f0bc2a9fad03546eac646 (commit)
       via: 9509befbfa43810dcde11532663561838d267f2c (commit)
       via: 0d098a5110e095bb9334196978289e081d5a022b (commit)
       via: 80a6279993f2369e79e70bc9b61bfcaf2f3e5f4c (commit)
       via: 7ce63feadf86bf4321aa184311996d010aab59f8 (commit)
       via: 6477d3f87e32cc623638073fc1983ebfc4fa54cd (commit)
       via: 24bcd10582193ef6dac5a124ad03323066e355f8 (commit)
       via: 4eb5bbf41c3fcb6bfd33704a18bd2e7e52acd437 (commit)
       via: 976859bb45f08382424c9c4b0dbf6acb3fba64fb (commit)
      from: d6cfc2f1e9cfd6462ae4b65753cafee45bfd5a5c (commit)


</pre>= COMMIT LOG ===========================================================
<div class="highlight"><pre>committer: Michael S Collins
comments: 
Merge branch &#39;master&#39; of git://git.freeswitch.org/freeswitch
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments: 
fix out of place parens in logic test

<span style="color: #000080; font-weight: bold">diff --git a/src/switch_channel.c b/src/switch_channel.c</span>
<span style="color: #000080; font-weight: bold">index 918ad82..de472a9 100644</span>
<span style="color: #A00000">--- a/src/switch_channel.c</span>
<span style="color: #00A000">+++ b/src/switch_channel.c</span>
<span style="color: #800080; font-weight: bold">@@ -2564,8 +2564,8 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_ring_ready_value(swi</span>
         char *app;
         switch_event_t *event;
 
<span style="color: #A00000">-        if (!switch_channel_test_flag(channel, CF_RING_READY) &amp;&amp; !switch_channel_test_flag(channel, CF_EARLY_MEDIA &amp;&amp;</span>
<span style="color: #A00000">-                                                                                                                                                                           !switch_channel_test_flag(channel, CF_ANSWERED))) {</span>
<span style="color: #00A000">+        if (!switch_channel_test_flag(channel, CF_RING_READY) &amp;&amp; </span>
<span style="color: #00A000">+                !switch_channel_test_flag(channel, CF_EARLY_MEDIA) &amp;&amp; !switch_channel_test_flag(channel, CF_ANSWERED)) {</span>
                 switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, switch_channel_get_uuid(channel), SWITCH_LOG_NOTICE, &quot;Ring-Ready %s!\n&quot;, channel-&gt;name);
                 switch_channel_set_flag_value(channel, CF_RING_READY, rv);
                 if (channel-&gt;caller_profile &amp;&amp; channel-&gt;caller_profile-&gt;times) {
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments: 
add channel data to speech events when chosen to fire

<span style="color: #000080; font-weight: bold">diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c</span>
<span style="color: #000080; font-weight: bold">index 4354f0d..0a646b6 100644</span>
<span style="color: #A00000">--- a/src/switch_ivr_async.c</span>
<span style="color: #00A000">+++ b/src/switch_ivr_async.c</span>
<span style="color: #800080; font-weight: bold">@@ -3129,6 +3129,7 @@ static void *SWITCH_THREAD_FUNC speech_thread(switch_thread_t *thread, void *obj</span>
                                         switch_event_t *dup;
 
                                         if (switch_event_dup(&amp;dup, event) == SWITCH_STATUS_SUCCESS) {
<span style="color: #00A000">+                                                switch_channel_event_set_data(channel, dup);</span>
                                                 switch_event_fire(&amp;dup);
                                         }
 
</pre></div>
<div class="highlight"><pre>committer: Brian West
comments: 
fixes from tony

<span style="color: #000080; font-weight: bold">diff --git a/scripts/perl/dhcp-inform.pl b/scripts/perl/dhcp-inform.pl</span>
<span style="color: #000080; font-weight: bold">index 3f977ca..2ca4bb8 100644</span>
<span style="color: #A00000">--- a/scripts/perl/dhcp-inform.pl</span>
<span style="color: #00A000">+++ b/scripts/perl/dhcp-inform.pl</span>
<span style="color: #800080; font-weight: bold">@@ -61,12 +61,7 @@ while ($sock-&gt;recv($newmsg, 1024)) {</span>
     }
     print &quot;Sending option 66 as $opt_u\n&quot;;
 
<span style="color: #A00000">-    $handle = IO::Socket::INET-&gt;new(Proto =&gt; &#39;udp&#39;,</span>
<span style="color: #A00000">-                                    PeerPort =&gt; &#39;68&#39;,</span>
<span style="color: #A00000">-                                    LocalPort =&gt; &#39;67&#39;,</span>
<span style="color: #A00000">-                                    ReuseAddr =&gt; 1,</span>
<span style="color: #A00000">-                                    PeerAddr =&gt; $dhcpreq-&gt;ciaddr(),</span>
<span style="color: #A00000">-                                   ) or die &quot;socket: $@&quot;;</span>
<span style="color: #A00000">-    $handle-&gt;send($dhcpresp-&gt;serialize())</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+    $sock-&gt;send($dhcpresp-&gt;serialize())</span>
   }
 }
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments: 
FS-3012

<span style="color: #000080; font-weight: bold">diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c</span>
<span style="color: #000080; font-weight: bold">index 643b3dd..47f94b1 100644</span>
<span style="color: #A00000">--- a/src/mod/endpoints/mod_sofia/sofia.c</span>
<span style="color: #00A000">+++ b/src/mod/endpoints/mod_sofia/sofia.c</span>
<span style="color: #800080; font-weight: bold">@@ -808,6 +808,18 @@ void sofia_event_callback(nua_event_t event,</span>
                 }
         }
         
<span style="color: #00A000">+        if ((event == nua_i_invite) &amp;&amp; (!session)) {</span>
<span style="color: #00A000">+                uint32_t sess_count = switch_core_session_count();</span>
<span style="color: #00A000">+                uint32_t sess_max = switch_core_session_limit(0);</span>
<span style="color: #00A000">+                </span>
<span style="color: #00A000">+                if (sess_count &gt;= sess_max || !sofia_test_pflag(profile, PFLAG_RUNNING) || !switch_core_ready()) {</span>
<span style="color: #00A000">+                        nua_respond(nh, 503, &quot;Maximum Calls In Progress&quot;, SIPTAG_RETRY_AFTER_STR(&quot;300&quot;), TAG_END());</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, &quot;No more sessions allowed at this time.\n&quot;);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        goto done;</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+        }</span>
         
         if (sofia_test_pflag(profile, PFLAG_AUTH_ALL) &amp;&amp; tech_pvt &amp;&amp; tech_pvt-&gt;key &amp;&amp; sip) {
                 sip_authorization_t const *authorization = NULL;
</pre></div>
<div class="highlight"><pre>committer: Leon de Rooij
comments: 
Added test_reactive to mod_lua freeswitch.Dbh

<span style="color: #000080; font-weight: bold">diff --git a/src/mod/languages/mod_lua/freeswitch.i b/src/mod/languages/mod_lua/freeswitch.i</span>
<span style="color: #000080; font-weight: bold">index 9ccaf8e..25faa5a 100644</span>
<span style="color: #A00000">--- a/src/mod/languages/mod_lua/freeswitch.i</span>
<span style="color: #00A000">+++ b/src/mod/languages/mod_lua/freeswitch.i</span>
<span style="color: #800080; font-weight: bold">@@ -89,6 +89,7 @@ class Dbh {</span>
     ~Dbh();
     bool release();
     bool connected();
<span style="color: #00A000">+    bool test_reactive(char *test_sql, char *drop_sql = NULL, char *reactive_sql = NULL);</span>
     bool query(char *sql, SWIGLUA_FN lua_fun);
     int affected_rows();
 };
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/languages/mod_lua/freeswitch_lua.cpp b/src/mod/languages/mod_lua/freeswitch_lua.cpp</span>
<span style="color: #000080; font-weight: bold">index 01f708d..b388f2e 100644</span>
<span style="color: #A00000">--- a/src/mod/languages/mod_lua/freeswitch_lua.cpp</span>
<span style="color: #00A000">+++ b/src/mod/languages/mod_lua/freeswitch_lua.cpp</span>
<span style="color: #800080; font-weight: bold">@@ -350,6 +350,16 @@ bool Dbh::connected()</span>
   return m_connected;
 }
 
<span style="color: #00A000">+bool Dbh::test_reactive(char *test_sql, char *drop_sql, char *reactive_sql)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+  if (m_connected) {</span>
<span style="color: #00A000">+    if (switch_cache_db_test_reactive(dbh, test_sql, drop_sql, reactive_sql) == SWITCH_TRUE) {</span>
<span style="color: #00A000">+      return true;</span>
<span style="color: #00A000">+    }</span>
<span style="color: #00A000">+  }</span>
<span style="color: #00A000">+  return false;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
 int Dbh::query_callback(void *pArg, int argc, char **argv, char **cargv)
 {
   SWIGLUA_FN *lua_fun = (SWIGLUA_FN *)pArg;
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/languages/mod_lua/freeswitch_lua.h b/src/mod/languages/mod_lua/freeswitch_lua.h</span>
<span style="color: #000080; font-weight: bold">index 5f79662..6411d69 100644</span>
<span style="color: #A00000">--- a/src/mod/languages/mod_lua/freeswitch_lua.h</span>
<span style="color: #00A000">+++ b/src/mod/languages/mod_lua/freeswitch_lua.h</span>
<span style="color: #800080; font-weight: bold">@@ -62,6 +62,7 @@ namespace LUA {</span>
       ~Dbh();
       bool release();
       bool connected();
<span style="color: #00A000">+      bool test_reactive(char *test_sql, char *drop_sql = NULL, char *reactive_sql = NULL);</span>
       bool query(char *sql, SWIGLUA_FN lua_fun);
       int affected_rows();
   };
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/languages/mod_lua/mod_lua_wrap.cpp b/src/mod/languages/mod_lua/mod_lua_wrap.cpp</span>
<span style="color: #000080; font-weight: bold">index f10ed63..1d84a39 100644</span>
<span style="color: #A00000">--- a/src/mod/languages/mod_lua/mod_lua_wrap.cpp</span>
<span style="color: #00A000">+++ b/src/mod/languages/mod_lua/mod_lua_wrap.cpp</span>
<span style="color: #800080; font-weight: bold">@@ -7254,6 +7254,184 @@ fail:</span>
 }
 
 
<span style="color: #00A000">+static int _wrap_Dbh_test_reactive__SWIG_0(lua_State* L) {</span>
<span style="color: #00A000">+  int SWIG_arg = -1;</span>
<span style="color: #00A000">+  LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;</span>
<span style="color: #00A000">+  char *arg2 = (char *) 0 ;</span>
<span style="color: #00A000">+  char *arg3 = (char *) 0 ;</span>
<span style="color: #00A000">+  char *arg4 = (char *) 0 ;</span>
<span style="color: #00A000">+  bool result;</span>
<span style="color: #00A000">+  </span>
<span style="color: #00A000">+  SWIG_check_num_args(&quot;test_reactive&quot;,4,4)</span>
<span style="color: #00A000">+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg(&quot;test_reactive&quot;,1,&quot;LUA::Dbh *&quot;);</span>
<span style="color: #00A000">+  if(!lua_isstring(L,2)) SWIG_fail_arg(&quot;test_reactive&quot;,2,&quot;char *&quot;);</span>
<span style="color: #00A000">+  if(!lua_isstring(L,3)) SWIG_fail_arg(&quot;test_reactive&quot;,3,&quot;char *&quot;);</span>
<span style="color: #00A000">+  if(!lua_isstring(L,4)) SWIG_fail_arg(&quot;test_reactive&quot;,4,&quot;char *&quot;);</span>
<span style="color: #00A000">+  </span>
<span style="color: #00A000">+  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&amp;arg1,SWIGTYPE_p_LUA__Dbh,0))){</span>
<span style="color: #00A000">+    SWIG_fail_ptr(&quot;Dbh_test_reactive&quot;,1,SWIGTYPE_p_LUA__Dbh);</span>
<span style="color: #00A000">+  }</span>
<span style="color: #00A000">+  </span>
<span style="color: #00A000">+  arg2 = (char *)lua_tostring(L, 2);</span>
<span style="color: #00A000">+  arg3 = (char *)lua_tostring(L, 3);</span>
<span style="color: #00A000">+  arg4 = (char *)lua_tostring(L, 4);</span>
<span style="color: #00A000">+  result = (bool)(arg1)-&gt;test_reactive(arg2,arg3,arg4);</span>
<span style="color: #00A000">+  SWIG_arg=0;</span>
<span style="color: #00A000">+  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;</span>
<span style="color: #00A000">+  return SWIG_arg;</span>
<span style="color: #00A000">+  </span>
<span style="color: #00A000">+  if(0) SWIG_fail;</span>
<span style="color: #00A000">+  </span>
<span style="color: #00A000">+fail:</span>
<span style="color: #00A000">+  lua_error(L);</span>
<span style="color: #00A000">+  return SWIG_arg;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+static int _wrap_Dbh_test_reactive__SWIG_1(lua_State* L) {</span>
<span style="color: #00A000">+  int SWIG_arg = -1;</span>
<span style="color: #00A000">+  LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;</span>
<span style="color: #00A000">+  char *arg2 = (char *) 0 ;</span>
<span style="color: #00A000">+  char *arg3 = (char *) 0 ;</span>
<span style="color: #00A000">+  bool result;</span>
<span style="color: #00A000">+  </span>
<span style="color: #00A000">+  SWIG_check_num_args(&quot;test_reactive&quot;,3,3)</span>
<span style="color: #00A000">+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg(&quot;test_reactive&quot;,1,&quot;LUA::Dbh *&quot;);</span>
<span style="color: #00A000">+  if(!lua_isstring(L,2)) SWIG_fail_arg(&quot;test_reactive&quot;,2,&quot;char *&quot;);</span>
<span style="color: #00A000">+  if(!lua_isstring(L,3)) SWIG_fail_arg(&quot;test_reactive&quot;,3,&quot;char *&quot;);</span>
<span style="color: #00A000">+  </span>
<span style="color: #00A000">+  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&amp;arg1,SWIGTYPE_p_LUA__Dbh,0))){</span>
<span style="color: #00A000">+    SWIG_fail_ptr(&quot;Dbh_test_reactive&quot;,1,SWIGTYPE_p_LUA__Dbh);</span>
<span style="color: #00A000">+  }</span>
<span style="color: #00A000">+  </span>
<span style="color: #00A000">+  arg2 = (char *)lua_tostring(L, 2);</span>
<span style="color: #00A000">+  arg3 = (char *)lua_tostring(L, 3);</span>
<span style="color: #00A000">+  result = (bool)(arg1)-&gt;test_reactive(arg2,arg3);</span>
<span style="color: #00A000">+  SWIG_arg=0;</span>
<span style="color: #00A000">+  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;</span>
<span style="color: #00A000">+  return SWIG_arg;</span>
<span style="color: #00A000">+  </span>
<span style="color: #00A000">+  if(0) SWIG_fail;</span>
<span style="color: #00A000">+  </span>
<span style="color: #00A000">+fail:</span>
<span style="color: #00A000">+  lua_error(L);</span>
<span style="color: #00A000">+  return SWIG_arg;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+static int _wrap_Dbh_test_reactive__SWIG_2(lua_State* L) {</span>
<span style="color: #00A000">+  int SWIG_arg = -1;</span>
<span style="color: #00A000">+  LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;</span>
<span style="color: #00A000">+  char *arg2 = (char *) 0 ;</span>
<span style="color: #00A000">+  bool result;</span>
<span style="color: #00A000">+  </span>
<span style="color: #00A000">+  SWIG_check_num_args(&quot;test_reactive&quot;,2,2)</span>
<span style="color: #00A000">+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg(&quot;test_reactive&quot;,1,&quot;LUA::Dbh *&quot;);</span>
<span style="color: #00A000">+  if(!lua_isstring(L,2)) SWIG_fail_arg(&quot;test_reactive&quot;,2,&quot;char *&quot;);</span>
<span style="color: #00A000">+  </span>
<span style="color: #00A000">+  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&amp;arg1,SWIGTYPE_p_LUA__Dbh,0))){</span>
<span style="color: #00A000">+    SWIG_fail_ptr(&quot;Dbh_test_reactive&quot;,1,SWIGTYPE_p_LUA__Dbh);</span>
<span style="color: #00A000">+  }</span>
<span style="color: #00A000">+  </span>
<span style="color: #00A000">+  arg2 = (char *)lua_tostring(L, 2);</span>
<span style="color: #00A000">+  result = (bool)(arg1)-&gt;test_reactive(arg2);</span>
<span style="color: #00A000">+  SWIG_arg=0;</span>
<span style="color: #00A000">+  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;</span>
<span style="color: #00A000">+  return SWIG_arg;</span>
<span style="color: #00A000">+  </span>
<span style="color: #00A000">+  if(0) SWIG_fail;</span>
<span style="color: #00A000">+  </span>
<span style="color: #00A000">+fail:</span>
<span style="color: #00A000">+  lua_error(L);</span>
<span style="color: #00A000">+  return SWIG_arg;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+static int _wrap_Dbh_test_reactive(lua_State* L) {</span>
<span style="color: #00A000">+  int argc;</span>
<span style="color: #00A000">+  int argv[5]={</span>
<span style="color: #00A000">+    1,2,3,4,5</span>
<span style="color: #00A000">+  };</span>
<span style="color: #00A000">+  </span>
<span style="color: #00A000">+  argc = lua_gettop(L);</span>
<span style="color: #00A000">+  if (argc == 2) {</span>
<span style="color: #00A000">+    int _v;</span>
<span style="color: #00A000">+    {</span>
<span style="color: #00A000">+      void *ptr;</span>
<span style="color: #00A000">+      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &amp;ptr, SWIGTYPE_p_LUA__Dbh, 0)) {</span>
<span style="color: #00A000">+        _v = 0;</span>
<span style="color: #00A000">+      } else {</span>
<span style="color: #00A000">+        _v = 1;</span>
<span style="color: #00A000">+      }</span>
<span style="color: #00A000">+    }</span>
<span style="color: #00A000">+    if (_v) {</span>
<span style="color: #00A000">+      {</span>
<span style="color: #00A000">+        _v = lua_isstring(L,argv[1]);</span>
<span style="color: #00A000">+      }</span>
<span style="color: #00A000">+      if (_v) {</span>
<span style="color: #00A000">+        return _wrap_Dbh_test_reactive__SWIG_2(L);</span>
<span style="color: #00A000">+      }</span>
<span style="color: #00A000">+    }</span>
<span style="color: #00A000">+  }</span>
<span style="color: #00A000">+  if (argc == 3) {</span>
<span style="color: #00A000">+    int _v;</span>
<span style="color: #00A000">+    {</span>
<span style="color: #00A000">+      void *ptr;</span>
<span style="color: #00A000">+      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &amp;ptr, SWIGTYPE_p_LUA__Dbh, 0)) {</span>
<span style="color: #00A000">+        _v = 0;</span>
<span style="color: #00A000">+      } else {</span>
<span style="color: #00A000">+        _v = 1;</span>
<span style="color: #00A000">+      }</span>
<span style="color: #00A000">+    }</span>
<span style="color: #00A000">+    if (_v) {</span>
<span style="color: #00A000">+      {</span>
<span style="color: #00A000">+        _v = lua_isstring(L,argv[1]);</span>
<span style="color: #00A000">+      }</span>
<span style="color: #00A000">+      if (_v) {</span>
<span style="color: #00A000">+        {</span>
<span style="color: #00A000">+          _v = lua_isstring(L,argv[2]);</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+        if (_v) {</span>
<span style="color: #00A000">+          return _wrap_Dbh_test_reactive__SWIG_1(L);</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">+  if (argc == 4) {</span>
<span style="color: #00A000">+    int _v;</span>
<span style="color: #00A000">+    {</span>
<span style="color: #00A000">+      void *ptr;</span>
<span style="color: #00A000">+      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &amp;ptr, SWIGTYPE_p_LUA__Dbh, 0)) {</span>
<span style="color: #00A000">+        _v = 0;</span>
<span style="color: #00A000">+      } else {</span>
<span style="color: #00A000">+        _v = 1;</span>
<span style="color: #00A000">+      }</span>
<span style="color: #00A000">+    }</span>
<span style="color: #00A000">+    if (_v) {</span>
<span style="color: #00A000">+      {</span>
<span style="color: #00A000">+        _v = lua_isstring(L,argv[1]);</span>
<span style="color: #00A000">+      }</span>
<span style="color: #00A000">+      if (_v) {</span>
<span style="color: #00A000">+        {</span>
<span style="color: #00A000">+          _v = lua_isstring(L,argv[2]);</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+        if (_v) {</span>
<span style="color: #00A000">+          {</span>
<span style="color: #00A000">+            _v = lua_isstring(L,argv[3]);</span>
<span style="color: #00A000">+          }</span>
<span style="color: #00A000">+          if (_v) {</span>
<span style="color: #00A000">+            return _wrap_Dbh_test_reactive__SWIG_0(L);</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">+  }</span>
<span style="color: #00A000">+  </span>
<span style="color: #00A000">+  lua_pushstring(L,&quot;No matching function for overloaded &#39;Dbh_test_reactive&#39;&quot;);</span>
<span style="color: #00A000">+  lua_error(L);return 0;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
 static int _wrap_Dbh_query(lua_State* L) {
   int SWIG_arg = -1;
   LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
<span style="color: #800080; font-weight: bold">@@ -7328,6 +7506,7 @@ delete arg1;</span>
 static swig_lua_method swig_LUA_Dbh_methods[] = {
     {&quot;release&quot;, _wrap_Dbh_release}, 
     {&quot;connected&quot;, _wrap_Dbh_connected}, 
<span style="color: #00A000">+    {&quot;test_reactive&quot;, _wrap_Dbh_test_reactive}, </span>
     {&quot;query&quot;, _wrap_Dbh_query}, 
     {&quot;affected_rows&quot;, _wrap_Dbh_affected_rows}, 
     {0,0}
</pre></div>
<div class="highlight"><pre>committer: Leon de Rooij
comments: 
Added optional core: prefix to first arg passed to freeswitch.Dbh for giving direct access to sqlite db

<span style="color: #000080; font-weight: bold">diff --git a/src/mod/languages/mod_lua/freeswitch_lua.cpp b/src/mod/languages/mod_lua/freeswitch_lua.cpp</span>
<span style="color: #000080; font-weight: bold">index 1a170dc..01f708d 100644</span>
<span style="color: #A00000">--- a/src/mod/languages/mod_lua/freeswitch_lua.cpp</span>
<span style="color: #00A000">+++ b/src/mod/languages/mod_lua/freeswitch_lua.cpp</span>
<span style="color: #800080; font-weight: bold">@@ -312,15 +312,21 @@ switch_status_t Session::run_dtmf_callback(void *input, switch_input_type_t ityp</span>
 Dbh::Dbh(char *dsn, char *user, char *pass)
 {
   switch_cache_db_connection_options_t options = { {0} };
<span style="color: #00A000">+  const char *prefix = &quot;core:&quot;;</span>
<span style="color: #00A000">+  m_connected = false;</span>
 
<span style="color: #A00000">-  options.odbc_options.dsn = dsn;</span>
<span style="color: #A00000">-  options.odbc_options.user = user;</span>
<span style="color: #A00000">-  options.odbc_options.pass = pass;</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-  if (switch_cache_db_get_db_handle(&amp;dbh, SCDB_TYPE_ODBC, &amp;options) == SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #A00000">-    m_connected = true;</span>
<span style="color: #00A000">+  if (strstr(dsn, prefix) == dsn) {</span>
<span style="color: #00A000">+    options.core_db_options.db_path = &amp;dsn[strlen(prefix)];</span>
<span style="color: #00A000">+    if (switch_cache_db_get_db_handle(&amp;dbh, SCDB_TYPE_CORE_DB, &amp;options) == SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+      m_connected = true;</span>
<span style="color: #00A000">+    }</span>
   } else {
<span style="color: #A00000">-    m_connected = false;</span>
<span style="color: #00A000">+    options.odbc_options.dsn = dsn;</span>
<span style="color: #00A000">+    options.odbc_options.user = user;</span>
<span style="color: #00A000">+    options.odbc_options.pass = pass;</span>
<span style="color: #00A000">+    if (switch_cache_db_get_db_handle(&amp;dbh, SCDB_TYPE_ODBC, &amp;options) == SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+      m_connected = true;</span>
<span style="color: #00A000">+    }</span>
   }
 }
 
</pre></div>
<div class="highlight"><pre>committer: David Yat Sin
comments: 
chlog: freetdm - isdn: fix for not including some bearer-cap contents on BRI

<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c</span>
<span style="color: #000080; font-weight: bold">index 64147b7..23fe08b 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c</span>
<span style="color: #00A000">+++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c</span>
<span style="color: #800080; font-weight: bold">@@ -873,38 +873,32 @@ ftdm_status_t set_bear_cap_ie(ftdm_channel_t *ftdmchan, BearCap *bearCap)</span>
         bearCap-&gt;tranMode.pres = PRSNT_NODEF;
         bearCap-&gt;tranMode.val = IN_TM_CIRCUIT;
 
<span style="color: #A00000">-        if (!FTDM_SPAN_IS_BRI(ftdmchan-&gt;span)) {</span>
<span style="color: #A00000">-                /* Trillium stack rejests lyr1Ident on BRI, but Netbricks always sends it.</span>
<span style="color: #A00000">-                Check with Trillium if this ever causes calls to fail in the field */</span>
<span style="color: #00A000">+        bearCap-&gt;usrInfoLyr1Prot.pres = PRSNT_NODEF;</span>
<span style="color: #00A000">+        bearCap-&gt;usrInfoLyr1Prot.val = sngisdn_get_usrInfoLyr1Prot_from_user(ftdmchan-&gt;caller_data.bearer_layer1);</span>
 
<span style="color: #A00000">-                /* PRI only params */</span>
<span style="color: #A00000">-                bearCap-&gt;usrInfoLyr1Prot.pres = PRSNT_NODEF;</span>
<span style="color: #A00000">-                bearCap-&gt;usrInfoLyr1Prot.val = sngisdn_get_usrInfoLyr1Prot_from_user(ftdmchan-&gt;caller_data.bearer_layer1);</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                switch (signal_data-&gt;switchtype) {</span>
<span style="color: #A00000">-                        case SNGISDN_SWITCH_NI2:</span>
<span style="color: #A00000">-                        case SNGISDN_SWITCH_4ESS:</span>
<span style="color: #A00000">-                        case SNGISDN_SWITCH_5ESS:</span>
<span style="color: #A00000">-                        case SNGISDN_SWITCH_DMS100:</span>
<span style="color: #A00000">-                        case SNGISDN_SWITCH_INSNET:</span>
<span style="color: #A00000">-                                if (bearCap-&gt;usrInfoLyr1Prot.val == IN_UIL1_G711ALAW) {</span>
<span style="color: #A00000">-                                        ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, &quot;Overriding bearer cap to u-law\n&quot;);</span>
<span style="color: #A00000">-                                        bearCap-&gt;usrInfoLyr1Prot.val = IN_UIL1_G711ULAW;</span>
<span style="color: #A00000">-                                }</span>
<span style="color: #A00000">-                                break;</span>
<span style="color: #A00000">-                        case SNGISDN_SWITCH_EUROISDN:</span>
<span style="color: #A00000">-                        case SNGISDN_SWITCH_QSIG:</span>
<span style="color: #A00000">-                                if (bearCap-&gt;usrInfoLyr1Prot.val == IN_UIL1_G711ULAW) {</span>
<span style="color: #A00000">-                                        ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, &quot;Overriding bearer cap to a-law\n&quot;);</span>
<span style="color: #A00000">-                                        bearCap-&gt;usrInfoLyr1Prot.val = IN_UIL1_G711ALAW;</span>
<span style="color: #A00000">-                                }</span>
<span style="color: #A00000">-                                break;</span>
<span style="color: #A00000">-                }</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                </span>
<span style="color: #A00000">-                bearCap-&gt;lyr1Ident.pres = PRSNT_NODEF;</span>
<span style="color: #A00000">-                bearCap-&gt;lyr1Ident.val = IN_L1_IDENT;</span>
<span style="color: #00A000">+        switch (signal_data-&gt;switchtype) {</span>
<span style="color: #00A000">+                case SNGISDN_SWITCH_NI2:</span>
<span style="color: #00A000">+                case SNGISDN_SWITCH_4ESS:</span>
<span style="color: #00A000">+                case SNGISDN_SWITCH_5ESS:</span>
<span style="color: #00A000">+                case SNGISDN_SWITCH_DMS100:</span>
<span style="color: #00A000">+                case SNGISDN_SWITCH_INSNET:</span>
<span style="color: #00A000">+                        if (bearCap-&gt;usrInfoLyr1Prot.val == IN_UIL1_G711ALAW) {</span>
<span style="color: #00A000">+                                ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, &quot;Overriding bearer cap to u-law\n&quot;);</span>
<span style="color: #00A000">+                                bearCap-&gt;usrInfoLyr1Prot.val = IN_UIL1_G711ULAW;</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+                        break;</span>
<span style="color: #00A000">+                case SNGISDN_SWITCH_EUROISDN:</span>
<span style="color: #00A000">+                case SNGISDN_SWITCH_QSIG:</span>
<span style="color: #00A000">+                        if (bearCap-&gt;usrInfoLyr1Prot.val == IN_UIL1_G711ULAW) {</span>
<span style="color: #00A000">+                                ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, &quot;Overriding bearer cap to a-law\n&quot;);</span>
<span style="color: #00A000">+                                bearCap-&gt;usrInfoLyr1Prot.val = IN_UIL1_G711ALAW;</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+                        break;</span>
         }
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        bearCap-&gt;lyr1Ident.pres = PRSNT_NODEF;</span>
<span style="color: #00A000">+        bearCap-&gt;lyr1Ident.val = IN_L1_IDENT;</span>
<span style="color: #00A000">+        </span>
         return FTDM_SUCCESS;
 }
 
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments: 
FS-2771

<span style="color: #000080; font-weight: bold">diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c</span>
<span style="color: #000080; font-weight: bold">index 472f2d9..12b3193 100644</span>
<span style="color: #A00000">--- a/src/mod/applications/mod_conference/mod_conference.c</span>
<span style="color: #00A000">+++ b/src/mod/applications/mod_conference/mod_conference.c</span>
<span style="color: #800080; font-weight: bold">@@ -152,7 +152,8 @@ typedef enum {</span>
         CFLAG_BRIDGE_TO = (1 &lt;&lt; 6),
         CFLAG_WAIT_MOD = (1 &lt;&lt; 7),
         CFLAG_VID_FLOOR = (1 &lt;&lt; 8),
<span style="color: #A00000">-        CFLAG_WASTE_BANDWIDTH = (1 &lt;&lt; 9)</span>
<span style="color: #00A000">+        CFLAG_WASTE_BANDWIDTH = (1 &lt;&lt; 9),</span>
<span style="color: #00A000">+        CFLAG_OUTCALL = (1 &lt;&lt; 10)</span>
 } conf_flag_t;
 
 typedef enum {
<span style="color: #800080; font-weight: bold">@@ -288,6 +289,8 @@ typedef struct conference_obj {</span>
         uint32_t avg_tally;
         switch_time_t run_time;
         char *uuid_str;
<span style="color: #00A000">+        uint32_t originating;</span>
<span style="color: #00A000">+        switch_call_cause_t cancel_cause;</span>
 } conference_obj_t;
 
 /* Relationship with another member */
<span style="color: #800080; font-weight: bold">@@ -395,11 +398,16 @@ SWITCH_STANDARD_API(conf_api_main);</span>
 static switch_status_t conference_outcall(conference_obj_t *conference,
                                                                                   char *conference_name,
                                                                                   switch_core_session_t *session,
<span style="color: #A00000">-                                                                                  char *bridgeto, uint32_t timeout, char *flags, char *cid_name, char *cid_num, switch_call_cause_t *cause);</span>
<span style="color: #00A000">+                                                                                  char *bridgeto, uint32_t timeout, </span>
<span style="color: #00A000">+                                                                                  char *flags, </span>
<span style="color: #00A000">+                                                                                  char *cid_name, </span>
<span style="color: #00A000">+                                                                                  char *cid_num, </span>
<span style="color: #00A000">+                                                                                  switch_call_cause_t *cause,</span>
<span style="color: #00A000">+                                                                                  switch_call_cause_t *cancel_cause);</span>
 static switch_status_t conference_outcall_bg(conference_obj_t *conference,
                                                                                          char *conference_name,
                                                                                          switch_core_session_t *session, char *bridgeto, uint32_t timeout, const char *flags, const char *cid_name,
<span style="color: #A00000">-                                                                                         const char *cid_num, const char *call_uuid);</span>
<span style="color: #00A000">+                                                                                         const char *cid_num, const char *call_uuid, switch_call_cause_t *cancel_cause);</span>
 SWITCH_STANDARD_APP(conference_function);
 static void launch_conference_thread(conference_obj_t *conference);
 static void launch_conference_video_thread(conference_obj_t *conference);
<span style="color: #800080; font-weight: bold">@@ -1381,6 +1389,14 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v</span>
         /* Rinse ... Repeat */
   end:
 
<span style="color: #00A000">+        if (switch_test_flag(conference, CFLAG_OUTCALL)) {</span>
<span style="color: #00A000">+                conference-&gt;cancel_cause = SWITCH_CAUSE_ORIGINATOR_CANCEL;</span>
<span style="color: #00A000">+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, &quot;Ending pending outcall channels for Conference: &#39;%s&#39;\n&quot;, conference-&gt;name);</span>
<span style="color: #00A000">+                while(conference-&gt;originating) {</span>
<span style="color: #00A000">+                        switch_yield(200000);</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+</span>
         if (switch_event_create(&amp;event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, &quot;proto&quot;, CONF_CHAT_PROTO);
                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, &quot;login&quot;, conference-&gt;name);
<span style="color: #800080; font-weight: bold">@@ -2404,6 +2420,8 @@ static void conference_loop_output(conference_member_t *member)</span>
 
                         switch_channel_set_private(channel, &quot;_conference_autocall_list_&quot;, NULL);
 
<span style="color: #00A000">+                        switch_set_flag(member-&gt;conference, CFLAG_OUTCALL);</span>
<span style="color: #00A000">+</span>
                         if (toval) {
                                 to = atoi(toval);
                                 if (to &lt; 10 || to &gt; 500) {
<span style="color: #800080; font-weight: bold">@@ -2422,7 +2440,8 @@ static void conference_loop_output(conference_member_t *member)</span>
                                 for (x = 0; x &lt; argc; x++) {
                                         char *dial_str = switch_mprintf(&quot;%s%s&quot;, switch_str_nil(prefix), argv[x]);
                                         switch_assert(dial_str);
<span style="color: #A00000">-                                        conference_outcall_bg(member-&gt;conference, NULL, NULL, dial_str, to, switch_str_nil(flags), cid_name, cid_num, NULL);</span>
<span style="color: #00A000">+                                        conference_outcall_bg(member-&gt;conference, NULL, NULL, dial_str, to, switch_str_nil(flags), cid_name, cid_num, NULL, </span>
<span style="color: #00A000">+                                                                                  &amp;member-&gt;conference-&gt;cancel_cause);</span>
                                         switch_safe_free(dial_str);
                                 }
                                 switch_safe_free(cpstr);
<span style="color: #800080; font-weight: bold">@@ -4244,9 +4263,9 @@ static switch_status_t conf_api_sub_dial(conference_obj_t *conference, switch_st</span>
         }
 
         if (conference) {
<span style="color: #A00000">-                conference_outcall(conference, NULL, NULL, argv[2], 60, NULL, argv[4], argv[3], &amp;cause);</span>
<span style="color: #00A000">+                conference_outcall(conference, NULL, NULL, argv[2], 60, NULL, argv[4], argv[3], &amp;cause, NULL);</span>
         } else {
<span style="color: #A00000">-                conference_outcall(NULL, argv[0], NULL, argv[2], 60, NULL, argv[4], argv[3], &amp;cause);</span>
<span style="color: #00A000">+                conference_outcall(NULL, argv[0], NULL, argv[2], 60, NULL, argv[4], argv[3], &amp;cause, NULL);</span>
         }
         stream-&gt;write_function(stream, &quot;Call Requested: result: [%s]\n&quot;, switch_channel_cause2str(cause));
 
<span style="color: #800080; font-weight: bold">@@ -4269,9 +4288,9 @@ static switch_status_t conf_api_sub_bgdial(conference_obj_t *conference, switch_</span>
         switch_uuid_format(uuid_str, &amp;uuid);
 
         if (conference) {
<span style="color: #A00000">-                conference_outcall_bg(conference, NULL, NULL, argv[2], 60, NULL, argv[4], argv[3], uuid_str);</span>
<span style="color: #00A000">+                conference_outcall_bg(conference, NULL, NULL, argv[2], 60, NULL, argv[4], argv[3], uuid_str, NULL);</span>
         } else {
<span style="color: #A00000">-                conference_outcall_bg(NULL, argv[0], NULL, argv[2], 60, NULL, argv[4], argv[3], uuid_str);</span>
<span style="color: #00A000">+                conference_outcall_bg(NULL, argv[0], NULL, argv[2], 60, NULL, argv[4], argv[3], uuid_str, NULL);</span>
         }
 
         stream-&gt;write_function(stream, &quot;OK Job-UUID: %s\n&quot;, uuid_str);
<span style="color: #800080; font-weight: bold">@@ -4785,7 +4804,11 @@ SWITCH_STANDARD_API(conf_api_main)</span>
 static switch_status_t conference_outcall(conference_obj_t *conference,
                                                                                   char *conference_name,
                                                                                   switch_core_session_t *session,
<span style="color: #A00000">-                                                                                  char *bridgeto, uint32_t timeout, char *flags, char *cid_name, char *cid_num, switch_call_cause_t *cause)</span>
<span style="color: #00A000">+                                                                                  char *bridgeto, uint32_t timeout, </span>
<span style="color: #00A000">+                                                                                  char *flags, char *cid_name, </span>
<span style="color: #00A000">+                                                                                  char *cid_num, </span>
<span style="color: #00A000">+                                                                                  switch_call_cause_t *cause,</span>
<span style="color: #00A000">+                                                                                  switch_call_cause_t *cancel_cause)</span>
 {
         switch_core_session_t *peer_session = NULL;
         switch_channel_t *peer_channel;
<span style="color: #800080; font-weight: bold">@@ -4831,8 +4854,15 @@ static switch_status_t conference_outcall(conference_obj_t *conference,</span>
 
         /* establish an outbound call leg */
 
<span style="color: #A00000">-        if (switch_ivr_originate(session, &amp;peer_session, cause, bridgeto, timeout, NULL, cid_name, cid_num, NULL, NULL, SOF_NO_LIMITS, NULL) !=</span>
<span style="color: #A00000">-                SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+        switch_mutex_lock(conference-&gt;mutex);</span>
<span style="color: #00A000">+        conference-&gt;originating++;</span>
<span style="color: #00A000">+        switch_mutex_unlock(conference-&gt;mutex);</span>
<span style="color: #00A000">+        status = switch_ivr_originate(session, &amp;peer_session, cause, bridgeto, timeout, NULL, cid_name, cid_num, NULL, NULL, SOF_NO_LIMITS, cancel_cause);</span>
<span style="color: #00A000">+        switch_mutex_lock(conference-&gt;mutex);</span>
<span style="color: #00A000">+        conference-&gt;originating--;</span>
<span style="color: #00A000">+        switch_mutex_unlock(conference-&gt;mutex);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (status != SWITCH_STATUS_SUCCESS) {</span>
                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, &quot;Cannot create outgoing channel, cause: %s\n&quot;,
                                                   switch_channel_cause2str(*cause));
                 if (caller_channel) {
<span style="color: #800080; font-weight: bold">@@ -4909,6 +4939,7 @@ struct bg_call {</span>
         char *cid_num;
         char *conference_name;
         char *uuid;
<span style="color: #00A000">+        switch_call_cause_t *cancel_cause;</span>
         switch_memory_pool_t *pool;
 };
 
<span style="color: #800080; font-weight: bold">@@ -4921,7 +4952,7 @@ static void *SWITCH_THREAD_FUNC conference_outcall_run(switch_thread_t *thread,</span>
                 switch_event_t *event;
 
                 conference_outcall(call-&gt;conference, call-&gt;conference_name,
<span style="color: #A00000">-                                                   call-&gt;session, call-&gt;bridgeto, call-&gt;timeout, call-&gt;flags, call-&gt;cid_name, call-&gt;cid_num, &amp;cause);</span>
<span style="color: #00A000">+                                                   call-&gt;session, call-&gt;bridgeto, call-&gt;timeout, call-&gt;flags, call-&gt;cid_name, call-&gt;cid_num, &amp;cause, call-&gt;cancel_cause);</span>
 
                 if (call-&gt;conference &amp;&amp; test_eflag(call-&gt;conference, EFLAG_BGDIAL_RESULT) &amp;&amp;
                         switch_event_create_subclass(&amp;event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
<span style="color: #800080; font-weight: bold">@@ -4949,7 +4980,7 @@ static void *SWITCH_THREAD_FUNC conference_outcall_run(switch_thread_t *thread,</span>
 static switch_status_t conference_outcall_bg(conference_obj_t *conference,
                                                                                          char *conference_name,
                                                                                          switch_core_session_t *session, char *bridgeto, uint32_t timeout, const char *flags, const char *cid_name,
<span style="color: #A00000">-                                                                                         const char *cid_num, const char *call_uuid)</span>
<span style="color: #00A000">+                                                                                         const char *cid_num, const char *call_uuid, switch_call_cause_t *cancel_cause)</span>
 {
         struct bg_call *call = NULL;
         switch_thread_t *thread;
<span style="color: #800080; font-weight: bold">@@ -4963,6 +4994,7 @@ static switch_status_t conference_outcall_bg(conference_obj_t *conference,</span>
         call-&gt;conference = conference;
         call-&gt;session = session;
         call-&gt;timeout = timeout;
<span style="color: #00A000">+        call-&gt;cancel_cause = cancel_cause;</span>
 
         if (conference) {
                 pool = conference-&gt;pool;
<span style="color: #800080; font-weight: bold">@@ -5717,7 +5749,7 @@ SWITCH_STANDARD_APP(conference_function)</span>
         /* if we&#39;re using &quot;bridge:&quot; make an outbound call and bridge it in */
         if (!zstr(bridgeto) &amp;&amp; strcasecmp(bridgeto, &quot;none&quot;)) {
                 switch_call_cause_t cause;
<span style="color: #A00000">-                if (conference_outcall(conference, NULL, session, bridgeto, 60, NULL, NULL, NULL, &amp;cause) != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                if (conference_outcall(conference, NULL, session, bridgeto, 60, NULL, NULL, NULL, &amp;cause, NULL) != SWITCH_STATUS_SUCCESS) {</span>
                         goto done;
                 }
         } else {
</pre></div>
<div class="highlight"><pre>committer: Daniel Swarbrick
comments: 
update mod_sofia management interface OID

<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 eb5e2ad..6c91ce1 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">@@ -4850,7 +4850,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)</span>
         sofia_endpoint_interface-&gt;state_handler = &amp;sofia_event_handlers;
 
         management_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_MANAGEMENT_INTERFACE);
<span style="color: #A00000">-        management_interface-&gt;relative_oid = &quot;1&quot;;</span>
<span style="color: #00A000">+        management_interface-&gt;relative_oid = &quot;1001&quot;;</span>
         management_interface-&gt;management_function = sofia_manage;
 
         SWITCH_ADD_API(api_interface, &quot;sofia&quot;, &quot;Sofia Controls&quot;, sofia_function, &quot;&lt;cmd&gt; &lt;args&gt;&quot;);
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments: 
revert change from 2800ea199d6c233fe0aeee91de3be33dfee19607 and add disconnect packet on listener kill

<span style="color: #000080; font-weight: bold">diff --git a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c</span>
<span style="color: #000080; font-weight: bold">index 344b0ee..f3a2c92 100644</span>
<span style="color: #A00000">--- a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c</span>
<span style="color: #800080; font-weight: bold">@@ -32,7 +32,7 @@</span>
 #include &lt;switch.h&gt;
 #define CMD_BUFLEN 1024 * 1000
 #define MAX_QUEUE_LEN 25000
<span style="color: #A00000">-#define MAX_MISSED 2000</span>
<span style="color: #00A000">+#define MAX_MISSED 500</span>
 SWITCH_MODULE_LOAD_FUNCTION(mod_event_socket_load);
 SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_socket_shutdown);
 SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime);
<span style="color: #800080; font-weight: bold">@@ -143,7 +143,7 @@ static const char *format2str(event_format_t format)</span>
 }
 
 static void remove_listener(listener_t *listener);
<span style="color: #A00000">-static void kill_listener(listener_t *l);</span>
<span style="color: #00A000">+static void kill_listener(listener_t *l, const char *message);</span>
 static void kill_all_listeners(void);
 
 static uint32_t next_id(void)
<span style="color: #800080; font-weight: bold">@@ -170,7 +170,7 @@ static switch_status_t socket_logger(const switch_log_node_t *node, switch_log_l</span>
                 if (switch_test_flag(l, LFLAG_LOG) &amp;&amp; l-&gt;level &gt;= node-&gt;level) {
                         switch_log_node_t *dnode = switch_log_node_dup(node);
 
<span style="color: #A00000">-                        if (switch_queue_push(l-&gt;log_queue, dnode) == SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                        if (switch_queue_trypush(l-&gt;log_queue, dnode) == SWITCH_STATUS_SUCCESS) {</span>
                                 if (l-&gt;lost_logs) {
                                         int ll = l-&gt;lost_logs;
                                         switch_event_t *event;
<span style="color: #800080; font-weight: bold">@@ -184,7 +184,7 @@ static switch_status_t socket_logger(const switch_log_node_t *node, switch_log_l</span>
                         } else {
                                 switch_log_node_free(&amp;dnode);
                                 if (++l-&gt;lost_logs &gt; MAX_MISSED) {
<span style="color: #A00000">-                                        kill_listener(l);</span>
<span style="color: #00A000">+                                        kill_listener(l, &quot;Disconnected due to log queue failure.\n&quot;);</span>
                                 }
                         }
                 }
<span style="color: #800080; font-weight: bold">@@ -366,7 +366,7 @@ static void event_handler(switch_event_t *event)</span>
 
                 if (send) {
                         if (switch_event_dup(&amp;clone, event) == SWITCH_STATUS_SUCCESS) {
<span style="color: #A00000">-                                if (switch_queue_push(l-&gt;event_queue, clone) == SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                                if (switch_queue_trypush(l-&gt;event_queue, clone) == SWITCH_STATUS_SUCCESS) {</span>
                                         if (l-&gt;lost_events) {
                                                 int le = l-&gt;lost_events;
                                                 l-&gt;lost_events = 0;
<span style="color: #800080; font-weight: bold">@@ -379,7 +379,7 @@ static void event_handler(switch_event_t *event)</span>
                                         }
                                 } else {
                                         if (++l-&gt;lost_events &gt; MAX_MISSED) {
<span style="color: #A00000">-                                                kill_listener(l);</span>
<span style="color: #00A000">+                                                kill_listener(l, &quot;Disconnected due to event queue failure.\n&quot;);</span>
                                         }
                                         switch_event_destroy(&amp;clone);
                                 }
<span style="color: #800080; font-weight: bold">@@ -579,8 +579,41 @@ static void remove_listener(listener_t *listener)</span>
         switch_mutex_unlock(globals.listener_mutex);
 }
 
<span style="color: #A00000">-static void kill_listener(listener_t *l)</span>
<span style="color: #00A000">+static void send_disconnect(listener_t *listener, const char *message)</span>
 {
<span style="color: #00A000">+        </span>
<span style="color: #00A000">+        char disco_buf[512] = &quot;&quot;;</span>
<span style="color: #00A000">+        switch_size_t len, mlen;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (zstr(message)) {</span>
<span style="color: #00A000">+                message = &quot;Disconnected.\n&quot;;</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        mlen = strlen(message);</span>
<span style="color: #00A000">+        </span>
<span style="color: #00A000">+        if (listener-&gt;session) {</span>
<span style="color: #00A000">+                switch_snprintf(disco_buf, sizeof(disco_buf), &quot;Content-Type: text/disconnect-notice\n&quot;</span>
<span style="color: #00A000">+                                                &quot;Controlled-Session-UUID: %s\n&quot;</span>
<span style="color: #00A000">+                                                &quot;Content-Disposition: disconnect\n&quot; &quot;Content-Length: %d\n\n&quot;, switch_core_session_get_uuid(listener-&gt;session), mlen);</span>
<span style="color: #00A000">+        } else {</span>
<span style="color: #00A000">+                switch_snprintf(disco_buf, sizeof(disco_buf), &quot;Content-Type: text/disconnect-notice\nContent-Length: %d\n\n&quot;, mlen);</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+        </span>
<span style="color: #00A000">+        len = strlen(disco_buf);</span>
<span style="color: #00A000">+        switch_socket_send(listener-&gt;sock, disco_buf, &amp;len);</span>
<span style="color: #00A000">+        if (len &gt; 0) {</span>
<span style="color: #00A000">+                len = mlen;</span>
<span style="color: #00A000">+                switch_socket_send(listener-&gt;sock, message, &amp;len);</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+static void kill_listener(listener_t *l, const char *message)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (message) {</span>
<span style="color: #00A000">+                send_disconnect(l, message);</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+</span>
         switch_clear_flag(l, LFLAG_RUNNING);
         if (l-&gt;sock) {
                 switch_socket_shutdown(l-&gt;sock, SWITCH_SHUTDOWN_READWRITE);
<span style="color: #800080; font-weight: bold">@@ -595,7 +628,7 @@ static void kill_all_listeners(void)</span>
 
         switch_mutex_lock(globals.listener_mutex);
         for (l = listen_list.listeners; l; l = l-&gt;next) {
<span style="color: #A00000">-                kill_listener(l);</span>
<span style="color: #00A000">+                kill_listener(l, &quot;The system is being shut down.\n&quot;);</span>
         }
         switch_mutex_unlock(globals.listener_mutex);
 }
<span style="color: #800080; font-weight: bold">@@ -1233,7 +1266,7 @@ static switch_status_t read_packet(listener_t *listener, switch_event_t **event,</span>
                                 if (switch_channel_get_state(chan) &lt; CS_HANGUP &amp;&amp; switch_channel_test_flag(chan, CF_DIVERT_EVENTS)) {
                                         switch_event_t *e = NULL;
                                         while (switch_core_session_dequeue_event(listener-&gt;session, &amp;e, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS) {
<span style="color: #A00000">-                                                if (switch_queue_push(listener-&gt;event_queue, e) != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                                                if (switch_queue_trypush(listener-&gt;event_queue, e) != SWITCH_STATUS_SUCCESS) {</span>
                                                         switch_core_session_queue_event(listener-&gt;session, &amp;e);
                                                         break;
                                                 }
<span style="color: #800080; font-weight: bold">@@ -2540,22 +2573,7 @@ static void *SWITCH_THREAD_FUNC listener_run(switch_thread_t *thread, void *obj)</span>
         }
 
         if (listener-&gt;sock) {
<span style="color: #A00000">-                char disco_buf[512] = &quot;&quot;;</span>
<span style="color: #A00000">-                const char message[] = &quot;Disconnected, goodbye.\nSee you at ClueCon! http://www.cluecon.com/\n&quot;;</span>
<span style="color: #A00000">-                int mlen = strlen(message);</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                if (listener-&gt;session) {</span>
<span style="color: #A00000">-                        switch_snprintf(disco_buf, sizeof(disco_buf), &quot;Content-Type: text/disconnect-notice\n&quot;</span>
<span style="color: #A00000">-                                                        &quot;Controlled-Session-UUID: %s\n&quot;</span>
<span style="color: #A00000">-                                                        &quot;Content-Disposition: disconnect\n&quot; &quot;Content-Length: %d\n\n&quot;, switch_core_session_get_uuid(listener-&gt;session), mlen);</span>
<span style="color: #A00000">-                } else {</span>
<span style="color: #A00000">-                        switch_snprintf(disco_buf, sizeof(disco_buf), &quot;Content-Type: text/disconnect-notice\nContent-Length: %d\n\n&quot;, mlen);</span>
<span style="color: #A00000">-                }</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                len = strlen(disco_buf);</span>
<span style="color: #A00000">-                switch_socket_send(listener-&gt;sock, disco_buf, &amp;len);</span>
<span style="color: #A00000">-                len = mlen;</span>
<span style="color: #A00000">-                switch_socket_send(listener-&gt;sock, message, &amp;len);</span>
<span style="color: #00A000">+                send_disconnect(listener, &quot;Disconnected, goodbye.\nSee you at ClueCon! http://www.cluecon.com/\n&quot;);</span>
                 close_socket(&amp;listener-&gt;sock);
         }
 
</pre></div>
<div class="highlight"><pre>committer: Daniel Swarbrick
comments: 
whoops, tab craziness

<span style="color: #000080; font-weight: bold">diff --git a/src/mod/event_handlers/mod_snmp/subagent.h b/src/mod/event_handlers/mod_snmp/subagent.h</span>
<span style="color: #000080; font-weight: bold">index 72dbeeb..3315378 100644</span>
<span style="color: #A00000">--- a/src/mod/event_handlers/mod_snmp/subagent.h</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_snmp/subagent.h</span>
<span style="color: #800080; font-weight: bold">@@ -2,15 +2,15 @@</span>
 #define subagent_H
 
 /* .1.3.6.1.4.1.27880.1.1 */
<span style="color: #A00000">-#define ID_VERSION_STR                                1</span>
<span style="color: #A00000">-#define ID_UUID                                                2</span>
<span style="color: #00A000">+#define ID_VERSION_STR                        1</span>
<span style="color: #00A000">+#define ID_UUID                                2</span>
 
 /* .1.3.6.1.4.1.27880.1.2 */
<span style="color: #A00000">-#define SS_UPTIME                                        1</span>
<span style="color: #00A000">+#define SS_UPTIME                        1</span>
 #define SS_SESSIONS_SINCE_STARTUP        2
<span style="color: #A00000">-#define SS_CURRENT_SESSIONS                        3</span>
<span style="color: #A00000">-#define SS_MAX_SESSIONS                                4</span>
<span style="color: #A00000">-#define SS_CURRENT_CALLS                        5</span>
<span style="color: #00A000">+#define SS_CURRENT_SESSIONS                3</span>
<span style="color: #00A000">+#define SS_MAX_SESSIONS                        4</span>
<span style="color: #00A000">+#define SS_CURRENT_CALLS                5</span>
 #define SS_SESSIONS_PER_SECOND                6
 #define SS_MAX_SESSIONS_PER_SECOND        7
 
</pre></div>
<div class="highlight"><pre>committer: Daniel Swarbrick
comments: 
tidy up subagent and #defines

<span style="color: #000080; font-weight: bold">diff --git a/src/mod/event_handlers/mod_snmp/mod_snmp.c b/src/mod/event_handlers/mod_snmp/mod_snmp.c</span>
<span style="color: #000080; font-weight: bold">index 79ccd16..0310637 100644</span>
<span style="color: #A00000">--- a/src/mod/event_handlers/mod_snmp/mod_snmp.c</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_snmp/mod_snmp.c</span>
<span style="color: #800080; font-weight: bold">@@ -101,8 +101,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_snmp_load)</span>
 SWITCH_MODULE_RUNTIME_FUNCTION(mod_snmp_runtime)
 {
         if (!globals.shutdown) {
<span style="color: #A00000">-                /* Block on select() */</span>
                 switch_mutex_lock(globals.mutex);
<span style="color: #00A000">+                /* Block on select() */</span>
                 agent_check_and_process(1);
                 switch_mutex_unlock(globals.mutex);
         }
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/event_handlers/mod_snmp/subagent.c b/src/mod/event_handlers/mod_snmp/subagent.c</span>
<span style="color: #000080; font-weight: bold">index ad36624..2da9ebe 100644</span>
<span style="color: #A00000">--- a/src/mod/event_handlers/mod_snmp/subagent.c</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_snmp/subagent.c</span>
<span style="color: #800080; font-weight: bold">@@ -37,31 +37,12 @@</span>
 #include &quot;subagent.h&quot;
 
 
<span style="color: #A00000">-static oid identity_oid[] = { 1,3,6,1,4,1,27880,1,1 };</span>
<span style="color: #A00000">-static oid systemStats_oid[] = { 1,3,6,1,4,1,27880,1,2 };</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-/* identity sub-IDs - these must match MIB */</span>
<span style="color: #A00000">-enum {</span>
<span style="color: #A00000">-        versionString_oid = 1,</span>
<span style="color: #A00000">-        uuid_oid</span>
<span style="color: #A00000">-};</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-/* systemStats sub-IDs - these must match MIB */</span>
<span style="color: #A00000">-enum {</span>
<span style="color: #A00000">-        uptime_oid = 1,</span>
<span style="color: #A00000">-        sessionsSinceStartup_oid,</span>
<span style="color: #A00000">-        currentSessions_oid,</span>
<span style="color: #A00000">-        maxSessions_oid,</span>
<span style="color: #A00000">-        currentCalls_oid,</span>
<span style="color: #A00000">-        sessionsPerSecond_oid,</span>
<span style="color: #A00000">-        maxSessionsPerSecond_oid</span>
<span style="color: #A00000">-};</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-</span>
 void init_subagent(void)
 {
<span style="color: #A00000">-        DEBUGMSGTL((&quot;init_nstAgentSubagentObject&quot;, &quot;Initializing\n&quot;));</span>
<span style="color: #00A000">+        static oid identity_oid[] = { 1,3,6,1,4,1,27880,1,1 };</span>
<span style="color: #00A000">+        static oid systemStats_oid[] = { 1,3,6,1,4,1,27880,1,2 };</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        DEBUGMSGTL((&quot;init_subagent&quot;, &quot;Initializing\n&quot;));</span>
 
         netsnmp_register_scalar_group(netsnmp_create_handler_registration(&quot;identity&quot;, handle_identity, identity_oid, OID_LENGTH(identity_oid), HANDLER_CAN_RONLY), 1, 2);
         netsnmp_register_scalar_group(netsnmp_create_handler_registration(&quot;systemStats&quot;, handle_systemStats, systemStats_oid, OID_LENGTH(systemStats_oid), HANDLER_CAN_RONLY), 1, 7);
<span style="color: #800080; font-weight: bold">@@ -70,28 +51,26 @@ void init_subagent(void)</span>
 
 int handle_identity(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests)
 {
<span style="color: #A00000">-        static char const version[] = SWITCH_VERSION_FULL;</span>
<span style="color: #A00000">-        char uuid[40] = &quot;&quot;;</span>
         netsnmp_request_info *request = NULL;
         oid subid;
<span style="color: #00A000">+        static char const version[] = SWITCH_VERSION_FULL;</span>
<span style="color: #00A000">+        char uuid[40] = &quot;&quot;;</span>
 
         switch(reqinfo-&gt;mode) {
         case MODE_GET:
<span style="color: #A00000">-                for (request = requests; request; request = request-&gt;next) {</span>
<span style="color: #A00000">-                        subid = request-&gt;requestvb-&gt;name[reginfo-&gt;rootoid_len - 2];</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                        switch (subid) {</span>
<span style="color: #A00000">-                                case versionString_oid:</span>
<span style="color: #A00000">-                                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_OCTET_STR, (u_char *) &amp;version, strlen(version));</span>
<span style="color: #A00000">-                                        break;</span>
<span style="color: #A00000">-                                case uuid_oid:</span>
<span style="color: #A00000">-                                        strncpy(uuid, switch_core_get_uuid(), sizeof(uuid));</span>
<span style="color: #A00000">-                                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_OCTET_STR, (u_char *) &amp;uuid, strlen(uuid));</span>
<span style="color: #A00000">-                                        break;</span>
<span style="color: #A00000">-                                default:</span>
<span style="color: #A00000">-                                        snmp_log(LOG_WARNING, &quot;Unregistered OID-suffix requested (%d)\n&quot;, (int) subid);</span>
<span style="color: #A00000">-                                        netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);</span>
<span style="color: #A00000">-                        }</span>
<span style="color: #00A000">+                subid = requests-&gt;requestvb-&gt;name[reginfo-&gt;rootoid_len - 2];</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                switch (subid) {</span>
<span style="color: #00A000">+                case ID_VERSION_STR:</span>
<span style="color: #00A000">+                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_OCTET_STR, (u_char *) &amp;version, strlen(version));</span>
<span style="color: #00A000">+                        break;</span>
<span style="color: #00A000">+                case ID_UUID:</span>
<span style="color: #00A000">+                        strncpy(uuid, switch_core_get_uuid(), sizeof(uuid));</span>
<span style="color: #00A000">+                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_OCTET_STR, (u_char *) &amp;uuid, strlen(uuid));</span>
<span style="color: #00A000">+                        break;</span>
<span style="color: #00A000">+                default:</span>
<span style="color: #00A000">+                        snmp_log(LOG_WARNING, &quot;Unregistered OID-suffix requested (%d)\n&quot;, (int) subid);</span>
<span style="color: #00A000">+                        netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);</span>
                 }
                 break;
 
<span style="color: #800080; font-weight: bold">@@ -114,47 +93,45 @@ int handle_systemStats(netsnmp_mib_handler *handler, netsnmp_handler_registratio</span>
 
         switch(reqinfo-&gt;mode) {
         case MODE_GET:
<span style="color: #A00000">-                for (request = requests; request; request = request-&gt;next) {</span>
<span style="color: #A00000">-                        subid = request-&gt;requestvb-&gt;name[reginfo-&gt;rootoid_len - 2];</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                        switch (subid) {</span>
<span style="color: #A00000">-                                case uptime_oid:</span>
<span style="color: #A00000">-                                        uptime = switch_core_uptime() / 10000;</span>
<span style="color: #A00000">-                                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_TIMETICKS, (u_char *) &amp;uptime, sizeof(uptime));</span>
<span style="color: #A00000">-                                        break;</span>
<span style="color: #A00000">-                                case sessionsSinceStartup_oid:</span>
<span style="color: #A00000">-                                        int_val = switch_core_session_id() - 1;</span>
<span style="color: #A00000">-                                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_COUNTER, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #A00000">-                                        break;</span>
<span style="color: #A00000">-                                case currentSessions_oid:</span>
<span style="color: #A00000">-                                        int_val = switch_core_session_count();</span>
<span style="color: #A00000">-                                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #A00000">-                                        break;</span>
<span style="color: #A00000">-                                case maxSessions_oid:</span>
<span style="color: #A00000">-                                        switch_core_session_ctl(SCSC_MAX_SESSIONS, &amp;int_val);;</span>
<span style="color: #A00000">-                                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #A00000">-                                        break;</span>
<span style="color: #A00000">-                                case currentCalls_oid:</span>
<span style="color: #A00000">-                                        /*</span>
<span style="color: #A00000">-                                         * This is zero for now, since there is no convenient way to get total call</span>
<span style="color: #A00000">-                                         * count (not to be confused with session count), without touching the</span>
<span style="color: #A00000">-                                         * database.</span>
<span style="color: #A00000">-                                         */</span>
<span style="color: #A00000">-                                        int_val = 0;</span>
<span style="color: #A00000">-                                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #A00000">-                                        break;</span>
<span style="color: #A00000">-                                case sessionsPerSecond_oid:</span>
<span style="color: #A00000">-                                        switch_core_session_ctl(SCSC_LAST_SPS, &amp;int_val);</span>
<span style="color: #A00000">-                                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #A00000">-                                        break;</span>
<span style="color: #A00000">-                                case maxSessionsPerSecond_oid:</span>
<span style="color: #A00000">-                                        switch_core_session_ctl(SCSC_SPS, &amp;int_val);</span>
<span style="color: #A00000">-                                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #A00000">-                                        break;</span>
<span style="color: #A00000">-                                default:</span>
<span style="color: #A00000">-                                        snmp_log(LOG_WARNING, &quot;Unregistered OID-suffix requested (%d)\n&quot;, (int) subid);</span>
<span style="color: #A00000">-                                        netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);</span>
<span style="color: #A00000">-                        }</span>
<span style="color: #00A000">+                subid = requests-&gt;requestvb-&gt;name[reginfo-&gt;rootoid_len - 2];</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                switch (subid) {</span>
<span style="color: #00A000">+                case SS_UPTIME:</span>
<span style="color: #00A000">+                        uptime = switch_core_uptime() / 10000;</span>
<span style="color: #00A000">+                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_TIMETICKS, (u_char *) &amp;uptime, sizeof(uptime));</span>
<span style="color: #00A000">+                        break;</span>
<span style="color: #00A000">+                case SS_SESSIONS_SINCE_STARTUP:</span>
<span style="color: #00A000">+                        int_val = switch_core_session_id() - 1;</span>
<span style="color: #00A000">+                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_COUNTER, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #00A000">+                        break;</span>
<span style="color: #00A000">+                case SS_CURRENT_SESSIONS:</span>
<span style="color: #00A000">+                        int_val = switch_core_session_count();</span>
<span style="color: #00A000">+                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #00A000">+                        break;</span>
<span style="color: #00A000">+                case SS_MAX_SESSIONS:</span>
<span style="color: #00A000">+                        switch_core_session_ctl(SCSC_MAX_SESSIONS, &amp;int_val);;</span>
<span style="color: #00A000">+                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #00A000">+                        break;</span>
<span style="color: #00A000">+                case SS_CURRENT_CALLS:</span>
<span style="color: #00A000">+                        /*</span>
<span style="color: #00A000">+                         * This is zero for now, since there is no convenient way to get total call</span>
<span style="color: #00A000">+                         * count (not to be confused with session count), without touching the</span>
<span style="color: #00A000">+                         * database.</span>
<span style="color: #00A000">+                         */</span>
<span style="color: #00A000">+                        int_val = 0;</span>
<span style="color: #00A000">+                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #00A000">+                        break;</span>
<span style="color: #00A000">+                case SS_SESSIONS_PER_SECOND:</span>
<span style="color: #00A000">+                        switch_core_session_ctl(SCSC_LAST_SPS, &amp;int_val);</span>
<span style="color: #00A000">+                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #00A000">+                        break;</span>
<span style="color: #00A000">+                case SS_MAX_SESSIONS_PER_SECOND:</span>
<span style="color: #00A000">+                        switch_core_session_ctl(SCSC_SPS, &amp;int_val);</span>
<span style="color: #00A000">+                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #00A000">+                        break;</span>
<span style="color: #00A000">+                default:</span>
<span style="color: #00A000">+                        snmp_log(LOG_WARNING, &quot;Unregistered OID-suffix requested (%d)\n&quot;, (int) subid);</span>
<span style="color: #00A000">+                        netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);</span>
                 }
                 break;
 
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/event_handlers/mod_snmp/subagent.h b/src/mod/event_handlers/mod_snmp/subagent.h</span>
<span style="color: #000080; font-weight: bold">index 8a57d8a..72dbeeb 100644</span>
<span style="color: #A00000">--- a/src/mod/event_handlers/mod_snmp/subagent.h</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_snmp/subagent.h</span>
<span style="color: #800080; font-weight: bold">@@ -1,6 +1,20 @@</span>
 #ifndef subagent_H
 #define subagent_H
 
<span style="color: #00A000">+/* .1.3.6.1.4.1.27880.1.1 */</span>
<span style="color: #00A000">+#define ID_VERSION_STR                                1</span>
<span style="color: #00A000">+#define ID_UUID                                                2</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+/* .1.3.6.1.4.1.27880.1.2 */</span>
<span style="color: #00A000">+#define SS_UPTIME                                        1</span>
<span style="color: #00A000">+#define SS_SESSIONS_SINCE_STARTUP        2</span>
<span style="color: #00A000">+#define SS_CURRENT_SESSIONS                        3</span>
<span style="color: #00A000">+#define SS_MAX_SESSIONS                                4</span>
<span style="color: #00A000">+#define SS_CURRENT_CALLS                        5</span>
<span style="color: #00A000">+#define SS_SESSIONS_PER_SECOND                6</span>
<span style="color: #00A000">+#define SS_MAX_SESSIONS_PER_SECOND        7</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
 void init_subagent(void);
 Netsnmp_Node_Handler handle_identity;
 Netsnmp_Node_Handler handle_systemStats;
</pre></div>
<div class="highlight"><pre>committer: Daniel Swarbrick
comments: 
wrap potentially non-threadsafe snmp operations in mutex; support snmpwalk in subagent

<span style="color: #000080; font-weight: bold">diff --git a/src/mod/event_handlers/mod_snmp/mod_snmp.c b/src/mod/event_handlers/mod_snmp/mod_snmp.c</span>
<span style="color: #000080; font-weight: bold">index 36a133c..79ccd16 100644</span>
<span style="color: #A00000">--- a/src/mod/event_handlers/mod_snmp/mod_snmp.c</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_snmp/mod_snmp.c</span>
<span style="color: #800080; font-weight: bold">@@ -38,6 +38,7 @@</span>
 
 static struct {
         switch_memory_pool_t *pool;
<span style="color: #00A000">+        switch_mutex_t *mutex;</span>
         int shutdown;
 } globals;
 
<span style="color: #800080; font-weight: bold">@@ -55,27 +56,13 @@ static int snmp_callback_log(int major, int minor, void *serverarg, void *client</span>
 }
 
 
<span style="color: #A00000">-static switch_state_handler_table_t state_handlers = {</span>
<span style="color: #A00000">-        /*.on_init */ NULL,</span>
<span style="color: #A00000">-        /*.on_routing */ NULL,</span>
<span style="color: #A00000">-        /*.on_execute */ NULL,</span>
<span style="color: #A00000">-        /*.on_hangup */ NULL,</span>
<span style="color: #A00000">-        /*.on_exchange_media */ NULL,</span>
<span style="color: #A00000">-        /*.on_soft_execute */ NULL,</span>
<span style="color: #A00000">-        /*.on_consume_media */ NULL,</span>
<span style="color: #A00000">-        /*.on_hibernate */ NULL,</span>
<span style="color: #A00000">-        /*.on_reset */ NULL,</span>
<span style="color: #A00000">-        /*.on_park */ NULL,</span>
<span style="color: #A00000">-        /*.on_reporting */ NULL</span>
<span style="color: #A00000">-};</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-</span>
 static switch_status_t load_config(switch_memory_pool_t *pool)
 {
         switch_status_t status = SWITCH_STATUS_SUCCESS;
 
         memset(&amp;globals, 0, sizeof(globals));
         globals.pool = pool;
<span style="color: #00A000">+        switch_mutex_init(&amp;globals.mutex, SWITCH_MUTEX_NESTED, globals.pool);</span>
 
         return status;
 }
<span style="color: #800080; font-weight: bold">@@ -87,7 +74,6 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_snmp_load)</span>
 
         load_config(pool);
 
<span style="color: #A00000">-        switch_core_add_state_handler(&amp;state_handlers);</span>
         *module_interface = switch_loadable_module_create_module_interface(pool, modname);
 
         /* Register callback function so we get Net-SNMP logging handled by FreeSWITCH */
<span style="color: #800080; font-weight: bold">@@ -114,9 +100,11 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_snmp_load)</span>
 
 SWITCH_MODULE_RUNTIME_FUNCTION(mod_snmp_runtime)
 {
<span style="color: #A00000">-        while (!globals.shutdown) {</span>
<span style="color: #00A000">+        if (!globals.shutdown) {</span>
                 /* Block on select() */
<span style="color: #00A000">+                switch_mutex_lock(globals.mutex);</span>
                 agent_check_and_process(1);
<span style="color: #00A000">+                switch_mutex_unlock(globals.mutex);</span>
         }
 
         return SWITCH_STATUS_SUCCESS;
<span style="color: #800080; font-weight: bold">@@ -126,9 +114,12 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_snmp_runtime)</span>
 SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_snmp_shutdown)
 {
         globals.shutdown = 1;
<span style="color: #A00000">-        switch_core_remove_state_handler(&amp;state_handlers);</span>
 
<span style="color: #00A000">+        switch_mutex_lock(globals.mutex);</span>
         snmp_shutdown(&quot;mod_snmp&quot;);
<span style="color: #00A000">+        switch_mutex_unlock(globals.mutex);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        switch_mutex_destroy(globals.mutex);</span>
 
         return SWITCH_STATUS_SUCCESS;
 }
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/event_handlers/mod_snmp/subagent.c b/src/mod/event_handlers/mod_snmp/subagent.c</span>
<span style="color: #000080; font-weight: bold">index 8a9f2da..ad36624 100644</span>
<span style="color: #A00000">--- a/src/mod/event_handlers/mod_snmp/subagent.c</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_snmp/subagent.c</span>
<span style="color: #800080; font-weight: bold">@@ -63,8 +63,8 @@ void init_subagent(void)</span>
 {
         DEBUGMSGTL((&quot;init_nstAgentSubagentObject&quot;, &quot;Initializing\n&quot;));
 
<span style="color: #A00000">-        netsnmp_register_handler(netsnmp_create_handler_registration(&quot;identity&quot;, handle_identity, identity_oid, OID_LENGTH(identity_oid), HANDLER_CAN_RONLY));</span>
<span style="color: #A00000">-        netsnmp_register_handler(netsnmp_create_handler_registration(&quot;systemStats&quot;, handle_systemStats, systemStats_oid, OID_LENGTH(systemStats_oid), HANDLER_CAN_RONLY));</span>
<span style="color: #00A000">+        netsnmp_register_scalar_group(netsnmp_create_handler_registration(&quot;identity&quot;, handle_identity, identity_oid, OID_LENGTH(identity_oid), HANDLER_CAN_RONLY), 1, 2);</span>
<span style="color: #00A000">+        netsnmp_register_scalar_group(netsnmp_create_handler_registration(&quot;systemStats&quot;, handle_systemStats, systemStats_oid, OID_LENGTH(systemStats_oid), HANDLER_CAN_RONLY), 1, 7);</span>
 }
 
 
<span style="color: #800080; font-weight: bold">@@ -76,33 +76,29 @@ int handle_identity(netsnmp_mib_handler *handler, netsnmp_handler_registration *</span>
         oid subid;
 
         switch(reqinfo-&gt;mode) {
<span style="color: #A00000">-                case MODE_GET:</span>
<span style="color: #A00000">-                        for (request = requests; request; request = request-&gt;next) {</span>
<span style="color: #A00000">-                                subid = request-&gt;requestvb-&gt;name[OID_LENGTH(systemStats_oid)];</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                                switch (subid) {</span>
<span style="color: #A00000">-                                        case versionString_oid:</span>
<span style="color: #A00000">-                                                snmp_set_var_typed_value(requests-&gt;requestvb, ASN_OCTET_STR, (u_char *) &amp;version, strlen(version));</span>
<span style="color: #A00000">-                                                break;</span>
<span style="color: #A00000">-                                        case uuid_oid:</span>
<span style="color: #A00000">-                                                strncpy(uuid, switch_core_get_uuid(), sizeof(uuid));</span>
<span style="color: #A00000">-                                                snmp_set_var_typed_value(requests-&gt;requestvb, ASN_OCTET_STR, (u_char *) &amp;uuid, strlen(uuid));</span>
<span style="color: #A00000">-                                                break;</span>
<span style="color: #A00000">-                                        default:</span>
<span style="color: #A00000">-                                                snmp_log(LOG_WARNING, &quot;Unregistered OID-suffix requested (%d)\n&quot;, (int) subid);</span>
<span style="color: #A00000">-                                                netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);</span>
<span style="color: #A00000">-                                }</span>
<span style="color: #00A000">+        case MODE_GET:</span>
<span style="color: #00A000">+                for (request = requests; request; request = request-&gt;next) {</span>
<span style="color: #00A000">+                        subid = request-&gt;requestvb-&gt;name[reginfo-&gt;rootoid_len - 2];</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        switch (subid) {</span>
<span style="color: #00A000">+                                case versionString_oid:</span>
<span style="color: #00A000">+                                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_OCTET_STR, (u_char *) &amp;version, strlen(version));</span>
<span style="color: #00A000">+                                        break;</span>
<span style="color: #00A000">+                                case uuid_oid:</span>
<span style="color: #00A000">+                                        strncpy(uuid, switch_core_get_uuid(), sizeof(uuid));</span>
<span style="color: #00A000">+                                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_OCTET_STR, (u_char *) &amp;uuid, strlen(uuid));</span>
<span style="color: #00A000">+                                        break;</span>
<span style="color: #00A000">+                                default:</span>
<span style="color: #00A000">+                                        snmp_log(LOG_WARNING, &quot;Unregistered OID-suffix requested (%d)\n&quot;, (int) subid);</span>
<span style="color: #00A000">+                                        netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);</span>
                         }
<span style="color: #A00000">-                        break;</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+                break;</span>
 
<span style="color: #A00000">-                case MODE_GETNEXT:</span>
<span style="color: #A00000">-                        snmp_log(LOG_ERR, &quot;MODE_GETNEXT not supported (yet)\n&quot;);</span>
<span style="color: #A00000">-                        break;</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                default:</span>
<span style="color: #A00000">-                        /* we should never get here, so this is a really bad error */</span>
<span style="color: #A00000">-                        snmp_log(LOG_ERR, &quot;Unknown mode (%d) in handle_versionString\n&quot;, reqinfo-&gt;mode );</span>
<span style="color: #A00000">-                        return SNMP_ERR_GENERR;</span>
<span style="color: #00A000">+        default:</span>
<span style="color: #00A000">+                /* we should never get here, so this is a really bad error */</span>
<span style="color: #00A000">+                snmp_log(LOG_ERR, &quot;Unknown mode (%d) in handle_identity\n&quot;, reqinfo-&gt;mode );</span>
<span style="color: #00A000">+                return SNMP_ERR_GENERR;</span>
         }
 
         return SNMP_ERR_NOERROR;
<span style="color: #800080; font-weight: bold">@@ -117,59 +113,55 @@ int handle_systemStats(netsnmp_mib_handler *handler, netsnmp_handler_registratio</span>
         uint32_t int_val;
 
         switch(reqinfo-&gt;mode) {
<span style="color: #A00000">-                case MODE_GET:</span>
<span style="color: #A00000">-                        for (request = requests; request; request = request-&gt;next) {</span>
<span style="color: #A00000">-                                subid = request-&gt;requestvb-&gt;name[OID_LENGTH(systemStats_oid)];</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                                switch (subid) {</span>
<span style="color: #A00000">-                                        case uptime_oid:</span>
<span style="color: #A00000">-                                                uptime = switch_core_uptime() / 10000;</span>
<span style="color: #A00000">-                                                snmp_set_var_typed_value(requests-&gt;requestvb, ASN_TIMETICKS, (u_char *) &amp;uptime, sizeof(uptime));</span>
<span style="color: #A00000">-                                                break;</span>
<span style="color: #A00000">-                                        case sessionsSinceStartup_oid:</span>
<span style="color: #A00000">-                                                int_val = switch_core_session_id() - 1;</span>
<span style="color: #A00000">-                                                snmp_set_var_typed_value(requests-&gt;requestvb, ASN_COUNTER, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #A00000">-                                                break;</span>
<span style="color: #A00000">-                                        case currentSessions_oid:</span>
<span style="color: #A00000">-                                                int_val = switch_core_session_count();</span>
<span style="color: #A00000">-                                                snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #A00000">-                                                break;</span>
<span style="color: #A00000">-                                        case maxSessions_oid:</span>
<span style="color: #A00000">-                                                switch_core_session_ctl(SCSC_MAX_SESSIONS, &amp;int_val);;</span>
<span style="color: #A00000">-                                                snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #A00000">-                                                break;</span>
<span style="color: #A00000">-                                        case currentCalls_oid:</span>
<span style="color: #A00000">-                                                /*</span>
<span style="color: #A00000">-                                                 * This is zero for now, since there is no convenient way to get total call</span>
<span style="color: #A00000">-                                                 * count (not to be confused with session count), without touching the</span>
<span style="color: #A00000">-                                                 * database.</span>
<span style="color: #A00000">-                                                 */</span>
<span style="color: #A00000">-                                                int_val = 0;</span>
<span style="color: #A00000">-                                                snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #A00000">-                                                break;</span>
<span style="color: #A00000">-                                        case sessionsPerSecond_oid:</span>
<span style="color: #A00000">-                                                switch_core_session_ctl(SCSC_LAST_SPS, &amp;int_val);</span>
<span style="color: #A00000">-                                                snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #A00000">-                                                break;</span>
<span style="color: #A00000">-                                        case maxSessionsPerSecond_oid:</span>
<span style="color: #A00000">-                                                switch_core_session_ctl(SCSC_SPS, &amp;int_val);</span>
<span style="color: #A00000">-                                                snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #A00000">-                                                break;</span>
<span style="color: #A00000">-                                        default:</span>
<span style="color: #A00000">-                                                snmp_log(LOG_WARNING, &quot;Unregistered OID-suffix requested (%d)\n&quot;, (int) subid);</span>
<span style="color: #A00000">-                                                netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);</span>
<span style="color: #A00000">-                                }</span>
<span style="color: #00A000">+        case MODE_GET:</span>
<span style="color: #00A000">+                for (request = requests; request; request = request-&gt;next) {</span>
<span style="color: #00A000">+                        subid = request-&gt;requestvb-&gt;name[reginfo-&gt;rootoid_len - 2];</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        switch (subid) {</span>
<span style="color: #00A000">+                                case uptime_oid:</span>
<span style="color: #00A000">+                                        uptime = switch_core_uptime() / 10000;</span>
<span style="color: #00A000">+                                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_TIMETICKS, (u_char *) &amp;uptime, sizeof(uptime));</span>
<span style="color: #00A000">+                                        break;</span>
<span style="color: #00A000">+                                case sessionsSinceStartup_oid:</span>
<span style="color: #00A000">+                                        int_val = switch_core_session_id() - 1;</span>
<span style="color: #00A000">+                                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_COUNTER, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #00A000">+                                        break;</span>
<span style="color: #00A000">+                                case currentSessions_oid:</span>
<span style="color: #00A000">+                                        int_val = switch_core_session_count();</span>
<span style="color: #00A000">+                                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #00A000">+                                        break;</span>
<span style="color: #00A000">+                                case maxSessions_oid:</span>
<span style="color: #00A000">+                                        switch_core_session_ctl(SCSC_MAX_SESSIONS, &amp;int_val);;</span>
<span style="color: #00A000">+                                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #00A000">+                                        break;</span>
<span style="color: #00A000">+                                case currentCalls_oid:</span>
<span style="color: #00A000">+                                        /*</span>
<span style="color: #00A000">+                                         * This is zero for now, since there is no convenient way to get total call</span>
<span style="color: #00A000">+                                         * count (not to be confused with session count), without touching the</span>
<span style="color: #00A000">+                                         * database.</span>
<span style="color: #00A000">+                                         */</span>
<span style="color: #00A000">+                                        int_val = 0;</span>
<span style="color: #00A000">+                                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #00A000">+                                        break;</span>
<span style="color: #00A000">+                                case sessionsPerSecond_oid:</span>
<span style="color: #00A000">+                                        switch_core_session_ctl(SCSC_LAST_SPS, &amp;int_val);</span>
<span style="color: #00A000">+                                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #00A000">+                                        break;</span>
<span style="color: #00A000">+                                case maxSessionsPerSecond_oid:</span>
<span style="color: #00A000">+                                        switch_core_session_ctl(SCSC_SPS, &amp;int_val);</span>
<span style="color: #00A000">+                                        snmp_set_var_typed_value(requests-&gt;requestvb, ASN_GAUGE, (u_char *) &amp;int_val, sizeof(int_val));</span>
<span style="color: #00A000">+                                        break;</span>
<span style="color: #00A000">+                                default:</span>
<span style="color: #00A000">+                                        snmp_log(LOG_WARNING, &quot;Unregistered OID-suffix requested (%d)\n&quot;, (int) subid);</span>
<span style="color: #00A000">+                                        netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);</span>
                         }
<span style="color: #A00000">-                        break;</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                case MODE_GETNEXT:</span>
<span style="color: #A00000">-                        snmp_log(LOG_ERR, &quot;MODE_GETNEXT not supported (yet)\n&quot;);</span>
<span style="color: #A00000">-                        break;</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+                break;</span>
 
<span style="color: #A00000">-                default:</span>
<span style="color: #A00000">-                        /* we should never get here, so this is a really bad error */</span>
<span style="color: #A00000">-                        snmp_log(LOG_ERR, &quot;Unknown mode (%d) in handle_systemStats\n&quot;, reqinfo-&gt;mode);</span>
<span style="color: #A00000">-                        return SNMP_ERR_GENERR;</span>
<span style="color: #00A000">+        default:</span>
<span style="color: #00A000">+                /* we should never get here, so this is a really bad error */</span>
<span style="color: #00A000">+                snmp_log(LOG_ERR, &quot;Unknown mode (%d) in handle_systemStats\n&quot;, reqinfo-&gt;mode);</span>
<span style="color: #00A000">+                return SNMP_ERR_GENERR;</span>
         }
 
         return SNMP_ERR_NOERROR;
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments: 
use switch_queue_trypop_timeout instead of a timer in mod_loopback to improve audio quality when not using bowout features

<span style="color: #000080; font-weight: bold">diff --git a/src/mod/endpoints/mod_loopback/mod_loopback.c b/src/mod/endpoints/mod_loopback/mod_loopback.c</span>
<span style="color: #000080; font-weight: bold">index f875f6b..aa57668 100644</span>
<span style="color: #A00000">--- a/src/mod/endpoints/mod_loopback/mod_loopback.c</span>
<span style="color: #00A000">+++ b/src/mod/endpoints/mod_loopback/mod_loopback.c</span>
<span style="color: #800080; font-weight: bold">@@ -77,11 +77,11 @@ struct private_object {</span>
 
         switch_frame_t cng_frame;
         unsigned char cng_databuf[SWITCH_RECOMMENDED_BUFFER_SIZE];
<span style="color: #A00000">-        switch_timer_t timer;</span>
         switch_caller_profile_t *caller_profile;
         int32_t bowout_frame_count;
         char *other_uuid;
         switch_queue_t *frame_queue;
<span style="color: #00A000">+        switch_codec_implementation_t read_impl;</span>
 };
 
 typedef struct private_object private_t;
<span style="color: #800080; font-weight: bold">@@ -111,7 +111,6 @@ static switch_status_t tech_init(private_t *tech_pvt, switch_core_session_t *ses</span>
         int interval = 20;
         switch_status_t status = SWITCH_STATUS_SUCCESS;
         switch_channel_t *channel = switch_core_session_get_channel(session);
<span style="color: #A00000">-        const switch_codec_implementation_t *read_impl;</span>
 
         if (codec) {
                 iananame = codec-&gt;implementation-&gt;iananame;
<span style="color: #800080; font-weight: bold">@@ -166,15 +165,7 @@ static switch_status_t tech_init(private_t *tech_pvt, switch_core_session_t *ses</span>
         switch_core_session_set_read_codec(session, &amp;tech_pvt-&gt;read_codec);
         switch_core_session_set_write_codec(session, &amp;tech_pvt-&gt;write_codec);
 
<span style="color: #A00000">-        if (tech_pvt-&gt;flag_mutex) {</span>
<span style="color: #A00000">-                switch_core_timer_destroy(&amp;tech_pvt-&gt;timer);</span>
<span style="color: #A00000">-        }</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-        read_impl = tech_pvt-&gt;read_codec.implementation;</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-        switch_core_timer_init(&amp;tech_pvt-&gt;timer, &quot;soft&quot;,</span>
<span style="color: #A00000">-                                                   read_impl-&gt;microseconds_per_packet / 1000, read_impl-&gt;samples_per_packet * 4, switch_core_session_get_pool(session));</span>
<span style="color: #A00000">-</span>
<span style="color: #00A000">+        tech_pvt-&gt;read_impl = *tech_pvt-&gt;read_codec.implementation;</span>
 
         if (!tech_pvt-&gt;flag_mutex) {
                 switch_mutex_init(&amp;tech_pvt-&gt;flag_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session));
<span style="color: #800080; font-weight: bold">@@ -376,7 +367,6 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session)</span>
         tech_pvt = switch_core_session_get_private(session);
 
         if (tech_pvt) {
<span style="color: #A00000">-                switch_core_timer_destroy(&amp;tech_pvt-&gt;timer);</span>
 
                 if (switch_core_codec_ready(&amp;tech_pvt-&gt;read_codec)) {
                         switch_core_codec_destroy(&amp;tech_pvt-&gt;read_codec);
<span style="color: #800080; font-weight: bold">@@ -568,12 +558,10 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch</span>
                 goto end;
         }
 
<span style="color: #A00000">-        switch_core_timer_next(&amp;tech_pvt-&gt;timer);</span>
<span style="color: #A00000">-</span>
         mutex = tech_pvt-&gt;mutex;
<span style="color: #A00000">-        switch_mutex_lock(mutex);</span>
 
<span style="color: #A00000">-        if (switch_queue_trypop(tech_pvt-&gt;frame_queue, &amp;pop) == SWITCH_STATUS_SUCCESS &amp;&amp; pop) {</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (switch_queue_pop_timeout(tech_pvt-&gt;frame_queue, &amp;pop, tech_pvt-&gt;read_impl.microseconds_per_packet) == SWITCH_STATUS_SUCCESS &amp;&amp; pop) {</span>
                 if (tech_pvt-&gt;write_frame) {
                         switch_frame_free(&amp;tech_pvt-&gt;write_frame);
                 }
<span style="color: #800080; font-weight: bold">@@ -585,6 +573,8 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch</span>
                 switch_set_flag(tech_pvt, TFLAG_CNG);
         }
 
<span style="color: #00A000">+        switch_mutex_lock(mutex);</span>
<span style="color: #00A000">+</span>
         if (switch_test_flag(tech_pvt, TFLAG_CNG)) {
                 unsigned char data[SWITCH_RECOMMENDED_BUFFER_SIZE];
                 uint32_t flag = 0;
<span style="color: #800080; font-weight: bold">@@ -775,8 +765,6 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s</span>
                                 switch_frame_free(&amp;frame);
                         }
 
<span style="color: #A00000">-                        switch_core_timer_sync(&amp;tech_pvt-&gt;timer);</span>
<span style="color: #A00000">-</span>
                 }
                 break;
         default:
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments: 
update syntax

<span style="color: #000080; font-weight: bold">diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c</span>
<span style="color: #000080; font-weight: bold">index 1c12e1c..7771b09 100644</span>
<span style="color: #A00000">--- a/src/mod/applications/mod_commands/mod_commands.c</span>
<span style="color: #00A000">+++ b/src/mod/applications/mod_commands/mod_commands.c</span>
<span style="color: #800080; font-weight: bold">@@ -2372,7 +2372,7 @@ SWITCH_STANDARD_API(uuid_media_function)</span>
         return SWITCH_STATUS_SUCCESS;
 }
 
<span style="color: #A00000">-#define BROADCAST_SYNTAX &quot;&lt;uuid&gt; &lt;path&gt; [aleg|bleg|both]&quot;</span>
<span style="color: #00A000">+#define BROADCAST_SYNTAX &quot;&lt;uuid&gt; &lt;path&gt; [aleg|bleg|holdb|both]&quot;</span>
 SWITCH_STANDARD_API(uuid_broadcast_function)
 {
         char *mycmd = NULL, *argv[4] = { 0 };
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments: 
add moh by default to uuid_broadcast when only broadcasting to A leg use aleg arg to disable this

<span style="color: #000080; font-weight: bold">diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c</span>
<span style="color: #000080; font-weight: bold">index 15ac8ec..1c12e1c 100644</span>
<span style="color: #A00000">--- a/src/mod/applications/mod_commands/mod_commands.c</span>
<span style="color: #00A000">+++ b/src/mod/applications/mod_commands/mod_commands.c</span>
<span style="color: #800080; font-weight: bold">@@ -2389,15 +2389,26 @@ SWITCH_STANDARD_API(uuid_broadcast_function)</span>
                 switch_media_flag_t flags = SMF_NONE;
 
                 if (argv[2]) {
<span style="color: #A00000">-                        if (!strcasecmp(argv[2], &quot;both&quot;)) {</span>
<span style="color: #00A000">+                        if (switch_stristr(&quot;both&quot;, (argv[2]))) {</span>
                                 flags |= (SMF_ECHO_ALEG | SMF_ECHO_BLEG);
<span style="color: #A00000">-                        } else if (!strcasecmp(argv[2], &quot;aleg&quot;)) {</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        if (switch_stristr(&quot;aleg&quot;, argv[2])) {</span>
                                 flags |= SMF_ECHO_ALEG;
<span style="color: #A00000">-                        } else if (!strcasecmp(argv[2], &quot;bleg&quot;)) {</span>
<span style="color: #00A000">+                        } </span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        if (switch_stristr(&quot;bleg&quot;, argv[2])) {</span>
<span style="color: #00A000">+                                flags &amp;= ~SMF_HOLD_BLEG;</span>
                                 flags |= SMF_ECHO_BLEG;
                         }
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        if (switch_stristr(&quot;holdb&quot;, argv[2])) {</span>
<span style="color: #00A000">+                                flags &amp;= ~SMF_ECHO_BLEG;</span>
<span style="color: #00A000">+                                flags |= SMF_HOLD_BLEG;</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+</span>
                 } else {
<span style="color: #A00000">-                        flags |= SMF_ECHO_ALEG;</span>
<span style="color: #00A000">+                        flags = SMF_ECHO_ALEG | SMF_HOLD_BLEG;</span>
                 }
 
                 status = switch_ivr_broadcast(argv[0], argv[1], flags);
</pre></div>
<div class="highlight"><pre>committer: cypromis
comments: 
not sure the stuff is needed in the core iksemel. this will take some more teting via hudson and some more comits, but hey, it does not have an impact on anythingbut solaris and derivates

<span style="color: #000080; font-weight: bold">diff --git a/libs/iksemel/src/Makefile.am b/libs/iksemel/src/Makefile.am</span>
<span style="color: #000080; font-weight: bold">index 10236f6..9d3da69 100644</span>
<span style="color: #A00000">--- a/libs/iksemel/src/Makefile.am</span>
<span style="color: #00A000">+++ b/libs/iksemel/src/Makefile.am</span>
<span style="color: #800080; font-weight: bold">@@ -25,5 +25,5 @@ libiksemel_la_SOURCES = \</span>
         base64.c
 
 libiksemel_la_LDFLAGS = -version-info 4:0:1 -no-undefined
<span style="color: #A00000">-libiksemel_la_CFLAGS = $(CFLAGS) $(LIBGNUTLS_CFLAGS)  @SUNCFLAGS@</span>
<span style="color: #A00000">-libiksemel_la_LIBADD = $(LIBGNUTLS_LIBS)  @SUNCFLAGS@</span>
<span style="color: #00A000">+libiksemel_la_CFLAGS = $(CFLAGS) $(LIBGNUTLS_CFLAGS)  </span>
<span style="color: #00A000">+libiksemel_la_LIBADD = $(LIBGNUTLS_LIBS)  </span>
</pre></div>
<div class="highlight"><pre>committer: cypromis
comments: 
more sun fixes to libiksemel.

<span style="color: #000080; font-weight: bold">diff --git a/libs/iksemel/configure.ac b/libs/iksemel/configure.ac</span>
<span style="color: #000080; font-weight: bold">index e00af1f..49d8621 100644</span>
<span style="color: #A00000">--- a/libs/iksemel/configure.ac</span>
<span style="color: #00A000">+++ b/libs/iksemel/configure.ac</span>
<span style="color: #800080; font-weight: bold">@@ -83,9 +83,13 @@ AC_ARG_ENABLE(64,</span>
 
 if test &quot;x${ax_cv_c_compiler_vendor}&quot;  =  &quot;xsun&quot; ; then
     if test &quot;${enable_64}&quot; = &quot;yes&quot;; then
<span style="color: #A00000">-        CFLAGS=&quot;$CFLAGS -m64 -lgpg-error&quot;</span>
<span style="color: #A00000">-        CXXFLAGS=&quot;$CXXFLAGS -m64 -lgpg-error&quot;</span>
<span style="color: #A00000">-        SUNFLAGS=&quot;-lgpg.error&quot;</span>
<span style="color: #00A000">+        CFLAGS=&quot;$CFLAGS -xc99=all -mt -m64 -lgpg-error&quot;</span>
<span style="color: #00A000">+        CXXFLAGS=&quot;$CXXFLAGS -xc99=all -mt -m64 -lgpg-error&quot;</span>
<span style="color: #00A000">+        SUNFLAGS=&quot;-xc99=all -mt -m64 -lgpg-error&quot;</span>
<span style="color: #00A000">+    else </span>
<span style="color: #00A000">+        CFLAGS=&quot;$CFLAGS -xc99=all -mt -lgpg-error&quot;</span>
<span style="color: #00A000">+        CXXFLAGS=&quot;$CXXFLAGS -xc99=all -mt -lgpg-error&quot;</span>
<span style="color: #00A000">+        SUNFLAGS=&quot;-xc99=all -mt -lgpg-error&quot;</span>
     fi
 fi
 
<span style="color: #000080; font-weight: bold">diff --git a/libs/iksemel/src/Makefile.am b/libs/iksemel/src/Makefile.am</span>
<span style="color: #000080; font-weight: bold">index 20ca263..10236f6 100644</span>
<span style="color: #A00000">--- a/libs/iksemel/src/Makefile.am</span>
<span style="color: #00A000">+++ b/libs/iksemel/src/Makefile.am</span>
<span style="color: #800080; font-weight: bold">@@ -25,5 +25,5 @@ libiksemel_la_SOURCES = \</span>
         base64.c
 
 libiksemel_la_LDFLAGS = -version-info 4:0:1 -no-undefined
<span style="color: #A00000">-libiksemel_la_CFLAGS = $(CFLAGS) $(LIBGNUTLS_CFLAGS)</span>
<span style="color: #A00000">-libiksemel_la_LIBADD = $(LIBGNUTLS_LIBS)</span>
<span style="color: #00A000">+libiksemel_la_CFLAGS = $(CFLAGS) $(LIBGNUTLS_CFLAGS)  @SUNCFLAGS@</span>
<span style="color: #00A000">+libiksemel_la_LIBADD = $(LIBGNUTLS_LIBS)  @SUNCFLAGS@</span>
</pre></div>
<div class="highlight"><pre>committer: Jeff Lenk
comments: 
revert till right solution found

<span style="color: #000080; font-weight: bold">diff --git a/w32/Setup/Product.wxs b/w32/Setup/Product.wxs</span>
<span style="color: #000080; font-weight: bold">index 1de2ec2..2f072aa 100644</span>
<span style="color: #A00000">--- a/w32/Setup/Product.wxs</span>
<span style="color: #00A000">+++ b/w32/Setup/Product.wxs</span>
<span style="color: #800080; font-weight: bold">@@ -57,9 +57,6 @@</span>
                                                          WorkingDirectory=&quot;INSTALLLOCATION&quot;/&gt;
                                 &lt;RemoveFolder Id=&quot;ApplicationProgramsFolder&quot; On=&quot;uninstall&quot;/&gt;
                                 &lt;RegistryValue Root=&quot;HKCU&quot; Key=&quot;Software\FreeSWITCH\FreeSWITCH&quot; Name=&quot;installed&quot; Type=&quot;integer&quot; Value=&quot;1&quot; KeyPath=&quot;yes&quot;/&gt;
<span style="color: #A00000">-        &lt;CreateFolder Directory=&quot;INSTALLLOCATION&quot;&gt;</span>
<span style="color: #A00000">-          &lt;Permission User=&quot;Authenticated Users&quot; GenericAll=&quot;yes&quot; /&gt;</span>
<span style="color: #A00000">-        &lt;/CreateFolder&gt;</span>
                         &lt;/Component&gt;
                         &lt;Component Id=&quot;FSCliShortcut&quot; Guid=&quot;D209546C-C728-4d8f-BDB2-29AED8824282&quot;&gt;
                                 &lt;Shortcut Id=&quot;FSCliStartMenuShortcut&quot;
<span style="color: #800080; font-weight: bold">@@ -68,9 +65,6 @@</span>
                                                          Target=&quot;[INSTALLLOCATION]fs_cli.exe&quot;
                                                          WorkingDirectory=&quot;INSTALLLOCATION&quot;/&gt;
                                 &lt;RegistryValue Root=&quot;HKCU&quot; Key=&quot;Software\FreeSWITCH\FS_CLI&quot; Name=&quot;installed&quot; Type=&quot;integer&quot; Value=&quot;1&quot; KeyPath=&quot;yes&quot;/&gt;
<span style="color: #A00000">-        &lt;CreateFolder Directory=&quot;INSTALLLOCATION&quot;&gt;</span>
<span style="color: #A00000">-          &lt;Permission User=&quot;Authenticated Users&quot; GenericAll=&quot;yes&quot; /&gt;</span>
<span style="color: #A00000">-        &lt;/CreateFolder&gt;</span>
                         &lt;/Component&gt;
                 &lt;/DirectoryRef&gt;
 
</pre></div>
<div class="highlight"><pre>committer: cypromis
comments: 
explicitly add gpg-error if sun comiler, maybe that solves it finaly

<span style="color: #000080; font-weight: bold">diff --git a/libs/iksemel/configure.ac b/libs/iksemel/configure.ac</span>
<span style="color: #000080; font-weight: bold">index 7761eb0..e00af1f 100644</span>
<span style="color: #A00000">--- a/libs/iksemel/configure.ac</span>
<span style="color: #00A000">+++ b/libs/iksemel/configure.ac</span>
<span style="color: #800080; font-weight: bold">@@ -85,9 +85,12 @@ if test &quot;x${ax_cv_c_compiler_vendor}&quot;  =  &quot;xsun&quot; ; then</span>
     if test &quot;${enable_64}&quot; = &quot;yes&quot;; then
         CFLAGS=&quot;$CFLAGS -m64 -lgpg-error&quot;
         CXXFLAGS=&quot;$CXXFLAGS -m64 -lgpg-error&quot;
<span style="color: #00A000">+        SUNFLAGS=&quot;-lgpg.error&quot;</span>
     fi
 fi
 
<span style="color: #00A000">+AC_SUBST(SUNCFLAGS)</span>
<span style="color: #00A000">+</span>
 dnl Generating makefiles
 AC_CONFIG_FILES([
 Makefile
<span style="color: #000080; font-weight: bold">diff --git a/libs/iksemel/tools/Makefile.am b/libs/iksemel/tools/Makefile.am</span>
<span style="color: #000080; font-weight: bold">index ab81e66..b7d80e9 100644</span>
<span style="color: #A00000">--- a/libs/iksemel/tools/Makefile.am</span>
<span style="color: #00A000">+++ b/libs/iksemel/tools/Makefile.am</span>
<span style="color: #800080; font-weight: bold">@@ -8,11 +8,11 @@ bin_PROGRAMS = ikslint iksroster iksperf</span>
 
 noinst_HEADERS = perf.h
 
<span style="color: #A00000">-ikslint_LDADD = $(top_builddir)/src/libiksemel.la</span>
<span style="color: #00A000">+ikslint_LDADD = $(top_builddir)/src/libiksemel.la @SUNCFLAGS@</span>
 ikslint_SOURCES = ikslint.c hash.c
 
<span style="color: #A00000">-iksroster_LDADD = $(top_builddir)/src/libiksemel.la</span>
<span style="color: #00A000">+iksroster_LDADD = $(top_builddir)/src/libiksemel.la @SUNCFLAGS@</span>
 iksroster_SOURCES = iksroster.c
 
<span style="color: #A00000">-iksperf_LDADD = $(top_builddir)/src/libiksemel.la</span>
<span style="color: #00A000">+iksperf_LDADD = $(top_builddir)/src/libiksemel.la @SUNCFLAGS@</span>
 iksperf_SOURCES = iksperf.c perf.c
</pre></div>
<div class="highlight"><pre>committer: cypromis
comments: 
gpg-error is needed on c flags as well on solaris

<span style="color: #000080; font-weight: bold">diff --git a/libs/iksemel/configure.ac b/libs/iksemel/configure.ac</span>
<span style="color: #000080; font-weight: bold">index 1b8af13..7761eb0 100644</span>
<span style="color: #A00000">--- a/libs/iksemel/configure.ac</span>
<span style="color: #00A000">+++ b/libs/iksemel/configure.ac</span>
<span style="color: #800080; font-weight: bold">@@ -83,7 +83,7 @@ AC_ARG_ENABLE(64,</span>
 
 if test &quot;x${ax_cv_c_compiler_vendor}&quot;  =  &quot;xsun&quot; ; then
     if test &quot;${enable_64}&quot; = &quot;yes&quot;; then
<span style="color: #A00000">-        CFLAGS=&quot;$CFLAGS -m64&quot;</span>
<span style="color: #00A000">+        CFLAGS=&quot;$CFLAGS -m64 -lgpg-error&quot;</span>
         CXXFLAGS=&quot;$CXXFLAGS -m64 -lgpg-error&quot;
     fi
 fi
</pre></div>
<div class="highlight"><pre>committer: Daniel Swarbrick
comments: 
make mod_snmp module unload more failsafe

<span style="color: #000080; font-weight: bold">diff --git a/src/mod/event_handlers/mod_snmp/mod_snmp.c b/src/mod/event_handlers/mod_snmp/mod_snmp.c</span>
<span style="color: #000080; font-weight: bold">index 040e82b..36a133c 100644</span>
<span style="color: #A00000">--- a/src/mod/event_handlers/mod_snmp/mod_snmp.c</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_snmp/mod_snmp.c</span>
<span style="color: #800080; font-weight: bold">@@ -98,6 +98,13 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_snmp_load)</span>
         netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE, 1);
 
         init_agent(&quot;mod_snmp&quot;);
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        /*</span>
<span style="color: #00A000">+         * Override master/subagent ping interval to 5s, to ensure that</span>
<span style="color: #00A000">+         * agent_check_and_process() never blocks for longer than that.</span>
<span style="color: #00A000">+         */</span>
<span style="color: #00A000">+        netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL, 5);</span>
<span style="color: #00A000">+</span>
         init_subagent();  
         init_snmp(&quot;mod_snmp&quot;);
 
<span style="color: #800080; font-weight: bold">@@ -107,8 +114,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_snmp_load)</span>
 
 SWITCH_MODULE_RUNTIME_FUNCTION(mod_snmp_runtime)
 {
<span style="color: #A00000">-        /* block on select() */</span>
<span style="color: #A00000">-        agent_check_and_process(1);</span>
<span style="color: #00A000">+        while (!globals.shutdown) {</span>
<span style="color: #00A000">+                /* Block on select() */</span>
<span style="color: #00A000">+                agent_check_and_process(1);</span>
<span style="color: #00A000">+        }</span>
 
         return SWITCH_STATUS_SUCCESS;
 }
</pre></div>
<div class="highlight"><pre>committer: Mathieu Rene
comments: 
don&#39;t hold loadable_modules.mutex while a module shutdown function is run, so that we do not prevent new channels from being created.

<span style="color: #000080; font-weight: bold">diff --git a/src/switch_loadable_module.c b/src/switch_loadable_module.c</span>
<span style="color: #000080; font-weight: bold">index 03858ac..d6796c8 100644</span>
<span style="color: #A00000">--- a/src/switch_loadable_module.c</span>
<span style="color: #00A000">+++ b/src/switch_loadable_module.c</span>
<span style="color: #800080; font-weight: bold">@@ -1047,20 +1047,24 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_unload_module(char *dir,</span>
                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, &quot;Module is not unloadable.\n&quot;);
                         *err = &quot;Module is not unloadable&quot;;
                         status = SWITCH_STATUS_NOUNLOAD;
<span style="color: #A00000">-                        goto end;</span>
<span style="color: #00A000">+                        goto unlock;</span>
                 } else {
<span style="color: #A00000">-                        if ((status = do_shutdown(module, SWITCH_TRUE, SWITCH_TRUE, !force, err) != SWITCH_STATUS_SUCCESS)) {</span>
<span style="color: #A00000">-                                goto end;</span>
<span style="color: #00A000">+                        /* Prevent anything from using the module while it&#39;s shutting down */</span>
<span style="color: #00A000">+                        switch_core_hash_delete(loadable_modules.module_hash, fname);</span>
<span style="color: #00A000">+                        switch_mutex_unlock(loadable_modules.mutex);</span>
<span style="color: #00A000">+                        if ((status = do_shutdown(module, SWITCH_TRUE, SWITCH_TRUE, !force, err)) != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                                /* Something went wrong in the module&#39;s shutdown function, add it again */</span>
<span style="color: #00A000">+                                switch_core_hash_insert_locked(loadable_modules.module_hash, fname, module, loadable_modules.mutex);</span>
                         }
<span style="color: #00A000">+                        goto end;</span>
                 }
<span style="color: #A00000">-                switch_core_hash_delete(loadable_modules.module_hash, fname);</span>
         } else {
                 *err = &quot;No such module!&quot;;
                 status = SWITCH_STATUS_FALSE;
         }
<span style="color: #A00000">-  end:</span>
<span style="color: #00A000">+unlock:</span>
         switch_mutex_unlock(loadable_modules.mutex);
<span style="color: #A00000">-</span>
<span style="color: #00A000">+  end:</span>
         if (force) {
                 switch_yield(1000000);
                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, &quot;PHEW!\n&quot;);
</pre></div>
<div class="highlight"><pre>committer: Jeff Lenk
comments: 
FS-3000 revert previous - flush digits after pin error

<span style="color: #000080; font-weight: bold">diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c</span>
<span style="color: #000080; font-weight: bold">index e6a47bf..472f2d9 100644</span>
<span style="color: #A00000">--- a/src/mod/applications/mod_conference/mod_conference.c</span>
<span style="color: #00A000">+++ b/src/mod/applications/mod_conference/mod_conference.c</span>
<span style="color: #800080; font-weight: bold">@@ -5597,7 +5597,6 @@ SWITCH_STANDARD_APP(conference_function)</span>
                         char pin_buf[80] = &quot;&quot;;
                         int pin_retries = 3;        /* XXX - this should be configurable - i&#39;m too lazy to do it right now... */
                         int pin_valid = 0;
<span style="color: #A00000">-                        int be_friendly = 0;</span>
                         switch_status_t status = SWITCH_STATUS_SUCCESS;
                         char *supplied_pin_value;
 
<span style="color: #800080; font-weight: bold">@@ -5632,23 +5631,19 @@ SWITCH_STANDARD_APP(conference_function)</span>
                                 switch_status_t pstatus = SWITCH_STATUS_FALSE;
 
                                 /* be friendly */
<span style="color: #A00000">-                                if (!be_friendly) {</span>
<span style="color: #A00000">-                                        if (conference-&gt;pin_sound) {</span>
<span style="color: #A00000">-                                                pstatus = conference_local_play_file(conference, session, conference-&gt;pin_sound, 20, pin_buf, sizeof(pin_buf));</span>
<span style="color: #A00000">-                                        } else if (conference-&gt;tts_engine &amp;&amp; conference-&gt;tts_voice) {</span>
<span style="color: #A00000">-                                                pstatus =</span>
<span style="color: #A00000">-                                                        switch_ivr_speak_text(session, conference-&gt;tts_engine, conference-&gt;tts_voice, &quot;please enter the conference pin number&quot;, NULL);</span>
<span style="color: #A00000">-                                        } else {</span>
<span style="color: #A00000">-                                                pstatus = switch_ivr_speak_text(session, &quot;flite&quot;, &quot;slt&quot;, &quot;please enter the conference pin number&quot;, NULL);</span>
<span style="color: #A00000">-                                        }</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                                        if (pstatus != SWITCH_STATUS_SUCCESS &amp;&amp; pstatus != SWITCH_STATUS_BREAK) {</span>
<span style="color: #A00000">-                                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, &quot;Cannot ask the user for a pin, ending call&quot;);</span>
<span style="color: #A00000">-                                                switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);</span>
<span style="color: #A00000">-                                        }</span>
<span style="color: #00A000">+                                if (conference-&gt;pin_sound) {</span>
<span style="color: #00A000">+                                        pstatus = conference_local_play_file(conference, session, conference-&gt;pin_sound, 20, pin_buf, sizeof(pin_buf));</span>
<span style="color: #00A000">+                                } else if (conference-&gt;tts_engine &amp;&amp; conference-&gt;tts_voice) {</span>
<span style="color: #00A000">+                                        pstatus =</span>
<span style="color: #00A000">+                                                switch_ivr_speak_text(session, conference-&gt;tts_engine, conference-&gt;tts_voice, &quot;please enter the conference pin number&quot;, NULL);</span>
<span style="color: #00A000">+                                } else {</span>
<span style="color: #00A000">+                                        pstatus = switch_ivr_speak_text(session, &quot;flite&quot;, &quot;slt&quot;, &quot;please enter the conference pin number&quot;, NULL);</span>
                                 }
 
<span style="color: #A00000">-                                be_friendly = 1;</span>
<span style="color: #00A000">+                                if (pstatus != SWITCH_STATUS_SUCCESS &amp;&amp; pstatus != SWITCH_STATUS_BREAK) {</span>
<span style="color: #00A000">+                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, &quot;Cannot ask the user for a pin, ending call&quot;);</span>
<span style="color: #00A000">+                                        switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);</span>
<span style="color: #00A000">+                                }</span>
 
                                 /* wait for them if neccessary */
                                 if (strlen(pin_buf) &lt; strlen(dpin)) {
<span style="color: #800080; font-weight: bold">@@ -5665,12 +5660,14 @@ SWITCH_STANDARD_APP(conference_function)</span>
 
                                 pin_valid = (status == SWITCH_STATUS_SUCCESS &amp;&amp; strcmp(pin_buf, dpin) == 0);
                                 if (!pin_valid) {
<span style="color: #00A000">+                                        /* zero the collected pin */</span>
<span style="color: #00A000">+                                        memset(pin_buf, 0, sizeof(pin_buf));</span>
<span style="color: #00A000">+</span>
                                         /* more friendliness */
                                         if (conference-&gt;bad_pin_sound) {
<span style="color: #A00000">-                                                conference_local_play_file(conference, session, conference-&gt;bad_pin_sound, 20, pin_buf, sizeof(pin_buf));</span>
<span style="color: #00A000">+                                                conference_local_play_file(conference, session, conference-&gt;bad_pin_sound, 20, NULL, 0);</span>
                                         }
<span style="color: #A00000">-                                        /* zero the collected pin */</span>
<span style="color: #A00000">-                                        memset(pin_buf, 0, sizeof(pin_buf));</span>
<span style="color: #00A000">+                                        switch_channel_flush_dtmf(channel);</span>
                                 }
                                 pin_retries--;
                         }
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments: 
fix unreachable condition with a null args to make any key stop playback/record etc without dequing and remove hard-coded flush digits in play_and_get_digits be sure to flush it yourself before using

<span style="color: #000080; font-weight: bold">diff --git a/src/switch_ivr.c b/src/switch_ivr.c</span>
<span style="color: #000080; font-weight: bold">index 496c29b..a40da1b 100644</span>
<span style="color: #A00000">--- a/src/switch_ivr.c</span>
<span style="color: #00A000">+++ b/src/switch_ivr.c</span>
<span style="color: #800080; font-weight: bold">@@ -224,7 +224,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session,</span>
                 switch_ivr_parse_all_events(session);
 
 
<span style="color: #A00000">-                if (args &amp;&amp; (args-&gt;input_callback || args-&gt;buf || args-&gt;buflen || args-&gt;dmachine)) {</span>
<span style="color: #00A000">+                if (args) {</span>
                         switch_dtmf_t dtmf;
 
                         /*
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c</span>
<span style="color: #000080; font-weight: bold">index 4e9e7b9..dc263e9 100644</span>
<span style="color: #A00000">--- a/src/switch_ivr_play_say.c</span>
<span style="color: #00A000">+++ b/src/switch_ivr_play_say.c</span>
<span style="color: #800080; font-weight: bold">@@ -634,7 +634,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se</span>
                         break;
                 }
 
<span style="color: #A00000">-                if (args &amp;&amp; (args-&gt;input_callback || args-&gt;buf || args-&gt;buflen || args-&gt;dmachine)) {</span>
<span style="color: #00A000">+                if (args) {</span>
                         /*
                            dtmf handler function you can hook up to be executed when a digit is dialed during playback 
                            if you return anything but SWITCH_STATUS_SUCCESS the playback will stop.
<span style="color: #800080; font-weight: bold">@@ -862,7 +862,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_gentones(switch_core_session_t *sessi</span>
 
                 switch_ivr_parse_all_events(session);
 
<span style="color: #A00000">-                if (args &amp;&amp; (args-&gt;input_callback || args-&gt;buf || args-&gt;buflen || args-&gt;dmachine)) {</span>
<span style="color: #00A000">+                if (args) {</span>
                         /*
                            dtmf handler function you can hook up to be executed when a digit is dialed during gentones 
                            if you return anything but SWITCH_STATUS_SUCCESS the playback will stop.
<span style="color: #800080; font-weight: bold">@@ -1314,7 +1314,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess</span>
 
                         switch_ivr_parse_all_events(session);
 
<span style="color: #A00000">-                        if (args &amp;&amp; (args-&gt;input_callback || args-&gt;buf || args-&gt;buflen || args-&gt;dmachine)) {</span>
<span style="color: #00A000">+                        if (args) {</span>
                                 /*
                                    dtmf handler function you can hook up to be executed when a digit is dialed during playback 
                                    if you return anything but SWITCH_STATUS_SUCCESS the playback will stop.
<span style="color: #800080; font-weight: bold">@@ -1875,7 +1875,7 @@ SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t</span>
                 switch_status_t status;
 
                 memset(digit_buffer, 0, digit_buffer_length);
<span style="color: #A00000">-                switch_channel_flush_dtmf(channel);</span>
<span style="color: #00A000">+</span>
                 status = switch_ivr_read(session, min_digits, max_digits, prompt_audio_file, var_name,
                                                                  digit_buffer, digit_buffer_length, timeout, valid_terminators, digit_timeout);
                 if (status == SWITCH_STATUS_TIMEOUT &amp;&amp; strlen(digit_buffer) &gt;= min_digits) {
<span style="color: #800080; font-weight: bold">@@ -2037,7 +2037,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session</span>
                         switch_event_destroy(&amp;event);
                 }
 
<span style="color: #A00000">-                if (args &amp;&amp; (args-&gt;input_callback || args-&gt;buf || args-&gt;buflen || args-&gt;dmachine)) {</span>
<span style="color: #00A000">+                if (args) {</span>
                         /* dtmf handler function you can hook up to be executed when a digit is dialed during playback 
                          * if you return anything but SWITCH_STATUS_SUCCESS the playback will stop.
                          */
</pre></div>
========================================================================<pre>

Summary of changes:
 .../ftmod_sangoma_isdn_support.c                   |   54 +++----
 libs/iksemel/configure.ac                          |   11 +-
 libs/iksemel/src/Makefile.am                       |    4 +-
 libs/iksemel/tools/Makefile.am                     |    6 +-
 scripts/perl/dhcp-inform.pl                        |    9 +-
 src/mod/applications/mod_commands/mod_commands.c   |   21 ++-
 .../applications/mod_conference/mod_conference.c   |   95 +++++++----
 src/mod/endpoints/mod_loopback/mod_loopback.c      |   24 +--
 src/mod/endpoints/mod_sofia/mod_sofia.c            |    2 +-
 src/mod/endpoints/mod_sofia/sofia.c                |   12 ++
 .../mod_event_socket/mod_event_socket.c            |   68 +++++---
 src/mod/event_handlers/mod_snmp/mod_snmp.c         |   38 ++--
 src/mod/event_handlers/mod_snmp/subagent.c         |  171 ++++++++-----------
 src/mod/event_handlers/mod_snmp/subagent.h         |   14 ++
 src/mod/languages/mod_lua/freeswitch.i             |    1 +
 src/mod/languages/mod_lua/freeswitch_lua.cpp       |   32 +++-
 src/mod/languages/mod_lua/freeswitch_lua.h         |    1 +
 src/mod/languages/mod_lua/mod_lua_wrap.cpp         |  179 ++++++++++++++++++++
 src/switch_channel.c                               |    4 +-
 src/switch_ivr.c                                   |    2 +-
 src/switch_ivr_async.c                             |    1 +
 src/switch_ivr_play_say.c                          |   10 +-
 src/switch_loadable_module.c                       |   16 +-
 w32/Setup/Product.wxs                              |    6 -
 24 files changed, 507 insertions(+), 274 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>