<h1>Project "FreeSWITCH Source" received a push.</h1>
<h2>branch: master updated</h2>
<pre>
via: 0d276e7d7b7b52ac5510d139d8252fc10ad37298 (commit)
via: daa28cfccae9b171221408f3af4f8c10283e67b3 (commit)
via: c64b78577f65b586ff6d7af711c79d0427fc61c5 (commit)
via: 9ade16e9291aa74b4483bb9b9d9db266e082f7cc (commit)
via: 314a2a1e2061ef321fa5f9b32a9c70ef0040cdb8 (commit)
via: 48c02b7cd2770f6aee1d6e89f5ecfe207231f398 (commit)
via: f954d21ab8f84ea3518525d6f8a5a25c5cd39d6b (commit)
via: f8254f81607c9b2fe8ece3c48cb6dff700bcbead (commit)
via: 608be370bcca24023ee9d05ee4a99c133044f0d3 (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)
via: a8f5bf60a87fb27420846bd9d9af5e61f1f947d6 (commit)
via: 6e4c30ea377728107e0747d614565eca964fa1d3 (commit)
via: 7a1dcb69581ba593f3dc3868c94c1124c41e64f3 (commit)
via: 6294bc1620c94785f23bf6ae6966aaa67cf34c7f (commit)
via: 0e37dcb5db19592d28eb771edb4a0d394f5275ac (commit)
via: b88cd3457a847cf05564df51bd8a60036b15bfd8 (commit)
via: 9adac7c6988df8436c634edaaa13ae39067f8df7 (commit)
via: 5316bcd9dc648b3874ebddea75ed6f34431c7f35 (commit)
via: 9fe440b2fe63935331b148ffc1d3c7a5ddffa20b (commit)
via: 8d6d52e015411649e0591eb7ad667885523b99c3 (commit)
via: 4eccdfef58a64652ae2a1f0a7a1f11ae55346420 (commit)
via: f5dafc9911eb892e0ac557bc892638cc9fb67014 (commit)
via: e0ed0008b1712d00f21d8fedce32eeb531e5da82 (commit)
via: 3fa3e11ca23f788841e00aef8342e1718675477d (commit)
via: 3dd9d5c0a399757059c60d9d8c751b97383da676 (commit)
via: 1cf79386c80712311c656a166b9dec5847857266 (commit)
via: e086b80632bad6c3afb24320d2fcb74304897a9c (commit)
via: accc28528009361b4b1e268431d6e2b94112020a (commit)
via: 6e2b1bd328607b2f0d5175b57389dfd2c3c62066 (commit)
via: c91b409caa37a115a46f60f7b3725d7dd1b3c50e (commit)
via: 1561ad2ca695058c79183c07c59fe1dab825deff (commit)
via: 74de704973086d5cf360578ad9eac5977cfa4770 (commit)
via: 2e18c5b4d9fc583b76b4c8e4470579b1a21845ae (commit)
via: 7fbc47f83a5bf455b6ece49deb7771d144bbce4c (commit)
via: 1c95ad98cd1c0e966b738796e74923db8919b754 (commit)
via: fd984d03bb629d08ac4192c5a1d3432e94ceb3d5 (commit)
via: 70700617d3d6bd45904a81be443fe28aa7fd0387 (commit)
via: d743baefedfbe679a647013adc2718defef90718 (commit)
via: 1da8339ffb5719ba92ececeb27b6c335f3e6b4aa (commit)
via: 0cf1d54a05319be2f388e5f2dbb1bfd75a2a9043 (commit)
via: 978cb111e7971eceb238d396124e10424b148a6c (commit)
from: 189db0e7ad0f4ef29ffa703114ff1d94a20d0b8f (commit)
</pre>= COMMIT LOG ===========================================================
<div class="highlight"><pre>committer: David Yat Sin
comments:
Merge branch 'master' of git://git.freeswitch.org/freeswitch
</pre></div>
<div class="highlight"><pre>committer: Jeff Lenk
comments:
add missing files
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/msvc/freetdm.2010.vcxproj b/libs/freetdm/msvc/freetdm.2010.vcxproj</span>
<span style="color: #000080; font-weight: bold">index 71eb6db..aecb9ef 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/msvc/freetdm.2010.vcxproj</span>
<span style="color: #00A000">+++ b/libs/freetdm/msvc/freetdm.2010.vcxproj</span>
<span style="color: #800080; font-weight: bold">@@ -188,6 +188,7 @@</span>
<ClInclude Include="..\src\include\ftdm_os.h" />
<ClInclude Include="..\src\include\private\ftdm_sched.h" />
<ClInclude Include="..\src\include\ftdm_threadmutex.h" />
<span style="color: #00A000">+ <ClInclude Include="..\src\include\private\ftdm_state.h" /></span>
<ClInclude Include="..\src\include\private\ftdm_types.h" />
<ClInclude Include="..\src\include\private\g711.h" />
<ClInclude Include="..\src\include\private\hashtable.h" />
<span style="color: #800080; font-weight: bold">@@ -209,6 +210,7 @@</span>
<ClCompile Include="..\src\ftdm_io.c" />
<ClCompile Include="..\src\ftdm_queue.c" />
<ClCompile Include="..\src\ftdm_sched.c" />
<span style="color: #00A000">+ <ClCompile Include="..\src\ftdm_state.c" /></span>
<ClCompile Include="..\src\ftdm_threadmutex.c" />
<ClCompile Include="..\src\g711.c" />
<ClCompile Include="..\src\hashtable.c" />
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/msvc/freetdm.2010.vcxproj.filters b/libs/freetdm/msvc/freetdm.2010.vcxproj.filters</span>
<span style="color: #000080; font-weight: bold">index ed642ba..e6dc40d 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/msvc/freetdm.2010.vcxproj.filters</span>
<span style="color: #00A000">+++ b/libs/freetdm/msvc/freetdm.2010.vcxproj.filters</span>
<span style="color: #800080; font-weight: bold">@@ -71,6 +71,9 @@</span>
<ClInclude Include="..\src\include\private\uart.h">
<Filter>Header Files</Filter>
</ClInclude>
<span style="color: #00A000">+ <ClInclude Include="..\src\include\private\ftdm_state.h"></span>
<span style="color: #00A000">+ <Filter>Header Files</Filter></span>
<span style="color: #00A000">+ </ClInclude></span>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\fsk.c">
<span style="color: #800080; font-weight: bold">@@ -124,5 +127,8 @@</span>
<ClCompile Include="..\src\uart.c">
<Filter>Source Files</Filter>
</ClCompile>
<span style="color: #00A000">+ <ClCompile Include="..\src\ftdm_state.c"></span>
<span style="color: #00A000">+ <Filter>Source Files</Filter></span>
<span style="color: #00A000">+ </ClCompile></span>
</ItemGroup>
</Project>
\ No newline at end of file
</pre></div>
<div class="highlight"><pre>committer: Travis Cross
comments:
.gitignore compressed files
<span style="color: #000080; font-weight: bold">diff --git a/.gitignore b/.gitignore</span>
<span style="color: #000080; font-weight: bold">index 304b42c..c53d07d 100644</span>
<span style="color: #A00000">--- a/.gitignore</span>
<span style="color: #00A000">+++ b/.gitignore</span>
<span style="color: #800080; font-weight: bold">@@ -33,6 +33,12 @@</span>
*.ilk
*.bsc
*.pch
<span style="color: #00A000">+*.tar</span>
<span style="color: #00A000">+*.gz</span>
<span style="color: #00A000">+*.tgz</span>
<span style="color: #00A000">+*.xz</span>
<span style="color: #00A000">+*.bz2</span>
<span style="color: #00A000">+*.tbz2</span>
core.*
/Path
/w32/Library/lastversion
<span style="color: #800080; font-weight: bold">@@ -79,7 +85,6 @@ configure.lineno</span>
/scripts/fsxs
/scripts/gentls_cert
/a.out.dSYM
<span style="color: #A00000">-/freeswitch-sounds-*</span>
src/mod/applications/mod_easyroute/Makefile
src/mod/applications/mod_lcr/Makefile
src/mod/applications/mod_nibblebill/Makefile
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/endpoints/mod_gsmopen/.gitignore b/src/mod/endpoints/mod_gsmopen/.gitignore</span>
<span style="color: #000080; font-weight: bold">index 9fdeeb1..fe8dc68 100644</span>
<span style="color: #A00000">--- a/src/mod/endpoints/mod_gsmopen/.gitignore</span>
<span style="color: #00A000">+++ b/src/mod/endpoints/mod_gsmopen/.gitignore</span>
<span style="color: #800080; font-weight: bold">@@ -1,2 +1,4 @@</span>
!/gsmlib/gsmlib-*/aclocal.m4
!/gsmlib/gsmlib-*/configure
<span style="color: #00A000">+!/gsmlib/gsmlib-1.10.tar.gz</span>
<span style="color: #00A000">+!/gsmlib/gsmlib_1.10-12ubuntu1.diff.gz</span>
</pre></div>
<div class="highlight"><pre>committer: Brian West
comments:
swigall
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.cxx</span>
<span style="color: #000080; font-weight: bold">index aa2a84f..3ee6ff6 100644</span>
<span style="color: #A00000">--- a/src/mod/languages/mod_managed/freeswitch_wrap.cxx</span>
<span style="color: #00A000">+++ b/src/mod/languages/mod_managed/freeswitch_wrap.cxx</span>
<span style="color: #800080; font-weight: bold">@@ -7413,6 +7413,20 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_core_session_get_dmachine(void * jar</span>
}
<span style="color: #00A000">+SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_set_codec_slin(void * jarg1, void * jarg2) {</span>
<span style="color: #00A000">+ int jresult ;</span>
<span style="color: #00A000">+ switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;</span>
<span style="color: #00A000">+ switch_slin_data_t *arg2 = (switch_slin_data_t *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t result;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_core_session_t *)jarg1; </span>
<span style="color: #00A000">+ arg2 = (switch_slin_data_t *)jarg2; </span>
<span style="color: #00A000">+ result = (switch_status_t)switch_core_session_set_codec_slin(arg1,arg2);</span>
<span style="color: #00A000">+ jresult = result; </span>
<span style="color: #00A000">+ return jresult;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_core_get_uuid() {
char * jresult ;
char *result = 0 ;
<span style="color: #800080; font-weight: bold">@@ -22794,6 +22808,119 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_api_interface(void * jarg1) {</span>
}
<span style="color: #00A000">+SWIGEXPORT void SWIGSTDCALL CSharp_switch_slin_data_session_set(void * jarg1, void * jarg2) {</span>
<span style="color: #00A000">+ switch_slin_data *arg1 = (switch_slin_data *) 0 ;</span>
<span style="color: #00A000">+ switch_core_session_t *arg2 = (switch_core_session_t *) 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_slin_data *)jarg1; </span>
<span style="color: #00A000">+ arg2 = (switch_core_session_t *)jarg2; </span>
<span style="color: #00A000">+ if (arg1) (arg1)->session = arg2;</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">+SWIGEXPORT void * SWIGSTDCALL CSharp_switch_slin_data_session_get(void * jarg1) {</span>
<span style="color: #00A000">+ void * jresult ;</span>
<span style="color: #00A000">+ switch_slin_data *arg1 = (switch_slin_data *) 0 ;</span>
<span style="color: #00A000">+ switch_core_session_t *result = 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_slin_data *)jarg1; </span>
<span style="color: #00A000">+ result = (switch_core_session_t *) ((arg1)->session);</span>
<span style="color: #00A000">+ jresult = (void *)result; </span>
<span style="color: #00A000">+ return jresult;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+SWIGEXPORT void SWIGSTDCALL CSharp_switch_slin_data_write_frame_set(void * jarg1, void * jarg2) {</span>
<span style="color: #00A000">+ switch_slin_data *arg1 = (switch_slin_data *) 0 ;</span>
<span style="color: #00A000">+ switch_frame_t *arg2 = (switch_frame_t *) 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_slin_data *)jarg1; </span>
<span style="color: #00A000">+ arg2 = (switch_frame_t *)jarg2; </span>
<span style="color: #00A000">+ if (arg1) (arg1)->write_frame = *arg2;</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">+SWIGEXPORT void * SWIGSTDCALL CSharp_switch_slin_data_write_frame_get(void * jarg1) {</span>
<span style="color: #00A000">+ void * jresult ;</span>
<span style="color: #00A000">+ switch_slin_data *arg1 = (switch_slin_data *) 0 ;</span>
<span style="color: #00A000">+ switch_frame_t *result = 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_slin_data *)jarg1; </span>
<span style="color: #00A000">+ result = (switch_frame_t *)& ((arg1)->write_frame);</span>
<span style="color: #00A000">+ jresult = (void *)result; </span>
<span style="color: #00A000">+ return jresult;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+SWIGEXPORT void SWIGSTDCALL CSharp_switch_slin_data_codec_set(void * jarg1, void * jarg2) {</span>
<span style="color: #00A000">+ switch_slin_data *arg1 = (switch_slin_data *) 0 ;</span>
<span style="color: #00A000">+ switch_codec_t *arg2 = (switch_codec_t *) 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_slin_data *)jarg1; </span>
<span style="color: #00A000">+ arg2 = (switch_codec_t *)jarg2; </span>
<span style="color: #00A000">+ if (arg1) (arg1)->codec = *arg2;</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">+SWIGEXPORT void * SWIGSTDCALL CSharp_switch_slin_data_codec_get(void * jarg1) {</span>
<span style="color: #00A000">+ void * jresult ;</span>
<span style="color: #00A000">+ switch_slin_data *arg1 = (switch_slin_data *) 0 ;</span>
<span style="color: #00A000">+ switch_codec_t *result = 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_slin_data *)jarg1; </span>
<span style="color: #00A000">+ result = (switch_codec_t *)& ((arg1)->codec);</span>
<span style="color: #00A000">+ jresult = (void *)result; </span>
<span style="color: #00A000">+ return jresult;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+SWIGEXPORT void SWIGSTDCALL CSharp_switch_slin_data_frame_data_set(void * jarg1, char * jarg2) {</span>
<span style="color: #00A000">+ switch_slin_data *arg1 = (switch_slin_data *) 0 ;</span>
<span style="color: #00A000">+ char *arg2 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_slin_data *)jarg1; </span>
<span style="color: #00A000">+ arg2 = (char *)jarg2; </span>
<span style="color: #00A000">+ {</span>
<span style="color: #00A000">+ if (arg2) strncpy((char *)arg1->frame_data, (const char *)arg2, 4096);</span>
<span style="color: #00A000">+ else arg1->frame_data[0] = 0;</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">+SWIGEXPORT char * SWIGSTDCALL CSharp_switch_slin_data_frame_data_get(void * jarg1) {</span>
<span style="color: #00A000">+ char * jresult ;</span>
<span style="color: #00A000">+ switch_slin_data *arg1 = (switch_slin_data *) 0 ;</span>
<span style="color: #00A000">+ char *result = 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_slin_data *)jarg1; </span>
<span style="color: #00A000">+ result = (char *)(char *) ((arg1)->frame_data);</span>
<span style="color: #00A000">+ jresult = SWIG_csharp_string_callback((const char *)result); </span>
<span style="color: #00A000">+ return jresult;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_slin_data() {</span>
<span style="color: #00A000">+ void * jresult ;</span>
<span style="color: #00A000">+ switch_slin_data *result = 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ result = (switch_slin_data *)new switch_slin_data();</span>
<span style="color: #00A000">+ jresult = (void *)result; </span>
<span style="color: #00A000">+ return jresult;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_slin_data(void * jarg1) {</span>
<span style="color: #00A000">+ switch_slin_data *arg1 = (switch_slin_data *) 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_slin_data *)jarg1; </span>
<span style="color: #00A000">+ delete arg1;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_timetable_profile_created_set(void * jarg1, void * jarg2) {
switch_channel_timetable *arg1 = (switch_channel_timetable *) 0 ;
switch_time_t arg2 ;
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/languages/mod_managed/managed/swig.cs b/src/mod/languages/mod_managed/managed/swig.cs</span>
<span style="color: #000080; font-weight: bold">index 5a2188a..48d585e 100644</span>
<span style="color: #A00000">--- a/src/mod/languages/mod_managed/managed/swig.cs</span>
<span style="color: #00A000">+++ b/src/mod/languages/mod_managed/managed/swig.cs</span>
<span style="color: #800080; font-weight: bold">@@ -1357,6 +1357,11 @@ public class freeswitch {</span>
return ret;
}
<span style="color: #00A000">+ public static switch_status_t switch_core_session_set_codec_slin(SWIGTYPE_p_switch_core_session session, switch_slin_data data) {</span>
<span style="color: #00A000">+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_session_set_codec_slin(SWIGTYPE_p_switch_core_session.getCPtr(session), switch_slin_data.getCPtr(data));</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
public static string switch_core_get_uuid() {
string ret = freeswitchPINVOKE.switch_core_get_uuid();
return ret;
<span style="color: #800080; font-weight: bold">@@ -7504,6 +7509,9 @@ class freeswitchPINVOKE {</span>
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_get_dmachine")]
public static extern IntPtr switch_core_session_get_dmachine(HandleRef jarg1);
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_set_codec_slin")]</span>
<span style="color: #00A000">+ public static extern int switch_core_session_set_codec_slin(HandleRef jarg1, HandleRef jarg2);</span>
<span style="color: #00A000">+</span>
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_get_uuid")]
public static extern string switch_core_get_uuid();
<span style="color: #800080; font-weight: bold">@@ -11188,6 +11196,36 @@ class freeswitchPINVOKE {</span>
[DllImport("mod_managed", EntryPoint="CSharp_delete_switch_api_interface")]
public static extern void delete_switch_api_interface(HandleRef jarg1);
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_slin_data_session_set")]</span>
<span style="color: #00A000">+ public static extern void switch_slin_data_session_set(HandleRef jarg1, HandleRef jarg2);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_slin_data_session_get")]</span>
<span style="color: #00A000">+ public static extern IntPtr switch_slin_data_session_get(HandleRef jarg1);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_slin_data_write_frame_set")]</span>
<span style="color: #00A000">+ public static extern void switch_slin_data_write_frame_set(HandleRef jarg1, HandleRef jarg2);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_slin_data_write_frame_get")]</span>
<span style="color: #00A000">+ public static extern IntPtr switch_slin_data_write_frame_get(HandleRef jarg1);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_slin_data_codec_set")]</span>
<span style="color: #00A000">+ public static extern void switch_slin_data_codec_set(HandleRef jarg1, HandleRef jarg2);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_slin_data_codec_get")]</span>
<span style="color: #00A000">+ public static extern IntPtr switch_slin_data_codec_get(HandleRef jarg1);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_slin_data_frame_data_set")]</span>
<span style="color: #00A000">+ public static extern void switch_slin_data_frame_data_set(HandleRef jarg1, string jarg2);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_slin_data_frame_data_get")]</span>
<span style="color: #00A000">+ public static extern string switch_slin_data_frame_data_get(HandleRef jarg1);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_new_switch_slin_data")]</span>
<span style="color: #00A000">+ public static extern IntPtr new_switch_slin_data();</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_slin_data")]</span>
<span style="color: #00A000">+ public static extern void delete_switch_slin_data(HandleRef jarg1);</span>
<span style="color: #00A000">+</span>
[DllImport("mod_managed", EntryPoint="CSharp_switch_channel_timetable_profile_created_set")]
public static extern void switch_channel_timetable_profile_created_set(HandleRef jarg1, HandleRef jarg2);
<span style="color: #800080; font-weight: bold">@@ -28401,7 +28439,8 @@ public enum switch_rtp_bug_flag_t {</span>
RTP_BUG_IGNORE_MARK_BIT = (1 << 2),
RTP_BUG_SEND_LINEAR_TIMESTAMPS = (1 << 3),
RTP_BUG_START_SEQ_AT_ZERO = (1 << 4),
<span style="color: #A00000">- RTP_BUG_NEVER_SEND_MARKER = (1 << 5)</span>
<span style="color: #00A000">+ RTP_BUG_NEVER_SEND_MARKER = (1 << 5),</span>
<span style="color: #00A000">+ RTP_BUG_IGNORE_DTMF_DURATION = (1 << 6)</span>
}
}
<span style="color: #800080; font-weight: bold">@@ -29437,6 +29476,96 @@ public enum switch_signal_t {</span>
namespace FreeSWITCH.Native {
<span style="color: #00A000">+using System;</span>
<span style="color: #00A000">+using System.Runtime.InteropServices;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+public class switch_slin_data : IDisposable {</span>
<span style="color: #00A000">+ private HandleRef swigCPtr;</span>
<span style="color: #00A000">+ protected bool swigCMemOwn;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ internal switch_slin_data(IntPtr cPtr, bool cMemoryOwn) {</span>
<span style="color: #00A000">+ swigCMemOwn = cMemoryOwn;</span>
<span style="color: #00A000">+ swigCPtr = new HandleRef(this, cPtr);</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ internal static HandleRef getCPtr(switch_slin_data obj) {</span>
<span style="color: #00A000">+ return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ ~switch_slin_data() {</span>
<span style="color: #00A000">+ Dispose();</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ public virtual void Dispose() {</span>
<span style="color: #00A000">+ lock(this) {</span>
<span style="color: #00A000">+ if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {</span>
<span style="color: #00A000">+ swigCMemOwn = false;</span>
<span style="color: #00A000">+ freeswitchPINVOKE.delete_switch_slin_data(swigCPtr);</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+ swigCPtr = new HandleRef(null, IntPtr.Zero);</span>
<span style="color: #00A000">+ GC.SuppressFinalize(this);</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ public SWIGTYPE_p_switch_core_session session {</span>
<span style="color: #00A000">+ set {</span>
<span style="color: #00A000">+ freeswitchPINVOKE.switch_slin_data_session_set(swigCPtr, SWIGTYPE_p_switch_core_session.getCPtr(value));</span>
<span style="color: #00A000">+ } </span>
<span style="color: #00A000">+ get {</span>
<span style="color: #00A000">+ IntPtr cPtr = freeswitchPINVOKE.switch_slin_data_session_get(swigCPtr);</span>
<span style="color: #00A000">+ SWIGTYPE_p_switch_core_session ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_core_session(cPtr, false);</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ } </span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ public switch_frame write_frame {</span>
<span style="color: #00A000">+ set {</span>
<span style="color: #00A000">+ freeswitchPINVOKE.switch_slin_data_write_frame_set(swigCPtr, switch_frame.getCPtr(value));</span>
<span style="color: #00A000">+ } </span>
<span style="color: #00A000">+ get {</span>
<span style="color: #00A000">+ IntPtr cPtr = freeswitchPINVOKE.switch_slin_data_write_frame_get(swigCPtr);</span>
<span style="color: #00A000">+ switch_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_frame(cPtr, false);</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ } </span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ public switch_codec codec {</span>
<span style="color: #00A000">+ set {</span>
<span style="color: #00A000">+ freeswitchPINVOKE.switch_slin_data_codec_set(swigCPtr, switch_codec.getCPtr(value));</span>
<span style="color: #00A000">+ } </span>
<span style="color: #00A000">+ get {</span>
<span style="color: #00A000">+ IntPtr cPtr = freeswitchPINVOKE.switch_slin_data_codec_get(swigCPtr);</span>
<span style="color: #00A000">+ switch_codec ret = (cPtr == IntPtr.Zero) ? null : new switch_codec(cPtr, false);</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ } </span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ public string frame_data {</span>
<span style="color: #00A000">+ set {</span>
<span style="color: #00A000">+ freeswitchPINVOKE.switch_slin_data_frame_data_set(swigCPtr, value);</span>
<span style="color: #00A000">+ } </span>
<span style="color: #00A000">+ get {</span>
<span style="color: #00A000">+ string ret = freeswitchPINVOKE.switch_slin_data_frame_data_get(swigCPtr);</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ } </span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ public switch_slin_data() : this(freeswitchPINVOKE.new_switch_slin_data(), true) {</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">+ * This file was automatically generated by SWIG (http://www.swig.org).</span>
<span style="color: #00A000">+ * Version 1.3.35</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * Do not make changes to this file unless you know what you are doing--modify</span>
<span style="color: #00A000">+ * the SWIG interface file instead.</span>
<span style="color: #00A000">+ * ----------------------------------------------------------------------------- */</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+namespace FreeSWITCH.Native {</span>
<span style="color: #00A000">+</span>
[System.Flags] public enum switch_speech_flag_enum_t {
SWITCH_SPEECH_FLAG_NONE = 0,
SWITCH_SPEECH_FLAG_HASTEXT = (1 << 0),
<span style="color: #800080; font-weight: bold">@@ -30146,7 +30275,7 @@ public enum switch_status_t {</span>
SWITCH_STATUS_FALSE,
SWITCH_STATUS_TIMEOUT,
SWITCH_STATUS_RESTART,
<span style="color: #A00000">- SWITCH_STATUS_TERM,</span>
<span style="color: #00A000">+ SWITCH_STATUS_INTR,</span>
SWITCH_STATUS_NOTIMPL,
SWITCH_STATUS_MEMERR,
SWITCH_STATUS_NOOP,
<span style="color: #800080; font-weight: bold">@@ -30163,6 +30292,7 @@ public enum switch_status_t {</span>
SWITCH_STATUS_TOO_SMALL,
SWITCH_STATUS_FOUND,
SWITCH_STATUS_CONTINUE,
<span style="color: #00A000">+ SWITCH_STATUS_TERM,</span>
SWITCH_STATUS_NOT_INITALIZED
}
</pre></div>
<div class="highlight"><pre>committer: Brian West
comments:
FS-3004
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c</span>
<span style="color: #000080; font-weight: bold">index 21c6a68..4dd936b 100644</span>
<span style="color: #A00000">--- a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c</span>
<span style="color: #00A000">+++ b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c</span>
<span style="color: #800080; font-weight: bold">@@ -40,6 +40,9 @@</span>
#define MAX_FEC_ENTRIES 4
#define MAX_FEC_SPAN 4
<span style="color: #00A000">+#define SPANDSP_EVENT_TXFAXRESULT "spandsp::txfaxresult"</span>
<span style="color: #00A000">+#define SPANDSP_EVENT_RXFAXRESULT "spandsp::rxfaxresult"</span>
<span style="color: #00A000">+</span>
/*****************************************************************************
        OUR DEFINES AND STRUCTS
*****************************************************************************/
<span style="color: #800080; font-weight: bold">@@ -305,7 +308,14 @@ static void phase_e_handler(t30_state_t *s, void *user_data, int result)</span>
        switch_core_session_t *session;
        switch_channel_t *channel;
        pvt_t *pvt;
<span style="color: #A00000">-        char *tmp;</span>
<span style="color: #00A000">+        char *fax_document_transferred_pages = NULL;</span>
<span style="color: #00A000">+        char *fax_document_total_pages = NULL;</span>
<span style="color: #00A000">+        char *fax_image_resolution = NULL;</span>
<span style="color: #00A000">+        char *fax_image_size = NULL;</span>
<span style="color: #00A000">+        char *fax_bad_rows = NULL;</span>
<span style="color: #00A000">+        char *fax_transfer_rate = NULL;</span>
<span style="color: #00A000">+        char *fax_result_code = NULL;</span>
<span style="color: #00A000">+        switch_event_t *event;</span>
        pvt = (pvt_t *) user_data;
        switch_assert(pvt);
<span style="color: #800080; font-weight: bold">@@ -353,13 +363,12 @@ static void phase_e_handler(t30_state_t *s, void *user_data, int result)</span>
        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "==============================================================================\n");
        /*
<span style="color: #A00000">-         Set our channel variables</span>
<span style="color: #00A000">+         Set our channel variables, variables are also used in event</span>
         */
<span style="color: #A00000">-        tmp = switch_mprintf("%i", result);</span>
<span style="color: #A00000">-        if (tmp) {</span>
<span style="color: #A00000">-                switch_channel_set_variable(channel, "fax_result_code", tmp);</span>
<span style="color: #A00000">-                switch_safe_free(tmp);</span>
<span style="color: #00A000">+        fax_result_code = switch_core_session_sprintf(session, "%i", result);</span>
<span style="color: #00A000">+        if (fax_result_code) {</span>
<span style="color: #00A000">+                switch_channel_set_variable(channel, "fax_result_code", fax_result_code);</span>
        }
        switch_channel_set_variable(channel, "fax_result_text", t30_completion_code_to_str(result));
<span style="color: #800080; font-weight: bold">@@ -368,49 +377,56 @@ static void phase_e_handler(t30_state_t *s, void *user_data, int result)</span>
        switch_channel_set_variable(channel, "fax_local_station_id", local_ident);
        switch_channel_set_variable(channel, "fax_remote_station_id", far_ident);
<span style="color: #A00000">-        tmp = switch_mprintf("%i", pvt->app_mode == FUNCTION_TX ? t.pages_tx : t.pages_rx);</span>
<span style="color: #A00000">-        if (tmp) {</span>
<span style="color: #A00000">-                switch_channel_set_variable(channel, "fax_document_transferred_pages", tmp);</span>
<span style="color: #A00000">-                switch_safe_free(tmp);</span>
<span style="color: #00A000">+        fax_document_transferred_pages = switch_core_session_sprintf(session, "%i", pvt->app_mode == FUNCTION_TX ? t.pages_tx : t.pages_rx);</span>
<span style="color: #00A000">+        if (fax_document_transferred_pages) {</span>
<span style="color: #00A000">+                switch_channel_set_variable(channel, "fax_document_transferred_pages", fax_document_transferred_pages);</span>
        }
<span style="color: #A00000">-        tmp = switch_mprintf("%i", t.pages_in_file);</span>
<span style="color: #A00000">-        if (tmp) {</span>
<span style="color: #A00000">-                switch_channel_set_variable(channel, "fax_document_total_pages", tmp);</span>
<span style="color: #A00000">-                switch_safe_free(tmp);</span>
<span style="color: #00A000">+        fax_document_total_pages = switch_core_session_sprintf(session, "%i", t.pages_in_file);</span>
<span style="color: #00A000">+        if (fax_document_total_pages) {</span>
<span style="color: #00A000">+                switch_channel_set_variable(channel, "fax_document_total_pages", fax_document_total_pages);</span>
        }
<span style="color: #A00000">-        tmp = switch_mprintf("%ix%i", t.x_resolution, t.y_resolution);</span>
<span style="color: #A00000">-        if (tmp) {</span>
<span style="color: #A00000">-                switch_channel_set_variable(channel, "fax_image_resolution", tmp);</span>
<span style="color: #A00000">-                switch_safe_free(tmp);</span>
<span style="color: #00A000">+        fax_image_resolution = switch_core_session_sprintf(session, "%ix%i", t.x_resolution, t.y_resolution);</span>
<span style="color: #00A000">+        if (fax_image_resolution) {</span>
<span style="color: #00A000">+                switch_channel_set_variable(channel, "fax_image_resolution", fax_image_resolution);</span>
        }
<span style="color: #A00000">-        tmp = switch_mprintf("%d", t.image_size);</span>
<span style="color: #A00000">-        if (tmp) {</span>
<span style="color: #A00000">-                switch_channel_set_variable(channel, "fax_image_size", tmp);</span>
<span style="color: #A00000">-                switch_safe_free(tmp);</span>
<span style="color: #00A000">+        fax_image_size = switch_core_session_sprintf(session, "%d", t.image_size);</span>
<span style="color: #00A000">+        if (fax_image_size) {</span>
<span style="color: #00A000">+                switch_channel_set_variable(channel, "fax_image_size", fax_image_size);</span>
        }
<span style="color: #A00000">-        tmp = switch_mprintf("%d", t.bad_rows);</span>
<span style="color: #A00000">-        if (tmp) {</span>
<span style="color: #A00000">-                switch_channel_set_variable(channel, "fax_bad_rows", tmp);</span>
<span style="color: #A00000">-                switch_safe_free(tmp);</span>
<span style="color: #00A000">+        fax_bad_rows = switch_core_session_sprintf(session, "%d", t.bad_rows);</span>
<span style="color: #00A000">+        if (fax_bad_rows) {</span>
<span style="color: #00A000">+                switch_channel_set_variable(channel, "fax_bad_rows", fax_bad_rows);</span>
        }
<span style="color: #A00000">-        tmp = switch_mprintf("%i", t.bit_rate);</span>
<span style="color: #A00000">-        if (tmp) {</span>
<span style="color: #A00000">-                switch_channel_set_variable(channel, "fax_transfer_rate", tmp);</span>
<span style="color: #A00000">-                switch_safe_free(tmp);</span>
<span style="color: #00A000">+        fax_transfer_rate = switch_core_session_sprintf(session, "%i", t.bit_rate);</span>
<span style="color: #00A000">+        if (fax_transfer_rate) {</span>
<span style="color: #00A000">+                switch_channel_set_variable(channel, "fax_transfer_rate", fax_transfer_rate);</span>
        }
        /* switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); */
        pvt->done = 1;
<span style="color: #A00000">-        /*</span>
<span style="color: #A00000">-         TODO Fire events</span>
<span style="color: #A00000">-         */</span>
<span style="color: #00A000">+        /* Fire event */</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, pvt->app_mode == FUNCTION_TX ? SPANDSP_EVENT_TXFAXRESULT : SPANDSP_EVENT_RXFAXRESULT) == SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-document-transferred-pages", fax_document_transferred_pages);</span>
<span style="color: #00A000">+                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-document-total-pages", fax_document_total_pages);</span>
<span style="color: #00A000">+                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-image-resolution", fax_image_resolution);</span>
<span style="color: #00A000">+                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-image-size", fax_image_size);</span>
<span style="color: #00A000">+                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-bad-rows", fax_bad_rows);</span>
<span style="color: #00A000">+                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-transfer-rate", fax_transfer_rate);</span>
<span style="color: #00A000">+                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-result-code", fax_result_code);</span>
<span style="color: #00A000">+                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-result-text", t30_completion_code_to_str(result));</span>
<span style="color: #00A000">+                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-ecm-used", (t.error_correcting_mode) ? "on" : "off");</span>
<span style="color: #00A000">+                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-local-station-id", local_ident);</span>
<span style="color: #00A000">+                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-remote-station-id", far_ident);</span>
<span style="color: #00A000">+                switch_core_session_queue_private_event(session, &event, SWITCH_FALSE);</span>
<span style="color: #00A000">+        }</span>
}
static int t38_tx_packet_handler(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count)
<span style="color: #800080; font-weight: bold">@@ -1026,7 +1042,6 @@ void mod_spandsp_fax_process_fax(switch_core_session_t *session, const char *dat</span>
                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Fax TX filename not set.\n");
                        goto done;
                } else if (pvt->app_mode == FUNCTION_RX) {
<span style="color: #A00000">-                        char *fname;</span>
                        const char *prefix;
                        switch_time_t time;
<span style="color: #800080; font-weight: bold">@@ -1036,11 +1051,7 @@ void mod_spandsp_fax_process_fax(switch_core_session_t *session, const char *dat</span>
                                prefix = globals.prepend_string;
                        }
<span style="color: #A00000">-                        fname = switch_mprintf("%s/%s-%ld-%ld.tif", globals.spool, prefix, globals.total_sessions, time);</span>
<span style="color: #A00000">-                        if (fname) {</span>
<span style="color: #A00000">-                                pvt->filename = switch_core_session_strdup(session, fname);</span>
<span style="color: #A00000">-                                switch_safe_free(fname);</span>
<span style="color: #A00000">-                        } else {</span>
<span style="color: #00A000">+                        if (!(pvt->filename = switch_core_session_sprintf(session, "%s/%s-%ld-%ld.tif", globals.spool, prefix, globals.total_sessions, time))) {</span>
                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cannot automatically set fax RX destination file\n");
                                goto done;
                        }
</pre></div>
<div class="highlight"><pre>committer: Raymond Chandler
comments:
test
<span style="color: #000080; font-weight: bold">diff --git a/build/modules.conf.in b/build/modules.conf.in</span>
<span style="color: #000080; font-weight: bold">index b46c2ff..84a9e9a 100644</span>
<span style="color: #A00000">--- a/build/modules.conf.in</span>
<span style="color: #00A000">+++ b/build/modules.conf.in</span>
<span style="color: #800080; font-weight: bold">@@ -112,4 +112,3 @@ say/mod_say_ru</span>
## Experimental Modules (don't cry if they're broken)
#../../contrib/mod/xml_int/mod_xml_odbc
<span style="color: #A00000">-</span>
</pre></div>
<div class="highlight"><pre>committer: Raymond Chandler
comments:
Merge branch 'master' of fs-git:freeswitch
</pre></div>
<div class="highlight"><pre>committer: Raymond Chandler
comments:
test
<span style="color: #000080; font-weight: bold">diff --git a/build/modules.conf.in b/build/modules.conf.in</span>
<span style="color: #000080; font-weight: bold">index 84a9e9a..b46c2ff 100644</span>
<span style="color: #A00000">--- a/build/modules.conf.in</span>
<span style="color: #00A000">+++ b/build/modules.conf.in</span>
<span style="color: #800080; font-weight: bold">@@ -112,3 +112,4 @@ say/mod_say_ru</span>
## Experimental Modules (don't cry if they're broken)
#../../contrib/mod/xml_int/mod_xml_odbc
<span style="color: #00A000">+</span>
</pre></div>
<div class="highlight"><pre>committer: Daniel Swarbrick
comments:
reduce agentx heartbeat to 2s, add management hook for mutex lock/unlock
<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 0310637..56c7be1 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">@@ -48,6 +48,20 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_snmp_runtime);</span>
SWITCH_MODULE_DEFINITION(mod_snmp, mod_snmp_load, mod_snmp_shutdown, mod_snmp_runtime);
<span style="color: #00A000">+static switch_status_t snmp_manage(char *relative_oid, switch_management_action_t action, char *data, switch_size_t datalen)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        if (action == SMA_GET) {</span>
<span style="color: #00A000">+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Mutex lock request from relative OID %s.\n", relative_oid);</span>
<span style="color: #00A000">+                switch_mutex_lock(globals.mutex);</span>
<span style="color: #00A000">+        } else if (action == SMA_SET) {</span>
<span style="color: #00A000">+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Mutex unlock request from relative OID %s.\n", relative_oid);</span>
<span style="color: #00A000">+                switch_mutex_unlock(globals.mutex);</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        return SWITCH_STATUS_SUCCESS;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
static int snmp_callback_log(int major, int minor, void *serverarg, void *clientarg)
{
        struct snmp_log_message *slm = (struct snmp_log_message *) serverarg;
<span style="color: #800080; font-weight: bold">@@ -71,10 +85,14 @@ static switch_status_t load_config(switch_memory_pool_t *pool)</span>
SWITCH_MODULE_LOAD_FUNCTION(mod_snmp_load)
{
        switch_status_t status = SWITCH_STATUS_SUCCESS;
<span style="color: #00A000">+        switch_management_interface_t *management_interface;</span>
        load_config(pool);
        *module_interface = switch_loadable_module_create_module_interface(pool, modname);
<span style="color: #00A000">+        management_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_MANAGEMENT_INTERFACE);</span>
<span style="color: #00A000">+        management_interface->relative_oid = "1000";</span>
<span style="color: #00A000">+        management_interface->management_function = snmp_manage;</span>
        /* Register callback function so we get Net-SNMP logging handled by FreeSWITCH */
        snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_LOGGING, snmp_callback_log, NULL);
<span style="color: #800080; font-weight: bold">@@ -86,10 +104,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_snmp_load)</span>
        init_agent("mod_snmp");
        /*
<span style="color: #A00000">-         * Override master/subagent ping interval to 5s, to ensure that</span>
<span style="color: #00A000">+         * Override master/subagent ping interval to 2s, to ensure that</span>
         * agent_check_and_process() never blocks for longer than that.
         */
<span style="color: #A00000">-        netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL, 5);</span>
<span style="color: #00A000">+        netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL, 2);</span>
        init_subagent();
        init_snmp("mod_snmp");
<span style="color: #800080; font-weight: bold">@@ -107,6 +125,8 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_snmp_runtime)</span>
                switch_mutex_unlock(globals.mutex);
        }
<span style="color: #00A000">+        switch_yield(5000);</span>
<span style="color: #00A000">+</span>
        return SWITCH_STATUS_SUCCESS;
}
</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) && !switch_channel_test_flag(channel, CF_EARLY_MEDIA &&</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) && </span>
<span style="color: #00A000">+                !switch_channel_test_flag(channel, CF_EARLY_MEDIA) && !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, "Ring-Ready %s!\n", channel->name);
                switch_channel_set_flag_value(channel, CF_RING_READY, rv);
                if (channel->caller_profile && channel->caller_profile->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(&dup, event) == SWITCH_STATUS_SUCCESS) {
<span style="color: #00A000">+                                                switch_channel_event_set_data(channel, dup);</span>
                                                switch_event_fire(&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->recv($newmsg, 1024)) {</span>
}
print "Sending option 66 as $opt_u\n";
<span style="color: #A00000">- $handle = IO::Socket::INET->new(Proto => 'udp',</span>
<span style="color: #A00000">-                                 PeerPort => '68',</span>
<span style="color: #A00000">-                                 LocalPort => '67',</span>
<span style="color: #A00000">-                                 ReuseAddr => 1,</span>
<span style="color: #A00000">-                                 PeerAddr => $dhcpreq->ciaddr(),</span>
<span style="color: #A00000">-                                 ) or die "socket: $@";</span>
<span style="color: #A00000">- $handle->send($dhcpresp->serialize())</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ $sock->send($dhcpresp->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) && (!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 >= sess_max || !sofia_test_pflag(profile, PFLAG_RUNNING) || !switch_core_ready()) {</span>
<span style="color: #00A000">+                        nua_respond(nh, 503, "Maximum Calls In Progress", SIPTAG_RETRY_AFTER_STR("300"), TAG_END());</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "No more sessions allowed at this time.\n");</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) && tech_pvt && tech_pvt->key && 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("test_reactive",4,4)</span>
<span style="color: #00A000">+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("test_reactive",1,"LUA::Dbh *");</span>
<span style="color: #00A000">+ if(!lua_isstring(L,2)) SWIG_fail_arg("test_reactive",2,"char *");</span>
<span style="color: #00A000">+ if(!lua_isstring(L,3)) SWIG_fail_arg("test_reactive",3,"char *");</span>
<span style="color: #00A000">+ if(!lua_isstring(L,4)) SWIG_fail_arg("test_reactive",4,"char *");</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){</span>
<span style="color: #00A000">+ SWIG_fail_ptr("Dbh_test_reactive",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)->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("test_reactive",3,3)</span>
<span style="color: #00A000">+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("test_reactive",1,"LUA::Dbh *");</span>
<span style="color: #00A000">+ if(!lua_isstring(L,2)) SWIG_fail_arg("test_reactive",2,"char *");</span>
<span style="color: #00A000">+ if(!lua_isstring(L,3)) SWIG_fail_arg("test_reactive",3,"char *");</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){</span>
<span style="color: #00A000">+ SWIG_fail_ptr("Dbh_test_reactive",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)->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("test_reactive",2,2)</span>
<span style="color: #00A000">+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("test_reactive",1,"LUA::Dbh *");</span>
<span style="color: #00A000">+ if(!lua_isstring(L,2)) SWIG_fail_arg("test_reactive",2,"char *");</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){</span>
<span style="color: #00A000">+ SWIG_fail_ptr("Dbh_test_reactive",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)->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 **) &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 **) &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 **) &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,"No matching function for overloaded 'Dbh_test_reactive'");</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[] = {
{"release", _wrap_Dbh_release},
{"connected", _wrap_Dbh_connected},
<span style="color: #00A000">+ {"test_reactive", _wrap_Dbh_test_reactive}, </span>
{"query", _wrap_Dbh_query},
{"affected_rows", _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 = "core:";</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(&dbh, SCDB_TYPE_ODBC, &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 = &dsn[strlen(prefix)];</span>
<span style="color: #00A000">+ if (switch_cache_db_get_db_handle(&dbh, SCDB_TYPE_CORE_DB, &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(&dbh, SCDB_TYPE_ODBC, &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->tranMode.pres = PRSNT_NODEF;
        bearCap->tranMode.val = IN_TM_CIRCUIT;
<span style="color: #A00000">-        if (!FTDM_SPAN_IS_BRI(ftdmchan->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->usrInfoLyr1Prot.pres = PRSNT_NODEF;</span>
<span style="color: #00A000">+        bearCap->usrInfoLyr1Prot.val = sngisdn_get_usrInfoLyr1Prot_from_user(ftdmchan->caller_data.bearer_layer1);</span>
<span style="color: #A00000">-                /* PRI only params */</span>
<span style="color: #A00000">-                bearCap->usrInfoLyr1Prot.pres = PRSNT_NODEF;</span>
<span style="color: #A00000">-                bearCap->usrInfoLyr1Prot.val = sngisdn_get_usrInfoLyr1Prot_from_user(ftdmchan->caller_data.bearer_layer1);</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                switch (signal_data->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->usrInfoLyr1Prot.val == IN_UIL1_G711ALAW) {</span>
<span style="color: #A00000">-                                        ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Overriding bearer cap to u-law\n");</span>
<span style="color: #A00000">-                                        bearCap->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->usrInfoLyr1Prot.val == IN_UIL1_G711ULAW) {</span>
<span style="color: #A00000">-                                        ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Overriding bearer cap to a-law\n");</span>
<span style="color: #A00000">-                                        bearCap->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->lyr1Ident.pres = PRSNT_NODEF;</span>
<span style="color: #A00000">-                bearCap->lyr1Ident.val = IN_L1_IDENT;</span>
<span style="color: #00A000">+        switch (signal_data->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->usrInfoLyr1Prot.val == IN_UIL1_G711ALAW) {</span>
<span style="color: #00A000">+                                ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Overriding bearer cap to u-law\n");</span>
<span style="color: #00A000">+                                bearCap->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->usrInfoLyr1Prot.val == IN_UIL1_G711ULAW) {</span>
<span style="color: #00A000">+                                ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Overriding bearer cap to a-law\n");</span>
<span style="color: #00A000">+                                bearCap->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->lyr1Ident.pres = PRSNT_NODEF;</span>
<span style="color: #00A000">+        bearCap->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 << 6),
        CFLAG_WAIT_MOD = (1 << 7),
        CFLAG_VID_FLOOR = (1 << 8),
<span style="color: #A00000">-        CFLAG_WASTE_BANDWIDTH = (1 << 9)</span>
<span style="color: #00A000">+        CFLAG_WASTE_BANDWIDTH = (1 << 9),</span>
<span style="color: #00A000">+        CFLAG_OUTCALL = (1 << 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->cancel_cause = SWITCH_CAUSE_ORIGINATOR_CANCEL;</span>
<span style="color: #00A000">+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Ending pending outcall channels for Conference: '%s'\n", conference->name);</span>
<span style="color: #00A000">+                while(conference->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(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", CONF_CHAT_PROTO);
                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", conference->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, "_conference_autocall_list_", NULL);
<span style="color: #00A000">+                        switch_set_flag(member->conference, CFLAG_OUTCALL);</span>
<span style="color: #00A000">+</span>
                        if (toval) {
                                to = atoi(toval);
                                if (to < 10 || to > 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 < argc; x++) {
                                        char *dial_str = switch_mprintf("%s%s", switch_str_nil(prefix), argv[x]);
                                        switch_assert(dial_str);
<span style="color: #A00000">-                                        conference_outcall_bg(member->conference, NULL, NULL, dial_str, to, switch_str_nil(flags), cid_name, cid_num, NULL);</span>
<span style="color: #00A000">+                                        conference_outcall_bg(member->conference, NULL, NULL, dial_str, to, switch_str_nil(flags), cid_name, cid_num, NULL, </span>
<span style="color: #00A000">+                                                                                 &member->conference->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], &cause);</span>
<span style="color: #00A000">+                conference_outcall(conference, NULL, NULL, argv[2], 60, NULL, argv[4], argv[3], &cause, NULL);</span>
        } else {
<span style="color: #A00000">-                conference_outcall(NULL, argv[0], NULL, argv[2], 60, NULL, argv[4], argv[3], &cause);</span>
<span style="color: #00A000">+                conference_outcall(NULL, argv[0], NULL, argv[2], 60, NULL, argv[4], argv[3], &cause, NULL);</span>
        }
        stream->write_function(stream, "Call Requested: result: [%s]\n", 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, &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->write_function(stream, "OK Job-UUID: %s\n", 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, &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->mutex);</span>
<span style="color: #00A000">+        conference->originating++;</span>
<span style="color: #00A000">+        switch_mutex_unlock(conference->mutex);</span>
<span style="color: #00A000">+        status = switch_ivr_originate(session, &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->mutex);</span>
<span style="color: #00A000">+        conference->originating--;</span>
<span style="color: #00A000">+        switch_mutex_unlock(conference->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, "Cannot create outgoing channel, cause: %s\n",
                                                 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->conference, call->conference_name,
<span style="color: #A00000">-                                                 call->session, call->bridgeto, call->timeout, call->flags, call->cid_name, call->cid_num, &cause);</span>
<span style="color: #00A000">+                                                 call->session, call->bridgeto, call->timeout, call->flags, call->cid_name, call->cid_num, &cause, call->cancel_cause);</span>
                if (call->conference && test_eflag(call->conference, EFLAG_BGDIAL_RESULT) &&
                        switch_event_create_subclass(&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->conference = conference;
        call->session = session;
        call->timeout = timeout;
<span style="color: #00A000">+        call->cancel_cause = cancel_cause;</span>
        if (conference) {
                pool = conference->pool;
<span style="color: #800080; font-weight: bold">@@ -5717,7 +5749,7 @@ SWITCH_STANDARD_APP(conference_function)</span>
        /* if we're using "bridge:" make an outbound call and bridge it in */
        if (!zstr(bridgeto) && strcasecmp(bridgeto, "none")) {
                switch_call_cause_t cause;
<span style="color: #A00000">-                if (conference_outcall(conference, NULL, session, bridgeto, 60, NULL, NULL, NULL, &cause) != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                if (conference_outcall(conference, NULL, session, bridgeto, 60, NULL, NULL, NULL, &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->state_handler = &sofia_event_handlers;
        management_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_MANAGEMENT_INTERFACE);
<span style="color: #A00000">-        management_interface->relative_oid = "1";</span>
<span style="color: #00A000">+        management_interface->relative_oid = "1001";</span>
        management_interface->management_function = sofia_manage;
        SWITCH_ADD_API(api_interface, "sofia", "Sofia Controls", sofia_function, "<cmd> <args>");
</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 <switch.h>
#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) && l->level >= node->level) {
                        switch_log_node_t *dnode = switch_log_node_dup(node);
<span style="color: #A00000">-                        if (switch_queue_push(l->log_queue, dnode) == SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                        if (switch_queue_trypush(l->log_queue, dnode) == SWITCH_STATUS_SUCCESS) {</span>
                                if (l->lost_logs) {
                                        int ll = l->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(&dnode);
                                if (++l->lost_logs > MAX_MISSED) {
<span style="color: #A00000">-                                        kill_listener(l);</span>
<span style="color: #00A000">+                                        kill_listener(l, "Disconnected due to log queue failure.\n");</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(&clone, event) == SWITCH_STATUS_SUCCESS) {
<span style="color: #A00000">-                                if (switch_queue_push(l->event_queue, clone) == SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                                if (switch_queue_trypush(l->event_queue, clone) == SWITCH_STATUS_SUCCESS) {</span>
                                        if (l->lost_events) {
                                                int le = l->lost_events;
                                                l->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->lost_events > MAX_MISSED) {
<span style="color: #A00000">-                                                kill_listener(l);</span>
<span style="color: #00A000">+                                                kill_listener(l, "Disconnected due to event queue failure.\n");</span>
                                        }
                                        switch_event_destroy(&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] = "";</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 = "Disconnected.\n";</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->session) {</span>
<span style="color: #00A000">+                switch_snprintf(disco_buf, sizeof(disco_buf), "Content-Type: text/disconnect-notice\n"</span>
<span style="color: #00A000">+                                                "Controlled-Session-UUID: %s\n"</span>
<span style="color: #00A000">+                                                "Content-Disposition: disconnect\n" "Content-Length: %d\n\n", switch_core_session_get_uuid(listener->session), mlen);</span>
<span style="color: #00A000">+        } else {</span>
<span style="color: #00A000">+                switch_snprintf(disco_buf, sizeof(disco_buf), "Content-Type: text/disconnect-notice\nContent-Length: %d\n\n", 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->sock, disco_buf, &len);</span>
<span style="color: #00A000">+        if (len > 0) {</span>
<span style="color: #00A000">+                len = mlen;</span>
<span style="color: #00A000">+                switch_socket_send(listener->sock, message, &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->sock) {
                switch_socket_shutdown(l->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->next) {
<span style="color: #A00000">-                kill_listener(l);</span>
<span style="color: #00A000">+                kill_listener(l, "The system is being shut down.\n");</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) < CS_HANGUP && switch_channel_test_flag(chan, CF_DIVERT_EVENTS)) {
                                        switch_event_t *e = NULL;
                                        while (switch_core_session_dequeue_event(listener->session, &e, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS) {
<span style="color: #A00000">-                                                if (switch_queue_push(listener->event_queue, e) != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                                                if (switch_queue_trypush(listener->event_queue, e) != SWITCH_STATUS_SUCCESS) {</span>
                                                        switch_core_session_queue_event(listener->session, &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->sock) {
<span style="color: #A00000">-                char disco_buf[512] = "";</span>
<span style="color: #A00000">-                const char message[] = "Disconnected, goodbye.\nSee you at ClueCon! http://www.cluecon.com/\n";</span>
<span style="color: #A00000">-                int mlen = strlen(message);</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                if (listener->session) {</span>
<span style="color: #A00000">-                        switch_snprintf(disco_buf, sizeof(disco_buf), "Content-Type: text/disconnect-notice\n"</span>
<span style="color: #A00000">-                                                        "Controlled-Session-UUID: %s\n"</span>
<span style="color: #A00000">-                                                        "Content-Disposition: disconnect\n" "Content-Length: %d\n\n", switch_core_session_get_uuid(listener->session), mlen);</span>
<span style="color: #A00000">-                } else {</span>
<span style="color: #A00000">-                        switch_snprintf(disco_buf, sizeof(disco_buf), "Content-Type: text/disconnect-notice\nContent-Length: %d\n\n", 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->sock, disco_buf, &len);</span>
<span style="color: #A00000">-                len = mlen;</span>
<span style="color: #A00000">-                switch_socket_send(listener->sock, message, &len);</span>
<span style="color: #00A000">+                send_disconnect(listener, "Disconnected, goodbye.\nSee you at ClueCon! http://www.cluecon.com/\n");</span>
                close_socket(&listener->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 "subagent.h"
<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(("init_nstAgentSubagentObject", "Initializing\n"));</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(("init_subagent", "Initializing\n"));</span>
        netsnmp_register_scalar_group(netsnmp_create_handler_registration("identity", handle_identity, identity_oid, OID_LENGTH(identity_oid), HANDLER_CAN_RONLY), 1, 2);
        netsnmp_register_scalar_group(netsnmp_create_handler_registration("systemStats", 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] = "";</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] = "";</span>
        switch(reqinfo->mode) {
        case MODE_GET:
<span style="color: #A00000">-                for (request = requests; request; request = request->next) {</span>
<span style="color: #A00000">-                        subid = request->requestvb->name[reginfo->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->requestvb, ASN_OCTET_STR, (u_char *) &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->requestvb, ASN_OCTET_STR, (u_char *) &uuid, strlen(uuid));</span>
<span style="color: #A00000">-                                        break;</span>
<span style="color: #A00000">-                                default:</span>
<span style="color: #A00000">-                                        snmp_log(LOG_WARNING, "Unregistered OID-suffix requested (%d)\n", (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->requestvb->name[reginfo->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->requestvb, ASN_OCTET_STR, (u_char *) &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->requestvb, ASN_OCTET_STR, (u_char *) &uuid, strlen(uuid));</span>
<span style="color: #00A000">+                        break;</span>
<span style="color: #00A000">+                default:</span>
<span style="color: #00A000">+                        snmp_log(LOG_WARNING, "Unregistered OID-suffix requested (%d)\n", (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->mode) {
        case MODE_GET:
<span style="color: #A00000">-                for (request = requests; request; request = request->next) {</span>
<span style="color: #A00000">-                        subid = request->requestvb->name[reginfo->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->requestvb, ASN_TIMETICKS, (u_char *) &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->requestvb, ASN_COUNTER, (u_char *) &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->requestvb, ASN_GAUGE, (u_char *) &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, &int_val);;</span>
<span style="color: #A00000">-                                        snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &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->requestvb, ASN_GAUGE, (u_char *) &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, &int_val);</span>
<span style="color: #A00000">-                                        snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &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, &int_val);</span>
<span style="color: #A00000">-                                        snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &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, "Unregistered OID-suffix requested (%d)\n", (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->requestvb->name[reginfo->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->requestvb, ASN_TIMETICKS, (u_char *) &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->requestvb, ASN_COUNTER, (u_char *) &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->requestvb, ASN_GAUGE, (u_char *) &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, &int_val);;</span>
<span style="color: #00A000">+                        snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &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->requestvb, ASN_GAUGE, (u_char *) &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, &int_val);</span>
<span style="color: #00A000">+                        snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &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, &int_val);</span>
<span style="color: #00A000">+                        snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &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, "Unregistered OID-suffix requested (%d)\n", (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(&globals, 0, sizeof(globals));
        globals.pool = pool;
<span style="color: #00A000">+        switch_mutex_init(&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(&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(&state_handlers);</span>
<span style="color: #00A000">+        switch_mutex_lock(globals.mutex);</span>
        snmp_shutdown("mod_snmp");
<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(("init_nstAgentSubagentObject", "Initializing\n"));
<span style="color: #A00000">-        netsnmp_register_handler(netsnmp_create_handler_registration("identity", handle_identity, identity_oid, OID_LENGTH(identity_oid), HANDLER_CAN_RONLY));</span>
<span style="color: #A00000">-        netsnmp_register_handler(netsnmp_create_handler_registration("systemStats", handle_systemStats, systemStats_oid, OID_LENGTH(systemStats_oid), HANDLER_CAN_RONLY));</span>
<span style="color: #00A000">+        netsnmp_register_scalar_group(netsnmp_create_handler_registration("identity", 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("systemStats", 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->mode) {
<span style="color: #A00000">-                case MODE_GET:</span>
<span style="color: #A00000">-                        for (request = requests; request; request = request->next) {</span>
<span style="color: #A00000">-                                subid = request->requestvb->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->requestvb, ASN_OCTET_STR, (u_char *) &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->requestvb, ASN_OCTET_STR, (u_char *) &uuid, strlen(uuid));</span>
<span style="color: #A00000">-                                                break;</span>
<span style="color: #A00000">-                                        default:</span>
<span style="color: #A00000">-                                                snmp_log(LOG_WARNING, "Unregistered OID-suffix requested (%d)\n", (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->next) {</span>
<span style="color: #00A000">+                        subid = request->requestvb->name[reginfo->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->requestvb, ASN_OCTET_STR, (u_char *) &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->requestvb, ASN_OCTET_STR, (u_char *) &uuid, strlen(uuid));</span>
<span style="color: #00A000">+                                        break;</span>
<span style="color: #00A000">+                                default:</span>
<span style="color: #00A000">+                                        snmp_log(LOG_WARNING, "Unregistered OID-suffix requested (%d)\n", (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, "MODE_GETNEXT not supported (yet)\n");</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, "Unknown mode (%d) in handle_versionString\n", reqinfo->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, "Unknown mode (%d) in handle_identity\n", reqinfo->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->mode) {
<span style="color: #A00000">-                case MODE_GET:</span>
<span style="color: #A00000">-                        for (request = requests; request; request = request->next) {</span>
<span style="color: #A00000">-                                subid = request->requestvb->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->requestvb, ASN_TIMETICKS, (u_char *) &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->requestvb, ASN_COUNTER, (u_char *) &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->requestvb, ASN_GAUGE, (u_char *) &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, &int_val);;</span>
<span style="color: #A00000">-                                                snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &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->requestvb, ASN_GAUGE, (u_char *) &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, &int_val);</span>
<span style="color: #A00000">-                                                snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &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, &int_val);</span>
<span style="color: #A00000">-                                                snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &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, "Unregistered OID-suffix requested (%d)\n", (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->next) {</span>
<span style="color: #00A000">+                        subid = request->requestvb->name[reginfo->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->requestvb, ASN_TIMETICKS, (u_char *) &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->requestvb, ASN_COUNTER, (u_char *) &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->requestvb, ASN_GAUGE, (u_char *) &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, &int_val);;</span>
<span style="color: #00A000">+                                        snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &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->requestvb, ASN_GAUGE, (u_char *) &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, &int_val);</span>
<span style="color: #00A000">+                                        snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &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, &int_val);</span>
<span style="color: #00A000">+                                        snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &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, "Unregistered OID-suffix requested (%d)\n", (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, "MODE_GETNEXT not supported (yet)\n");</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, "Unknown mode (%d) in handle_systemStats\n", reqinfo->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, "Unknown mode (%d) in handle_systemStats\n", reqinfo->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->implementation->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, &tech_pvt->read_codec);
        switch_core_session_set_write_codec(session, &tech_pvt->write_codec);
<span style="color: #A00000">-        if (tech_pvt->flag_mutex) {</span>
<span style="color: #A00000">-                switch_core_timer_destroy(&tech_pvt->timer);</span>
<span style="color: #A00000">-        }</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-        read_impl = tech_pvt->read_codec.implementation;</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-        switch_core_timer_init(&tech_pvt->timer, "soft",</span>
<span style="color: #A00000">-                                                 read_impl->microseconds_per_packet / 1000, read_impl->samples_per_packet * 4, switch_core_session_get_pool(session));</span>
<span style="color: #A00000">-</span>
<span style="color: #00A000">+        tech_pvt->read_impl = *tech_pvt->read_codec.implementation;</span>
        if (!tech_pvt->flag_mutex) {
                switch_mutex_init(&tech_pvt->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(&tech_pvt->timer);</span>
                if (switch_core_codec_ready(&tech_pvt->read_codec)) {
                        switch_core_codec_destroy(&tech_pvt->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(&tech_pvt->timer);</span>
<span style="color: #A00000">-</span>
        mutex = tech_pvt->mutex;
<span style="color: #A00000">-        switch_mutex_lock(mutex);</span>
<span style="color: #A00000">-        if (switch_queue_trypop(tech_pvt->frame_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) {</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (switch_queue_pop_timeout(tech_pvt->frame_queue, &pop, tech_pvt->read_impl.microseconds_per_packet) == SWITCH_STATUS_SUCCESS && pop) {</span>
                if (tech_pvt->write_frame) {
                        switch_frame_free(&tech_pvt->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(&frame);
                        }
<span style="color: #A00000">-                        switch_core_timer_sync(&tech_pvt->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 "<uuid> <path> [aleg|bleg|both]"</span>
<span style="color: #00A000">+#define BROADCAST_SYNTAX "<uuid> <path> [aleg|bleg|holdb|both]"</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], "both")) {</span>
<span style="color: #00A000">+                        if (switch_stristr("both", (argv[2]))) {</span>
                                flags |= (SMF_ECHO_ALEG | SMF_ECHO_BLEG);
<span style="color: #A00000">-                        } else if (!strcasecmp(argv[2], "aleg")) {</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        if (switch_stristr("aleg", argv[2])) {</span>
                                flags |= SMF_ECHO_ALEG;
<span style="color: #A00000">-                        } else if (!strcasecmp(argv[2], "bleg")) {</span>
<span style="color: #00A000">+                        } </span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        if (switch_stristr("bleg", argv[2])) {</span>
<span style="color: #00A000">+                                flags &= ~SMF_HOLD_BLEG;</span>
                                flags |= SMF_ECHO_BLEG;
                        }
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        if (switch_stristr("holdb", argv[2])) {</span>
<span style="color: #00A000">+                                flags &= ~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 "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
if test "${enable_64}" = "yes"; then
<span style="color: #A00000">- CFLAGS="$CFLAGS -m64 -lgpg-error"</span>
<span style="color: #A00000">- CXXFLAGS="$CXXFLAGS -m64 -lgpg-error"</span>
<span style="color: #A00000">-        SUNFLAGS="-lgpg.error"</span>
<span style="color: #00A000">+ CFLAGS="$CFLAGS -xc99=all -mt -m64 -lgpg-error"</span>
<span style="color: #00A000">+ CXXFLAGS="$CXXFLAGS -xc99=all -mt -m64 -lgpg-error"</span>
<span style="color: #00A000">+        SUNFLAGS="-xc99=all -mt -m64 -lgpg-error"</span>
<span style="color: #00A000">+ else </span>
<span style="color: #00A000">+        CFLAGS="$CFLAGS -xc99=all -mt -lgpg-error"</span>
<span style="color: #00A000">+        CXXFLAGS="$CXXFLAGS -xc99=all -mt -lgpg-error"</span>
<span style="color: #00A000">+        SUNFLAGS="-xc99=all -mt -lgpg-error"</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="INSTALLLOCATION"/>
                                <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
                                <RegistryValue Root="HKCU" Key="Software\FreeSWITCH\FreeSWITCH" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
<span style="color: #A00000">- <CreateFolder Directory="INSTALLLOCATION"></span>
<span style="color: #A00000">- <Permission User="Authenticated Users" GenericAll="yes" /></span>
<span style="color: #A00000">- </CreateFolder></span>
                        </Component>
                        <Component Id="FSCliShortcut" Guid="D209546C-C728-4d8f-BDB2-29AED8824282">
                                <Shortcut Id="FSCliStartMenuShortcut"
<span style="color: #800080; font-weight: bold">@@ -68,9 +65,6 @@</span>
                                                         Target="[INSTALLLOCATION]fs_cli.exe"
                                                         WorkingDirectory="INSTALLLOCATION"/>
                                <RegistryValue Root="HKCU" Key="Software\FreeSWITCH\FS_CLI" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
<span style="color: #A00000">- <CreateFolder Directory="INSTALLLOCATION"></span>
<span style="color: #A00000">- <Permission User="Authenticated Users" GenericAll="yes" /></span>
<span style="color: #A00000">- </CreateFolder></span>
                        </Component>
                </DirectoryRef>
</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 "x${ax_cv_c_compiler_vendor}" = "xsun" ; then</span>
if test "${enable_64}" = "yes"; then
CFLAGS="$CFLAGS -m64 -lgpg-error"
CXXFLAGS="$CXXFLAGS -m64 -lgpg-error"
<span style="color: #00A000">+        SUNFLAGS="-lgpg.error"</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 "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
if test "${enable_64}" = "yes"; then
<span style="color: #A00000">- CFLAGS="$CFLAGS -m64"</span>
<span style="color: #00A000">+ CFLAGS="$CFLAGS -m64 -lgpg-error"</span>
CXXFLAGS="$CXXFLAGS -m64 -lgpg-error"
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("mod_snmp");
<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("mod_snmp");
<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'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, "Module is not unloadable.\n");
                        *err = "Module is not unloadable";
                        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'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'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 = "No such module!";
                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, "PHEW!\n");
</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] = "";
                        int pin_retries = 3;        /* XXX - this should be configurable - i'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->pin_sound) {</span>
<span style="color: #A00000">-                                                pstatus = conference_local_play_file(conference, session, conference->pin_sound, 20, pin_buf, sizeof(pin_buf));</span>
<span style="color: #A00000">-                                        } else if (conference->tts_engine && conference->tts_voice) {</span>
<span style="color: #A00000">-                                                pstatus =</span>
<span style="color: #A00000">-                                                        switch_ivr_speak_text(session, conference->tts_engine, conference->tts_voice, "please enter the conference pin number", NULL);</span>
<span style="color: #A00000">-                                        } else {</span>
<span style="color: #A00000">-                                                pstatus = switch_ivr_speak_text(session, "flite", "slt", "please enter the conference pin number", NULL);</span>
<span style="color: #A00000">-                                        }</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                                        if (pstatus != SWITCH_STATUS_SUCCESS && pstatus != SWITCH_STATUS_BREAK) {</span>
<span style="color: #A00000">-                                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Cannot ask the user for a pin, ending call");</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->pin_sound) {</span>
<span style="color: #00A000">+                                        pstatus = conference_local_play_file(conference, session, conference->pin_sound, 20, pin_buf, sizeof(pin_buf));</span>
<span style="color: #00A000">+                                } else if (conference->tts_engine && conference->tts_voice) {</span>
<span style="color: #00A000">+                                        pstatus =</span>
<span style="color: #00A000">+                                                switch_ivr_speak_text(session, conference->tts_engine, conference->tts_voice, "please enter the conference pin number", NULL);</span>
<span style="color: #00A000">+                                } else {</span>
<span style="color: #00A000">+                                        pstatus = switch_ivr_speak_text(session, "flite", "slt", "please enter the conference pin number", NULL);</span>
                                }
<span style="color: #A00000">-                                be_friendly = 1;</span>
<span style="color: #00A000">+                                if (pstatus != SWITCH_STATUS_SUCCESS && pstatus != SWITCH_STATUS_BREAK) {</span>
<span style="color: #00A000">+                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Cannot ask the user for a pin, ending call");</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) < 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 && 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->bad_pin_sound) {
<span style="color: #A00000">-                                                conference_local_play_file(conference, session, conference->bad_pin_sound, 20, pin_buf, sizeof(pin_buf));</span>
<span style="color: #00A000">+                                                conference_local_play_file(conference, session, conference->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 && (args->input_callback || args->buf || args->buflen || args->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 && (args->input_callback || args->buf || args->buflen || args->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 && (args->input_callback || args->buf || args->buflen || args->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 && (args->input_callback || args->buf || args->buflen || args->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 && strlen(digit_buffer) >= 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(&event);
                }
<span style="color: #A00000">-                if (args && (args->input_callback || args->buf || args->buflen || args->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>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
fix proper display of meta digit in log lines
<span style="color: #000080; font-weight: bold">diff --git a/src/include/switch_utils.h b/src/include/switch_utils.h</span>
<span style="color: #000080; font-weight: bold">index 2c4de14..a1a93c6 100644</span>
<span style="color: #A00000">--- a/src/include/switch_utils.h</span>
<span style="color: #00A000">+++ b/src/include/switch_utils.h</span>
<span style="color: #800080; font-weight: bold">@@ -192,7 +192,7 @@ static inline char switch_itodtmf(char i)</span>
                r = i + 55;
        }
<span style="color: #A00000">-        return r;</span>
<span style="color: #00A000">+        return r + 48;</span>
}
static inline int switch_dtmftoi(char *s)
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
update code in mod_celt to match API of 0.10.0
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/codecs/mod_celt/mod_celt.c b/src/mod/codecs/mod_celt/mod_celt.c</span>
<span style="color: #000080; font-weight: bold">index 37983f3..8d36b6a 100644</span>
<span style="color: #A00000">--- a/src/mod/codecs/mod_celt/mod_celt.c</span>
<span style="color: #00A000">+++ b/src/mod/codecs/mod_celt/mod_celt.c</span>
<span style="color: #800080; font-weight: bold">@@ -53,8 +53,8 @@ static switch_status_t switch_celt_init(switch_codec_t *codec, switch_codec_flag</span>
                return SWITCH_STATUS_FALSE;
        }
<span style="color: #A00000">-        context->mode_object = celt_mode_create(codec->implementation->actual_samples_per_second, codec->implementation->samples_per_packet, NULL);</span>
<span style="color: #A00000">-</span>
<span style="color: #00A000">+        context->frame_size = codec->implementation->samples_per_packet;</span>
<span style="color: #00A000">+        context->mode_object = celt_mode_create(codec->implementation->actual_samples_per_second, context->frame_size, NULL);</span>
        context->bytes_per_packet = (codec->implementation->bits_per_second * context->frame_size / codec->implementation->actual_samples_per_second + 4) / 8;
        /*
<span style="color: #800080; font-weight: bold">@@ -106,15 +106,22 @@ static switch_status_t switch_celt_encode(switch_codec_t *codec,</span>
                                                                                 unsigned int *flag)
{
        struct celt_context *context = codec->private_info;
<span style="color: #00A000">+        int bytes = 0;</span>
        if (!context) {
                return SWITCH_STATUS_FALSE;
        }
<span style="color: #A00000">-        *encoded_data_len = (uint32_t) celt_encode(context->encoder_object, (void *) decoded_data, codec->implementation->samples_per_packet,</span>
<span style="color: #A00000">-                                                                                         (unsigned char *) encoded_data, context->bytes_per_packet);</span>
<span style="color: #00A000">+        bytes = (uint32_t) celt_encode(context->encoder_object, (void *) decoded_data, codec->implementation->samples_per_packet,</span>
<span style="color: #00A000">+                                                                 (unsigned char *) encoded_data, context->bytes_per_packet);</span>
<span style="color: #A00000">-        return SWITCH_STATUS_SUCCESS;</span>
<span style="color: #00A000">+        if (bytes > 0) {</span>
<span style="color: #00A000">+                *encoded_data_len = (uint32_t) bytes;</span>
<span style="color: #00A000">+                return SWITCH_STATUS_SUCCESS;</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Encoder Error!\n");</span>
<span style="color: #00A000">+        return SWITCH_STATUS_GENERR;</span>
}
static switch_status_t switch_celt_decode(switch_codec_t *codec,
<span style="color: #800080; font-weight: bold">@@ -152,23 +159,6 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_celt_load)</span>
        SWITCH_ADD_CODEC(codec_interface, "CELT ultra-low delay");
<span style="color: #A00000">-        switch_core_codec_add_implementation(pool, codec_interface, SWITCH_CODEC_TYPE_AUDIO,        /* enumeration defining the type of the codec */</span>
<span style="color: #A00000">-                                                                                 114,        /* the IANA code number */</span>
<span style="color: #A00000">-                                                                                 "CELT",        /* the IANA code name */</span>
<span style="color: #A00000">-                                                                                 NULL,        /* default fmtp to send (can be overridden by the init function) */</span>
<span style="color: #A00000">-                                                                                 32000,        /* samples transferred per second */</span>
<span style="color: #A00000">-                                                                                 32000,        /* actual samples transferred per second */</span>
<span style="color: #A00000">-                                                                                 32000,        /* bits transferred per second */</span>
<span style="color: #A00000">-                                                                                 10000,        /* number of microseconds per frame */</span>
<span style="color: #A00000">-                                                                                 320,        /* number of samples per frame */</span>
<span style="color: #A00000">-                                                                                 640,        /* number of bytes per frame decompressed */</span>
<span style="color: #A00000">-                                                                                 0,        /* number of bytes per frame compressed */</span>
<span style="color: #A00000">-                                                                                 1,        /* number of channels represented */</span>
<span style="color: #A00000">-                                                                                 1,        /* number of frames per network packet */</span>
<span style="color: #A00000">-                                                                                 switch_celt_init,        /* function to initialize a codec handle using this implementation */</span>
<span style="color: #A00000">-                                                                                 switch_celt_encode,        /* function to encode raw data into encoded data */</span>
<span style="color: #A00000">-                                                                                 switch_celt_decode,        /* function to decode encoded data into raw data */</span>
<span style="color: #A00000">-                                                                                 switch_celt_destroy);        /* deinitalize a codec handle using this implementation */</span>
        ms_per_frame = 2000;
        samples_per_frame = 96;
        bytes_per_frame = 192;
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
add record_restart_time_limit_on_dtmf var
<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 523dfde..4e9e7b9 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">@@ -372,6 +372,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se</span>
        switch_event_t *event;
        int divisor = 0;
        int file_flags = SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT;
<span style="color: #00A000">+        int restart_limit_on_dtmf = 0;</span>
        const char *prefix;
        prefix = switch_channel_get_variable(channel, "sound_prefix");
<span style="color: #800080; font-weight: bold">@@ -528,6 +529,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se</span>
        if (switch_test_flag(fh, SWITCH_FILE_NATIVE)) {
                asis = 1;
        }
<span style="color: #00A000">+        </span>
<span style="color: #00A000">+        restart_limit_on_dtmf = switch_true(switch_channel_get_variable(channel, "record_restart_limit_on_dtmf"));</span>
        if ((p = switch_channel_get_variable(channel, "RECORD_TITLE"))) {
                vval = switch_core_session_strdup(session, p);
<span style="color: #800080; font-weight: bold">@@ -637,6 +640,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se</span>
                         if you return anything but SWITCH_STATUS_SUCCESS the playback will stop.
                         */
                        if (switch_channel_has_dtmf(channel)) {
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                                if (limit && restart_limit_on_dtmf) {</span>
<span style="color: #00A000">+                                        start = switch_epoch_time_now(NULL);</span>
<span style="color: #00A000">+                                }</span>
<span style="color: #00A000">+</span>
                                if (!args->input_callback && !args->buf && !args->dmachine) {
                                        status = SWITCH_STATUS_BREAK;
                                        break;
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
have samples_out reflect what was written to the FH not the file even with buffering
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_core_file.c b/src/switch_core_file.c</span>
<span style="color: #000080; font-weight: bold">index c00756f..19f2354 100644</span>
<span style="color: #A00000">--- a/src/switch_core_file.c</span>
<span style="color: #00A000">+++ b/src/switch_core_file.c</span>
<span style="color: #800080; font-weight: bold">@@ -391,10 +391,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_write(switch_file_handle_t *fh,</span>
                                if ((status = fh->file_interface->file_write(fh, fh->pre_buffer_data, &blen)) != SWITCH_STATUS_SUCCESS) {
                                        *len = 0;
                                }
<span style="color: #A00000">-                                fh->samples_out += blen;</span>
                        }
                }
<span style="color: #00A000">+                fh->samples_out += orig_len;</span>
                return status;
        } else {
                switch_status_t status;
</pre></div>
<div class="highlight"><pre>committer: Jeff Lenk
comments:
windows - tweak installer permissions
<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 2f072aa..1de2ec2 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,6 +57,9 @@</span>
                                                         WorkingDirectory="INSTALLLOCATION"/>
                                <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
                                <RegistryValue Root="HKCU" Key="Software\FreeSWITCH\FreeSWITCH" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
<span style="color: #00A000">+ <CreateFolder Directory="INSTALLLOCATION"></span>
<span style="color: #00A000">+ <Permission User="Authenticated Users" GenericAll="yes" /></span>
<span style="color: #00A000">+ </CreateFolder></span>
                        </Component>
                        <Component Id="FSCliShortcut" Guid="D209546C-C728-4d8f-BDB2-29AED8824282">
                                <Shortcut Id="FSCliStartMenuShortcut"
<span style="color: #800080; font-weight: bold">@@ -65,6 +68,9 @@</span>
                                                         Target="[INSTALLLOCATION]fs_cli.exe"
                                                         WorkingDirectory="INSTALLLOCATION"/>
                                <RegistryValue Root="HKCU" Key="Software\FreeSWITCH\FS_CLI" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
<span style="color: #00A000">+ <CreateFolder Directory="INSTALLLOCATION"></span>
<span style="color: #00A000">+ <Permission User="Authenticated Users" GenericAll="yes" /></span>
<span style="color: #00A000">+ </CreateFolder></span>
                        </Component>
                </DirectoryRef>
</pre></div>
<div class="highlight"><pre>committer: Jeff Lenk
comments:
FS-3000 mod_conference: if more digits than the length of the correct pin the remaining digits are accounted for next retry
<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 7f7ee83..e6a47bf 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,6 +5597,7 @@ SWITCH_STANDARD_APP(conference_function)</span>
                        char pin_buf[80] = "";
                        int pin_retries = 3;        /* XXX - this should be configurable - i'm too lazy to do it right now... */
                        int pin_valid = 0;
<span style="color: #00A000">+                        int be_friendly = 0;</span>
                        switch_status_t status = SWITCH_STATUS_SUCCESS;
                        char *supplied_pin_value;
<span style="color: #800080; font-weight: bold">@@ -5631,20 +5632,24 @@ SWITCH_STANDARD_APP(conference_function)</span>
                                switch_status_t pstatus = SWITCH_STATUS_FALSE;
                                /* be friendly */
<span style="color: #A00000">-                                if (conference->pin_sound) {</span>
<span style="color: #A00000">-                                        pstatus = conference_local_play_file(conference, session, conference->pin_sound, 20, pin_buf, sizeof(pin_buf));</span>
<span style="color: #A00000">-                                } else if (conference->tts_engine && conference->tts_voice) {</span>
<span style="color: #A00000">-                                        pstatus =</span>
<span style="color: #A00000">-                                                switch_ivr_speak_text(session, conference->tts_engine, conference->tts_voice, "please enter the conference pin number", NULL);</span>
<span style="color: #A00000">-                                } else {</span>
<span style="color: #A00000">-                                        pstatus = switch_ivr_speak_text(session, "flite", "slt", "please enter the conference pin number", NULL);</span>
<span style="color: #A00000">-                                }</span>
<span style="color: #00A000">+                                if (!be_friendly) {</span>
<span style="color: #00A000">+                                        if (conference->pin_sound) {</span>
<span style="color: #00A000">+                                                pstatus = conference_local_play_file(conference, session, conference->pin_sound, 20, pin_buf, sizeof(pin_buf));</span>
<span style="color: #00A000">+                                        } else if (conference->tts_engine && conference->tts_voice) {</span>
<span style="color: #00A000">+                                                pstatus =</span>
<span style="color: #00A000">+                                                        switch_ivr_speak_text(session, conference->tts_engine, conference->tts_voice, "please enter the conference pin number", NULL);</span>
<span style="color: #00A000">+                                        } else {</span>
<span style="color: #00A000">+                                                pstatus = switch_ivr_speak_text(session, "flite", "slt", "please enter the conference pin number", NULL);</span>
<span style="color: #00A000">+                                        }</span>
<span style="color: #A00000">-                                if (pstatus != SWITCH_STATUS_SUCCESS && pstatus != SWITCH_STATUS_BREAK) {</span>
<span style="color: #A00000">-                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Cannot ask the user for a pin, ending call");</span>
<span style="color: #A00000">-                                        switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);</span>
<span style="color: #00A000">+                                        if (pstatus != SWITCH_STATUS_SUCCESS && pstatus != SWITCH_STATUS_BREAK) {</span>
<span style="color: #00A000">+                                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Cannot ask the user for a pin, ending call");</span>
<span style="color: #00A000">+                                                switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);</span>
<span style="color: #00A000">+                                        }</span>
                                }
<span style="color: #00A000">+                                be_friendly = 1;</span>
<span style="color: #00A000">+</span>
                                /* wait for them if neccessary */
                                if (strlen(pin_buf) < strlen(dpin)) {
                                        char *buf = pin_buf + strlen(pin_buf);
<span style="color: #800080; font-weight: bold">@@ -5660,13 +5665,12 @@ SWITCH_STANDARD_APP(conference_function)</span>
                                pin_valid = (status == SWITCH_STATUS_SUCCESS && strcmp(pin_buf, dpin) == 0);
                                if (!pin_valid) {
<span style="color: #A00000">-                                        /* zero the collected pin */</span>
<span style="color: #A00000">-                                        memset(pin_buf, 0, sizeof(pin_buf));</span>
<span style="color: #A00000">-</span>
                                        /* more friendliness */
                                        if (conference->bad_pin_sound) {
                                                conference_local_play_file(conference, session, conference->bad_pin_sound, 20, pin_buf, sizeof(pin_buf));
                                        }
<span style="color: #00A000">+                                        /* zero the collected pin */</span>
<span style="color: #00A000">+                                        memset(pin_buf, 0, sizeof(pin_buf));</span>
                                }
                                pin_retries--;
                        }
</pre></div>
<div class="highlight"><pre>committer: Stefan Knoblich
comments:
[fsxs] Remove APR and APR-UTIL libraries from fsxs LIBS variable.
"LIBS" in the final fsxs script will be empty now.
We still link against libfreeswitch when building a module,
but we don't explicitly list (some of) its dependency libs anymore
(this list was not complete anyway).
This fixes a bogus /path_to_source/expat.la entry in LIBS that
came from "apu-config --libs".
Tested on Gentoo x86_64 (binutils 2.20.1) and Centos 5.5 (binutils 2.17.50).
Tested-by: Stefan Knoblich <s.knoblich@axsentis.de>
Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
<span style="color: #000080; font-weight: bold">diff --git a/Makefile.am b/Makefile.am</span>
<span style="color: #000080; font-weight: bold">index 8d35068..37a01d2 100644</span>
<span style="color: #A00000">--- a/Makefile.am</span>
<span style="color: #00A000">+++ b/Makefile.am</span>
<span style="color: #800080; font-weight: bold">@@ -349,7 +349,7 @@ scripts/fsxs: scripts/fsxs.in</span>
         -e "s|@INCLUDES\@|-I$(prefix)/include|" \
         -e "s|@SOLINK\@|$(SOLINK)|" \
         -e "s|@LDFLAGS\@|-L$(prefix)/lib|" \
<span style="color: #A00000">-         -e "s|@LIBS\@|`./libs/apr/apr-1-config --libs` `./libs/apr-util/apu-1-config --libs`|" \</span>
<span style="color: #00A000">+         -e "s|@LIBS\@||" \</span>
         $(top_srcdir)/scripts/fsxs.in > scripts/fsxs
##
</pre></div>
<div class="highlight"><pre>committer: Steve Underwood
comments:
Typo in the spandsp .pc.in file fixed
<span style="color: #000080; font-weight: bold">diff --git a/libs/spandsp/spandsp.pc.in b/libs/spandsp/spandsp.pc.in</span>
<span style="color: #000080; font-weight: bold">index 86a50ff..1a91ba0 100644</span>
<span style="color: #A00000">--- a/libs/spandsp/spandsp.pc.in</span>
<span style="color: #00A000">+++ b/libs/spandsp/spandsp.pc.in</span>
<span style="color: #800080; font-weight: bold">@@ -1,5 +1,5 @@</span>
prefix=@prefix@
<span style="color: #A00000">-exec_prefix=@exec_prefix@</span>
<span style="color: #00A000">+exec_prefix=@prefix@</span>
libdir=@libdir@
includedir=@includedir@
</pre></div>
<div class="highlight"><pre>committer: Andrew Thompson
comments:
mod_erlang_event Add proper locking for the list of XML bindings
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/event_handlers/mod_erlang_event/handle_msg.c b/src/mod/event_handlers/mod_erlang_event/handle_msg.c</span>
<span style="color: #000080; font-weight: bold">index 9ae1527..87f91fc 100644</span>
<span style="color: #A00000">--- a/src/mod/event_handlers/mod_erlang_event/handle_msg.c</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_erlang_event/handle_msg.c</span>
<span style="color: #800080; font-weight: bold">@@ -778,7 +778,7 @@ static switch_status_t handle_msg_bind(listener_t *listener, erlang_msg * msg, e</span>
                        binding->process.pid = msg->from;
                        binding->listener = listener;
<span style="color: #A00000">-                        switch_thread_rwlock_wrlock(globals.listener_rwlock);</span>
<span style="color: #00A000">+                        switch_thread_rwlock_wrlock(globals.bindings_rwlock);</span>
                        for (ptr = bindings.head; ptr && ptr->next; ptr = ptr->next);
<span style="color: #800080; font-weight: bold">@@ -789,7 +789,7 @@ static switch_status_t handle_msg_bind(listener_t *listener, erlang_msg * msg, e</span>
                        }
                        switch_xml_set_binding_sections(bindings.search_binding, switch_xml_get_binding_sections(bindings.search_binding) | section);
<span style="color: #A00000">-                        switch_thread_rwlock_unlock(globals.listener_rwlock);</span>
<span style="color: #00A000">+                        switch_thread_rwlock_unlock(globals.bindings_rwlock);</span>
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "sections %d\n", switch_xml_get_binding_sections(bindings.search_binding));
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c</span>
<span style="color: #000080; font-weight: bold">index 1a8bd00..900b965 100644</span>
<span style="color: #A00000">--- a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c</span>
<span style="color: #800080; font-weight: bold">@@ -90,7 +90,7 @@ static void remove_binding(listener_t *listener, erlang_pid * pid)</span>
{
        struct erlang_binding *ptr, *lst = NULL;
<span style="color: #A00000">-        switch_thread_rwlock_wrlock(globals.listener_rwlock);</span>
<span style="color: #00A000">+        switch_thread_rwlock_wrlock(globals.bindings_rwlock);</span>
        switch_xml_set_binding_sections(bindings.search_binding, SWITCH_XML_SECTION_MAX);
<span style="color: #800080; font-weight: bold">@@ -100,7 +100,7 @@ static void remove_binding(listener_t *listener, erlang_pid * pid)</span>
                                if (ptr->next) {
                                        bindings.head = ptr->next;
                                } else {
<span style="color: #A00000">-                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Removed all (only?) listeners\n");</span>
<span style="color: #00A000">+                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Removed all (only?) binding\n");</span>
                                        bindings.head = NULL;
                                        break;
                                }
<span style="color: #800080; font-weight: bold">@@ -111,13 +111,13 @@ static void remove_binding(listener_t *listener, erlang_pid * pid)</span>
                                        lst->next = NULL;
                                }
                        }
<span style="color: #A00000">-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Removed listener\n");</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Removed binding\n");</span>
                } else {
                        switch_xml_set_binding_sections(bindings.search_binding, switch_xml_get_binding_sections(bindings.search_binding) | ptr->section);
                }
        }
<span style="color: #A00000">-        switch_thread_rwlock_unlock(globals.listener_rwlock);</span>
<span style="color: #00A000">+        switch_thread_rwlock_unlock(globals.bindings_rwlock);</span>
}
<span style="color: #800080; font-weight: bold">@@ -381,6 +381,8 @@ static switch_xml_t erlang_fetch(const char *sectionstr, const char *tag_name, c</span>
        section = switch_xml_parse_section_string((char *) sectionstr);
<span style="color: #00A000">+        switch_thread_rwlock_rdlock(globals.bindings_rwlock);</span>
<span style="color: #00A000">+</span>
        for (ptr = bindings.head; ptr; ptr = ptr->next) {
                if (ptr->section != section)
                        continue;
<span style="color: #800080; font-weight: bold">@@ -417,6 +419,8 @@ static switch_xml_t erlang_fetch(const char *sectionstr, const char *tag_name, c</span>
                switch_mutex_unlock(ptr->listener->sock_mutex);
        }
<span style="color: #00A000">+        switch_thread_rwlock_unlock(globals.bindings_rwlock);</span>
<span style="color: #00A000">+</span>
        ei_x_free(&buf);
        if (!p) {
<span style="color: #800080; font-weight: bold">@@ -1638,6 +1642,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_erlang_event_load)</span>
        memset(&prefs, 0, sizeof(prefs));
        switch_thread_rwlock_create(&globals.listener_rwlock, pool);
<span style="color: #00A000">+        switch_thread_rwlock_create(&globals.bindings_rwlock, pool);</span>
        switch_mutex_init(&globals.fetch_reply_mutex, SWITCH_MUTEX_DEFAULT, pool);
        switch_mutex_init(&globals.listener_count_mutex, SWITCH_MUTEX_UNNESTED, pool);
        switch_core_hash_init(&globals.fetch_reply_hash, pool);
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h</span>
<span style="color: #000080; font-weight: bold">index dacfbd6..121e7b4 100644</span>
<span style="color: #A00000">--- a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h</span>
<span style="color: #800080; font-weight: bold">@@ -161,6 +161,7 @@ struct api_command_struct {</span>
struct globals_struct {
        switch_thread_rwlock_t *listener_rwlock;
<span style="color: #00A000">+        switch_thread_rwlock_t *bindings_rwlock;</span>
        switch_event_node_t *node;
        switch_mutex_t *ref_mutex;
        switch_mutex_t *fetch_reply_mutex;
</pre></div>
<div class="highlight"><pre>committer: Andrew Thompson
comments:
mod_conference Add energy level to conference_add_event_member_data
This is useful when you want to find the energy a member joined with
without having to pull the XML list
<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 2d9341a..7f7ee83 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">@@ -477,6 +477,7 @@ static switch_status_t conference_add_event_member_data(conference_member_t *mem</span>
        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Mute-Detect", "%s", switch_test_flag(member, MFLAG_MUTE_DETECT) ? "true" : "false" );
        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-Type", "%s", switch_test_flag(member, MFLAG_MOD) ? "moderator" : "member");
<span style="color: #00A000">+        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Energy-Level", "%d", member->energy_level);</span>
        return status;
}
</pre></div>
<div class="highlight"><pre>committer: Andrew Thompson
comments:
mod_erlang_event: Don't urlencode events (and destroy an event after use)
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/event_handlers/mod_erlang_event/ei_helpers.c b/src/mod/event_handlers/mod_erlang_event/ei_helpers.c</span>
<span style="color: #000080; font-weight: bold">index a99b520..db4f778 100644</span>
<span style="color: #A00000">--- a/src/mod/event_handlers/mod_erlang_event/ei_helpers.c</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_erlang_event/ei_helpers.c</span>
<span style="color: #800080; font-weight: bold">@@ -111,6 +111,7 @@ void ei_encode_switch_event_headers(ei_x_buff * ebuf, switch_event_t *event)</span>
        for (hp = event->headers; hp; hp = hp->next) {
                ei_x_encode_tuple_header(ebuf, 2);
                _ei_x_encode_string(ebuf, hp->name);
<span style="color: #00A000">+                switch_url_decode(hp->value);</span>
                _ei_x_encode_string(ebuf, hp->value);
        }
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c</span>
<span style="color: #000080; font-weight: bold">index 8d3c594..1a8bd00 100644</span>
<span style="color: #A00000">--- a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c</span>
<span style="color: #800080; font-weight: bold">@@ -532,6 +532,7 @@ static switch_status_t notify_new_session(listener_t *listener, session_elem_t *</span>
                                                 session_element->uuid_str);
        }
<span style="color: #00A000">+        switch_event_destroy(&call_event);</span>
        ei_x_free(&lbuf);
        return SWITCH_STATUS_SUCCESS;
}
</pre></div>
<div class="highlight"><pre>committer: Daniel Swarbrick
comments:
add mod_snmp to modules.conf.in and modules.conf.xml (commented out)
<span style="color: #000080; font-weight: bold">diff --git a/build/modules.conf.in b/build/modules.conf.in</span>
<span style="color: #000080; font-weight: bold">index 2be000f..84a9e9a 100644</span>
<span style="color: #A00000">--- a/build/modules.conf.in</span>
<span style="color: #00A000">+++ b/build/modules.conf.in</span>
<span style="color: #800080; font-weight: bold">@@ -78,6 +78,7 @@ event_handlers/mod_cdr_sqlite</span>
#event_handlers/mod_cdr_pg_csv
#event_handlers/mod_radius_cdr
#event_handlers/mod_erlang_event
<span style="color: #00A000">+#event_handlers/mod_snmp</span>
formats/mod_native_file
formats/mod_sndfile
#formats/mod_shout
<span style="color: #000080; font-weight: bold">diff --git a/conf/autoload_configs/modules.conf.xml b/conf/autoload_configs/modules.conf.xml</span>
<span style="color: #000080; font-weight: bold">index b7100bd..2e7ebfa 100644</span>
<span style="color: #A00000">--- a/conf/autoload_configs/modules.conf.xml</span>
<span style="color: #00A000">+++ b/conf/autoload_configs/modules.conf.xml</span>
<span style="color: #800080; font-weight: bold">@@ -24,6 +24,7 @@</span>
<load module="mod_event_socket"/>
<!-- <load module="mod_zeroconf"/> -->
<!-- <load module="mod_erlang_event"/> -->
<span style="color: #00A000">+ <!-- <load module="mod_snmp"/> --></span>
<!-- Directory Interfaces -->
<!-- <load module="mod_ldap"/> -->
</pre></div>
<div class="highlight"><pre>committer: Brian West
comments:
Fix ZRTP
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_rtp.c b/src/switch_rtp.c</span>
<span style="color: #000080; font-weight: bold">index faf2868..4acadfe 100644</span>
<span style="color: #A00000">--- a/src/switch_rtp.c</span>
<span style="color: #00A000">+++ b/src/switch_rtp.c</span>
<span style="color: #800080; font-weight: bold">@@ -2726,14 +2726,6 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_</span>
                        }
                }
<span style="color: #A00000">-                if (bytes && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA) && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_UDPTL) &&</span>
<span style="color: #A00000">-                        rtp_session->recv_msg.header.pt != 13 && </span>
<span style="color: #A00000">-                        rtp_session->recv_msg.header.pt != rtp_session->recv_te && </span>
<span style="color: #A00000">-                        (!rtp_session->cng_pt || rtp_session->recv_msg.header.pt != rtp_session->cng_pt) && </span>
<span style="color: #A00000">-                        rtp_session->recv_msg.header.pt != rtp_session->payload) {</span>
<span style="color: #A00000">-                        /* drop frames of incorrect payload number and return CNG frame instead */</span>
<span style="color: #A00000">-                        return_cng_frame();</span>
<span style="color: #A00000">-                }</span>
                if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_ENABLE_RTCP) && rtp_session->rtcp_read_pollfd) {
                        rtcp_poll_status = switch_poll(rtp_session->rtcp_read_pollfd, 1, &rtcp_fdr, 0);
<span style="color: #800080; font-weight: bold">@@ -2812,6 +2804,15 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_</span>
                        goto end;
                }
<span style="color: #00A000">+                if (bytes && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA) && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_UDPTL) &&</span>
<span style="color: #00A000">+                        rtp_session->recv_msg.header.pt != 13 && </span>
<span style="color: #00A000">+                        rtp_session->recv_msg.header.pt != rtp_session->recv_te && </span>
<span style="color: #00A000">+                        (!rtp_session->cng_pt || rtp_session->recv_msg.header.pt != rtp_session->cng_pt) && </span>
<span style="color: #00A000">+                        rtp_session->recv_msg.header.pt != rtp_session->payload) {</span>
<span style="color: #00A000">+                        /* drop frames of incorrect payload number and return CNG frame instead */</span>
<span style="color: #00A000">+                        return_cng_frame();</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+</span>
                if (!bytes && (io_flags & SWITCH_IO_FLAG_NOBLOCK)) {
                        rtp_session->missed_count = 0;
                        ret = 0;
</pre></div>
<div class="highlight"><pre>committer: Michael Jerris
comments:
FS-3002: handle 2833 in do_flush instead of dropping valid dtmf
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_apr.c b/src/switch_apr.c</span>
<span style="color: #000080; font-weight: bold">index 4c99662..3798d6e 100644</span>
<span style="color: #A00000">--- a/src/switch_apr.c</span>
<span style="color: #00A000">+++ b/src/switch_apr.c</span>
<span style="color: #800080; font-weight: bold">@@ -833,7 +833,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_recvfrom(switch_sockaddr_t *from,</span>
                 */
        }
<span style="color: #A00000">-        if (r == 35) {</span>
<span style="color: #00A000">+        if (r == 35 || r == 730035) {</span>
                r = SWITCH_STATUS_BREAK;
        }
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_rtp.c b/src/switch_rtp.c</span>
<span style="color: #000080; font-weight: bold">index 3ce7a07..faf2868 100644</span>
<span style="color: #A00000">--- a/src/switch_rtp.c</span>
<span style="color: #00A000">+++ b/src/switch_rtp.c</span>
<span style="color: #800080; font-weight: bold">@@ -32,6 +32,7 @@</span>
*/
//#define DEBUG_2833
//#define RTP_DEBUG_WRITE_DELTA
<span style="color: #00A000">+//#define DEBUG_MISSED_SEQ</span>
#include <switch.h>
#include <switch_stun.h>
#undef PACKAGE_NAME
<span style="color: #800080; font-weight: bold">@@ -245,6 +246,9 @@ struct switch_rtp {</span>
        switch_time_t send_time;
        switch_byte_t auto_adj_used;
        uint8_t pause_jb;
<span style="color: #00A000">+        uint16_t last_seq;</span>
<span style="color: #00A000">+        switch_time_t last_read_time;</span>
<span style="color: #00A000">+        switch_size_t last_flush_packet_count;</span>
};
struct switch_rtcp_senderinfo {
<span style="color: #800080; font-weight: bold">@@ -256,6 +260,180 @@ struct switch_rtcp_senderinfo {</span>
        unsigned oc:32;
};
<span style="color: #00A000">+typedef enum {</span>
<span style="color: #00A000">+        RESULT_CONTINUE,</span>
<span style="color: #00A000">+        RESULT_GOTO_END,</span>
<span style="color: #00A000">+        RESULT_GOTO_RECVFROM,</span>
<span style="color: #00A000">+        RESULT_GOTO_TIMERCHECK</span>
<span style="color: #00A000">+} handle_rfc2833_result_t;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_size_t bytes, int *do_cng)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+#ifdef DEBUG_2833</span>
<span style="color: #00A000">+        if (rtp_session->dtmf_data.in_digit_sanity && !(rtp_session->dtmf_data.in_digit_sanity % 100)) {</span>
<span style="color: #00A000">+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "sanity %d\n", rtp_session->dtmf_data.in_digit_sanity);</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+#endif</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (rtp_session->dtmf_data.in_digit_sanity && !--rtp_session->dtmf_data.in_digit_sanity) {</span>
<span style="color: #00A000">+                rtp_session->dtmf_data.last_digit = 0;</span>
<span style="color: #00A000">+                rtp_session->dtmf_data.in_digit_ts = 0;</span>
<span style="color: #00A000">+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed DTMF sanity check.\n");</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        /* RFC2833 ... like all RFC RE: VoIP, guaranteed to drive you to insanity! </span>
<span style="color: #00A000">+         We know the real rules here, but if we enforce them, it's an interop nightmare so,</span>
<span style="color: #00A000">+         we put up with as much as we can so we don't have to deal with being punished for</span>
<span style="color: #00A000">+         doing it right. Nice guys finish last!</span>
<span style="color: #00A000">+        */</span>
<span style="color: #00A000">+        if (bytes > rtp_header_len && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA) &&</span>
<span style="color: #00A000">+                !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PASS_RFC2833) && rtp_session->recv_te && rtp_session->recv_msg.header.pt == rtp_session->recv_te) {</span>
<span style="color: #00A000">+                switch_size_t len = bytes - rtp_header_len;</span>
<span style="color: #00A000">+                unsigned char *packet = (unsigned char *) rtp_session->recv_msg.body;</span>
<span style="color: #00A000">+                int end;</span>
<span style="color: #00A000">+                uint16_t duration;</span>
<span style="color: #00A000">+                char key;</span>
<span style="color: #00A000">+                uint16_t in_digit_seq;</span>
<span style="color: #00A000">+                uint32_t ts;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                if (!(packet[0] || packet[1] || packet[2] || packet[3]) && len >= 8) {</span>
<span style="color: #00A000">+                        packet += 4;</span>
<span style="color: #00A000">+                        len -= 4;</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "DTMF payload offset by 4 bytes.\n");</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                if (!(packet[0] || packet[1] || packet[2] || packet[3])) {</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed DTMF payload check.\n");</span>
<span style="color: #00A000">+                        rtp_session->dtmf_data.last_digit = 0;</span>
<span style="color: #00A000">+                        rtp_session->dtmf_data.in_digit_ts = 0;</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                end = packet[1] & 0x80 ? 1 : 0;</span>
<span style="color: #00A000">+                duration = (packet[2] << 8) + packet[3];</span>
<span style="color: #00A000">+                key = switch_rfc2833_to_char(packet[0]);</span>
<span style="color: #00A000">+                in_digit_seq = ntohs((uint16_t) rtp_session->recv_msg.header.seq);</span>
<span style="color: #00A000">+                ts = htonl(rtp_session->recv_msg.header.ts);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                if (in_digit_seq < rtp_session->dtmf_data.in_digit_seq) {</span>
<span style="color: #00A000">+                        if (rtp_session->dtmf_data.in_digit_seq - in_digit_seq > 100) {</span>
<span style="color: #00A000">+                                rtp_session->dtmf_data.in_digit_seq = 0;</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+#ifdef DEBUG_2833</span>
<span style="color: #00A000">+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "packet[%d]: %02x %02x %02x %02x\n", (int) len, (unsigned) packet[0], (unsigned)</span>
<span style="color: #00A000">+                         packet[1], (unsigned) packet[2], (unsigned) packet[3]);</span>
<span style="color: #00A000">+#endif</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                if (in_digit_seq > rtp_session->dtmf_data.in_digit_seq) {</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        rtp_session->dtmf_data.in_digit_seq = in_digit_seq;</span>
<span style="color: #00A000">+#ifdef DEBUG_2833</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "read: %c %u %u %u %u %d %d %s\n",</span>
<span style="color: #00A000">+                                 key, in_digit_seq, rtp_session->dtmf_data.in_digit_seq,</span>
<span style="color: #00A000">+                                 ts, duration, rtp_session->recv_msg.header.m, end, end && !rtp_session->dtmf_data.in_digit_ts ? "ignored" : "");</span>
<span style="color: #00A000">+#endif</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        if (!rtp_session->dtmf_data.in_digit_queued && (rtp_session->rtp_bugs & RTP_BUG_IGNORE_DTMF_DURATION) &&</span>
<span style="color: #00A000">+                                rtp_session->dtmf_data.in_digit_ts) {</span>
<span style="color: #00A000">+                                switch_dtmf_t dtmf = { key, switch_core_min_dtmf_duration(0) };</span>
<span style="color: #00A000">+#ifdef DEBUG_2833</span>
<span style="color: #00A000">+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Early Queuing digit %c:%d\n", dtmf.digit, dtmf.duration / 8);</span>
<span style="color: #00A000">+#endif</span>
<span style="color: #00A000">+                                switch_rtp_queue_rfc2833_in(rtp_session, &dtmf);</span>
<span style="color: #00A000">+                                rtp_session->dtmf_data.in_digit_queued = 1;</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        /* only set sanity if we do NOT ignore the packet */</span>
<span style="color: #00A000">+                        if (rtp_session->dtmf_data.in_digit_ts) {</span>
<span style="color: #00A000">+                                rtp_session->dtmf_data.in_digit_sanity = 2000;</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        if (rtp_session->dtmf_data.last_duration > duration && </span>
<span style="color: #00A000">+                                rtp_session->dtmf_data.last_duration > 0xFC17 && ts == rtp_session->dtmf_data.in_digit_ts) {</span>
<span style="color: #00A000">+                                rtp_session->dtmf_data.flip++;</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        if (end) {</span>
<span style="color: #00A000">+                                if (rtp_session->dtmf_data.in_digit_ts) {</span>
<span style="color: #00A000">+                                        switch_dtmf_t dtmf = { key, duration };</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                                        if (ts > rtp_session->dtmf_data.in_digit_ts) {</span>
<span style="color: #00A000">+                                                dtmf.duration += (ts - rtp_session->dtmf_data.in_digit_ts);</span>
<span style="color: #00A000">+                                        }</span>
<span style="color: #00A000">+                                        if (rtp_session->dtmf_data.flip) {</span>
<span style="color: #00A000">+                                                dtmf.duration += rtp_session->dtmf_data.flip * 0xFFFF;</span>
<span style="color: #00A000">+                                                rtp_session->dtmf_data.flip = 0;</span>
<span style="color: #00A000">+#ifdef DEBUG_2833</span>
<span style="color: #00A000">+                                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "you're welcome!\n");</span>
<span style="color: #00A000">+#endif</span>
<span style="color: #00A000">+                                        }</span>
<span style="color: #00A000">+#ifdef DEBUG_2833</span>
<span style="color: #00A000">+                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "done digit=%c ts=%u start_ts=%u dur=%u ddur=%u\n",</span>
<span style="color: #00A000">+                                                 dtmf.digit, ts, rtp_session->dtmf_data.in_digit_ts, duration, dtmf.duration);</span>
<span style="color: #00A000">+#endif</span>
<span style="color: #00A000">+                                                </span>
<span style="color: #00A000">+                                        if (!(rtp_session->rtp_bugs & RTP_BUG_IGNORE_DTMF_DURATION) && !rtp_session->dtmf_data.in_digit_queued) {</span>
<span style="color: #00A000">+#ifdef DEBUG_2833</span>
<span style="color: #00A000">+                                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Queuing digit %c:%d\n", dtmf.digit, dtmf.duration / 8);</span>
<span style="color: #00A000">+#endif</span>
<span style="color: #00A000">+                                                switch_rtp_queue_rfc2833_in(rtp_session, &dtmf);</span>
<span style="color: #00A000">+                                        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                                        rtp_session->dtmf_data.last_digit = rtp_session->dtmf_data.first_digit;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                                        rtp_session->dtmf_data.in_digit_ts = 0;</span>
<span style="color: #00A000">+                                        rtp_session->dtmf_data.in_digit_sanity = 0;</span>
<span style="color: #00A000">+                                        rtp_session->dtmf_data.in_digit_queued = 0;</span>
<span style="color: #00A000">+                                        *do_cng = 1;</span>
<span style="color: #00A000">+                                } else {</span>
<span style="color: #00A000">+                                        if (!switch_rtp_ready(rtp_session)) {</span>
<span style="color: #00A000">+                                                return RESULT_GOTO_END;</span>
<span style="color: #00A000">+                                        }</span>
<span style="color: #00A000">+                                        switch_cond_next();</span>
<span style="color: #00A000">+                                        return RESULT_GOTO_RECVFROM;</span>
<span style="color: #00A000">+                                }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        } else if (!rtp_session->dtmf_data.in_digit_ts) {</span>
<span style="color: #00A000">+                                rtp_session->dtmf_data.in_digit_ts = ts;</span>
<span style="color: #00A000">+                                rtp_session->dtmf_data.first_digit = key;</span>
<span style="color: #00A000">+                                rtp_session->dtmf_data.in_digit_sanity = 2000;</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        rtp_session->dtmf_data.last_duration = duration;</span>
<span style="color: #00A000">+                } else {</span>
<span style="color: #00A000">+#ifdef DEBUG_2833</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "drop: %c %u %u %u %u %d %d\n",</span>
<span style="color: #00A000">+                                 key, in_digit_seq, rtp_session->dtmf_data.in_digit_seq, ts, duration, rtp_session->recv_msg.header.m, end);</span>
<span style="color: #00A000">+#endif</span>
<span style="color: #00A000">+                        switch_cond_next();</span>
<span style="color: #00A000">+                        return RESULT_GOTO_RECVFROM;</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (bytes && rtp_session->dtmf_data.in_digit_ts) {</span>
<span style="color: #00A000">+                if (!switch_rtp_ready(rtp_session)) {</span>
<span style="color: #00A000">+                        return RESULT_GOTO_END;</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                if (!rtp_session->dtmf_data.in_interleaved && rtp_session->recv_msg.header.pt != rtp_session->recv_te) {</span>
<span style="color: #00A000">+                        /* Drat, they are sending audio still as well as DTMF ok fine..... *sigh* */</span>
<span style="color: #00A000">+                        rtp_session->dtmf_data.in_interleaved = 1;</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+                        </span>
<span style="color: #00A000">+                if (rtp_session->dtmf_data.in_interleaved || (rtp_session->rtp_bugs & RTP_BUG_IGNORE_DTMF_DURATION)) {</span>
<span style="color: #00A000">+                        if (rtp_session->recv_msg.header.pt == rtp_session->recv_te) {</span>
<span style="color: #00A000">+                                return RESULT_GOTO_RECVFROM;</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+                } else {</span>
<span style="color: #00A000">+                        *do_cng = 1;</span>
<span style="color: #00A000">+                        return RESULT_GOTO_TIMERCHECK;</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        return RESULT_CONTINUE;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
static int global_init = 0;
static int rtp_common_write(switch_rtp_t *rtp_session,
                                                        rtp_msg_t *send_msg, void *data, uint32_t datalen, switch_payload_t payload, uint32_t timestamp, switch_frame_flag_t *flags);
<span style="color: #800080; font-weight: bold">@@ -2157,6 +2335,15 @@ static void do_flush(switch_rtp_t *rtp_session)</span>
                                bytes = sizeof(rtp_msg_t);
                                status = switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock_input, 0, (void *) &rtp_session->recv_msg, &bytes);
                                if (bytes) {
<span style="color: #00A000">+                                        int do_cng = 0;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                                        /* Make sure to handle RFC2833 packets, even if we're flushing the packets */</span>
<span style="color: #00A000">+                                        if (bytes > rtp_header_len && rtp_session->recv_te && rtp_session->recv_msg.header.pt == rtp_session->recv_te) {</span>
<span style="color: #00A000">+                                                handle_rfc2833(rtp_session, bytes, &do_cng);</span>
<span style="color: #00A000">+#ifdef DEBUG_2833</span>
<span style="color: #00A000">+                                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "*** RTP packet handled in flush loop ***\n");</span>
<span style="color: #00A000">+#endif</span>
<span style="color: #00A000">+                                        }</span>
                                        flushed++;
<span style="color: #800080; font-weight: bold">@@ -2195,7 +2382,52 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t</span>
        *bytes = sizeof(rtp_msg_t);
        status = switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock_input, 0, (void *) &rtp_session->recv_msg, bytes);
        ts = ntohl(rtp_session->recv_msg.header.ts);
<span style="color: #A00000">-        </span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (*bytes ) {</span>
<span style="color: #00A000">+                uint16_t seq = ntohs((uint16_t) rtp_session->recv_msg.header.seq);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                if (rtp_session->last_seq && rtp_session->last_seq+1 != seq) {</span>
<span style="color: #00A000">+#ifdef DEBUG_MISSED_SEQ</span>
<span style="color: #00A000">+                        switch_size_t flushed_packets_diff = rtp_session->stats.inbound.flush_packet_count - rtp_session->last_flush_packet_count;</span>
<span style="color: #00A000">+                        switch_size_t num_missed = (switch_size_t)seq - (rtp_session->last_seq+1);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        if (num_missed == 1) { /* We missed one packet */</span>
<span style="color: #00A000">+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missed one RTP frame with sequence [%d]%s. Time since last read [%d]\n",</span>
<span style="color: #00A000">+                                                                 rtp_session->last_seq+1, (flushed_packets_diff == 1) ? " (flushed by FS)" : " (missed)",</span>
<span style="color: #00A000">+                                                                 rtp_session->last_read_time ? switch_micro_time_now()-rtp_session->last_read_time : 0);</span>
<span style="color: #00A000">+                        } else { /* We missed multiple packets */</span>
<span style="color: #00A000">+                                if (flushed_packets_diff == 0) { </span>
<span style="color: #00A000">+                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,</span>
<span style="color: #00A000">+                                                                         "Missed %d RTP frames from sequence [%d] to [%d] (missed). Time since last read [%d]\n",</span>
<span style="color: #00A000">+                                                                         num_missed, rtp_session->last_seq+1, seq-1,</span>
<span style="color: #00A000">+                                                                         rtp_session->last_read_time ? switch_micro_time_now()-rtp_session->last_read_time : 0);</span>
<span style="color: #00A000">+                                } else if (flushed_packets_diff == num_missed) {</span>
<span style="color: #00A000">+                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,</span>
<span style="color: #00A000">+                                                                         "Missed %d RTP frames from sequence [%d] to [%d] (flushed by FS). Time since last read [%d]\n",</span>
<span style="color: #00A000">+                                                                         num_missed, rtp_session->last_seq+1, seq-1,</span>
<span style="color: #00A000">+                                                                         rtp_session->last_read_time ? switch_micro_time_now()-rtp_session->last_read_time : 0);</span>
<span style="color: #00A000">+                                } else if (num_missed > flushed_packets_diff) {</span>
<span style="color: #00A000">+                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,</span>
<span style="color: #00A000">+                                                                         "Missed %d RTP frames from sequence [%d] to [%d] (%d packets flushed by FS, %d packets missed)."</span>
<span style="color: #00A000">+                                                                         " Time since last read [%d]\n",</span>
<span style="color: #00A000">+                                                                         num_missed, rtp_session->last_seq+1, seq-1,</span>
<span style="color: #00A000">+                                                                         flushed_packets_diff, num_missed-flushed_packets_diff,</span>
<span style="color: #00A000">+                                                                         rtp_session->last_read_time ? switch_micro_time_now()-rtp_session->last_read_time : 0);</span>
<span style="color: #00A000">+                                } else {</span>
<span style="color: #00A000">+                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,</span>
<span style="color: #00A000">+                                                                         "Missed %d RTP frames from sequence [%d] to [%d] (%d packets flushed by FS). Time since last read [%d]\n",</span>
<span style="color: #00A000">+                                                                         num_missed, rtp_session->last_seq+1, seq-1,</span>
<span style="color: #00A000">+                                                                         flushed_packets_diff, rtp_session->last_read_time ? switch_micro_time_now()-rtp_session->last_read_time : 0);</span>
<span style="color: #00A000">+                                }</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+#endif</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+                rtp_session->last_seq = seq;</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        rtp_session->last_flush_packet_count = rtp_session->stats.inbound.flush_packet_count;</span>
<span style="color: #00A000">+        rtp_session->last_read_time = switch_micro_time_now();</span>
<span style="color: #00A000">+</span>
        if (*bytes && (!rtp_session->recv_te || rtp_session->recv_msg.header.pt != rtp_session->recv_te) &&
                ts && !rtp_session->jb && !rtp_session->pause_jb && ts == rtp_session->last_cng_ts) {
                /* we already sent this frame..... */
<span style="color: #800080; font-weight: bold">@@ -2836,173 +3068,20 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_</span>
                        bytes = sbytes;
                }
<span style="color: #A00000">-#ifdef DEBUG_2833</span>
<span style="color: #A00000">-                if (rtp_session->dtmf_data.in_digit_sanity && !(rtp_session->dtmf_data.in_digit_sanity % 100)) {</span>
<span style="color: #A00000">-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "sanity %d\n", rtp_session->dtmf_data.in_digit_sanity);</span>
<span style="color: #A00000">-                }</span>
<span style="color: #A00000">-#endif</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                if (rtp_session->dtmf_data.in_digit_sanity && !--rtp_session->dtmf_data.in_digit_sanity) {</span>
<span style="color: #A00000">-                        rtp_session->dtmf_data.last_digit = 0;</span>
<span style="color: #A00000">-                        rtp_session->dtmf_data.in_digit_ts = 0;</span>
<span style="color: #A00000">-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed DTMF sanity check.\n");</span>
<span style="color: #A00000">-                }</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                /* RFC2833 ... like all RFC RE: VoIP, guaranteed to drive you to insanity! </span>
<span style="color: #A00000">-                 We know the real rules here, but if we enforce them, it's an interop nightmare so,</span>
<span style="color: #A00000">-                 we put up with as much as we can so we don't have to deal with being punished for</span>
<span style="color: #A00000">-                 doing it right. Nice guys finish last!</span>
<span style="color: #A00000">-                */</span>
<span style="color: #A00000">-                if (bytes > rtp_header_len && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA) &&</span>
<span style="color: #A00000">-                        !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PASS_RFC2833) && rtp_session->recv_msg.header.pt == rtp_session->recv_te) {</span>
<span style="color: #A00000">-                        switch_size_t len = bytes - rtp_header_len;</span>
<span style="color: #A00000">-                        unsigned char *packet = (unsigned char *) rtp_session->recv_msg.body;</span>
<span style="color: #A00000">-                        int end;</span>
<span style="color: #A00000">-                        uint16_t duration;</span>
<span style="color: #A00000">-                        char key;</span>
<span style="color: #A00000">-                        uint16_t in_digit_seq;</span>
<span style="color: #A00000">-                        uint32_t ts;</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                        if (!(packet[0] || packet[1] || packet[2] || packet[3]) && len >= 8) {</span>
<span style="color: #A00000">-                                packet += 4;</span>
<span style="color: #A00000">-                                len -= 4;</span>
<span style="color: #A00000">-                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "DTMF payload offset by 4 bytes.\n");</span>
<span style="color: #A00000">-                        }</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                        if (!(packet[0] || packet[1] || packet[2] || packet[3])) {</span>
<span style="color: #A00000">-                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed DTMF payload check.\n");</span>
<span style="color: #A00000">-                                rtp_session->dtmf_data.last_digit = 0;</span>
<span style="color: #A00000">-                                rtp_session->dtmf_data.in_digit_ts = 0;</span>
<span style="color: #A00000">-                        }</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                        end = packet[1] & 0x80 ? 1 : 0;</span>
<span style="color: #A00000">-                        duration = (packet[2] << 8) + packet[3];</span>
<span style="color: #A00000">-                        key = switch_rfc2833_to_char(packet[0]);</span>
<span style="color: #A00000">-                        in_digit_seq = ntohs((uint16_t) rtp_session->recv_msg.header.seq);</span>
<span style="color: #A00000">-                        ts = htonl(rtp_session->recv_msg.header.ts);</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                        if (in_digit_seq < rtp_session->dtmf_data.in_digit_seq) {</span>
<span style="color: #A00000">-                                if (rtp_session->dtmf_data.in_digit_seq - in_digit_seq > 100) {</span>
<span style="color: #A00000">-                                        rtp_session->dtmf_data.in_digit_seq = 0;</span>
<span style="color: #A00000">-                                }</span>
<span style="color: #A00000">-                        }</span>
<span style="color: #A00000">-#ifdef DEBUG_2833</span>
<span style="color: #A00000">-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "packet[%d]: %02x %02x %02x %02x\n", (int) len, (unsigned) packet[0], (unsigned)</span>
<span style="color: #A00000">-                                 packet[1], (unsigned) packet[2], (unsigned) packet[3]);</span>
<span style="color: #A00000">-#endif</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                        if (in_digit_seq > rtp_session->dtmf_data.in_digit_seq) {</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                                rtp_session->dtmf_data.in_digit_seq = in_digit_seq;</span>
<span style="color: #A00000">-#ifdef DEBUG_2833</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "read: %c %u %u %u %u %d %d %s\n",</span>
<span style="color: #A00000">-                                         key, in_digit_seq, rtp_session->dtmf_data.in_digit_seq,</span>
<span style="color: #A00000">-                                         ts, duration, rtp_session->recv_msg.header.m, end, end && !rtp_session->dtmf_data.in_digit_ts ? "ignored" : "");</span>
<span style="color: #A00000">-#endif</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                                if (!rtp_session->dtmf_data.in_digit_queued && (rtp_session->rtp_bugs & RTP_BUG_IGNORE_DTMF_DURATION) &&</span>
<span style="color: #A00000">-                                        rtp_session->dtmf_data.in_digit_ts) {</span>
<span style="color: #A00000">-                                        switch_dtmf_t dtmf = { key, switch_core_min_dtmf_duration(0) };</span>
<span style="color: #A00000">-#ifdef DEBUG_2833</span>
<span style="color: #A00000">-                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Early Queuing digit %c:%d\n", dtmf.digit, dtmf.duration / 8);</span>
<span style="color: #A00000">-#endif</span>
<span style="color: #A00000">-                                        switch_rtp_queue_rfc2833_in(rtp_session, &dtmf);</span>
<span style="color: #A00000">-                                        rtp_session->dtmf_data.in_digit_queued = 1;</span>
<span style="color: #A00000">-                                }</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                                /* only set sanity if we do NOT ignore the packet */</span>
<span style="color: #A00000">-                                if (rtp_session->dtmf_data.in_digit_ts) {</span>
<span style="color: #A00000">-                                        rtp_session->dtmf_data.in_digit_sanity = 2000;</span>
<span style="color: #A00000">-                                }</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                                if (rtp_session->dtmf_data.last_duration > duration && </span>
<span style="color: #A00000">-                                        rtp_session->dtmf_data.last_duration > 0xFC17 && ts == rtp_session->dtmf_data.in_digit_ts) {</span>
<span style="color: #A00000">-                                        rtp_session->dtmf_data.flip++;</span>
<span style="color: #A00000">-                                }</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                                if (end) {</span>
<span style="color: #A00000">-                                        if (rtp_session->dtmf_data.in_digit_ts) {</span>
<span style="color: #A00000">-                                                switch_dtmf_t dtmf = { key, duration };</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                                                if (ts > rtp_session->dtmf_data.in_digit_ts) {</span>
<span style="color: #A00000">-                                                        dtmf.duration += (ts - rtp_session->dtmf_data.in_digit_ts);</span>
<span style="color: #A00000">-                                                }</span>
<span style="color: #A00000">-                                                if (rtp_session->dtmf_data.flip) {</span>
<span style="color: #A00000">-                                                        dtmf.duration += rtp_session->dtmf_data.flip * 0xFFFF;</span>
<span style="color: #A00000">-                                                        rtp_session->dtmf_data.flip = 0;</span>
<span style="color: #A00000">-#ifdef DEBUG_2833</span>
<span style="color: #A00000">-                                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "you're welcome!\n");</span>
<span style="color: #A00000">-#endif</span>
<span style="color: #A00000">-                                                }</span>
<span style="color: #A00000">-#ifdef DEBUG_2833</span>
<span style="color: #A00000">-                                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "done digit=%c ts=%u start_ts=%u dur=%u ddur=%u\n",</span>
<span style="color: #A00000">-                                                         dtmf.digit, ts, rtp_session->dtmf_data.in_digit_ts, duration, dtmf.duration);</span>
<span style="color: #A00000">-#endif</span>
<span style="color: #A00000">-                                                </span>
<span style="color: #A00000">-                                                if (!(rtp_session->rtp_bugs & RTP_BUG_IGNORE_DTMF_DURATION) && !rtp_session->dtmf_data.in_digit_queued) {</span>
<span style="color: #A00000">-#ifdef DEBUG_2833</span>
<span style="color: #A00000">-                                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Queuing digit %c:%d\n", dtmf.digit, dtmf.duration / 8);</span>
<span style="color: #A00000">-#endif</span>
<span style="color: #A00000">-                                                        switch_rtp_queue_rfc2833_in(rtp_session, &dtmf);</span>
<span style="color: #A00000">-                                                }</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                                                rtp_session->dtmf_data.last_digit = rtp_session->dtmf_data.first_digit;</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                                                rtp_session->dtmf_data.in_digit_ts = 0;</span>
<span style="color: #A00000">-                                                rtp_session->dtmf_data.in_digit_sanity = 0;</span>
<span style="color: #A00000">-                                                rtp_session->dtmf_data.in_digit_queued = 0;</span>
<span style="color: #A00000">-                                                do_cng = 1;</span>
<span style="color: #A00000">-                                        } else {</span>
<span style="color: #A00000">-                                                if (!switch_rtp_ready(rtp_session)) {</span>
<span style="color: #A00000">-                                                        goto end;</span>
<span style="color: #A00000">-                                                }</span>
<span style="color: #A00000">-                                                switch_cond_next();</span>
<span style="color: #A00000">-                                                goto recvfrom;</span>
<span style="color: #A00000">-                                        }</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                                } else if (!rtp_session->dtmf_data.in_digit_ts) {</span>
<span style="color: #A00000">-                                        rtp_session->dtmf_data.in_digit_ts = ts;</span>
<span style="color: #A00000">-                                        rtp_session->dtmf_data.first_digit = key;</span>
<span style="color: #A00000">-                                        rtp_session->dtmf_data.in_digit_sanity = 2000;</span>
<span style="color: #A00000">-                                }</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                                rtp_session->dtmf_data.last_duration = duration;</span>
<span style="color: #A00000">-                        } else {</span>
<span style="color: #A00000">-#ifdef DEBUG_2833</span>
<span style="color: #A00000">-                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "drop: %c %u %u %u %u %d %d\n",</span>
<span style="color: #A00000">-                                         key, in_digit_seq, rtp_session->dtmf_data.in_digit_seq, ts, duration, rtp_session->recv_msg.header.m, end);</span>
<span style="color: #A00000">-#endif</span>
<span style="color: #A00000">-                                switch_cond_next();</span>
<span style="color: #A00000">-                                goto recvfrom;</span>
<span style="color: #A00000">-                        }</span>
<span style="color: #A00000">-                }</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                if (rtp_session->dtmf_data.in_digit_ts) {</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                }</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                if (bytes && rtp_session->dtmf_data.in_digit_ts) {</span>
<span style="color: #A00000">-                        if (!switch_rtp_ready(rtp_session)) {</span>
<span style="color: #A00000">-                                goto end;</span>
<span style="color: #A00000">-                        }</span>
<span style="color: #A00000">-                        if (!rtp_session->dtmf_data.in_interleaved && rtp_session->recv_msg.header.pt != rtp_session->recv_te) {</span>
<span style="color: #A00000">-                                /* Drat, they are sending audio still as well as DTMF ok fine..... *sigh* */</span>
<span style="color: #A00000">-                                rtp_session->dtmf_data.in_interleaved = 1;</span>
<span style="color: #A00000">-                        }</span>
<span style="color: #A00000">-                        </span>
<span style="color: #A00000">-                        if (rtp_session->dtmf_data.in_interleaved || (rtp_session->rtp_bugs & RTP_BUG_IGNORE_DTMF_DURATION)) {</span>
<span style="color: #A00000">-                                if (rtp_session->recv_msg.header.pt == rtp_session->recv_te) {</span>
<span style="color: #A00000">-                                        goto recvfrom;</span>
<span style="color: #A00000">-                                }</span>
<span style="color: #A00000">-                        } else {</span>
<span style="color: #A00000">-                                return_cng_frame();</span>
<span style="color: #A00000">-                        }</span>
<span style="color: #00A000">+                /* Handle incoming RFC2833 packets */</span>
<span style="color: #00A000">+                switch (handle_rfc2833(rtp_session, bytes, &do_cng)) {</span>
<span style="color: #00A000">+                case RESULT_GOTO_END:</span>
<span style="color: #00A000">+                        goto end;</span>
<span style="color: #00A000">+                case RESULT_GOTO_RECVFROM:</span>
<span style="color: #00A000">+                        goto recvfrom;</span>
<span style="color: #00A000">+                case RESULT_GOTO_TIMERCHECK:</span>
<span style="color: #00A000">+                        goto timer_check;</span>
<span style="color: #00A000">+                case RESULT_CONTINUE:</span>
<span style="color: #00A000">+                        goto result_continue;</span>
                }
<span style="color: #00A000">+        result_continue:</span>
        timer_check:
                if (do_cng) {
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
FS-3007
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c</span>
<span style="color: #000080; font-weight: bold">index 94fef61..19125c6 100644</span>
<span style="color: #A00000">--- a/src/mod/endpoints/mod_sofia/sofia_presence.c</span>
<span style="color: #00A000">+++ b/src/mod/endpoints/mod_sofia/sofia_presence.c</span>
<span style="color: #800080; font-weight: bold">@@ -630,6 +630,11 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)</span>
                        char *probe_user = NULL, *probe_euser, *probe_host, *p;
                        struct dialog_helper dh = { { 0 } };
<span style="color: #00A000">+                        if (strcasecmp(proto, SOFIA_CHAT_PROTO) != 0) {</span>
<span style="color: #00A000">+                                goto done;</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
                        if (!to || !(probe_user = strdup(to))) {
                                goto done;
                        }
<span style="color: #800080; font-weight: bold">@@ -2405,6 +2410,20 @@ void sofia_presence_handle_sip_i_subscribe(int status,</span>
                        switch_event_fire(&sevent);
                }
<span style="color: #00A000">+        } else if (to_user && (strcasecmp(proto, SOFIA_CHAT_PROTO) != 0)) {</span>
<span style="color: #00A000">+                if (switch_event_create(&sevent, SWITCH_EVENT_PRESENCE_PROBE) == SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                        switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "proto", proto);</span>
<span style="color: #00A000">+                        switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "long", profile->name);</span>
<span style="color: #00A000">+                        switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "from", "%s@%s", from_user, from_host);</span>
<span style="color: #00A000">+                        switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "to", "%s%s%s@%s", proto, "+", to_user, to_host);</span>
<span style="color: #00A000">+                        switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "proto-specific-event-name", event);</span>
<span style="color: #00A000">+                        switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "expires", exp_delta_str);</span>
<span style="color: #00A000">+                        switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "event_type", "presence");</span>
<span style="color: #00A000">+                        switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");</span>
<span style="color: #00A000">+                        switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "expires", exp_delta_str);</span>
<span style="color: #00A000">+                        switch_event_fire(&sevent);</span>
<span style="color: #00A000">+        </span>
<span style="color: #00A000">+                }</span>
        } else {
                if (switch_event_create(&sevent, SWITCH_EVENT_PRESENCE_PROBE) == SWITCH_STATUS_SUCCESS) {
                        switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
FS-2917
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_core.c b/src/switch_core.c</span>
<span style="color: #000080; font-weight: bold">index b531111..43fb36d 100644</span>
<span style="color: #A00000">--- a/src/switch_core.c</span>
<span style="color: #00A000">+++ b/src/switch_core.c</span>
<span style="color: #800080; font-weight: bold">@@ -151,13 +151,21 @@ static void check_ip(void)</span>
SWITCH_STANDARD_SCHED_FUNC(heartbeat_callback)
{
        send_heartbeat();
<span style="color: #A00000">-        check_ip();</span>
        /* reschedule this task */
        task->runtime = switch_epoch_time_now(NULL) + 20;
}
<span style="color: #00A000">+SWITCH_STANDARD_SCHED_FUNC(check_ip_callback)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        check_ip();</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        /* reschedule this task */</span>
<span style="color: #00A000">+        task->runtime = switch_epoch_time_now(NULL) + 60;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
SWITCH_DECLARE(switch_status_t) switch_core_set_console(const char *console)
{
        if ((runtime.console = fopen(console, "a")) == 0) {
<span style="color: #800080; font-weight: bold">@@ -1357,6 +1365,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc</span>
        
        switch_scheduler_add_task(switch_epoch_time_now(NULL), heartbeat_callback, "heartbeat", "core", 0, NULL, SSHF_NONE | SSHF_NO_DEL);
<span style="color: #00A000">+        switch_scheduler_add_task(switch_epoch_time_now(NULL), check_ip_callback, "check_ip", "core", 0, NULL, SSHF_NONE | SSHF_NO_DEL | SSHF_OWN_THREAD);</span>
<span style="color: #00A000">+</span>
        switch_uuid_get(&uuid);
        switch_uuid_format(runtime.uuid_str, &uuid);
</pre></div>
<div class="highlight"><pre>committer: Moises Silva
comments:
Merge branch 'master' of git.freeswitch.org:freeswitch
</pre></div>
<div class="highlight"><pre>committer: Moises Silva
comments:
freetdm: ftmod_wanpipe dummy for disabling echotrain
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c b/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c</span>
<span style="color: #000080; font-weight: bold">index 3b384cd..e08fd61 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c</span>
<span style="color: #00A000">+++ b/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c</span>
<span style="color: #800080; font-weight: bold">@@ -664,6 +664,8 @@ static FIO_COMMAND_FUNCTION(wanpipe_command)</span>
                        }
                }
                break;
<span style="color: #00A000">+        case FTDM_COMMAND_DISABLE_ECHOTRAIN: { err = 0; }</span>
<span style="color: #00A000">+                break;</span>
        case FTDM_COMMAND_ENABLE_DTMF_DETECT:
                {
#ifdef WP_API_FEATURE_DTMF_EVENTS
</pre></div>
<div class="highlight"><pre>committer: Daniel Swarbrick
comments:
initial checkin of mod_snmp
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/event_handlers/mod_snmp/FREESWITCH-MIB b/src/mod/event_handlers/mod_snmp/FREESWITCH-MIB</span>
new file mode 100644
<span style="color: #000080; font-weight: bold">index 0000000..9584c8b</span>
<span style="color: #A00000">--- /dev/null</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_snmp/FREESWITCH-MIB</span>
<span style="color: #800080; font-weight: bold">@@ -0,0 +1,110 @@</span>
<span style="color: #00A000">+FREESWITCH-MIB DEFINITIONS ::= BEGIN</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+IMPORTS</span>
<span style="color: #00A000">+ OBJECT-TYPE, MODULE-IDENTITY,</span>
<span style="color: #00A000">+ Integer32, Gauge32, Counter32, Counter64, TimeTicks,</span>
<span style="color: #00A000">+ enterprises,</span>
<span style="color: #00A000">+ FROM SNMPv2-SMI</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ DisplayString</span>
<span style="color: #00A000">+ FROM SNMPv2-TC</span>
<span style="color: #00A000">+;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+freeswitch MODULE-IDENTITY</span>
<span style="color: #00A000">+ LAST-UPDATED "201101170000Z"</span>
<span style="color: #00A000">+ ORGANIZATION "www.freeswitch.org"</span>
<span style="color: #00A000">+ CONTACT-INFO</span>
<span style="color: #00A000">+ "Primary contact: Anthony Minessale II</span>
<span style="color: #00A000">+ Email: anthm@freeswitch.org"</span>
<span style="color: #00A000">+ DESCRIPTION</span>
<span style="color: #00A000">+ "This file defines the private FreeSWITCH SNMP MIB extensions."</span>
<span style="color: #00A000">+ REVISION "201101170000Z"</span>
<span style="color: #00A000">+ DESCRIPTION</span>
<span style="color: #00A000">+ "First draft by daniel.swarbrick@seventhsignal.de"</span>
<span style="color: #00A000">+ ::= { enterprises 27880 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+core OBJECT IDENTIFIER ::= { freeswitch 1 }</span>
<span style="color: #00A000">+mod-sofia OBJECT IDENTIFIER ::= { freeswitch 1001 }</span>
<span style="color: #00A000">+mod-skinny OBJECT IDENTIFIER ::= { freeswitch 1002 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+identity OBJECT IDENTIFIER ::= { core 1 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+versionString OBJECT-TYPE</span>
<span style="color: #00A000">+ SYNTAX DisplayString</span>
<span style="color: #00A000">+ MAX-ACCESS read-only</span>
<span style="color: #00A000">+ STATUS current</span>
<span style="color: #00A000">+ DESCRIPTION</span>
<span style="color: #00A000">+ "FreeSWITCH version as a string"</span>
<span style="color: #00A000">+ ::= { identity 1 } </span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+uuid OBJECT-TYPE</span>
<span style="color: #00A000">+ SYNTAX DisplayString</span>
<span style="color: #00A000">+ MAX-ACCESS read-only</span>
<span style="color: #00A000">+ STATUS current</span>
<span style="color: #00A000">+ DESCRIPTION</span>
<span style="color: #00A000">+ "FreeSWITCH core UUID"</span>
<span style="color: #00A000">+ ::= { identity 2 } </span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+systemStats OBJECT IDENTIFIER ::= { core 2 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+uptime OBJECT-TYPE</span>
<span style="color: #00A000">+ SYNTAX TimeTicks</span>
<span style="color: #00A000">+ MAX-ACCESS read-only</span>
<span style="color: #00A000">+ STATUS current</span>
<span style="color: #00A000">+ DESCRIPTION</span>
<span style="color: #00A000">+ "FreeSWITCH process uptime in hundredths of seconds"</span>
<span style="color: #00A000">+ ::= { systemStats 1 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+sessionsSinceStartup OBJECT-TYPE</span>
<span style="color: #00A000">+ SYNTAX Counter32</span>
<span style="color: #00A000">+ MAX-ACCESS read-only</span>
<span style="color: #00A000">+ STATUS current</span>
<span style="color: #00A000">+ DESCRIPTION</span>
<span style="color: #00A000">+ "Number of sessions since FreeSWITCH process was started"</span>
<span style="color: #00A000">+ ::= { systemStats 2 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+currentSessions OBJECT-TYPE</span>
<span style="color: #00A000">+ SYNTAX Gauge32</span>
<span style="color: #00A000">+ MAX-ACCESS read-only</span>
<span style="color: #00A000">+ STATUS current</span>
<span style="color: #00A000">+ DESCRIPTION</span>
<span style="color: #00A000">+ "Currently active sessions"</span>
<span style="color: #00A000">+ ::= { systemStats 3 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+maxSessions OBJECT-TYPE</span>
<span style="color: #00A000">+ SYNTAX Gauge32</span>
<span style="color: #00A000">+ MAX-ACCESS read-only</span>
<span style="color: #00A000">+ STATUS current</span>
<span style="color: #00A000">+ DESCRIPTION</span>
<span style="color: #00A000">+ "Maximum permissible active sessions"</span>
<span style="color: #00A000">+ ::= { systemStats 4 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+currentCalls OBJECT-TYPE</span>
<span style="color: #00A000">+ SYNTAX Gauge32</span>
<span style="color: #00A000">+ MAX-ACCESS read-only</span>
<span style="color: #00A000">+ STATUS current</span>
<span style="color: #00A000">+ DESCRIPTION</span>
<span style="color: #00A000">+ "Currently active calls"</span>
<span style="color: #00A000">+ ::= { systemStats 5 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+sessionsPerSecond OBJECT-TYPE</span>
<span style="color: #00A000">+ SYNTAX Gauge32</span>
<span style="color: #00A000">+ MAX-ACCESS read-only</span>
<span style="color: #00A000">+ STATUS current</span>
<span style="color: #00A000">+ DESCRIPTION</span>
<span style="color: #00A000">+ "Current sessions per second"</span>
<span style="color: #00A000">+ ::= { systemStats 6 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+maxSessionsPerSecond OBJECT-TYPE</span>
<span style="color: #00A000">+ SYNTAX Gauge32</span>
<span style="color: #00A000">+ MAX-ACCESS read-only</span>
<span style="color: #00A000">+ STATUS current</span>
<span style="color: #00A000">+ DESCRIPTION</span>
<span style="color: #00A000">+ "Maximum permissible sessions per second"</span>
<span style="color: #00A000">+ ::= { systemStats 7 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+END</span>
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/event_handlers/mod_snmp/Makefile b/src/mod/event_handlers/mod_snmp/Makefile</span>
new file mode 100644
<span style="color: #000080; font-weight: bold">index 0000000..1d8827d</span>
<span style="color: #A00000">--- /dev/null</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_snmp/Makefile</span>
<span style="color: #800080; font-weight: bold">@@ -0,0 +1,7 @@</span>
<span style="color: #00A000">+include ../../../../build/modmake.rules</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+LOCAL_CFLAGS=-I `net-snmp-config --cflags`</span>
<span style="color: #00A000">+LOCAL_LDFLAGS=`net-snmp-config --agent-libs`</span>
<span style="color: #00A000">+LOCAL_OBJS=subagent.o</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+local_depend: $(LOCAL_OBJS)</span>
<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>
new file mode 100644
<span style="color: #000080; font-weight: bold">index 0000000..040e82b</span>
<span style="color: #A00000">--- /dev/null</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_snmp/mod_snmp.c</span>
<span style="color: #800080; font-weight: bold">@@ -0,0 +1,138 @@</span>
<span style="color: #00A000">+/* </span>
<span style="color: #00A000">+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application</span>
<span style="color: #00A000">+ * Copyright (C) 2005-2011, Anthony Minessale II <anthm@freeswitch.org></span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * Version: MPL 1.1</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * The contents of this file are subject to the Mozilla Public License Version</span>
<span style="color: #00A000">+ * 1.1 (the "License"); you may not use this file except in compliance with</span>
<span style="color: #00A000">+ * the License. You may obtain a copy of the License at</span>
<span style="color: #00A000">+ * http://www.mozilla.org/MPL/</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * Software distributed under the License is distributed on an "AS IS" basis,</span>
<span style="color: #00A000">+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License</span>
<span style="color: #00A000">+ * for the specific language governing rights and limitations under the</span>
<span style="color: #00A000">+ * License.</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * The Initial Developer of the Original Code is</span>
<span style="color: #00A000">+ * Anthony Minessale II <anthm@freeswitch.org></span>
<span style="color: #00A000">+ * Portions created by the Initial Developer are Copyright (C)</span>
<span style="color: #00A000">+ * the Initial Developer. All Rights Reserved.</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * Contributor(s):</span>
<span style="color: #00A000">+ * Daniel Swarbrick <daniel.swarbrick@seventhsignal.de></span>
<span style="color: #00A000">+ * Stefan Knoblich <s.knoblich@axsentis.de></span>
<span style="color: #00A000">+ * </span>
<span style="color: #00A000">+ * mod_snmp.c -- SNMP AgentX Subagent Module</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ */</span>
<span style="color: #00A000">+#include <switch.h></span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+#include <net-snmp/net-snmp-config.h></span>
<span style="color: #00A000">+#include <net-snmp/net-snmp-includes.h></span>
<span style="color: #00A000">+#include <net-snmp/agent/net-snmp-agent-includes.h></span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+#include "subagent.h"</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+static struct {</span>
<span style="color: #00A000">+        switch_memory_pool_t *pool;</span>
<span style="color: #00A000">+        int shutdown;</span>
<span style="color: #00A000">+} globals;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+SWITCH_MODULE_LOAD_FUNCTION(mod_snmp_load);</span>
<span style="color: #00A000">+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_snmp_shutdown);</span>
<span style="color: #00A000">+SWITCH_MODULE_RUNTIME_FUNCTION(mod_snmp_runtime);</span>
<span style="color: #00A000">+SWITCH_MODULE_DEFINITION(mod_snmp, mod_snmp_load, mod_snmp_shutdown, mod_snmp_runtime);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+static int snmp_callback_log(int major, int minor, void *serverarg, void *clientarg)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        struct snmp_log_message *slm = (struct snmp_log_message *) serverarg;</span>
<span style="color: #00A000">+        switch_log_printf(SWITCH_CHANNEL_LOG, slm->priority, "%s", slm->msg);</span>
<span style="color: #00A000">+        return SNMP_ERR_NOERROR;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+static switch_state_handler_table_t state_handlers = {</span>
<span style="color: #00A000">+        /*.on_init */ NULL,</span>
<span style="color: #00A000">+        /*.on_routing */ NULL,</span>
<span style="color: #00A000">+        /*.on_execute */ NULL,</span>
<span style="color: #00A000">+        /*.on_hangup */ NULL,</span>
<span style="color: #00A000">+        /*.on_exchange_media */ NULL,</span>
<span style="color: #00A000">+        /*.on_soft_execute */ NULL,</span>
<span style="color: #00A000">+        /*.on_consume_media */ NULL,</span>
<span style="color: #00A000">+        /*.on_hibernate */ NULL,</span>
<span style="color: #00A000">+        /*.on_reset */ NULL,</span>
<span style="color: #00A000">+        /*.on_park */ NULL,</span>
<span style="color: #00A000">+        /*.on_reporting */ NULL</span>
<span style="color: #00A000">+};</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+static switch_status_t load_config(switch_memory_pool_t *pool)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        switch_status_t status = SWITCH_STATUS_SUCCESS;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        memset(&globals, 0, sizeof(globals));</span>
<span style="color: #00A000">+        globals.pool = pool;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        return status;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+SWITCH_MODULE_LOAD_FUNCTION(mod_snmp_load)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        switch_status_t status = SWITCH_STATUS_SUCCESS;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        load_config(pool);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        switch_core_add_state_handler(&state_handlers);</span>
<span style="color: #00A000">+        *module_interface = switch_loadable_module_create_module_interface(pool, modname);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        /* Register callback function so we get Net-SNMP logging handled by FreeSWITCH */</span>
<span style="color: #00A000">+        snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_LOGGING, snmp_callback_log, NULL);</span>
<span style="color: #00A000">+        snmp_enable_calllog();</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DONT_PERSIST_STATE, 1);</span>
<span style="color: #00A000">+        netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE, 1);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        init_agent("mod_snmp");</span>
<span style="color: #00A000">+        init_subagent(); </span>
<span style="color: #00A000">+        init_snmp("mod_snmp");</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        return status;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+SWITCH_MODULE_RUNTIME_FUNCTION(mod_snmp_runtime)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        /* block on select() */</span>
<span style="color: #00A000">+        agent_check_and_process(1);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        return SWITCH_STATUS_SUCCESS;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_snmp_shutdown)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        globals.shutdown = 1;</span>
<span style="color: #00A000">+        switch_core_remove_state_handler(&state_handlers);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        snmp_shutdown("mod_snmp");</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        return SWITCH_STATUS_SUCCESS;</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">+/* For Emacs:</span>
<span style="color: #00A000">+ * Local Variables:</span>
<span style="color: #00A000">+ * mode:c</span>
<span style="color: #00A000">+ * indent-tabs-mode:t</span>
<span style="color: #00A000">+ * tab-width:4</span>
<span style="color: #00A000">+ * c-basic-offset:4</span>
<span style="color: #00A000">+ * End:</span>
<span style="color: #00A000">+ * For VIM:</span>
<span style="color: #00A000">+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4:</span>
<span style="color: #00A000">+ */</span>
<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>
new file mode 100644
<span style="color: #000080; font-weight: bold">index 0000000..8a9f2da</span>
<span style="color: #A00000">--- /dev/null</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_snmp/subagent.c</span>
<span style="color: #800080; font-weight: bold">@@ -0,0 +1,189 @@</span>
<span style="color: #00A000">+/* </span>
<span style="color: #00A000">+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application</span>
<span style="color: #00A000">+ * Copyright (C) 2005-2011, Anthony Minessale II <anthm@freeswitch.org></span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * Version: MPL 1.1</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * The contents of this file are subject to the Mozilla Public License Version</span>
<span style="color: #00A000">+ * 1.1 (the "License"); you may not use this file except in compliance with</span>
<span style="color: #00A000">+ * the License. You may obtain a copy of the License at</span>
<span style="color: #00A000">+ * http://www.mozilla.org/MPL/</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * Software distributed under the License is distributed on an "AS IS" basis,</span>
<span style="color: #00A000">+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License</span>
<span style="color: #00A000">+ * for the specific language governing rights and limitations under the</span>
<span style="color: #00A000">+ * License.</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * The Initial Developer of the Original Code is</span>
<span style="color: #00A000">+ * Anthony Minessale II <anthm@freeswitch.org></span>
<span style="color: #00A000">+ * Portions created by the Initial Developer are Copyright (C)</span>
<span style="color: #00A000">+ * the Initial Developer. All Rights Reserved.</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * Contributor(s):</span>
<span style="color: #00A000">+ * Daniel Swarbrick <daniel.swarbrick@seventhsignal.de></span>
<span style="color: #00A000">+ * Stefan Knoblich <s.knoblich@axsentis.de></span>
<span style="color: #00A000">+ * </span>
<span style="color: #00A000">+ * mod_snmp.c -- SNMP AgentX Subagent Module</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ */</span>
<span style="color: #00A000">+#include <switch.h></span>
<span style="color: #00A000">+#include <switch_version.h></span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+#include <net-snmp/net-snmp-config.h></span>
<span style="color: #00A000">+#include <net-snmp/net-snmp-includes.h></span>
<span style="color: #00A000">+#include <net-snmp/agent/net-snmp-agent-includes.h></span>
<span style="color: #00A000">+#include "subagent.h"</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</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">+/* identity sub-IDs - these must match MIB */</span>
<span style="color: #00A000">+enum {</span>
<span style="color: #00A000">+        versionString_oid = 1,</span>
<span style="color: #00A000">+        uuid_oid</span>
<span style="color: #00A000">+};</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+/* systemStats sub-IDs - these must match MIB */</span>
<span style="color: #00A000">+enum {</span>
<span style="color: #00A000">+        uptime_oid = 1,</span>
<span style="color: #00A000">+        sessionsSinceStartup_oid,</span>
<span style="color: #00A000">+        currentSessions_oid,</span>
<span style="color: #00A000">+        maxSessions_oid,</span>
<span style="color: #00A000">+        currentCalls_oid,</span>
<span style="color: #00A000">+        sessionsPerSecond_oid,</span>
<span style="color: #00A000">+        maxSessionsPerSecond_oid</span>
<span style="color: #00A000">+};</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+void init_subagent(void)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        DEBUGMSGTL(("init_nstAgentSubagentObject", "Initializing\n"));</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        netsnmp_register_handler(netsnmp_create_handler_registration("identity", handle_identity, identity_oid, OID_LENGTH(identity_oid), HANDLER_CAN_RONLY));</span>
<span style="color: #00A000">+        netsnmp_register_handler(netsnmp_create_handler_registration("systemStats", handle_systemStats, systemStats_oid, OID_LENGTH(systemStats_oid), HANDLER_CAN_RONLY));</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+int handle_identity(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        static char const version[] = SWITCH_VERSION_FULL;</span>
<span style="color: #00A000">+        char uuid[40] = "";</span>
<span style="color: #00A000">+        netsnmp_request_info *request = NULL;</span>
<span style="color: #00A000">+        oid subid;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        switch(reqinfo->mode) {</span>
<span style="color: #00A000">+                case MODE_GET:</span>
<span style="color: #00A000">+                        for (request = requests; request; request = request->next) {</span>
<span style="color: #00A000">+                                subid = request->requestvb->name[OID_LENGTH(systemStats_oid)];</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->requestvb, ASN_OCTET_STR, (u_char *) &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->requestvb, ASN_OCTET_STR, (u_char *) &uuid, strlen(uuid));</span>
<span style="color: #00A000">+                                                break;</span>
<span style="color: #00A000">+                                        default:</span>
<span style="color: #00A000">+                                                snmp_log(LOG_WARNING, "Unregistered OID-suffix requested (%d)\n", (int) subid);</span>
<span style="color: #00A000">+                                                netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);</span>
<span style="color: #00A000">+                                }</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+                        break;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                case MODE_GETNEXT:</span>
<span style="color: #00A000">+                        snmp_log(LOG_ERR, "MODE_GETNEXT not supported (yet)\n");</span>
<span style="color: #00A000">+                        break;</span>
<span style="color: #00A000">+</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, "Unknown mode (%d) in handle_versionString\n", reqinfo->mode );</span>
<span style="color: #00A000">+                        return SNMP_ERR_GENERR;</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        return SNMP_ERR_NOERROR;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+int handle_systemStats(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        netsnmp_request_info *request = NULL;</span>
<span style="color: #00A000">+        oid subid;</span>
<span style="color: #00A000">+        switch_time_t uptime;</span>
<span style="color: #00A000">+        uint32_t int_val;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        switch(reqinfo->mode) {</span>
<span style="color: #00A000">+                case MODE_GET:</span>
<span style="color: #00A000">+                        for (request = requests; request; request = request->next) {</span>
<span style="color: #00A000">+                                subid = request->requestvb->name[OID_LENGTH(systemStats_oid)];</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->requestvb, ASN_TIMETICKS, (u_char *) &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->requestvb, ASN_COUNTER, (u_char *) &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->requestvb, ASN_GAUGE, (u_char *) &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, &int_val);;</span>
<span style="color: #00A000">+                                                snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &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->requestvb, ASN_GAUGE, (u_char *) &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, &int_val);</span>
<span style="color: #00A000">+                                                snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &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, &int_val);</span>
<span style="color: #00A000">+                                                snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &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, "Unregistered OID-suffix requested (%d)\n", (int) subid);</span>
<span style="color: #00A000">+                                                netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);</span>
<span style="color: #00A000">+                                }</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+                        break;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                case MODE_GETNEXT:</span>
<span style="color: #00A000">+                        snmp_log(LOG_ERR, "MODE_GETNEXT not supported (yet)\n");</span>
<span style="color: #00A000">+                        break;</span>
<span style="color: #00A000">+</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, "Unknown mode (%d) in handle_systemStats\n", reqinfo->mode);</span>
<span style="color: #00A000">+                        return SNMP_ERR_GENERR;</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        return SNMP_ERR_NOERROR;</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">+/* For Emacs:</span>
<span style="color: #00A000">+ * Local Variables:</span>
<span style="color: #00A000">+ * mode:c</span>
<span style="color: #00A000">+ * indent-tabs-mode:t</span>
<span style="color: #00A000">+ * tab-width:4</span>
<span style="color: #00A000">+ * c-basic-offset:4</span>
<span style="color: #00A000">+ * End:</span>
<span style="color: #00A000">+ * For VIM:</span>
<span style="color: #00A000">+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4:</span>
<span style="color: #00A000">+ */</span>
<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>
new file mode 100644
<span style="color: #000080; font-weight: bold">index 0000000..8a57d8a</span>
<span style="color: #A00000">--- /dev/null</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_snmp/subagent.h</span>
<span style="color: #800080; font-weight: bold">@@ -0,0 +1,8 @@</span>
<span style="color: #00A000">+#ifndef subagent_H</span>
<span style="color: #00A000">+#define subagent_H</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+void init_subagent(void);</span>
<span style="color: #00A000">+Netsnmp_Node_Handler handle_identity;</span>
<span style="color: #00A000">+Netsnmp_Node_Handler handle_systemStats;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+#endif /* subagent_H */</span>
</pre></div>
<div class="highlight"><pre>committer: Mathieu Rene
comments:
Tricky preprocessor... try again
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/formats/mod_shout/mod_shout.c b/src/mod/formats/mod_shout/mod_shout.c</span>
<span style="color: #000080; font-weight: bold">index 0b73c66..377cfe5 100644</span>
<span style="color: #A00000">--- a/src/mod/formats/mod_shout/mod_shout.c</span>
<span style="color: #00A000">+++ b/src/mod/formats/mod_shout/mod_shout.c</span>
<span style="color: #800080; font-weight: bold">@@ -584,8 +584,11 @@ static void launch_write_stream_thread(shout_context_t *context)</span>
}
#define TC_BUFFER_SIZE 1024 * 32
<span style="color: #A00000">-#define STR(_x) #_x</span>
<span style="color: #A00000">-#define MPGERROR() {err = "MPG123 Error at " __FILE__ ":" STR(__LINE__) "."; mpg123err = mpg123_strerror(context->mh); goto error; }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+#define CONCAT_LOCATION(_x,_y) _x ":" #_y</span>
<span style="color: #00A000">+#define MAKE_LOCATION(_x,_y) CONCAT_LOCATION(_x,_y)</span>
<span style="color: #00A000">+#define HERE MAKE_LOCATION(__FILE__, __LINE__)</span>
<span style="color: #00A000">+#define MPGERROR() {err = "MPG123 Error at " HERE "."; mpg123err = mpg123_strerror(context->mh); goto error; }</span>
static switch_status_t shout_file_open(switch_file_handle_t *handle, const char *path)
{
        shout_context_t *context;
</pre></div>
<div class="highlight"><pre>committer: Mathieu Rene
comments:
extra spaces </ocd>
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/formats/mod_shout/mod_shout.c b/src/mod/formats/mod_shout/mod_shout.c</span>
<span style="color: #000080; font-weight: bold">index 1542be4..0b73c66 100644</span>
<span style="color: #A00000">--- a/src/mod/formats/mod_shout/mod_shout.c</span>
<span style="color: #00A000">+++ b/src/mod/formats/mod_shout/mod_shout.c</span>
<span style="color: #800080; font-weight: bold">@@ -585,7 +585,7 @@ static void launch_write_stream_thread(shout_context_t *context)</span>
#define TC_BUFFER_SIZE 1024 * 32
#define STR(_x) #_x
<span style="color: #A00000">-#define MPGERROR() {err = "MPG123 Error at " __FILE__ " : " STR(__LINE__) "."; mpg123err = mpg123_strerror(context->mh); goto error; }</span>
<span style="color: #00A000">+#define MPGERROR() {err = "MPG123 Error at " __FILE__ ":" STR(__LINE__) "."; mpg123err = mpg123_strerror(context->mh); goto error; }</span>
static switch_status_t shout_file_open(switch_file_handle_t *handle, const char *path)
{
        shout_context_t *context;
</pre></div>
<div class="highlight"><pre>committer: Mathieu Rene
comments:
FS-2942 - At least display __FILE__ and __LINE__ properly so we can have more data
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/formats/mod_shout/mod_shout.c b/src/mod/formats/mod_shout/mod_shout.c</span>
<span style="color: #000080; font-weight: bold">index a4965c4..1542be4 100644</span>
<span style="color: #A00000">--- a/src/mod/formats/mod_shout/mod_shout.c</span>
<span style="color: #00A000">+++ b/src/mod/formats/mod_shout/mod_shout.c</span>
<span style="color: #800080; font-weight: bold">@@ -584,7 +584,8 @@ static void launch_write_stream_thread(shout_context_t *context)</span>
}
#define TC_BUFFER_SIZE 1024 * 32
<span style="color: #A00000">-#define MPGERROR() {err = "MPG123 Error at __FILE__:__LINE__."; mpg123err = mpg123_strerror(context->mh); goto error; }</span>
<span style="color: #00A000">+#define STR(_x) #_x</span>
<span style="color: #00A000">+#define MPGERROR() {err = "MPG123 Error at " __FILE__ " : " STR(__LINE__) "."; mpg123err = mpg123_strerror(context->mh); goto error; }</span>
static switch_status_t shout_file_open(switch_file_handle_t *handle, const char *path)
{
        shout_context_t *context;
</pre></div>
<div class="highlight"><pre>committer: Moises Silva
comments:
freetdm: added threaded media to the TODO
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/TODO b/libs/freetdm/TODO</span>
<span style="color: #000080; font-weight: bold">index 6b8ef8f..6b4cf71 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/TODO</span>
<span style="color: #00A000">+++ b/libs/freetdm/TODO</span>
<span style="color: #800080; font-weight: bold">@@ -11,3 +11,12 @@</span>
cannot be shown to end users, we already provide extensive logging for problem
troubleshooting.
<span style="color: #00A000">+- Implement threaded IO.</span>
<span style="color: #00A000">+ Currently IO modules only work on-demand, where the user (ie, FreeSWITCH) drives the read/write</span>
<span style="color: #00A000">+ of media. If the user stops reading, some functions are not possible </span>
<span style="color: #00A000">+ (DTMF detection or Hangup tone detection). It would be useful to implement a FreeTDM mode</span>
<span style="color: #00A000">+ where the media is driven by a group of threads that are always reading (and possibly writing)</span>
<span style="color: #00A000">+ then when the user does ftdm_channel_read(), the media would be read from the buffers filled</span>
<span style="color: #00A000">+ by the media thread and not from the underlying IO device, this gives a chance to FreeTDM to</span>
<span style="color: #00A000">+ still perform hangup detection or other media services even if the application is not reading.</span>
<span style="color: #00A000">+</span>
</pre></div>
<div class="highlight"><pre>committer: Jeff Lenk
comments:
FS-2973 Fix possible segfaults and memory leak during unload, and add new setting odbc-retries
<span style="color: #000080; font-weight: bold">diff --git a/conf/autoload_configs/easyroute.conf.xml b/conf/autoload_configs/easyroute.conf.xml</span>
<span style="color: #000080; font-weight: bold">index 7cd4909..350a509 100644</span>
<span style="color: #A00000">--- a/conf/autoload_configs/easyroute.conf.xml</span>
<span style="color: #00A000">+++ b/conf/autoload_configs/easyroute.conf.xml</span>
<span style="color: #800080; font-weight: bold">@@ -11,6 +11,9 @@</span>
<!-- IP or Hostname of Default Route -->
<param name="default-gateway" value="192.168.66.6"/>
<span style="color: #00A000">+ <!-- Number of times to retry ODBC connection on connection problems, default is 120 --></span>
<span style="color: #00A000">+ <param name="odbc-retries" value="120"/></span>
<span style="color: #00A000">+</span>
<!-- Customer Query. Use this with Care!!! We are not responsible if you mess
This up!!! Query *MUST* return columns in the following order!
         gateway varchar(128) - contains destination gateway host:port pair (ex: 192.168.1.1:5060 )
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/applications/mod_easyroute/mod_easyroute.c b/src/mod/applications/mod_easyroute/mod_easyroute.c</span>
<span style="color: #000080; font-weight: bold">index 481df95..75b4712 100644</span>
<span style="color: #A00000">--- a/src/mod/applications/mod_easyroute/mod_easyroute.c</span>
<span style="color: #00A000">+++ b/src/mod/applications/mod_easyroute/mod_easyroute.c</span>
<span style="color: #800080; font-weight: bold">@@ -65,6 +65,7 @@ static struct {</span>
        switch_mutex_t *mutex;
        char *custom_query;
        switch_odbc_handle_t *master_odbc;
<span style="color: #00A000">+        int odbc_num_retries;</span>
} globals;
SWITCH_MODULE_LOAD_FUNCTION(mod_easyroute_load);
<span style="color: #800080; font-weight: bold">@@ -120,6 +121,8 @@ static switch_status_t load_config(void)</span>
                                set_global_default_gateway(val);
                        } else if (!strcasecmp(var, "custom-query")) {
                                set_global_custom_query(val);
<span style="color: #00A000">+                        } else if (!strcasecmp(var, "odbc-retries")) {</span>
<span style="color: #00A000">+                                globals.odbc_num_retries = atoi(val);</span>
                        }
                }
        }
<span style="color: #800080; font-weight: bold">@@ -143,6 +146,9 @@ static switch_status_t load_config(void)</span>
                } else {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Opened ODBC Database!\n");
                }
<span style="color: #00A000">+                if (globals.odbc_num_retries) {</span>
<span style="color: #00A000">+                        switch_odbc_set_num_retries(globals.master_odbc, globals.odbc_num_retries);</span>
<span style="color: #00A000">+                }</span>
                if (switch_odbc_handle_connect(globals.master_odbc) != SWITCH_ODBC_SUCCESS) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot Open ODBC Database!\n");
                        status = SWITCH_STATUS_FALSE;
<span style="color: #800080; font-weight: bold">@@ -205,7 +211,7 @@ static switch_status_t route_lookup(char *dn, easyroute_results_t *results, int</span>
                switch_mutex_lock(globals.mutex);
        }
        /* Do the Query */
<span style="color: #A00000">-        if (switch_odbc_handle_callback_exec(globals.master_odbc, sql, route_callback, &pdata, NULL) == SWITCH_ODBC_SUCCESS) {</span>
<span style="color: #00A000">+        if (globals.master_odbc && switch_odbc_handle_callback_exec(globals.master_odbc, sql, route_callback, &pdata, NULL) == SWITCH_ODBC_SUCCESS) {</span>
                char tmp_profile[129];
                char tmp_gateway[129];
<span style="color: #800080; font-weight: bold">@@ -418,7 +424,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_easyroute_load)</span>
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_easyroute_shutdown)
{
<span style="color: #A00000">-        switch_odbc_handle_disconnect(globals.master_odbc);</span>
<span style="color: #00A000">+        if (globals.master_odbc) {</span>
<span style="color: #00A000">+                switch_odbc_handle_disconnect(globals.master_odbc);</span>
<span style="color: #00A000">+                switch_odbc_handle_destroy(&globals.master_odbc);</span>
<span style="color: #00A000">+        }</span>
        switch_safe_free(globals.db_username);
        switch_safe_free(globals.db_password);
        switch_safe_free(globals.db_dsn);
</pre></div>
<div class="highlight"><pre>committer: Joao Mesquita
comments:
Export the variables to the b leg as well
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c</span>
<span style="color: #000080; font-weight: bold">index 4141725..5a3be03 100755</span>
<span style="color: #A00000">--- a/src/mod/applications/mod_dptools/mod_dptools.c</span>
<span style="color: #00A000">+++ b/src/mod/applications/mod_dptools/mod_dptools.c</span>
<span style="color: #800080; font-weight: bold">@@ -2982,6 +2982,8 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,</span>
                        }
                }
        }
<span style="color: #00A000">+ switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "dialed_user", user);</span>
<span style="color: #00A000">+ switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "dialed_domain", domain);</span>
        if (!dest) {
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No dial-string available, please check your user directory.\n");
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
D'oh Over zealous packet eating
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_rtp.c b/src/switch_rtp.c</span>
<span style="color: #000080; font-weight: bold">index 4e5450d..3ce7a07 100644</span>
<span style="color: #A00000">--- a/src/switch_rtp.c</span>
<span style="color: #00A000">+++ b/src/switch_rtp.c</span>
<span style="color: #800080; font-weight: bold">@@ -2494,7 +2494,8 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_</span>
                        }
                }
<span style="color: #A00000">-                if (rtp_session->recv_msg.header.pt != 13 && </span>
<span style="color: #00A000">+                if (bytes && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA) && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_UDPTL) &&</span>
<span style="color: #00A000">+                        rtp_session->recv_msg.header.pt != 13 && </span>
                        rtp_session->recv_msg.header.pt != rtp_session->recv_te &&
                        (!rtp_session->cng_pt || rtp_session->recv_msg.header.pt != rtp_session->cng_pt) &&
                        rtp_session->recv_msg.header.pt != rtp_session->payload) {
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
add execute_on_originate var '<app> <arg>' to run in origination thread or '<app>::<arg>' to run async. also originating_leg_uuid variable to show the uuid of the originating leg on an outbound channel
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c</span>
<span style="color: #000080; font-weight: bold">index d156c70..78743e6 100644</span>
<span style="color: #A00000">--- a/src/switch_ivr_originate.c</span>
<span style="color: #00A000">+++ b/src/switch_ivr_originate.c</span>
<span style="color: #800080; font-weight: bold">@@ -2755,6 +2755,26 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess</span>
                                                        }
                                                }
                                        }
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                                        if (session) {</span>
<span style="color: #00A000">+                                                switch_channel_set_variable(originate_status[i].peer_channel, "originating_leg_uuid", switch_core_session_get_uuid(session));</span>
<span style="color: #00A000">+                                        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                                        if ((vvar = switch_channel_get_variable_dup(originate_status[i].peer_channel, "execute_on_originate", SWITCH_FALSE))) {</span>
<span style="color: #00A000">+                                                char *app = switch_core_session_strdup(originate_status[i].peer_session, vvar);</span>
<span style="color: #00A000">+                                                char *arg = NULL;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                                                if (strstr(app, "::")) {</span>
<span style="color: #00A000">+                                                        switch_core_session_execute_application_async(originate_status[i].peer_session, app, arg);</span>
<span style="color: #00A000">+                                                } else {</span>
<span style="color: #00A000">+                                                        if ((arg = strchr(app, ' '))) {</span>
<span style="color: #00A000">+                                                                *arg++ = '\0';</span>
<span style="color: #00A000">+                                                        }</span>
<span style="color: #00A000">+                                                        </span>
<span style="color: #00A000">+                                                        switch_core_session_execute_application(originate_status[i].peer_session, app, arg);</span>
<span style="color: #00A000">+                                                }</span>
<span style="color: #00A000">+                                                </span>
<span style="color: #00A000">+                                        }</span>
                                }
                                if (table) {
<span style="color: #800080; font-weight: bold">@@ -2773,7 +2793,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess</span>
                                        *cause = SWITCH_CAUSE_SUCCESS;
                                        goto outer_for;
                                }
<span style="color: #A00000">-</span>
<span style="color: #00A000">+                                </span>
                                if (!switch_core_session_running(originate_status[i].peer_session)) {
                                        if (originate_status[i].per_channel_delay_start) {
                                                switch_channel_set_flag(originate_status[i].peer_channel, CF_BLOCK_STATE);
</pre></div>
<div class="highlight"><pre>committer: David Yat Sin
comments:
freetdm: Fix for defaulting to wrong codec
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c</span>
<span style="color: #000080; font-weight: bold">index afba96a..bd5b13b 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c</span>
<span style="color: #00A000">+++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c</span>
<span style="color: #800080; font-weight: bold">@@ -389,10 +389,11 @@ ftdm_status_t ftmod_isdn_parse_cfg(ftdm_conf_parameter_t *ftdm_parameters, ftdm_</span>
        }
        if (span->default_caller_data.bearer_layer1 == FTDM_INVALID_INT_PARM) {
<span style="color: #A00000">-                if (signal_data->switchtype == SNGISDN_SWITCH_EUROISDN) {</span>
<span style="color: #A00000">-                        span->default_caller_data.bearer_layer1 = IN_UIL1_G711ULAW;</span>
<span style="color: #A00000">-                } else {</span>
<span style="color: #00A000">+                if (signal_data->switchtype == SNGISDN_SWITCH_EUROISDN ||</span>
<span style="color: #00A000">+                        signal_data->switchtype == SNGISDN_SWITCH_QSIG) {</span>
                        span->default_caller_data.bearer_layer1 = IN_UIL1_G711ALAW;
<span style="color: #00A000">+                } else {</span>
<span style="color: #00A000">+                        span->default_caller_data.bearer_layer1 = IN_UIL1_G711ULAW;</span>
                }
        }
        return FTDM_SUCCESS;
</pre></div>
<div class="highlight"><pre>committer: David Yat Sin
comments:
freetdm: added support for early-media-override
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.c</span>
<span style="color: #000080; font-weight: bold">index e7053c1..df528ae 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.c</span>
<span style="color: #00A000">+++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.c</span>
<span style="color: #800080; font-weight: bold">@@ -676,6 +676,9 @@ static ftdm_status_t ftdm_sangoma_isdn_process_state_change(ftdm_channel_t *ftdm</span>
                                /*OUTBOUND...so we were told by the line of this so noifiy the user*/
                                sigev.event_id = FTDM_SIGEVENT_PROCEED;
                                ftdm_span_send_signal(ftdmchan->span, &sigev);
<span style="color: #00A000">+                                if (sngisdn_test_flag(sngisdn_info, FLAG_MEDIA_READY)) {</span>
<span style="color: #00A000">+                                        ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_PROGRESS_MEDIA);</span>
<span style="color: #00A000">+                                }</span>
                        } else {
                                if (!sngisdn_test_flag(sngisdn_info, FLAG_SENT_PROCEED)) {
                                        /* By default, we do not send a progress indicator in the proceed */
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h</span>
<span style="color: #000080; font-weight: bold">index 58fcc07..80dc73f 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h</span>
<span style="color: #00A000">+++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h</span>
<span style="color: #800080; font-weight: bold">@@ -112,6 +112,11 @@ typedef enum {</span>
        SNGISDN_OPT_FALSE = 2,
} sngisdn_opt_t;
<span style="color: #00A000">+typedef enum {</span>
<span style="color: #00A000">+        SNGISDN_EARLY_MEDIA_ON_PROCEED = (1 << 0),</span>
<span style="color: #00A000">+        SNGISDN_EARLY_MEDIA_ON_PROGRESS = (1 << 1),</span>
<span style="color: #00A000">+        SNGISDN_EARLY_MEDIA_ON_ALERT= (1 << 2),</span>
<span style="color: #00A000">+} sngisdn_early_media_opt_t;</span>
typedef enum {
        SNGISDN_AVAIL_DOWN = 1,
<span style="color: #800080; font-weight: bold">@@ -188,7 +193,8 @@ typedef struct sngisdn_span_data {</span>
        uint8_t                 span_id;
        uint8_t                        tei;
        uint8_t                        min_digits;
<span style="color: #A00000">-        uint8_t                        trace_flags;                /* TODO: change to flags, so we can use ftdm_test_flag etc.. */</span>
<span style="color: #00A000">+        uint8_t                        trace_flags;                /* TODO change to bit map of sngisdn_tracetype_t */</span>
<span style="color: #00A000">+        uint8_t                        early_media_flags;        /* bit map of ftdm_sngisdn_early_media_opt_t */</span>
        uint8_t                        overlap_dial;
        uint8_t                        setup_arb;
        uint8_t                        facility_ie_decode;
<span style="color: #800080; font-weight: bold">@@ -196,10 +202,10 @@ typedef struct sngisdn_span_data {</span>
        int8_t                        facility_timeout;
        uint8_t                        num_local_numbers;
        uint8_t                 ignore_cause_value;
<span style="color: #A00000">-        uint8_t                        raw_trace_q931;</span>
<span style="color: #A00000">-        uint8_t                        raw_trace_q921;</span>
<span style="color: #00A000">+        uint8_t                        raw_trace_q931; /* TODO: combine with trace_flags */</span>
<span style="color: #00A000">+        uint8_t                        raw_trace_q921; /* TODO: combine with trace_flags */</span>
        uint8_t                        timer_t3;
<span style="color: #A00000">-        uint8_t                        restart_opt;</span>
<span style="color: #00A000">+        uint8_t                        restart_opt;        </span>
        char*                        local_numbers[SNGISDN_NUM_LOCAL_NUMBERS];
        ftdm_sched_t         *sched;
        ftdm_queue_t         *event_queue;
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c</span>
<span style="color: #000080; font-weight: bold">index aad68e1..afba96a 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c</span>
<span style="color: #00A000">+++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c</span>
<span style="color: #800080; font-weight: bold">@@ -192,6 +192,24 @@ static ftdm_status_t parse_signalling(const char* signalling, ftdm_span_t *span)</span>
        return FTDM_SUCCESS;
}
<span style="color: #00A000">+static ftdm_status_t parse_early_media(const char* opt, ftdm_span_t *span)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) span->signal_data;</span>
<span style="color: #00A000">+        if (!strcasecmp(opt, "on-proceed")) {</span>
<span style="color: #00A000">+                signal_data->early_media_flags |= SNGISDN_EARLY_MEDIA_ON_PROCEED;</span>
<span style="color: #00A000">+        } else if (!strcasecmp(opt, "on-progress")) {</span>
<span style="color: #00A000">+                signal_data->early_media_flags |= SNGISDN_EARLY_MEDIA_ON_PROGRESS;</span>
<span style="color: #00A000">+        } else if (!strcasecmp(opt, "on-alert")) {</span>
<span style="color: #00A000">+                signal_data->early_media_flags |= SNGISDN_EARLY_MEDIA_ON_ALERT;</span>
<span style="color: #00A000">+        } else {</span>
<span style="color: #00A000">+                ftdm_log(FTDM_LOG_ERROR, "Unsupported early-media option %s\n", opt);</span>
<span style="color: #00A000">+                return FTDM_FAIL;</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+        ftdm_log(FTDM_LOG_DEBUG, "Early media opt:0x%x\n", signal_data->early_media_flags);</span>
<span style="color: #00A000">+        return FTDM_SUCCESS;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
static ftdm_status_t set_switchtype_defaults(ftdm_span_t *span)
{
        sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) span->signal_data;
<span style="color: #800080; font-weight: bold">@@ -249,6 +267,7 @@ static ftdm_status_t set_switchtype_defaults(ftdm_span_t *span)</span>
        return FTDM_SUCCESS;
}
<span style="color: #00A000">+</span>
ftdm_status_t ftmod_isdn_parse_cfg(ftdm_conf_parameter_t *ftdm_parameters, ftdm_span_t *span)
{
        unsigned paramindex;
<span style="color: #800080; font-weight: bold">@@ -351,10 +370,14 @@ ftdm_status_t ftmod_isdn_parse_cfg(ftdm_conf_parameter_t *ftdm_parameters, ftdm_</span>
                        parse_yesno(var, val, &signal_data->raw_trace_q931);
                } else if (!strcasecmp(var, "q921-raw-trace")) {
                        parse_yesno(var, val, &signal_data->raw_trace_q921);
<span style="color: #00A000">+                } else if (!strcasecmp(var, "early-media-override")) {</span>
<span style="color: #00A000">+                        if (parse_early_media(val, span) != FTDM_SUCCESS) {</span>
<span style="color: #00A000">+                                return FTDM_FAIL;</span>
<span style="color: #00A000">+                        }</span>
                } else {
                        ftdm_log(FTDM_LOG_WARNING, "Ignoring unknown parameter %s\n", ftdm_parameters[paramindex].var);
                }
<span style="color: #A00000">-        }</span>
<span style="color: #00A000">+        } /* for (paramindex = 0; ftdm_parameters[paramindex].var; paramindex++) */</span>
        
        if (signal_data->switchtype == SNGISDN_SWITCH_INVALID) {
                ftdm_log(FTDM_LOG_ERROR, "%s: switchtype not specified", span->name);
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_hndl.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_hndl.c</span>
<span style="color: #000080; font-weight: bold">index 7b7c748..0b52011 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_hndl.c</span>
<span style="color: #00A000">+++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_hndl.c</span>
<span style="color: #800080; font-weight: bold">@@ -167,12 +167,12 @@ void sngisdn_process_con_ind (sngisdn_event_data_t *sngisdn_event)</span>
                                char retrieved_str[255];
                                ret_val = sng_isdn_retrieve_facility_caller_name(conEvnt->facilityStr.facilityStr.val, conEvnt->facilityStr.facilityStr.len, retrieved_str);
<span style="color: #A00000">- /*</span>
<span style="color: #A00000">- return values for "sng_isdn_retrieve_facility_information_following":</span>
<span style="color: #A00000">-                                If there will be no information following, or fails to decode IE, returns -1</span>
<span style="color: #A00000">-                                If there will be no information following, but current FACILITY IE contains a caller name, returns 0</span>
<span style="color: #A00000">-                                If there will be information following, returns 1</span>
<span style="color: #A00000">-                                                                                */</span>
<span style="color: #00A000">+                                /*</span>
<span style="color: #00A000">+                                        return values for "sng_isdn_retrieve_facility_information_following":</span>
<span style="color: #00A000">+                                        If there will be no information following, or fails to decode IE, returns -1</span>
<span style="color: #00A000">+                                        If there will be no information following, but current FACILITY IE contains a caller name, returns 0</span>
<span style="color: #00A000">+                                        If there will be information following, returns 1</span>
<span style="color: #00A000">+                                */</span>
                                if (ret_val == 1) {
                                        ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Expecting Caller name in FACILITY\n");
<span style="color: #800080; font-weight: bold">@@ -346,6 +346,7 @@ void sngisdn_process_cnst_ind (sngisdn_event_data_t *sngisdn_event)</span>
        
        sngisdn_chan_data_t *sngisdn_info = sngisdn_event->sngisdn_info;
        ftdm_channel_t *ftdmchan = sngisdn_info->ftdmchan;
<span style="color: #00A000">+        sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) ftdmchan->span->signal_data;</span>
        
        CnStEvnt *cnStEvnt = &sngisdn_event->event.cnStEvnt;
<span style="color: #800080; font-weight: bold">@@ -384,7 +385,7 @@ void sngisdn_process_cnst_ind (sngisdn_event_data_t *sngisdn_event)</span>
                                case FTDM_CHANNEL_STATE_DIALING:
                                case FTDM_CHANNEL_STATE_PROCEED:
                                case FTDM_CHANNEL_STATE_PROGRESS:
<span style="color: #A00000">-                                case FTDM_CHANNEL_STATE_RINGING:</span>
<span style="color: #00A000">+                                case FTDM_CHANNEL_STATE_RINGING:                                        </span>
                                        if (cnStEvnt->progInd.eh.pres && cnStEvnt->progInd.progDesc.val == IN_PD_IBAVAIL) {
                                                ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Early media available\n");
                                                sngisdn_set_flag(sngisdn_info, FLAG_MEDIA_READY);
<span style="color: #800080; font-weight: bold">@@ -393,16 +394,34 @@ void sngisdn_process_cnst_ind (sngisdn_event_data_t *sngisdn_event)</span>
                                        }
                                        switch (evntType) {
                                                case MI_CALLPROC:
<span style="color: #00A000">+                                                        if (!sngisdn_test_flag(sngisdn_info, FLAG_MEDIA_READY) &&</span>
<span style="color: #00A000">+                                                                (signal_data->early_media_flags & SNGISDN_EARLY_MEDIA_ON_PROCEED)) {</span>
<span style="color: #00A000">+                                                                </span>
<span style="color: #00A000">+                                                                ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Early media override on proceed\n");</span>
<span style="color: #00A000">+                                                                sngisdn_set_flag(sngisdn_info, FLAG_MEDIA_READY);</span>
<span style="color: #00A000">+                                                        }</span>
                                                        if (ftdmchan->state == FTDM_CHANNEL_STATE_DIALING) {
                                                                ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_PROCEED);
                                                        }
                                                        break;
                                                case MI_ALERTING:
<span style="color: #00A000">+                                                        if (!sngisdn_test_flag(sngisdn_info, FLAG_MEDIA_READY) &&</span>
<span style="color: #00A000">+                                                                (signal_data->early_media_flags & SNGISDN_EARLY_MEDIA_ON_ALERT)) {</span>
<span style="color: #00A000">+                                                                </span>
<span style="color: #00A000">+                                                                ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Early media override on alert\n");</span>
<span style="color: #00A000">+                                                                sngisdn_set_flag(sngisdn_info, FLAG_MEDIA_READY);</span>
<span style="color: #00A000">+                                                        }</span>
                                                        if (ftdmchan->state == FTDM_CHANNEL_STATE_PROCEED) {
                                                                ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_RINGING);
                                                        }
                                                        break;
                                                case MI_PROGRESS:
<span style="color: #00A000">+                                                        if (!sngisdn_test_flag(sngisdn_info, FLAG_MEDIA_READY) &&</span>
<span style="color: #00A000">+                                                                (signal_data->early_media_flags & SNGISDN_EARLY_MEDIA_ON_PROGRESS)) {</span>
<span style="color: #00A000">+                                                                </span>
<span style="color: #00A000">+                                                                ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Early media override on progress\n");</span>
<span style="color: #00A000">+                                                                sngisdn_set_flag(sngisdn_info, FLAG_MEDIA_READY);</span>
<span style="color: #00A000">+                                                        }</span>
                                                        if (sngisdn_test_flag(sngisdn_info, FLAG_MEDIA_READY)) {
                                                                ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_PROGRESS_MEDIA);
                                                        } else if (ftdmchan->state != FTDM_CHANNEL_STATE_PROGRESS) {
</pre></div>
<div class="highlight"><pre>committer: David Yat Sin
comments:
Merge branch 'master' of git.freeswitch.org:freeswitch
</pre></div>
<div class="highlight"><pre>committer: David Yat Sin
comments:
freetdm - improved default bearer-cap code
<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 9c1b7ba..64147b7 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">@@ -881,18 +881,27 @@ ftdm_status_t set_bear_cap_ie(ftdm_channel_t *ftdmchan, BearCap *bearCap)</span>
                bearCap->usrInfoLyr1Prot.pres = PRSNT_NODEF;
                bearCap->usrInfoLyr1Prot.val = sngisdn_get_usrInfoLyr1Prot_from_user(ftdmchan->caller_data.bearer_layer1);
<span style="color: #A00000">-                if (signal_data->switchtype == SNGISDN_SWITCH_EUROISDN &&</span>
<span style="color: #A00000">-                        bearCap->usrInfoLyr1Prot.val == IN_UIL1_G711ULAW) {</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                        /* We are bridging a call from T1 */</span>
<span style="color: #A00000">-                        bearCap->usrInfoLyr1Prot.val = IN_UIL1_G711ALAW;</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                } else if (bearCap->usrInfoLyr1Prot.val == IN_UIL1_G711ALAW) {</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                        /* We are bridging a call from E1 */</span>
<span style="color: #A00000">-                        bearCap->usrInfoLyr1Prot.val = IN_UIL1_G711ULAW;</span>
<span style="color: #00A000">+                switch (signal_data->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->usrInfoLyr1Prot.val == IN_UIL1_G711ALAW) {</span>
<span style="color: #00A000">+                                        ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Overriding bearer cap to u-law\n");</span>
<span style="color: #00A000">+                                        bearCap->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->usrInfoLyr1Prot.val == IN_UIL1_G711ULAW) {</span>
<span style="color: #00A000">+                                        ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Overriding bearer cap to a-law\n");</span>
<span style="color: #00A000">+                                        bearCap->usrInfoLyr1Prot.val = IN_UIL1_G711ALAW;</span>
<span style="color: #00A000">+                                }</span>
<span style="color: #00A000">+                                break;</span>
                }
<span style="color: #00A000">+                </span>
                bearCap->lyr1Ident.pres = PRSNT_NODEF;
                bearCap->lyr1Ident.val = IN_L1_IDENT;
        }
</pre></div>
========================================================================<pre>
Summary of changes:
.gitignore | 7 +-
Makefile.am | 2 +-
build/modules.conf.in | 1 +
conf/autoload_configs/easyroute.conf.xml | 3 +
conf/autoload_configs/modules.conf.xml | 1 +
libs/freetdm/TODO | 9 +
libs/freetdm/msvc/freetdm.2010.vcxproj | 2 +
libs/freetdm/msvc/freetdm.2010.vcxproj.filters | 6 +
.../ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.c | 3 +
.../ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h | 14 +-
.../ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c | 32 ++-
.../ftmod_sangoma_isdn_stack_hndl.c | 33 ++-
.../ftmod_sangoma_isdn_support.c | 45 ++-
.../src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c | 2 +
libs/iksemel/configure.ac | 11 +-
libs/iksemel/src/Makefile.am | 4 +-
libs/iksemel/tools/Makefile.am | 6 +-
libs/spandsp/spandsp.pc.in | 2 +-
scripts/perl/dhcp-inform.pl | 9 +-
src/include/switch_utils.h | 2 +-
src/mod/applications/mod_commands/mod_commands.c | 21 +-
.../applications/mod_conference/mod_conference.c | 64 +++-
src/mod/applications/mod_dptools/mod_dptools.c | 2 +
src/mod/applications/mod_easyroute/mod_easyroute.c | 13 +-
src/mod/applications/mod_spandsp/mod_spandsp_fax.c | 89 +++--
src/mod/codecs/mod_celt/mod_celt.c | 34 +-
src/mod/endpoints/mod_gsmopen/.gitignore | 2 +
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 +
src/mod/endpoints/mod_sofia/sofia_presence.c | 19 +
.../event_handlers/mod_erlang_event/ei_helpers.c | 1 +
.../event_handlers/mod_erlang_event/handle_msg.c | 4 +-
.../mod_erlang_event/mod_erlang_event.c | 14 +-
.../mod_erlang_event/mod_erlang_event.h | 1 +
.../mod_event_socket/mod_event_socket.c | 68 ++--
src/mod/event_handlers/mod_snmp/FREESWITCH-MIB | 110 +++++
src/mod/event_handlers/mod_snmp/Makefile | 7 +
src/mod/event_handlers/mod_snmp/mod_snmp.c | 158 ++++++++
src/mod/event_handlers/mod_snmp/subagent.c | 158 ++++++++
src/mod/event_handlers/mod_snmp/subagent.h | 22 +
src/mod/formats/mod_shout/mod_shout.c | 6 +-
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/mod/languages/mod_managed/freeswitch_wrap.cxx | 127 ++++++
src/mod/languages/mod_managed/managed/swig.cs | 134 ++++++-
src/switch_apr.c | 2 +-
src/switch_channel.c | 4 +-
src/switch_core.c | 12 +-
src/switch_core_file.c | 2 +-
src/switch_ivr.c | 2 +-
src/switch_ivr_async.c | 1 +
src/switch_ivr_originate.c | 22 +-
src/switch_ivr_play_say.c | 18 +-
src/switch_loadable_module.c | 16 +-
src/switch_rtp.c | 425 ++++++++++++--------
58 files changed, 1615 insertions(+), 388 deletions(-)
create mode 100644 src/mod/event_handlers/mod_snmp/FREESWITCH-MIB
create mode 100644 src/mod/event_handlers/mod_snmp/Makefile
create mode 100644 src/mod/event_handlers/mod_snmp/mod_snmp.c
create mode 100644 src/mod/event_handlers/mod_snmp/subagent.c
create mode 100644 src/mod/event_handlers/mod_snmp/subagent.h
</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>