<h1>Project "FreeSWITCH Source" received a push.</h1>
<h2>branch: master updated</h2>
<pre>
via: 41dc6f46db0140b171d5ae71bfe923e7605f0cff (commit)
via: e5fb456f3bfddbf1e379c77030e8e4dd5549d12a (commit)
via: 74a0cfd1e101413a3941c41d04ee01d8df2ae418 (commit)
via: b55b4eeaeea1d1cebc5a44ffdd88b224898d5d8a (commit)
via: f60fdf653dd2d7f8d3eaa6a9086e1f68bd993c59 (commit)
via: 85913b70b43483d4d3d840d128549ddba75b56a6 (commit)
via: 257bf9a46c44f76d8b38c90f288f364bcf1c6398 (commit)
via: 4ae8282e6c6df0e296113e9b4b4a1383e1af8ad7 (commit)
via: 89c5f3bf8226bf605336b66e7761fd9f753d935a (commit)
via: 83dea0ee45a1eed53fe6c7bcac96410229c2fe3c (commit)
via: 10d696ebacedde5416e99f03911c928eea8889d1 (commit)
via: 43dd776c3616f3735bd8b73d965f81e9d16dab79 (commit)
via: fb66abfab4a74055c38cdc67da83e6e0175a4a0b (commit)
via: 93b85b5a4c8abff3be692288176a40fda5b13c3f (commit)
via: 6a524a1d567f9e73d10d14067212bda5f67b7ffb (commit)
via: d72cde9b76a856cf002366300bea02c26db44ffb (commit)
via: 2404dd295aa0b6ef2e9da1598a4b3d479ee6317f (commit)
via: 45b3adda57a9281d0dd4389884d2a42eebc7dbba (commit)
via: 52bf0423e2231e7e16126baa13b8fef14132ac57 (commit)
via: 33848eb01c327b04ad3c34bb5165bb1e01891863 (commit)
via: 2d6161e889fdaf8b03608fefdd7ef480a56ddf8b (commit)
via: e88b9639624cef4f35901146241f515730b3b118 (commit)
via: 86d5e441da872719faf72e24afdda85d8491406b (commit)
via: 9470e70057c549598d6d5e768d6cb08a2ba82104 (commit)
via: 1f1541b474c549d6a13b6a943d13f046d463751a (commit)
via: 766f2d61651f161b074fad2f987b4f10532a9a7a (commit)
via: 1623e5d2952d63e2e49d454cd6fdf921a8516227 (commit)
via: 256a82dbf2d7f4b4e1d7527f1e6a15d8d0d38a21 (commit)
via: c8f5c66c3520ecda8f8dbc07dc01f1d4035058e4 (commit)
via: 2ad81ac82f3c3c989e4d7d11f788c43c2c6f20d8 (commit)
via: 49a5effcdf2cea9e0ddcf146cf3fe85d1872e654 (commit)
via: be3483b924a674e4c4f0f05734e7e4917634f3ca (commit)
via: e6e4bcea734fbfb54b901ff8b1107ddfe76b7010 (commit)
via: 068d36a5c95c5a4143f423b7c36cbe6d5cea36d5 (commit)
via: 9986f4ebf2a0c40cc99bc7f9f03f2dec6ae74645 (commit)
via: 6d3abd41cadef3a2bff8175487c094c80d7d9cf7 (commit)
via: b3ac44f555a80f8278c5f915cfb36766903905a4 (commit)
via: 9e6503a482ff533ff214b01a07c3432be14ff1ce (commit)
via: 97a2b4f9025099bdab5718a13ee36d15a6152411 (commit)
via: 68b2756970bd4280eba700b7439afdff374fd9e3 (commit)
via: 9b0c16b5d48a7b9d0ea15ac429a8ca4c8eef8693 (commit)
via: f05fe55594ffca6edc8f4e74204650aa219ed1ac (commit)
via: 08f494b80802aacf101705382f149ca4b028eb57 (commit)
via: 02082c930cc08cd65b3ac51d2e8231e502bd8f31 (commit)
via: 89253a139117b32fa0a6dc101e53e9b830361048 (commit)
via: 15e65cfafb8a46caca8bb8a63d55edf817f17f2d (commit)
via: 92a9bacc44576e7b1d41c48752af597801e41d21 (commit)
via: 8f483f41c78ae3dd1bad7c3378733f04438f6af1 (commit)
via: 0f39c8f9c3d8e8bce05c551e0168e476ce29437a (commit)
via: 6d7e019b5c0244f53c16361d2667049b430adb55 (commit)
via: 128d53c2e6a73a6136efcfffa4e880e6635e43f1 (commit)
via: 4cbdfbe481d7f9b448663418dccc88b017f9ce69 (commit)
via: e719ae662b7cb08ebd7f8e732a140e9aeb502960 (commit)
via: 439df43cae04a053a1c22befdd7f1009f6cb6dfa (commit)
via: d395b654fb0abab4889d5b8c239728683e772959 (commit)
via: acd56d2fe2a0458801010cc6b03c524023cbc597 (commit)
from: 944b99687ea3e6f14f6eeb1f6daa97a6905fbb1d (commit)
</pre>= COMMIT LOG ===========================================================
<div class="highlight"><pre>committer: Arnaldo Pereira
comments:
Merge branch 'master' of git://git.freeswitch.org/freeswitch
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
doh regression
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_event.c b/src/switch_event.c</span>
<span style="color: #000080; font-weight: bold">index 3e12ea1..b626d5b 100644</span>
<span style="color: #A00000">--- a/src/switch_event.c</span>
<span style="color: #00A000">+++ b/src/switch_event.c</span>
<span style="color: #800080; font-weight: bold">@@ -1561,6 +1561,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const</span>
        char *cloned_sub_val = NULL;
        char *func_val = NULL;
        int nv = 0;
<span style="color: #00A000">+        char *gvar = NULL;</span>
        nv = switch_string_var_check_const(in) || switch_string_has_escaped_data(in);
<span style="color: #800080; font-weight: bold">@@ -1673,7 +1674,6 @@ SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const</span>
                                        int offset = 0;
                                        int ooffset = 0;
                                        char *ptr;
<span style="color: #A00000">-                                        char *gvar = NULL;</span>
                                        if ((expanded = switch_event_expand_headers(event, (char *) vname)) == vname) {
                                                expanded = NULL;
<span style="color: #800080; font-weight: bold">@@ -1690,6 +1690,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const</span>
                                        }
                                        if (!(sub_val = switch_event_get_header(event, vname))) {
<span style="color: #00A000">+                                                switch_safe_free(gvar);</span>
                                                if ((gvar = switch_core_get_variable_dup(vname))) {
                                                        sub_val = gvar;
                                                }
<span style="color: #800080; font-weight: bold">@@ -1713,7 +1714,6 @@ SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const</span>
                                                }
                                        }
<span style="color: #A00000">-                                        switch_safe_free(gvar);</span>
                                        switch_safe_free(expanded);
                                } else {
                                        switch_stream_handle_t stream = { 0 };
<span style="color: #800080; font-weight: bold">@@ -1789,6 +1789,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const</span>
                }
        }
        free(indup);
<span style="color: #00A000">+        switch_safe_free(gvar);</span>
        return data;
}
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
FS-3027
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c</span>
<span style="color: #000080; font-weight: bold">index dfd6a76..8b2f470 100644</span>
<span style="color: #A00000">--- a/src/mod/endpoints/mod_sofia/sofia_glue.c</span>
<span style="color: #00A000">+++ b/src/mod/endpoints/mod_sofia/sofia_glue.c</span>
<span style="color: #800080; font-weight: bold">@@ -4071,15 +4071,22 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s</span>
        greedy = !!sofia_test_pflag(tech_pvt->profile, PFLAG_GREEDY);
        scrooge = !!sofia_test_pflag(tech_pvt->profile, PFLAG_SCROOGE);
<span style="color: #A00000">-        if (!greedy || !scrooge) {</span>
<span style="color: #A00000">-                if ((val = switch_channel_get_variable(channel, "sip_codec_negotiation"))) {</span>
<span style="color: #A00000">-                        if (!strcasecmp(val, "greedy")) {</span>
<span style="color: #A00000">-                                greedy = 1;</span>
<span style="color: #A00000">-                        } else if (!strcasecmp(val, "scrooge")) {</span>
<span style="color: #A00000">-                                scrooge = 1;</span>
<span style="color: #A00000">-                                greedy = 1;</span>
<span style="color: #A00000">-                        }</span>
<span style="color: #A00000">-                }</span>
<span style="color: #00A000">+        if ((val = switch_channel_get_variable(channel, "sip_codec_negotiation"))) {</span>
<span style="color: #00A000">+                if (!strcasecmp(val, "generous")) {</span>
<span style="color: #00A000">+                        greedy = 0;</span>
<span style="color: #00A000">+                        scrooge = 0;</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "sip_codec_negotiation overriding sofia inbound-codec-negotiation : generous\n" );</span>
<span style="color: #00A000">+                } else if (!strcasecmp(val, "greedy")) {</span>
<span style="color: #00A000">+                        greedy = 1;</span>
<span style="color: #00A000">+                        scrooge = 0;</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "sip_codec_negotiation overriding sofia inbound-codec-negotiation : greedy\n" );</span>
<span style="color: #00A000">+                } else if (!strcasecmp(val, "scrooge")) {</span>
<span style="color: #00A000">+                        scrooge = 1;</span>
<span style="color: #00A000">+                        greedy = 1;</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "sip_codec_negotiation overriding sofia inbound-codec-negotiation : scrooge\n" );</span>
<span style="color: #00A000">+                } else {</span>
<span style="color: #00A000">+                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "sip_codec_negotiation ignored invalid value : '%s' \n", val );        </span>
<span style="color: #00A000">+                }                </span>
        }
        if ((tech_pvt->origin = switch_core_session_strdup(session, (char *) sdp->sdp_origin->o_username))) {
</pre></div>
<div class="highlight"><pre>committer: Jeff Lenk
comments:
VS2010 fix minor build order problem
<span style="color: #000080; font-weight: bold">diff --git a/libs/win32/sofia/libsofia_sip_ua_static.2010.vcxproj b/libs/win32/sofia/libsofia_sip_ua_static.2010.vcxproj</span>
<span style="color: #000080; font-weight: bold">index d841b89..be91504 100644</span>
<span style="color: #A00000">--- a/libs/win32/sofia/libsofia_sip_ua_static.2010.vcxproj</span>
<span style="color: #00A000">+++ b/libs/win32/sofia/libsofia_sip_ua_static.2010.vcxproj</span>
<span style="color: #800080; font-weight: bold">@@ -508,6 +508,12 @@ if not exist "$(ProjectDir)$(IntDir)\auth_client.obj" "autogen.cmd"</span>
<Project>{8b3b4c4c-13c2-446c-beb0-f412cc2cfb9a}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<span style="color: #00A000">+ <ProjectReference Include="..\openssl\libeay32.2010.vcxproj"></span>
<span style="color: #00A000">+ <Project>{d331904d-a00a-4694-a5a3-fcff64ab5dbe}</Project></span>
<span style="color: #00A000">+ </ProjectReference></span>
<span style="color: #00A000">+ <ProjectReference Include="..\openssl\ssleay32.2010.vcxproj"></span>
<span style="color: #00A000">+ <Project>{b4b62169-5ad4-4559-8707-3d933ac5db39}</Project></span>
<span style="color: #00A000">+ </ProjectReference></span>
<ProjectReference Include="..\pthread\pthread.2010.vcxproj">
<Project>{df018947-0fff-4eb3-bdee-441dc81da7a4}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
fix possible bad pointer in global vars (please test)
<span style="color: #000080; font-weight: bold">diff --git a/fscomm/widgets/codecwidget.cpp b/fscomm/widgets/codecwidget.cpp</span>
<span style="color: #000080; font-weight: bold">index 42b10fe..2f82e1a 100644</span>
<span style="color: #A00000">--- a/fscomm/widgets/codecwidget.cpp</span>
<span style="color: #00A000">+++ b/fscomm/widgets/codecwidget.cpp</span>
<span style="color: #800080; font-weight: bold">@@ -131,6 +131,8 @@ void CodecWidget::setCodecString(QString codecList)</span>
QStringList parsed = codecList.split("{");
QString var = parsed.at(1);
var = var.split("}").at(0);
<span style="color: #00A000">+                // warning switch_core_get_Variable may return an unsafe pointer in some cases.</span>
<span style="color: #00A000">+                // revise to use switch_core_get_variable_dup, and then free it after you are done.</span>
var = switch_core_get_variable(var.toAscii().data());
if ( ! var.isEmpty() ) {
codecList = var;
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
only pass publish on when you have a subscription
<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 19125c6..a38a61e 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">@@ -2570,6 +2570,19 @@ static int sofia_counterpath_crutch(void *pArg, int argc, char **argv, char **co</span>
        return 0;
}
<span style="color: #00A000">+</span>
<span style="color: #00A000">+uint32_t sofia_presence_contact_count(sofia_profile_t *profile, const char *contact_str)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        char buf[32] = "";</span>
<span style="color: #00A000">+        char *sql;</span>
<span style="color: #00A000">+        </span>
<span style="color: #00A000">+        sql = switch_mprintf("select count(*) from sip_subscriptions where profile_name='%q' and contact_str='%q'", profile->name, contact_str);</span>
<span style="color: #00A000">+        </span>
<span style="color: #00A000">+        sofia_glue_execute_sql2str(profile, profile->ireg_mutex, sql, buf, sizeof(buf));</span>
<span style="color: #00A000">+        switch_safe_free(sql);</span>
<span style="color: #00A000">+        return atoi(buf);                                </span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip,
                                                                                 tagi_t tags[])
{
<span style="color: #800080; font-weight: bold">@@ -2584,7 +2597,7 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n</span>
        char expstr[30] = "";
        long exp = 0, exp_delta = 3600;
        char *pd_dup = NULL;
<span style="color: #A00000">-        int count = 1;</span>
<span style="color: #00A000">+        int count = 1, sub_count = 0;</span>
        char *contact_str;
        int open = 1;
<span style="color: #800080; font-weight: bold">@@ -2667,24 +2680,25 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n</span>
                                count = sofia_reg_reg_count(profile, from_user, from_host);
                        }
                                
<span style="color: #00A000">+                        sub_count = sofia_presence_contact_count(profile, contact_str);</span>
                        /* if (count > 1) let's not and say we did or all the clients who subscribe to their own presence will think they selves is offline */
                        event_type = sip_header_as_string(profile->home, (void *) sip->sip_event);
                        if (count < 2) {
<span style="color: #A00000">-                                if ((sql =</span>
<span style="color: #A00000">-                                         switch_mprintf("delete from sip_presence where sip_user='%q' and sip_host='%q' "</span>
<span style="color: #A00000">-                                                                        " and profile_name='%q' and hostname='%q'", from_user, from_host, profile->name, mod_sofia_globals.hostname))) {</span>
<span style="color: #00A000">+                                if ((sql = switch_mprintf("delete from sip_presence where sip_user='%q' and sip_host='%q' "</span>
<span style="color: #00A000">+                                                                                 " and profile_name='%q' and hostname='%q'", </span>
<span style="color: #00A000">+                                                                                 from_user, from_host, profile->name, mod_sofia_globals.hostname))) {</span>
                                        sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
                                }
                                        
<span style="color: #A00000">-                                if ((sql =</span>
<span style="color: #A00000">-                                         switch_mprintf("insert into sip_presence (sip_user, sip_host, status, rpid, expires, user_agent,"</span>
<span style="color: #A00000">-                                                                        " profile_name, hostname, open_closed) "</span>
<span style="color: #A00000">-                                                                        "values ('%q','%q','%q','%q',%ld,'%q','%q','%q','%q')",</span>
<span style="color: #A00000">-                                                                        from_user, from_host, note_txt, rpid, exp, full_agent, profile->name, mod_sofia_globals.hostname, open_closed))) {</span>
<span style="color: #A00000">-                                                </span>
<span style="color: #00A000">+                                if (sub_count > 0 && (sql = switch_mprintf("insert into sip_presence (sip_user, sip_host, status, rpid, expires, user_agent,"</span>
<span style="color: #00A000">+                                                                                                                 " profile_name, hostname, open_closed) "</span>
<span style="color: #00A000">+                                                                                                                 "values ('%q','%q','%q','%q',%ld,'%q','%q','%q','%q')",</span>
<span style="color: #00A000">+                                                                                                                 from_user, from_host, note_txt, rpid, exp, full_agent, profile->name, </span>
<span style="color: #00A000">+                                                                                                                 mod_sofia_globals.hostname, open_closed))) {</span>
<span style="color: #00A000">+                                        </span>
                                        sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
                                }
                                
<span style="color: #800080; font-weight: bold">@@ -2696,16 +2710,17 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n</span>
                                switch_safe_free(sql);
                        }
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                        if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #A00000">-                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);</span>
<span style="color: #A00000">-                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid);</span>
<span style="color: #A00000">-                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url);</span>
<span style="color: #A00000">-                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "user-agent", full_agent);</span>
<span style="color: #A00000">-                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", from_user, from_host);</span>
<span style="color: #A00000">-                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", note_txt);</span>
<span style="color: #A00000">-                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", event_type);</span>
<span style="color: #A00000">-                                switch_event_fire(&event);</span>
<span style="color: #00A000">+                        if (sub_count > 0) {</span>
<span style="color: #00A000">+                                if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);</span>
<span style="color: #00A000">+                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid);</span>
<span style="color: #00A000">+                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url);</span>
<span style="color: #00A000">+                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "user-agent", full_agent);</span>
<span style="color: #00A000">+                                        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", from_user, from_host);</span>
<span style="color: #00A000">+                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", note_txt);</span>
<span style="color: #00A000">+                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", event_type);</span>
<span style="color: #00A000">+                                        switch_event_fire(&event);</span>
<span style="color: #00A000">+                                }</span>
                        }
                        if (event_type) {
<span style="color: #800080; font-weight: bold">@@ -2728,7 +2743,12 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n</span>
        switch_snprintf(expstr, sizeof(expstr), "%d", exp_delta);
        switch_stun_random_string(etag, 8, NULL);
<span style="color: #A00000">-        nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua), SIPTAG_ETAG_STR(etag), SIPTAG_EXPIRES_STR(expstr), TAG_END());</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (sub_count > 0) {</span>
<span style="color: #00A000">+                nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua), SIPTAG_ETAG_STR(etag), SIPTAG_EXPIRES_STR(expstr), TAG_END());</span>
<span style="color: #00A000">+        } else {</span>
<span style="color: #00A000">+                nua_respond(nh, SIP_404_NOT_FOUND, NUTAG_WITH_THIS(nua), TAG_END());</span>
<span style="color: #00A000">+        }</span>
        switch_safe_free(contact_str);
}
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
fix possible bad pointer in global vars (please test)
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/mod_freetdm/mod_freetdm.c b/libs/freetdm/mod_freetdm/mod_freetdm.c</span>
<span style="color: #000080; font-weight: bold">index 970cb5b..2ef21cc 100755</span>
<span style="color: #A00000">--- a/libs/freetdm/mod_freetdm/mod_freetdm.c</span>
<span style="color: #00A000">+++ b/libs/freetdm/mod_freetdm/mod_freetdm.c</span>
<span style="color: #800080; font-weight: bold">@@ -1067,9 +1067,16 @@ static const char* channel_get_variable(switch_core_session_t *session, switch_e</span>
return variable;
}
}
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+         // This is unsafe, I don't see anywhere in the whole code where this is called with NULL session anyway.</span>
<span style="color: #00A000">+         // There is a new switch_core_get_variable_dup that will strdup it for you and then you must free it.</span>
<span style="color: #00A000">+         // That messes up the abstraction completely so I am just commenting it out for you.....</span>
<span style="color: #00A000">+         /*</span>
if ((variable = switch_core_get_variable(variable_name))) {
return variable;
}
<span style="color: #00A000">+         */</span>
return NULL;
}
<span style="color: #000080; font-weight: bold">diff --git a/libs/openzap/mod_openzap/mod_openzap.c b/libs/openzap/mod_openzap/mod_openzap.c</span>
<span style="color: #000080; font-weight: bold">index d52149c..ef346b8 100644</span>
<span style="color: #A00000">--- a/libs/openzap/mod_openzap/mod_openzap.c</span>
<span style="color: #00A000">+++ b/libs/openzap/mod_openzap/mod_openzap.c</span>
<span style="color: #800080; font-weight: bold">@@ -1234,19 +1234,19 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi</span>
                zap_set_string(caller_data.ani.digits, dest);
        }
        
<span style="color: #A00000">-        if ((var = switch_event_get_header(var_event, "openzap_outbound_ton")) || (var = switch_core_get_variable("openzap_outbound_ton"))) {</span>
<span style="color: #00A000">+        if ((var = switch_event_get_header(var_event, "openzap_outbound_ton"))) {</span>
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Setting TON to: %s\n", var);
                zap_set_ton(var, &caller_data.ani.type);
        } else {
                caller_data.ani.type = outbound_profile->destination_number_ton;
        }
<span style="color: #A00000">-        if ((var = switch_event_get_header(var_event, "openzap_custom_call_data")) || (var = switch_core_get_variable("openzap_custom_call_data"))) {</span>
<span style="color: #00A000">+        if ((var = switch_event_get_header(var_event, "openzap_custom_call_data"))) {</span>
                zap_set_string((char *)caller_data.raw_data, var);
                caller_data.raw_data_len = strlen(var);
        }
        
<span style="color: #A00000">-        if ((var = switch_event_get_header(var_event, "openzap_outbound_npi")) || (var = switch_core_get_variable("openzap_outbound_npi"))) {</span>
<span style="color: #00A000">+        if ((var = switch_event_get_header(var_event, "openzap_outbound_npi"))) {</span>
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Setting NPI to: %s\n", var);
                zap_set_npi(var, &caller_data.ani.plan);
        } else {
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
fix possible bad pointer in global vars (please test)
<span style="color: #000080; font-weight: bold">diff --git a/src/include/private/switch_core_pvt.h b/src/include/private/switch_core_pvt.h</span>
<span style="color: #000080; font-weight: bold">index 30690b1..05cd24d 100644</span>
<span style="color: #A00000">--- a/src/include/private/switch_core_pvt.h</span>
<span style="color: #00A000">+++ b/src/include/private/switch_core_pvt.h</span>
<span style="color: #800080; font-weight: bold">@@ -246,6 +246,7 @@ struct switch_runtime {</span>
        int sql_buffer_len;
        int max_sql_buffer_len;
        switch_dbtype_t odbc_dbtype;
<span style="color: #00A000">+        char hostname[256];</span>
};
extern struct switch_runtime runtime;
<span style="color: #000080; font-weight: bold">diff --git a/src/include/switch_core.h b/src/include/switch_core.h</span>
<span style="color: #000080; font-weight: bold">index 109a169..69b0642 100644</span>
<span style="color: #A00000">--- a/src/include/switch_core.h</span>
<span style="color: #00A000">+++ b/src/include/switch_core.h</span>
<span style="color: #800080; font-weight: bold">@@ -759,6 +759,9 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_force_locate(_In_z_</span>
\return the value of the desired variable
*/
SWITCH_DECLARE(char *) switch_core_get_variable(_In_z_ const char *varname);
<span style="color: #00A000">+SWITCH_DECLARE(char *) switch_core_get_variable_dup(_In_z_ const char *varname);</span>
<span style="color: #00A000">+SWITCH_DECLARE(char *) switch_core_get_variable_pdup(_In_z_ const char *varname, switch_memory_pool_t *pool);</span>
<span style="color: #00A000">+SWITCH_DECLARE(const char *) switch_core_get_hostname(void);</span>
/*!
\brief Add a global variable to the core
<span style="color: #000080; font-weight: bold">diff --git a/src/include/switch_nat.h b/src/include/switch_nat.h</span>
<span style="color: #000080; font-weight: bold">index bdbd51b..9e40546 100644</span>
<span style="color: #A00000">--- a/src/include/switch_nat.h</span>
<span style="color: #00A000">+++ b/src/include/switch_nat.h</span>
<span style="color: #800080; font-weight: bold">@@ -49,7 +49,7 @@ typedef enum {</span>
        SWITCH_NAT_TCP
} switch_nat_ip_proto_t;
<span style="color: #A00000">-</span>
<span style="color: #00A000">+SWITCH_DECLARE(const char *) switch_nat_get_type(void);</span>
/*!
\brief Initilize the NAT Traversal System
<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 7771b09..807770a 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">@@ -349,7 +349,7 @@ SWITCH_STANDARD_API(timer_test_function)</span>
SWITCH_STANDARD_API(group_call_function)
{
<span style="color: #A00000">-        char *domain;</span>
<span style="color: #00A000">+        char *domain, *dup_domain = NULL;</span>
        char *group_name = NULL;
        char *flags;
        int ok = 0;
<span style="color: #800080; font-weight: bold">@@ -392,7 +392,9 @@ SWITCH_STANDARD_API(group_call_function)</span>
        if (domain) {
                *domain++ = '\0';
        } else {
<span style="color: #A00000">-                domain = switch_core_get_variable("domain");</span>
<span style="color: #00A000">+                if ((dup_domain = switch_core_get_variable_dup("domain"))) {</span>
<span style="color: #00A000">+                        domain = dup_domain;</span>
<span style="color: #00A000">+                }</span>
        }
        if (!zstr(domain)) {
<span style="color: #800080; font-weight: bold">@@ -544,13 +546,14 @@ SWITCH_STANDARD_API(group_call_function)</span>
        }
end:
<span style="color: #A00000">-</span>
<span style="color: #00A000">+        </span>
        switch_safe_free(group_name);
<span style="color: #00A000">+        switch_safe_free(dup_domain);</span>
        if (!ok) {
                stream->write_function(stream, "error/NO_ROUTE_DESTINATION");
        }
<span style="color: #A00000">-</span>
<span style="color: #00A000">+        </span>
        return SWITCH_STATUS_SUCCESS;
}
<span style="color: #800080; font-weight: bold">@@ -559,7 +562,7 @@ SWITCH_STANDARD_API(in_group_function)</span>
{
        switch_xml_t x_domain, xml = NULL, x_user = NULL, x_group;
        int argc;
<span style="color: #A00000">-        char *mydata = NULL, *argv[2], *user, *domain;</span>
<span style="color: #00A000">+        char *mydata = NULL, *argv[2], *user, *domain, *dup_domain = NULL;</span>
        char delim = ',';
        switch_event_t *params = NULL;
        const char *rval = "false";
<span style="color: #800080; font-weight: bold">@@ -579,7 +582,9 @@ SWITCH_STANDARD_API(in_group_function)</span>
        if ((domain = strchr(user, '@'))) {
                *domain++ = '\0';
        } else {
<span style="color: #A00000">-                domain = switch_core_get_variable("domain");</span>
<span style="color: #00A000">+                if ((dup_domain = switch_core_get_variable_dup("domain"))) {</span>
<span style="color: #00A000">+                        domain = dup_domain;</span>
<span style="color: #00A000">+                }</span>
        }
        switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
<span style="color: #800080; font-weight: bold">@@ -601,6 +606,7 @@ SWITCH_STANDARD_API(in_group_function)</span>
        switch_xml_free(xml);
        switch_safe_free(mydata);
<span style="color: #00A000">+        switch_safe_free(dup_domain);</span>
        switch_event_destroy(&params);
        return SWITCH_STATUS_SUCCESS;
<span style="color: #800080; font-weight: bold">@@ -610,7 +616,7 @@ SWITCH_STANDARD_API(user_data_function)</span>
{
        switch_xml_t x_domain, xml = NULL, x_user = NULL, x_group = NULL, x_param, x_params;
        int argc;
<span style="color: #A00000">-        char *mydata = NULL, *argv[3], *key = NULL, *type = NULL, *user, *domain;</span>
<span style="color: #00A000">+        char *mydata = NULL, *argv[3], *key = NULL, *type = NULL, *user, *domain, *dup_domain = NULL;</span>
        char delim = ' ';
        const char *container = "params", *elem = "param";
        const char *result = NULL;
<span style="color: #800080; font-weight: bold">@@ -631,7 +637,9 @@ SWITCH_STANDARD_API(user_data_function)</span>
        if ((domain = strchr(user, '@'))) {
                *domain++ = '\0';
        } else {
<span style="color: #A00000">-                if (!(domain = switch_core_get_variable("domain"))) {</span>
<span style="color: #00A000">+                if ((dup_domain = switch_core_get_variable("domain"))) {</span>
<span style="color: #00A000">+                        domain = dup_domain;</span>
<span style="color: #00A000">+                } else {</span>
                        domain = "cluecon.com";
                }
        }
<span style="color: #800080; font-weight: bold">@@ -694,6 +702,7 @@ SWITCH_STANDARD_API(user_data_function)</span>
        }
        switch_xml_free(xml);
        switch_safe_free(mydata);
<span style="color: #00A000">+        switch_safe_free(dup_domain);</span>
        switch_event_destroy(&params);
        return SWITCH_STATUS_SUCCESS;
<span style="color: #800080; font-weight: bold">@@ -4375,7 +4384,9 @@ SWITCH_STANDARD_API(global_getvar_function)</span>
        if (zstr(cmd)) {
                switch_core_dump_variables(stream);
        } else {
<span style="color: #A00000">-                stream->write_function(stream, "%s", switch_str_nil(switch_core_get_variable(cmd)));</span>
<span style="color: #00A000">+                char *var = switch_core_get_variable_dup(cmd);</span>
<span style="color: #00A000">+                stream->write_function(stream, "%s", switch_str_nil(var));</span>
<span style="color: #00A000">+                switch_safe_free(var);</span>
        }
        return SWITCH_STATUS_SUCCESS;
}
<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 928a9b8..4be2a64 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">@@ -2787,7 +2787,7 @@ static switch_call_cause_t group_outgoing_channel(switch_core_session_t *session</span>
        if ((domain = strchr(group, '@'))) {
                *domain++ = '\0';
        } else {
<span style="color: #A00000">-                domain = switch_core_get_variable("domain");</span>
<span style="color: #00A000">+                domain = switch_core_get_variable_pdup("domain", switch_core_session_get_pool(session));</span>
        }
        if (!domain) {
<span style="color: #800080; font-weight: bold">@@ -2908,7 +2908,7 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,</span>
        if ((domain = strchr(user, '@'))) {
                *domain++ = '\0';
        } else {
<span style="color: #A00000">-                domain = switch_core_get_variable("domain");</span>
<span style="color: #00A000">+                domain = switch_core_get_variable_pdup("domain", switch_core_session_get_pool(session));</span>
        }
        if (!domain) {
<span style="color: #800080; font-weight: bold">@@ -3193,10 +3193,11 @@ static switch_status_t event_chat_send(const char *proto, const char *from, cons</span>
                if (body)
                        switch_event_add_body(event, "%s", body);
                if (to) {
<span style="color: #A00000">-                        const char *v;</span>
<span style="color: #00A000">+                        char *v;</span>
                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "To", to);
<span style="color: #A00000">-                        if ((v = switch_core_get_variable(to))) {</span>
<span style="color: #00A000">+                        if ((v = switch_core_get_variable_dup(to))) {</span>
                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Command", v);
<span style="color: #00A000">+                                free(v);</span>
                        }
                }
<span style="color: #800080; font-weight: bold">@@ -3214,15 +3215,15 @@ static switch_status_t api_chat_send(const char *proto, const char *from, const</span>
                                                                         const char *body, const char *type, const char *hint)
{
        if (to) {
<span style="color: #A00000">-                const char *v;</span>
<span style="color: #00A000">+                char *v = NULL;</span>
                switch_stream_handle_t stream = { 0 };
                char *cmd = NULL, *arg;
<span style="color: #A00000">-                if (!(v = switch_core_get_variable(to))) {</span>
<span style="color: #A00000">-                        v = to;</span>
<span style="color: #00A000">+                if (!(v = switch_core_get_variable_dup(to))) {</span>
<span style="color: #00A000">+                        v = strdup(to);</span>
                }
<span style="color: #A00000">-                cmd = strdup(v);</span>
<span style="color: #00A000">+                cmd = v;</span>
                switch_assert(cmd);
                switch_url_decode(cmd);
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/applications/mod_redis/mod_redis.c b/src/mod/applications/mod_redis/mod_redis.c</span>
<span style="color: #000080; font-weight: bold">index 1e99967..ebf2a9e 100755</span>
<span style="color: #A00000">--- a/src/mod/applications/mod_redis/mod_redis.c</span>
<span style="color: #00A000">+++ b/src/mod/applications/mod_redis/mod_redis.c</span>
<span style="color: #800080; font-weight: bold">@@ -89,7 +89,7 @@ SWITCH_LIMIT_INCR(limit_incr_redis)</span>
        }
        
        /* Get the keys for redis server */
<span style="color: #A00000">-        uuid_rediskey = switch_core_session_sprintf(session,"%s_%s_%s", switch_core_get_variable("hostname"), realm, resource);</span>
<span style="color: #00A000">+        uuid_rediskey = switch_core_session_sprintf(session,"%s_%s_%s", switch_core_get_hostname(), realm, resource);</span>
        rediskey = switch_core_session_sprintf(session, "%s_%s", realm, resource);
        if ((pvt = switch_channel_get_private(channel, "limit_redis"))) {
<span style="color: #800080; font-weight: bold">@@ -179,7 +179,7 @@ SWITCH_LIMIT_RELEASE(limit_release_redis)</span>
                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Couldn't decrement value corresponding to %s\n", (char *)p_key);
                                switch_goto_status(SWITCH_STATUS_FALSE, end);
                        }
<span style="color: #A00000">-                         p_uuid_key = switch_core_session_sprintf(session, "%s_%s", switch_core_get_variable("hostname"), (char *)p_key);</span>
<span style="color: #00A000">+                         p_uuid_key = switch_core_session_sprintf(session, "%s_%s", switch_core_get_hostname(), (char *)p_key);</span>
                        if (credis_decr(redis,p_uuid_key,&uuid_val) != 0) {
                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Couldn't decrement value corresponding to %s\n", p_uuid_key);
                                switch_goto_status(SWITCH_STATUS_FALSE, end);
<span style="color: #800080; font-weight: bold">@@ -193,7 +193,7 @@ SWITCH_LIMIT_RELEASE(limit_release_redis)</span>
        
        } else {        
                 rediskey = switch_core_session_sprintf(session, "%s_%s", realm, resource);
<span style="color: #A00000">-                uuid_rediskey = switch_core_session_sprintf(session, "%s_%s_%s", switch_core_get_variable("hostname"), realm, resource);</span>
<span style="color: #00A000">+                uuid_rediskey = switch_core_session_sprintf(session, "%s_%s_%s", switch_core_get_hostname(), realm, resource);</span>
                switch_core_hash_delete(pvt->hash, (const char *) rediskey);
                if (credis_decr(redis, rediskey, &val) != 0) {
<span style="color: #800080; font-weight: bold">@@ -249,13 +249,13 @@ SWITCH_LIMIT_RESET(limit_reset_redis)</span>
{
        REDIS redis;
        if (redis_factory(&redis) == SWITCH_STATUS_SUCCESS) {
<span style="color: #A00000">-                char *rediskey = switch_mprintf("%s_*", switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                char *rediskey = switch_mprintf("%s_*", switch_core_get_hostname());</span>
                int dec = 0, val = 0, keyc;
                char *uuids[2000];
        
                if ((keyc = credis_keys(redis, rediskey, uuids, switch_arraylen(uuids))) > 0) {
                        int i = 0;
<span style="color: #A00000">-                        int hostnamelen = strlen(switch_core_get_variable("hostname"))+1;</span>
<span style="color: #00A000">+                        int hostnamelen = strlen(switch_core_get_hostname())+1;</span>
                        
                        for (i = 0; i < keyc && uuids[i]; i++){
                                const char *key = uuids[i] + hostnamelen;
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c</span>
<span style="color: #000080; font-weight: bold">index 76870f7..80b011e 100644</span>
<span style="color: #A00000">--- a/src/mod/applications/mod_voicemail/mod_voicemail.c</span>
<span style="color: #00A000">+++ b/src/mod/applications/mod_voicemail/mod_voicemail.c</span>
<span style="color: #800080; font-weight: bold">@@ -2734,6 +2734,7 @@ static switch_status_t voicemail_inject(const char *data, switch_core_session_t</span>
        switch_memory_pool_t *pool = NULL;
        char *forwarded_by = NULL;
        char *read_flags = NORMAL_FLAG_STRING;
<span style="color: #00A000">+        char *dup_domain = NULL;</span>
        
        if (zstr(data)) {
                status = SWITCH_STATUS_FALSE;
<span style="color: #800080; font-weight: bold">@@ -2781,7 +2782,9 @@ static switch_status_t voicemail_inject(const char *data, switch_core_session_t</span>
        }
        if (zstr(domain)) {
<span style="color: #A00000">-                domain = switch_core_get_variable("domain");</span>
<span style="color: #00A000">+                if ((dup_domain = switch_core_get_variable_dup("domain"))) {</span>
<span style="color: #00A000">+                        domain = dup_domain;</span>
<span style="color: #00A000">+                }</span>
                profile_name = domain;
        }
<span style="color: #800080; font-weight: bold">@@ -2915,6 +2918,7 @@ static switch_status_t voicemail_inject(const char *data, switch_core_session_t</span>
end:
        switch_safe_free(dup);
<span style="color: #00A000">+        switch_safe_free(dup_domain);</span>
        return status;
}
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c b/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c</span>
<span style="color: #000080; font-weight: bold">index 5869d14..43534da 100644</span>
<span style="color: #A00000">--- a/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c</span>
<span style="color: #00A000">+++ b/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c</span>
<span style="color: #800080; font-weight: bold">@@ -313,7 +313,7 @@ static switch_call_cause_t sip_outgoing_channel(switch_core_session_t *session,</span>
        if (session) {
                profile = switch_channel_get_variable(switch_core_session_get_channel(session), "sip_profile");
        } else {
<span style="color: #A00000">-                profile = switch_core_get_variable("sip_profile");</span>
<span style="color: #00A000">+                profile = switch_core_get_variable_pdup("sip_profile", switch_core_session_get_pool(session));</span>
        }
        if (zstr(profile)) {
                profile = "default";
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c</span>
<span style="color: #000080; font-weight: bold">index 66f62b2..9fb1f39 100644</span>
<span style="color: #A00000">--- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c</span>
<span style="color: #00A000">+++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c</span>
<span style="color: #800080; font-weight: bold">@@ -2049,7 +2049,7 @@ static void set_profile_val(mdl_profile_t *profile, char *var, char *val)</span>
        } else if (!strcasecmp(var, "ext-rtp-ip")) {
                char *ip = globals.guess_ip;
                if (val && !strcasecmp(val, "auto-nat")) {
<span style="color: #A00000">-                        ip = globals.auto_nat ? switch_core_get_variable("nat_public_addr") : globals.guess_ip;</span>
<span style="color: #00A000">+                        ip = globals.auto_nat ? switch_core_get_variable_pdup("nat_public_addr", module_pool) : globals.guess_ip;</span>
                } else if (val && !strcasecmp(val, "auto")) {
                        globals.auto_nat = 0;
                        ip = globals.guess_ip;
<span style="color: #800080; font-weight: bold">@@ -2523,7 +2523,7 @@ static switch_status_t load_config(void)</span>
        memset(&globals, 0, sizeof(globals));
        globals.running = 1;
<span style="color: #A00000">-        globals.auto_nat = (switch_core_get_variable("nat_type") ? 1 : 0);</span>
<span style="color: #00A000">+        globals.auto_nat = (switch_nat_get_type() ? 1 : 0);</span>
        switch_find_local_ip(globals.guess_ip, sizeof(globals.guess_ip), NULL, AF_INET);
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/endpoints/mod_khomp/src/khomp_pvt.cpp b/src/mod/endpoints/mod_khomp/src/khomp_pvt.cpp</span>
<span style="color: #000080; font-weight: bold">index 1b126eb..15009f2 100644</span>
<span style="color: #A00000">--- a/src/mod/endpoints/mod_khomp/src/khomp_pvt.cpp</span>
<span style="color: #00A000">+++ b/src/mod/endpoints/mod_khomp/src/khomp_pvt.cpp</span>
<span style="color: #800080; font-weight: bold">@@ -1625,9 +1625,10 @@ bool Board::KhompPvt::setCollectCall()</span>
DBG(FUNC, PVT_FMT(_target, "option drop collect call is '%s'") % (Opt::_options._drop_collect_call() ? "yes" : "no"));
// get global filter configuration value
<span style="color: #A00000">- tmp_var = switch_core_get_variable("KDropCollectCall");</span>
<span style="color: #00A000">+ tmp_var = switch_core_get_variable_dup("KDropCollectCall");</span>
confvalues.push_back(getTriStateValue(tmp_var));
DBG(FUNC, PVT_FMT(_target, "global KDropCollectCall was '%s'") % (tmp_var ? tmp_var : "(empty)"));
<span style="color: #00A000">+        switch_safe_free(tmp_var);</span>
try
{
<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 8bceb3b..c78aac7 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">@@ -3501,7 +3501,7 @@ SWITCH_STANDARD_API(sofia_contact_function)</span>
        }
        if (zstr(domain)) {
<span style="color: #A00000">-                domain = switch_core_get_variable("domain");</span>
<span style="color: #00A000">+                domain = switch_core_get_variable_pdup("domain", switch_core_session_get_pool(session));</span>
        }
        if (!user) goto end;
<span style="color: #800080; font-weight: bold">@@ -4776,7 +4776,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)</span>
        mod_sofia_globals.running = 1;
        switch_mutex_unlock(mod_sofia_globals.mutex);
<span style="color: #A00000">-        mod_sofia_globals.auto_nat = (switch_core_get_variable("nat_type") ? 1 : 0);</span>
<span style="color: #00A000">+        mod_sofia_globals.auto_nat = (switch_nat_get_type() ? 1 : 0);</span>
        switch_queue_create(&mod_sofia_globals.presence_queue, SOFIA_QUEUE_SIZE, mod_sofia_globals.pool);
        switch_queue_create(&mod_sofia_globals.mwi_queue, SOFIA_QUEUE_SIZE, mod_sofia_globals.pool);
<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 47f94b1..825d1bf 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">@@ -1459,7 +1459,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void</span>
        supported = switch_core_sprintf(profile->pool, "%s%sprecondition, path, replaces", use_100rel ? "100rel, " : "", use_timer ? "timer, " : "");
<span style="color: #A00000">-        if (sofia_test_pflag(profile, PFLAG_AUTO_NAT) && switch_core_get_variable("nat_type")) {</span>
<span style="color: #00A000">+        if (sofia_test_pflag(profile, PFLAG_AUTO_NAT) && switch_nat_get_type()) {</span>
                if (switch_nat_add_mapping(profile->sip_port, SWITCH_NAT_UDP, NULL, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Created UDP nat mapping for %s port %d\n", profile->name, profile->sip_port);
                }
<span style="color: #800080; font-weight: bold">@@ -1676,7 +1676,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void</span>
                switch_event_fire(&s_event);
        }
<span style="color: #A00000">-        if (sofia_test_pflag(profile, PFLAG_AUTO_NAT) && switch_core_get_variable("nat_type")) {</span>
<span style="color: #00A000">+        if (sofia_test_pflag(profile, PFLAG_AUTO_NAT) && switch_nat_get_type()) {</span>
                if (switch_nat_del_mapping(profile->sip_port, SWITCH_NAT_UDP) == SWITCH_STATUS_SUCCESS) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Deleted UDP nat mapping for %s port %d\n", profile->name, profile->sip_port);
                }
<span style="color: #800080; font-weight: bold">@@ -3741,9 +3741,9 @@ switch_status_t config_sofia(int reload, char *profile_name)</span>
                                if (!profile->rtpip[0]) {
                                        profile->rtpip[profile->rtpip_index++] = switch_core_strdup(profile->pool, mod_sofia_globals.guess_ip);
                                }
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                                if (switch_core_get_variable("nat_type")) {</span>
<span style="color: #A00000">-                                        const char *ip = switch_core_get_variable("nat_public_addr");</span>
<span style="color: #00A000">+                                </span>
<span style="color: #00A000">+                                if (switch_nat_get_type()) {</span>
<span style="color: #00A000">+                                        char *ip = switch_core_get_variable_dup("nat_public_addr");</span>
                                        if (ip && !strchr(profile->sipip, ':')) {
                                                if (!profile->extrtpip) {
                                                        profile->extrtpip = switch_core_strdup(profile->pool, ip);
<span style="color: #800080; font-weight: bold">@@ -3754,6 +3754,7 @@ switch_status_t config_sofia(int reload, char *profile_name)</span>
                                                sofia_set_pflag(profile, PFLAG_AUTO_NAT);
                                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "NAT detected setting external ip to %s\n", ip);
                                        }
<span style="color: #00A000">+                                        switch_safe_free(ip);</span>
                                }
                                if (profile->nonce_ttl < 60) {
<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 f3a2c92..1462e4e 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">@@ -2642,7 +2642,7 @@ static int config(void)</span>
                                } else if (!strcmp(var, "debug")) {
                                        globals.debug = atoi(val);
                                } else if (!strcmp(var, "nat-map")) {
<span style="color: #A00000">-                                        if (switch_true(val) && switch_core_get_variable("nat_type")) {</span>
<span style="color: #00A000">+                                        if (switch_true(val) && switch_nat_get_type()) {</span>
                                                prefs.nat_map = 1;
                                        }
                                } else if (!strcmp(var, "listen-port")) {
<span style="color: #800080; font-weight: bold">@@ -2795,7 +2795,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime)</span>
        close_socket(&listen_list.sock);
<span style="color: #A00000">-        if (prefs.nat_map && switch_core_get_variable("nat_type")) {</span>
<span style="color: #00A000">+        if (prefs.nat_map && switch_nat_get_type()) {</span>
                switch_nat_del_mapping(prefs.port, SWITCH_NAT_TCP);
        }
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/formats/mod_file_string/mod_file_string.c b/src/mod/formats/mod_file_string/mod_file_string.c</span>
<span style="color: #000080; font-weight: bold">index ca86cbd..7e36c72 100644</span>
<span style="color: #A00000">--- a/src/mod/formats/mod_file_string/mod_file_string.c</span>
<span style="color: #00A000">+++ b/src/mod/formats/mod_file_string/mod_file_string.c</span>
<span style="color: #800080; font-weight: bold">@@ -77,7 +77,7 @@ static int next_file(switch_file_handle_t *handle)</span>
        if (!prefix) {
<span style="color: #A00000">-                if (!(prefix = switch_core_get_variable("sound_prefix"))) {</span>
<span style="color: #00A000">+                if (!(prefix = switch_core_get_variable_pdup("sound_prefix", handle->memory_pool))) {</span>
                        prefix = SWITCH_GLOBAL_dirs.sounds_dir;
                }
        }
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c</span>
<span style="color: #000080; font-weight: bold">index 9eb2636..1d6ee8d 100644</span>
<span style="color: #A00000">--- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c</span>
<span style="color: #00A000">+++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c</span>
<span style="color: #800080; font-weight: bold">@@ -3378,8 +3378,9 @@ static JSBool js_global_get(JSContext * cx, JSObject * obj, uintN argc, jsval *</span>
        if (argc > 0) {
                var_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
<span style="color: #A00000">-                val = switch_core_get_variable(var_name);</span>
<span style="color: #00A000">+                val = switch_core_get_variable_dup(var_name);</span>
                *rval = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, val));
<span style="color: #00A000">+                free(val);</span>
                return JS_TRUE;
        }
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c</span>
<span style="color: #000080; font-weight: bold">index 468190d..9e61312 100644</span>
<span style="color: #A00000">--- a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c</span>
<span style="color: #00A000">+++ b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c</span>
<span style="color: #800080; font-weight: bold">@@ -322,6 +322,7 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name)</span>
        int at = 0;
        char *dp;
        abyss_bool rval = FALSE;
<span style="color: #00A000">+        char *dup_domain = NULL;</span>
        p = RequestHeaderValue(r, "authorization");
<span style="color: #800080; font-weight: bold">@@ -354,7 +355,9 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name)</span>
                                                if (globals.default_domain) {
                                                        domain_name = globals.default_domain;
                                                } else {
<span style="color: #A00000">-                                                        domain_name = switch_core_get_variable("domain");</span>
<span style="color: #00A000">+                                                        if ((dup_domain = switch_core_get_variable_dup("domain"))) {</span>
<span style="color: #00A000">+                                                                domain_name = dup_domain;</span>
<span style="color: #00A000">+                                                        }</span>
                                                }
                                        }
                                }
<span style="color: #800080; font-weight: bold">@@ -465,6 +468,7 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name)</span>
        switch_safe_free(mypass1);
        switch_safe_free(mypass2);
        switch_safe_free(box);
<span style="color: #00A000">+        switch_safe_free(dup_domain);</span>
        return rval;
}
<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 70b1879..f750496 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">@@ -672,7 +672,7 @@ SWITCH_DECLARE(const char *) switch_channel_get_hold_music_partner(switch_channe</span>
SWITCH_DECLARE(const char *) switch_channel_get_variable_dup(switch_channel_t *channel, const char *varname, switch_bool_t dup)
{
<span style="color: #A00000">-        const char *v = NULL, *r = NULL;</span>
<span style="color: #00A000">+        const char *v = NULL, *r = NULL, *vdup = NULL;</span>
        switch_assert(channel != NULL);
        switch_mutex_lock(channel->profile_mutex);
<span style="color: #800080; font-weight: bold">@@ -690,13 +690,16 @@ SWITCH_DECLARE(const char *) switch_channel_get_variable_dup(switch_channel_t *c</span>
                }
                if (!cp || !(v = switch_caller_get_field_by_name(cp, varname))) {
<span style="color: #A00000">-                        v = switch_core_get_variable(varname);</span>
<span style="color: #00A000">+                        if ((vdup = switch_core_get_variable_pdup(varname, switch_core_session_get_pool(channel->session)))) {</span>
<span style="color: #00A000">+                                v = vdup;</span>
<span style="color: #00A000">+                        }</span>
                }
        }
<span style="color: #A00000">-        if (dup) {</span>
<span style="color: #A00000">-                if (v)</span>
<span style="color: #00A000">+        if (dup && v != vdup) {</span>
<span style="color: #00A000">+                if (v) {</span>
                        r = switch_core_session_strdup(channel->session, v);
<span style="color: #00A000">+                }</span>
        } else {
                r = v;
        }
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_console.c b/src/switch_console.c</span>
<span style="color: #000080; font-weight: bold">index 41bbb91..c5d601b 100644</span>
<span style="color: #A00000">--- a/src/switch_console.c</span>
<span style="color: #00A000">+++ b/src/switch_console.c</span>
<span style="color: #800080; font-weight: bold">@@ -643,9 +643,9 @@ SWITCH_DECLARE_NONSTD(switch_status_t) switch_console_list_uuid(const char *line</span>
        if (!zstr(cursor)) {
                sql = switch_mprintf("select distinct uuid from channels where uuid like '%q%%' and hostname='%q' order by uuid",
<span style="color: #A00000">-                                                         cursor, switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                         cursor, switch_core_get_hostname());</span>
        } else {
<span style="color: #A00000">-                sql = switch_mprintf("select distinct uuid from channels where hostname='%q' order by uuid", switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                sql = switch_mprintf("select distinct uuid from channels where hostname='%q' order by uuid", switch_core_get_hostname());</span>
        }
        switch_cache_db_execute_sql_callback(db, sql, uuid_callback, &h, &errmsg);
<span style="color: #800080; font-weight: bold">@@ -764,7 +764,7 @@ SWITCH_DECLARE(unsigned char) switch_console_complete(const char *line, const ch</span>
        if (h.words == 0) {
                sql = switch_mprintf("select distinct name from interfaces where type='api' and name like '%q%%' and hostname='%q' order by name",
<span style="color: #A00000">-                                                         buf, switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                         buf, switch_core_get_hostname());</span>
        }
        if (sql) {
<span style="color: #800080; font-weight: bold">@@ -792,7 +792,7 @@ SWITCH_DECLARE(unsigned char) switch_console_complete(const char *line, const ch</span>
                if (h.words == 0) {
                        stream.write_function(&stream, "select distinct a1 from complete where " "a1 not in (select name from interfaces where hostname='%s') %s ",
<span style="color: #A00000">-                                                                 switch_core_get_variable("hostname"), argc ? "and" : "");</span>
<span style="color: #00A000">+                                                                 switch_core_get_hostname(), argc ? "and" : "");</span>
                } else {
                        if (db->type == SCDB_TYPE_CORE_DB) {
                                stream.write_function(&stream, "select distinct a%d,'%q','%q' from complete where ", h.words + 1, switch_str_nil(dup), switch_str_nil(lp));
<span style="color: #800080; font-weight: bold">@@ -821,7 +821,7 @@ SWITCH_DECLARE(unsigned char) switch_console_complete(const char *line, const ch</span>
                        }
                }
<span style="color: #A00000">-                stream.write_function(&stream, " and hostname='%s' order by a%d", switch_core_get_variable("hostname"), h.words + 1);</span>
<span style="color: #00A000">+                stream.write_function(&stream, " and hostname='%s' order by a%d", switch_core_get_hostname(), h.words + 1);</span>
                
                switch_cache_db_execute_sql_callback(db, stream.data, comp_callback, &h, &errmsg);
<span style="color: #800080; font-weight: bold">@@ -1794,7 +1794,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_complete(const char *string)</span>
                                                }
                                        }
                                }
<span style="color: #A00000">-                                mystream.write_function(&mystream, " '%s')", switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                mystream.write_function(&mystream, " '%s')", switch_core_get_hostname());</span>
                                switch_cache_db_persistant_execute(db, mystream.data, 5);
                                status = SWITCH_STATUS_SUCCESS;
                        } else if (!strcasecmp(argv[0], "add")) {
<span style="color: #800080; font-weight: bold">@@ -1810,7 +1810,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_complete(const char *string)</span>
                                                }
                                        }
                                }
<span style="color: #A00000">-                                mystream.write_function(&mystream, " '%s')", switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                mystream.write_function(&mystream, " '%s')", switch_core_get_hostname());</span>
                                switch_cache_db_persistant_execute(db, mystream.data, 5);
                                status = SWITCH_STATUS_SUCCESS;
<span style="color: #800080; font-weight: bold">@@ -1827,7 +1827,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_complete(const char *string)</span>
                                                        mystream.write_function(&mystream, "a%d = '%w'%w", x + 1, switch_str_nil(argv[x + 1]), x == argc - 2 ? "" : " and ");
                                                }
                                        }
<span style="color: #A00000">-                                        mystream.write_function(&mystream, " and hostname='%s'", switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                        mystream.write_function(&mystream, " and hostname='%s'", switch_core_get_hostname());</span>
                                        switch_cache_db_persistant_execute(db, mystream.data, 1);
                                }
                                status = SWITCH_STATUS_SUCCESS;
<span style="color: #800080; font-weight: bold">@@ -1863,38 +1863,38 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_alias(const char *string)</span>
                        }
                        
                        if (!strcasecmp(argv[0], "stickyadd") && argc == 3) {
<span style="color: #A00000">-                                sql = switch_mprintf("delete from aliases where alias='%q' and hostname='%q'", argv[1], switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                sql = switch_mprintf("delete from aliases where alias='%q' and hostname='%q'", argv[1], switch_core_get_hostname());</span>
                                switch_cache_db_persistant_execute(db, sql, 5);
                                switch_safe_free(sql);
                                if (db->type == SCDB_TYPE_CORE_DB) {
                                        sql = switch_mprintf("insert into aliases (sticky, alias, command, hostname) values (1, '%q','%q','%q')",
<span style="color: #A00000">-                                                                                 argv[1], argv[2], switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                                                 argv[1], argv[2], switch_core_get_hostname());</span>
                                } else {
                                        sql = switch_mprintf("insert into aliases (sticky, alias, command, hostname) values (1, '%w','%w','%w')",
<span style="color: #A00000">-                                                                                 argv[1], argv[2], switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                                                 argv[1], argv[2], switch_core_get_hostname());</span>
                                }
                                switch_cache_db_persistant_execute(db, sql, 5);
                                status = SWITCH_STATUS_SUCCESS;
                        } else if (!strcasecmp(argv[0], "add") && argc == 3) {
<span style="color: #A00000">-                                sql = switch_mprintf("delete from aliases where alias='%q' and hostname='%q'", argv[1], switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                sql = switch_mprintf("delete from aliases where alias='%q' and hostname='%q'", argv[1], switch_core_get_hostname());</span>
                                switch_cache_db_persistant_execute(db, sql, 5);
                                switch_safe_free(sql);
                                if (db->type == SCDB_TYPE_CORE_DB) {
                                        sql = switch_mprintf("insert into aliases (sticky, alias, command, hostname) values (0, '%q','%q','%q')",
<span style="color: #A00000">-                                                                                 argv[1], argv[2], switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                                                 argv[1], argv[2], switch_core_get_hostname());</span>
                                } else {
                                        sql = switch_mprintf("insert into aliases (sticky, alias, command, hostname) values (0, '%w','%w','%w')",
<span style="color: #A00000">-                                                                                 argv[1], argv[2], switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                                                 argv[1], argv[2], switch_core_get_hostname());</span>
                                }
                                switch_cache_db_persistant_execute(db, sql, 5);
                                status = SWITCH_STATUS_SUCCESS;
                        } else if (!strcasecmp(argv[0], "del") && argc == 2) {
                                char *what = argv[1];
                                if (!strcasecmp(what, "*")) {
<span style="color: #A00000">-                                        sql = switch_mprintf("delete from aliases where hostname='%q'", switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                        sql = switch_mprintf("delete from aliases where hostname='%q'", switch_core_get_hostname());</span>
                                        switch_cache_db_persistant_execute(db, sql, 1);
                                } else {
<span style="color: #A00000">-                                        sql = switch_mprintf("delete from aliases where alias='%q' and hostname='%q'", argv[1], switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                        sql = switch_mprintf("delete from aliases where alias='%q' and hostname='%q'", argv[1], switch_core_get_hostname());</span>
                                        switch_cache_db_persistant_execute(db, sql, 5);
                                }
                                status = SWITCH_STATUS_SUCCESS;
<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 43fb36d..8754305 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">@@ -261,6 +261,11 @@ SWITCH_DECLARE(void) switch_core_dump_variables(switch_stream_handle_t *stream)</span>
        switch_mutex_unlock(runtime.global_mutex);
}
<span style="color: #00A000">+SWITCH_DECLARE(const char *) switch_core_get_hostname(void)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        return runtime.hostname;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
SWITCH_DECLARE(char *) switch_core_get_variable(const char *varname)
{
        char *val;
<span style="color: #800080; font-weight: bold">@@ -270,6 +275,32 @@ SWITCH_DECLARE(char *) switch_core_get_variable(const char *varname)</span>
        return val;
}
<span style="color: #00A000">+SWITCH_DECLARE(char *) switch_core_get_variable_dup(const char *varname)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        char *val = NULL, *v;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        switch_mutex_lock(runtime.global_var_mutex);</span>
<span style="color: #00A000">+        if ((v = (char *) switch_event_get_header(runtime.global_vars, varname))) {</span>
<span style="color: #00A000">+                val = strdup(v);</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+        switch_mutex_unlock(runtime.global_var_mutex);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        return val;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+SWITCH_DECLARE(char *) switch_core_get_variable_pdup(const char *varname, switch_memory_pool_t *pool)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        char *val = NULL, *v;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        switch_mutex_lock(runtime.global_var_mutex);</span>
<span style="color: #00A000">+        if ((v = (char *) switch_event_get_header(runtime.global_vars, varname))) {</span>
<span style="color: #00A000">+                val = switch_core_strdup(pool, v);</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+        switch_mutex_unlock(runtime.global_var_mutex);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        return val;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
static void switch_core_unset_variables(void)
{
        switch_mutex_lock(runtime.global_var_mutex);
<span style="color: #800080; font-weight: bold">@@ -1202,12 +1233,18 @@ static void switch_core_set_serial(void)</span>
        if ((fd = open(path, O_RDONLY, 0)) < 0) {
<span style="color: #A00000">-                char *ip = switch_core_get_variable("local_ip_v4");</span>
<span style="color: #00A000">+                char *ip = switch_core_get_variable_dup("local_ip_v4");</span>
                uint32_t ipi = 0;
                switch_byte_t *byte;
                int i = 0;
<span style="color: #A00000">-                switch_inet_pton(AF_INET, ip, &ipi);</span>
<span style="color: #00A000">+                if (ip) {</span>
<span style="color: #00A000">+                        switch_inet_pton(AF_INET, ip, &ipi);</span>
<span style="color: #00A000">+                        free(ip);</span>
<span style="color: #00A000">+                        ip = NULL;</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
                byte = (switch_byte_t *) & ipi;
                for (i = 0; i < 8; i += 2) {
<span style="color: #800080; font-weight: bold">@@ -1237,7 +1274,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc</span>
        char guess_ip[256];
        int mask = 0;
        struct in_addr in;
<span style="color: #A00000">-        char hostname[256] = "";</span>
<span style="color: #00A000">+</span>
        if (runtime.runlevel > 0) {
                /* one per customer */
<span style="color: #800080; font-weight: bold">@@ -1310,8 +1347,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc</span>
                runtime.console = stdout;
        }
<span style="color: #A00000">-        gethostname(hostname, sizeof(hostname));</span>
<span style="color: #A00000">-        switch_core_set_variable("hostname", hostname);</span>
<span style="color: #00A000">+        gethostname(runtime.hostname, sizeof(runtime.hostname));</span>
<span style="color: #00A000">+        switch_core_set_variable("hostname", runtime.hostname);</span>
        switch_find_local_ip(guess_ip, sizeof(guess_ip), &mask, AF_INET);
        switch_core_set_variable("local_ip_v4", guess_ip);
<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 19f2354..fc7d223 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">@@ -102,7 +102,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file,</span>
                        }
                        if (!spool_path) {
<span style="color: #A00000">-                                spool_path = switch_core_get_variable(SWITCH_AUDIO_SPOOL_PATH_VARIABLE);</span>
<span style="color: #00A000">+                                spool_path = switch_core_get_variable_pdup(SWITCH_AUDIO_SPOOL_PATH_VARIABLE, fh->memory_pool);</span>
                        }
                        file_path = fh->file_path;
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c</span>
<span style="color: #000080; font-weight: bold">index 2db2a0d..73890a1 100644</span>
<span style="color: #A00000">--- a/src/switch_core_sqldb.c</span>
<span style="color: #00A000">+++ b/src/switch_core_sqldb.c</span>
<span style="color: #800080; font-weight: bold">@@ -1134,7 +1134,7 @@ static void core_event_handler(switch_event_t *event)</span>
                                new_sql() = switch_mprintf("insert into tasks values(%q,'%q','%q',%q, '%q')",
                                                                                 id,
                                                                                 switch_event_get_header_nil(event, "task-desc"),
<span style="color: #A00000">-                                                                                 switch_event_get_header_nil(event, "task-group"), manager ? manager : "0", switch_core_get_variable("hostname")</span>
<span style="color: #00A000">+                                                                                 switch_event_get_header_nil(event, "task-group"), manager ? manager : "0", switch_core_get_hostname()</span>
                                                                                 );
                        }
                }
<span style="color: #800080; font-weight: bold">@@ -1142,7 +1142,7 @@ static void core_event_handler(switch_event_t *event)</span>
        case SWITCH_EVENT_DEL_SCHEDULE:
        case SWITCH_EVENT_EXE_SCHEDULE:
                new_sql() = switch_mprintf("delete from tasks where task_id=%q and hostname='%q'",
<span style="color: #A00000">-                                                                 switch_event_get_header_nil(event, "task-id"), switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                                 switch_event_get_header_nil(event, "task-id"), switch_core_get_hostname());</span>
                break;
        case SWITCH_EVENT_RE_SCHEDULE:
                {
<span style="color: #800080; font-weight: bold">@@ -1153,7 +1153,7 @@ static void core_event_handler(switch_event_t *event)</span>
                                new_sql() = switch_mprintf("update tasks set task_desc='%q',task_group='%q', task_sql_manager=%q where task_id=%q and hostname='%q'",
                                                                                 switch_event_get_header_nil(event, "task-desc"),
                                                                                 switch_event_get_header_nil(event, "task-group"), manager ? manager : "0", id,
<span style="color: #A00000">-                                                                                 switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                                                 switch_core_get_hostname());</span>
                        }
                }
                break;
<span style="color: #800080; font-weight: bold">@@ -1163,10 +1163,10 @@ static void core_event_handler(switch_event_t *event)</span>
                        
                        if (uuid) {
                                new_sql() = switch_mprintf("delete from channels where uuid='%q' and hostname='%q'",
<span style="color: #A00000">-                                                                                 uuid, switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                                                 uuid, switch_core_get_hostname());</span>
                                new_sql() = switch_mprintf("delete from calls where (caller_uuid='%q' or callee_uuid='%q') and hostname='%q'",
<span style="color: #A00000">-                                                                                 uuid, uuid, switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                                                 uuid, uuid, switch_core_get_hostname());</span>
                        }
                }
<span style="color: #800080; font-weight: bold">@@ -1178,12 +1178,12 @@ static void core_event_handler(switch_event_t *event)</span>
                                                                         "update calls set callee_uuid='%q' where callee_uuid='%q' and hostname='%q'",
                                                                         switch_event_get_header_nil(event, "unique-id"),
                                                                         switch_event_get_header_nil(event, "old-unique-id"),
<span style="color: #A00000">-                                                                         switch_core_get_variable("hostname"),</span>
<span style="color: #00A000">+                                                                         switch_core_get_hostname(),</span>
                                                                         switch_event_get_header_nil(event, "unique-id"),
                                                                         switch_event_get_header_nil(event, "old-unique-id"),
<span style="color: #A00000">-                                                                         switch_core_get_variable("hostname"),</span>
<span style="color: #00A000">+                                                                         switch_core_get_hostname(),</span>
                                                                         switch_event_get_header_nil(event, "unique-id"),
<span style="color: #A00000">-                                                                         switch_event_get_header_nil(event, "old-unique-id"), switch_core_get_variable("hostname")</span>
<span style="color: #00A000">+                                                                         switch_event_get_header_nil(event, "old-unique-id"), switch_core_get_hostname()</span>
                                                                         );
                        break;
                }
<span style="color: #800080; font-weight: bold">@@ -1198,7 +1198,7 @@ static void core_event_handler(switch_event_t *event)</span>
                                                                 switch_event_get_header_nil(event, "channel-state"),
                                                                 switch_event_get_header_nil(event, "channel-call-state"),
                                                                 switch_event_get_header_nil(event, "caller-dialplan"),
<span style="color: #A00000">-                                                                 switch_event_get_header_nil(event, "caller-context"), switch_core_get_variable("hostname")</span>
<span style="color: #00A000">+                                                                 switch_event_get_header_nil(event, "caller-context"), switch_core_get_hostname()</span>
                                                                 );
                break;
        case SWITCH_EVENT_CODEC:
<span style="color: #800080; font-weight: bold">@@ -1211,7 +1211,7 @@ static void core_event_handler(switch_event_t *event)</span>
                         switch_event_get_header_nil(event, "channel-write-codec-name"),
                         switch_event_get_header_nil(event, "channel-write-codec-rate"),
                         switch_event_get_header_nil(event, "channel-write-codec-bit-rate"),
<span style="color: #A00000">-                         switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                         switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());</span>
                break;
        case SWITCH_EVENT_CHANNEL_HOLD:
        case SWITCH_EVENT_CHANNEL_UNHOLD:
<span style="color: #800080; font-weight: bold">@@ -1223,7 +1223,7 @@ static void core_event_handler(switch_event_t *event)</span>
                                                                 switch_event_get_header_nil(event, "application-data"),
                                                                 switch_event_get_header_nil(event, "channel-presence-id"),
                                                                 switch_event_get_header_nil(event, "channel-presence-data"),
<span style="color: #A00000">-                                                                 switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname")</span>
<span style="color: #00A000">+                                                                 switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname()</span>
                                                                 );
        }
<span style="color: #800080; font-weight: bold">@@ -1238,7 +1238,7 @@ static void core_event_handler(switch_event_t *event)</span>
                                                                                 switch_event_get_header_nil(event, "channel-presence-data"),
                                                                                 switch_event_get_header_nil(event, "channel-call-uuid"),
                                                                                 extra_cols,
<span style="color: #A00000">-                                                                                 switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                                                 switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());</span>
                                free(extra_cols);
                        } else {
                                new_sql() = switch_mprintf("update channels set "
<span style="color: #800080; font-weight: bold">@@ -1246,7 +1246,7 @@ static void core_event_handler(switch_event_t *event)</span>
                                                                                 switch_event_get_header_nil(event, "channel-presence-id"),
                                                                                 switch_event_get_header_nil(event, "channel-presence-data"),
                                                                                 switch_event_get_header_nil(event, "channel-call-uuid"),
<span style="color: #A00000">-                                                                                 switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                                                 switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());</span>
                        }
                }
<span style="color: #800080; font-weight: bold">@@ -1281,7 +1281,7 @@ static void core_event_handler(switch_event_t *event)</span>
                                                                                 switch_str_nil(name),
                                                                                 switch_str_nil(number),
                                                                                 switch_event_get_header_nil(event, "direction"),
<span style="color: #A00000">-                                                                                 switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                                                 switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());</span>
                                name = switch_event_get_header(event, "callee-name");
                                number = switch_event_get_header(event, "callee-number");
<span style="color: #800080; font-weight: bold">@@ -1298,7 +1298,7 @@ static void core_event_handler(switch_event_t *event)</span>
                {
                        new_sql() = switch_mprintf("update channels set callstate='%q' where uuid='%q' and hostname='%q'",
                                                                         switch_event_get_header_nil(event, "channel-call-state"),
<span style="color: #A00000">-                                                                         switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                                         switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());</span>
                }
                break;
<span style="color: #800080; font-weight: bold">@@ -1330,7 +1330,7 @@ static void core_event_handler(switch_event_t *event)</span>
                                                                                         switch_event_get_header_nil(event, "channel-presence-id"),
                                                                                         switch_event_get_header_nil(event, "channel-presence-data"),
                                                                                         extra_cols,
<span style="color: #A00000">-                                                                                         switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                                                         switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());</span>
                                        free(extra_cols);
                                } else {
                                        new_sql() = switch_mprintf("update channels set state='%s',cid_name='%q',cid_num='%q',"
<span style="color: #800080; font-weight: bold">@@ -1345,13 +1345,13 @@ static void core_event_handler(switch_event_t *event)</span>
                                                                                         switch_event_get_header_nil(event, "caller-context"),
                                                                                         switch_event_get_header_nil(event, "channel-presence-id"),
                                                                                         switch_event_get_header_nil(event, "channel-presence-data"),
<span style="color: #A00000">-                                                                                         switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                                                         switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());</span>
                                }
                                break;
                        default:
                                new_sql() = switch_mprintf("update channels set state='%s' where uuid='%s' and hostname='%q'",
                                                                                 switch_event_get_header_nil(event, "channel-state"),
<span style="color: #A00000">-                                                                                 switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                                                 switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());</span>
                                break;
                        }
<span style="color: #800080; font-weight: bold">@@ -1377,7 +1377,7 @@ static void core_event_handler(switch_event_t *event)</span>
                        new_sql() = switch_mprintf("update channels set call_uuid='%q' where uuid='%s' and hostname='%q'",
                                                                         switch_event_get_header_nil(event, "channel-call-uuid"),
<span style="color: #A00000">-                                                                         switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                                         switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());</span>
                        if (runtime.odbc_dbtype == DBTYPE_DEFAULT) {
                                func_name = "function";
<span style="color: #800080; font-weight: bold">@@ -1404,7 +1404,7 @@ static void core_event_handler(switch_event_t *event)</span>
                                                                         callee_cid_num,
                                                                         switch_event_get_header_nil(event, "Other-Leg-destination-number"),
                                                                         switch_event_get_header_nil(event, "Other-Leg-channel-name"),
<span style="color: #A00000">-                                                                         switch_event_get_header_nil(event, "Other-Leg-unique-id"), switch_core_get_variable("hostname")</span>
<span style="color: #00A000">+                                                                         switch_event_get_header_nil(event, "Other-Leg-unique-id"), switch_core_get_hostname()</span>
                                                                         );
                }
                break;
<span style="color: #800080; font-weight: bold">@@ -1413,14 +1413,14 @@ static void core_event_handler(switch_event_t *event)</span>
                        char *uuid = switch_event_get_header_nil(event, "caller-unique-id");
                        new_sql() = switch_mprintf("delete from calls where (caller_uuid='%q' or callee_uuid='%q') and hostname='%q'",
<span style="color: #A00000">-                                                                         uuid, uuid, switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                                         uuid, uuid, switch_core_get_hostname());</span>
                        break;
                }
        case SWITCH_EVENT_SHUTDOWN:
                new_sql() = switch_mprintf("delete from channels where hostname='%q';"
                                                                 "delete from interfaces where hostname='%q';"
                                                                 "delete from calls where hostname='%q'",
<span style="color: #A00000">-                                                                 switch_core_get_variable("hostname"), switch_core_get_variable("hostname"), switch_core_get_variable("hostname")</span>
<span style="color: #00A000">+                                                                 switch_core_get_hostname(), switch_core_get_hostname(), switch_core_get_hostname()</span>
                                                                 );
                break;
        case SWITCH_EVENT_LOG:
<span style="color: #800080; font-weight: bold">@@ -1438,7 +1438,7 @@ static void core_event_handler(switch_event_t *event)</span>
                                        switch_mprintf
                                        ("insert into interfaces (type,name,description,syntax,ikey,filename,hostname) values('%q','%q','%q','%q','%q','%q','%q')", type, name,
                                         switch_str_nil(description), switch_str_nil(syntax), switch_str_nil(key), switch_str_nil(filename),
<span style="color: #A00000">-                                         switch_core_get_variable("hostname")</span>
<span style="color: #00A000">+                                         switch_core_get_hostname()</span>
                                         );
                        }
                        break;
<span style="color: #800080; font-weight: bold">@@ -1449,7 +1449,7 @@ static void core_event_handler(switch_event_t *event)</span>
                        const char *name = switch_event_get_header_nil(event, "name");
                        if (!zstr(type) && !zstr(name)) {
                                new_sql() = switch_mprintf("delete from interfaces where type='%q' and name='%q' and hostname='%q'", type, name,
<span style="color: #A00000">-                                                                                 switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                                                 switch_core_get_hostname());</span>
                        }
                        break;
                }
<span style="color: #800080; font-weight: bold">@@ -1461,7 +1461,7 @@ static void core_event_handler(switch_event_t *event)</span>
                                break;
                        }
                        new_sql() = switch_mprintf("update channels set secure='%s' where uuid='%s' and hostname='%q'",
<span style="color: #A00000">-                                                                         type, switch_event_get_header_nil(event, "caller-unique-id"), switch_core_get_variable("hostname")</span>
<span style="color: #00A000">+                                                                         type, switch_event_get_header_nil(event, "caller-unique-id"), switch_core_get_hostname()</span>
                                                                         );
                        break;
                }
<span style="color: #800080; font-weight: bold">@@ -1472,12 +1472,12 @@ static void core_event_handler(switch_event_t *event)</span>
                        if (!strcmp("add", op)) {
                                new_sql() = switch_mprintf("insert into nat (port, proto, sticky, hostname) values (%s, %s, %d,'%q')",
                                                                                 switch_event_get_header_nil(event, "port"),
<span style="color: #A00000">-                                                                                 switch_event_get_header_nil(event, "proto"), sticky, switch_core_get_variable("hostname")</span>
<span style="color: #00A000">+                                                                                 switch_event_get_header_nil(event, "proto"), sticky, switch_core_get_hostname()</span>
                                                                                 );
                        } else if (!strcmp("del", op)) {
                                new_sql() = switch_mprintf("delete from nat where port=%s and proto=%s and hostname='%q'",
                                                                                 switch_event_get_header_nil(event, "port"),
<span style="color: #A00000">-                                                                                 switch_event_get_header_nil(event, "proto"), switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                                                                                 switch_event_get_header_nil(event, "proto"), switch_core_get_hostname());</span>
                        } else if (!strcmp("status", op)) {
                                /* call show nat api */
                        } else if (!strcmp("status_response", op)) {
<span style="color: #800080; font-weight: bold">@@ -1664,7 +1664,7 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_</span>
                        char sql[512] = "";
                        char *tables[] = { "channels", "calls", "interfaces", "tasks", NULL };
                        int i;
<span style="color: #A00000">-                        const char *hostname = switch_core_get_variable("hostname");</span>
<span style="color: #00A000">+                        const char *hostname = switch_core_get_hostname();</span>
                        for (i = 0; tables[i]; i++) {
                                switch_snprintf(sql, sizeof(sql), "delete from %s where hostname='%s'", tables[i], hostname);
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_event.c b/src/switch_event.c</span>
<span style="color: #000080; font-weight: bold">index 003fc82..3e12ea1 100644</span>
<span style="color: #A00000">--- a/src/switch_event.c</span>
<span style="color: #00A000">+++ b/src/switch_event.c</span>
<span style="color: #800080; font-weight: bold">@@ -1673,6 +1673,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const</span>
                                        int offset = 0;
                                        int ooffset = 0;
                                        char *ptr;
<span style="color: #00A000">+                                        char *gvar = NULL;</span>
                                        if ((expanded = switch_event_expand_headers(event, (char *) vname)) == vname) {
                                                expanded = NULL;
<span style="color: #800080; font-weight: bold">@@ -1689,7 +1690,9 @@ SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const</span>
                                        }
                                        if (!(sub_val = switch_event_get_header(event, vname))) {
<span style="color: #A00000">-                                                sub_val = switch_core_get_variable(vname);</span>
<span style="color: #00A000">+                                                if ((gvar = switch_core_get_variable_dup(vname))) {</span>
<span style="color: #00A000">+                                                        sub_val = gvar;</span>
<span style="color: #00A000">+                                                }</span>
                                        }
                                        if (offset || ooffset) {
<span style="color: #800080; font-weight: bold">@@ -1710,6 +1713,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const</span>
                                                }
                                        }
<span style="color: #00A000">+                                        switch_safe_free(gvar);</span>
                                        switch_safe_free(expanded);
                                } else {
                                        switch_stream_handle_t stream = { 0 };
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_nat.c b/src/switch_nat.c</span>
<span style="color: #000080; font-weight: bold">index 536baee..85b0247 100644</span>
<span style="color: #A00000">--- a/src/switch_nat.c</span>
<span style="color: #00A000">+++ b/src/switch_nat.c</span>
<span style="color: #800080; font-weight: bold">@@ -45,6 +45,7 @@</span>
typedef struct {
        switch_nat_type_t nat_type;
<span style="color: #00A000">+        char nat_type_str[5];</span>
        struct UPNPUrls urls;
        struct IGDdatas data;
        char *descURL;
<span style="color: #800080; font-weight: bold">@@ -420,6 +421,7 @@ SWITCH_DECLARE(void) switch_nat_init(switch_memory_pool_t *pool)</span>
                switch_core_set_variable("nat_public_addr", nat_globals.pub_addr);
                switch_core_set_variable("nat_private_addr", nat_globals.pvt_addr);
                switch_core_set_variable("nat_type", nat_globals.nat_type == SWITCH_NAT_TYPE_PMP ? "pmp" : "upnp");
<span style="color: #00A000">+                strncpy(nat_globals.nat_type_str, nat_globals.nat_type == SWITCH_NAT_TYPE_PMP ? "pmp" : "upnp", sizeof(nat_globals.nat_type_str) - 1);</span>
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "NAT detected type: %s, ExtIP: '%s'\n",
                                                 nat_globals.nat_type == SWITCH_NAT_TYPE_PMP ? "pmp" : "upnp", nat_globals.pub_addr);
<span style="color: #800080; font-weight: bold">@@ -564,6 +566,11 @@ static switch_status_t switch_nat_del_mapping_upnp(switch_port_t port, switch_na</span>
        return status;
}
<span style="color: #00A000">+SWITCH_DECLARE(const char *) switch_nat_get_type(void)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        return nat_globals.nat_type_str;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
SWITCH_DECLARE(switch_status_t) switch_nat_add_mapping_internal(switch_port_t port, switch_nat_ip_proto_t proto, switch_port_t * external_port,
                                                                                                                                switch_bool_t sticky, switch_bool_t publish)
{
<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 4acadfe..e8d7558 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">@@ -791,8 +791,8 @@ static void zrtp_logger(int level, const char *data, int len, int offset)</span>
SWITCH_DECLARE(void) switch_rtp_init(switch_memory_pool_t *pool)
{
#ifdef ENABLE_ZRTP
<span style="color: #A00000">-        const char *zid_string = switch_core_get_variable("switch_serial");</span>
<span style="color: #A00000">-        const char *zrtp_enabled = switch_core_get_variable("zrtp_enabled");</span>
<span style="color: #00A000">+        const char *zid_string = switch_core_get_variable_pdup("switch_serial", pool);</span>
<span style="color: #00A000">+        const char *zrtp_enabled = switch_core_get_variable_pdup("zrtp_enabled", pool);</span>
        zrtp_config_t zrtp_config;
        char zrtp_cache_path[256] = "";
        zrtp_on = zrtp_enabled ? switch_true(zrtp_enabled) : 0;
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_utils.c b/src/switch_utils.c</span>
<span style="color: #000080; font-weight: bold">index 850b07f..eb5ed7f 100644</span>
<span style="color: #A00000">--- a/src/switch_utils.c</span>
<span style="color: #00A000">+++ b/src/switch_utils.c</span>
<span style="color: #800080; font-weight: bold">@@ -1154,8 +1154,8 @@ SWITCH_DECLARE(switch_status_t) switch_find_local_ip(char *buf, int len, int *ma</span>
{
        switch_status_t status = SWITCH_STATUS_FALSE;
        char *base;
<span style="color: #A00000">-        const char *force_local_ip_v4 = switch_core_get_variable("force_local_ip_v4");</span>
<span style="color: #A00000">-        const char *force_local_ip_v6 = switch_core_get_variable("force_local_ip_v6");</span>
<span style="color: #00A000">+        char *force_local_ip_v4 = switch_core_get_variable_dup("force_local_ip_v4");</span>
<span style="color: #00A000">+        char *force_local_ip_v6 = switch_core_get_variable_dup("force_local_ip_v6");</span>
#ifdef WIN32
        SOCKET tmp_socket;
<span style="color: #800080; font-weight: bold">@@ -1176,14 +1176,20 @@ SWITCH_DECLARE(switch_status_t) switch_find_local_ip(char *buf, int len, int *ma</span>
        case AF_INET:
                if (force_local_ip_v4) {
                        switch_copy_string(buf, force_local_ip_v4, len);
<span style="color: #00A000">+                        switch_safe_free(force_local_ip_v4);</span>
<span style="color: #00A000">+                        switch_safe_free(force_local_ip_v6);</span>
                        return SWITCH_STATUS_SUCCESS;
                }
        case AF_INET6:
                if (force_local_ip_v6) {
                        switch_copy_string(buf, force_local_ip_v6, len);
<span style="color: #00A000">+                        switch_safe_free(force_local_ip_v4);</span>
<span style="color: #00A000">+                        switch_safe_free(force_local_ip_v6);</span>
                        return SWITCH_STATUS_SUCCESS;
                }
        default:
<span style="color: #00A000">+                switch_safe_free(force_local_ip_v4);</span>
<span style="color: #00A000">+                switch_safe_free(force_local_ip_v6);</span>
                break;
        }
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_xml.c b/src/switch_xml.c</span>
<span style="color: #000080; font-weight: bold">index 964a769..4c30d98 100644</span>
<span style="color: #A00000">--- a/src/switch_xml.c</span>
<span style="color: #00A000">+++ b/src/switch_xml.c</span>
<span style="color: #800080; font-weight: bold">@@ -1208,11 +1208,12 @@ static char *expand_vars(char *buf, char *ebuf, switch_size_t elen, switch_size_</span>
                                var = rp;
                                *e++ = '\0';
                                rp = e;
<span style="color: #A00000">-                                if ((val = switch_core_get_variable(var))) {</span>
<span style="color: #00A000">+                                if ((val = switch_core_get_variable_dup(var))) {</span>
                                        char *p;
                                        for (p = val; p && *p && wp <= ep; p++) {
                                                *wp++ = *p;
                                        }
<span style="color: #00A000">+                                        free(val);</span>
                                }
                                continue;
                        } else if (err) {
</pre></div>
<div class="highlight"><pre>committer: Brian West
comments:
FS-3023
<span style="color: #000080; font-weight: bold">diff --git a/src/include/switch_cpp.h b/src/include/switch_cpp.h</span>
<span style="color: #000080; font-weight: bold">index 0bd2a8b..f4a0922 100644</span>
<span style="color: #A00000">--- a/src/include/switch_cpp.h</span>
<span style="color: #00A000">+++ b/src/include/switch_cpp.h</span>
<span style="color: #800080; font-weight: bold">@@ -68,6 +68,10 @@ Note that the first parameter to the new operator is implicitly handled by c++..</span>
SWITCH_DECLARE(void) consoleLog(char *level_str, char *msg);
SWITCH_DECLARE(void) consoleCleanLog(char *msg);
<span style="color: #00A000">+SWITCH_DECLARE(bool) email(char *to, char *from, char *headers = NULL, char *body = NULL,</span>
<span style="color: #00A000">+ char *file = NULL, char *convert_cmd = NULL, char *convert_ext = NULL);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
         class CoreSession;
         class IVRMenu {
<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 e91de6d..71e9f99 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">@@ -33352,6 +33352,30 @@ SWIGEXPORT void SWIGSTDCALL CSharp_consoleCleanLog(char * jarg1) {</span>
}
<span style="color: #00A000">+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_email(char * jarg1, char * jarg2, char * jarg3, char * jarg4, char * jarg5, char * jarg6, char * jarg7) {</span>
<span style="color: #00A000">+ unsigned int jresult ;</span>
<span style="color: #00A000">+ char *arg1 = (char *) 0 ;</span>
<span style="color: #00A000">+ char *arg2 = (char *) 0 ;</span>
<span style="color: #00A000">+ char *arg3 = (char *) NULL ;</span>
<span style="color: #00A000">+ char *arg4 = (char *) NULL ;</span>
<span style="color: #00A000">+ char *arg5 = (char *) NULL ;</span>
<span style="color: #00A000">+ char *arg6 = (char *) NULL ;</span>
<span style="color: #00A000">+ char *arg7 = (char *) NULL ;</span>
<span style="color: #00A000">+ bool result;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (char *)jarg1; </span>
<span style="color: #00A000">+ arg2 = (char *)jarg2; </span>
<span style="color: #00A000">+ arg3 = (char *)jarg3; </span>
<span style="color: #00A000">+ arg4 = (char *)jarg4; </span>
<span style="color: #00A000">+ arg5 = (char *)jarg5; </span>
<span style="color: #00A000">+ arg6 = (char *)jarg6; </span>
<span style="color: #00A000">+ arg7 = (char *)jarg7; </span>
<span style="color: #00A000">+ result = (bool)email(arg1,arg2,arg3,arg4,arg5,arg6,arg7);</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 void * SWIGSTDCALL CSharp_new_IvrMenu(void * jarg1, char * jarg2, char * jarg3, char * jarg4, char * jarg5, char * jarg6, char * jarg7, char * jarg8, char * jarg9, char * jarg10, int jarg11, int jarg12, int jarg13, int jarg14, int jarg15, int jarg16) {
void * jresult ;
IVRMenu *arg1 = (IVRMenu *) 0 ;
<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 1f02c3f..c640199 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">@@ -5364,6 +5364,11 @@ public class freeswitch {</span>
freeswitchPINVOKE.consoleCleanLog(msg);
}
<span style="color: #00A000">+ public static bool email(string to, string from, string headers, string body, string file, string convert_cmd, string convert_ext) {</span>
<span style="color: #00A000">+ bool ret = freeswitchPINVOKE.email(to, from, headers, body, file, convert_cmd, convert_ext);</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
public static void console_log(string level_str, string msg) {
freeswitchPINVOKE.console_log(level_str, msg);
}
<span style="color: #800080; font-weight: bold">@@ -13588,6 +13593,9 @@ class freeswitchPINVOKE {</span>
[DllImport("mod_managed", EntryPoint="CSharp_consoleCleanLog")]
public static extern void consoleCleanLog(string jarg1);
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_email")]</span>
<span style="color: #00A000">+ public static extern bool email(string jarg1, string jarg2, string jarg3, string jarg4, string jarg5, string jarg6, string jarg7);</span>
<span style="color: #00A000">+</span>
[DllImport("mod_managed", EntryPoint="CSharp_new_IvrMenu")]
public static extern IntPtr new_IvrMenu(HandleRef jarg1, string jarg2, string jarg3, string jarg4, string jarg5, string jarg6, string jarg7, string jarg8, string jarg9, string jarg10, int jarg11, int jarg12, int jarg13, int jarg14, int jarg15, int jarg16);
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_cpp.cpp b/src/switch_cpp.cpp</span>
<span style="color: #000080; font-weight: bold">index bbcd05d..c62946b 100644</span>
<span style="color: #A00000">--- a/src/switch_cpp.cpp</span>
<span style="color: #00A000">+++ b/src/switch_cpp.cpp</span>
<span style="color: #800080; font-weight: bold">@@ -1195,6 +1195,13 @@ SWITCH_DECLARE(void) console_clean_log(char *msg)</span>
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN,SWITCH_LOG_DEBUG, "%s", switch_str_nil(msg));
}
<span style="color: #00A000">+SWITCH_DECLARE(bool) email(char *to, char *from, char *headers, char *body, char *file, char *convert_cmd, char *convert_ext)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+ if (switch_simple_email(to, from, headers, body, file, convert_cmd, convert_ext) == SWITCH_TRUE) {</span>
<span style="color: #00A000">+ return true;</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+ return false;</span>
<span style="color: #00A000">+}</span>
SWITCH_DECLARE(void) msleep(unsigned ms)
{
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
FS-3024
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c</span>
<span style="color: #000080; font-weight: bold">index 35311c9..2db2a0d 100644</span>
<span style="color: #A00000">--- a/src/switch_core_sqldb.c</span>
<span style="color: #00A000">+++ b/src/switch_core_sqldb.c</span>
<span style="color: #800080; font-weight: bold">@@ -1409,9 +1409,13 @@ static void core_event_handler(switch_event_t *event)</span>
                }
                break;
        case SWITCH_EVENT_CHANNEL_UNBRIDGE:
<span style="color: #A00000">-                new_sql() = switch_mprintf("delete from calls where (caller_uuid='%s' or callee_uuid='%q') and hostname='%q'",</span>
<span style="color: #A00000">-                                                                 switch_event_get_header_nil(event, "caller-unique-id"), switch_core_get_variable("hostname"));</span>
<span style="color: #A00000">-                break;</span>
<span style="color: #00A000">+                {</span>
<span style="color: #00A000">+                        char *uuid = switch_event_get_header_nil(event, "caller-unique-id");</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        new_sql() = switch_mprintf("delete from calls where (caller_uuid='%q' or callee_uuid='%q') and hostname='%q'",</span>
<span style="color: #00A000">+                                                                         uuid, uuid, switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+                        break;</span>
<span style="color: #00A000">+                }</span>
        case SWITCH_EVENT_SHUTDOWN:
                new_sql() = switch_mprintf("delete from channels where hostname='%q';"
                                                                 "delete from interfaces where hostname='%q';"
</pre></div>
<div class="highlight"><pre>committer: Andrew Thompson
comments:
Added conference UUID to 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 12b3193..961a140 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">@@ -3778,6 +3778,7 @@ static void conference_xlist(conference_obj_t *conference, switch_xml_t x_confer</span>
        switch_xml_set_attr_d(x_conference, "member-count", ival);
        switch_snprintf(i, sizeof(i), "%u", conference->rate);
        switch_xml_set_attr_d(x_conference, "rate", ival);
<span style="color: #00A000">+        switch_xml_set_attr_d(x_conference, "uuid", conference->uuid_str);</span>
        if (switch_test_flag(conference, CFLAG_LOCKED)) {
                switch_xml_set_attr_d(x_conference, "locked", "true");
</pre></div>
<div class="highlight"><pre>committer: Brian West
comments:
sigh
<span style="color: #000080; font-weight: bold">diff --git a/libs/openzap/mod_openzap/mod_openzap.c b/libs/openzap/mod_openzap/mod_openzap.c</span>
<span style="color: #000080; font-weight: bold">index 3e5227e..d52149c 100644</span>
<span style="color: #A00000">--- a/libs/openzap/mod_openzap/mod_openzap.c</span>
<span style="color: #00A000">+++ b/libs/openzap/mod_openzap/mod_openzap.c</span>
<span style="color: #800080; font-weight: bold">@@ -135,7 +135,9 @@ void dump_chan_xml(zap_span_t *span, uint32_t chan_id, switch_stream_handle_t *s</span>
static void zap_set_npi(const char *npi_string, uint8_t *target)
{
<span style="color: #A00000">-        if (!strcasecmp(npi_string, "isdn") || !strcasecmp(npi_string, "e164")) {</span>
<span style="color: #00A000">+        if (switch_is_number(npi_string)) {</span>
<span style="color: #00A000">+                *target = (uint8_t)atoi(npi_string);</span>
<span style="color: #00A000">+        } else if (!strcasecmp(npi_string, "isdn") || !strcasecmp(npi_string, "e164")) {</span>
                *target = ZAP_NPI_ISDN;
        } else if (!strcasecmp(npi_string, "data")) {
                *target = ZAP_NPI_DATA;
<span style="color: #800080; font-weight: bold">@@ -157,7 +159,9 @@ static void zap_set_npi(const char *npi_string, uint8_t *target)</span>
static void zap_set_ton(const char *ton_string, uint8_t *target)
{
<span style="color: #A00000">-        if (!strcasecmp(ton_string, "national")) {</span>
<span style="color: #00A000">+        if (switch_is_number(ton_string)) {</span>
<span style="color: #00A000">+                *target = (uint8_t)atoi(ton_string);</span>
<span style="color: #00A000">+        } else if (!strcasecmp(ton_string, "national")) {</span>
                *target = ZAP_TON_NATIONAL;
        } else if (!strcasecmp(ton_string, "international")) {
                *target = ZAP_TON_INTERNATIONAL;
<span style="color: #800080; font-weight: bold">@@ -1231,15 +1235,8 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi</span>
        }
        
        if ((var = switch_event_get_header(var_event, "openzap_outbound_ton")) || (var = switch_core_get_variable("openzap_outbound_ton"))) {
<span style="color: #A00000">-                if (!strcasecmp(var, "national")) {</span>
<span style="color: #A00000">-                        caller_data.ani.type = ZAP_TON_NATIONAL;</span>
<span style="color: #A00000">-                } else if (!strcasecmp(var, "international")) {</span>
<span style="color: #A00000">-                        caller_data.ani.type = ZAP_TON_INTERNATIONAL;</span>
<span style="color: #A00000">-                } else if (!strcasecmp(var, "local")) {</span>
<span style="color: #A00000">-                        caller_data.ani.type = ZAP_TON_SUBSCRIBER_NUMBER;</span>
<span style="color: #A00000">-                } else if (!strcasecmp(var, "unknown")) {</span>
<span style="color: #A00000">-                        caller_data.ani.type = ZAP_TON_UNKNOWN;</span>
<span style="color: #A00000">-                }</span>
<span style="color: #00A000">+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Setting TON to: %s\n", var);</span>
<span style="color: #00A000">+                zap_set_ton(var, &caller_data.ani.type);</span>
        } else {
                caller_data.ani.type = outbound_profile->destination_number_ton;
        }
<span style="color: #800080; font-weight: bold">@@ -1248,9 +1245,14 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi</span>
                zap_set_string((char *)caller_data.raw_data, var);
                caller_data.raw_data_len = strlen(var);
        }
<span style="color: #A00000">-</span>
<span style="color: #A00000">-        caller_data.ani.plan = outbound_profile->destination_number_numplan;</span>
<span style="color: #A00000">-</span>
<span style="color: #00A000">+        </span>
<span style="color: #00A000">+        if ((var = switch_event_get_header(var_event, "openzap_outbound_npi")) || (var = switch_core_get_variable("openzap_outbound_npi"))) {</span>
<span style="color: #00A000">+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Setting NPI to: %s\n", var);</span>
<span style="color: #00A000">+                zap_set_npi(var, &caller_data.ani.plan);</span>
<span style="color: #00A000">+        } else {</span>
<span style="color: #00A000">+                caller_data.ani.plan = outbound_profile->destination_number_numplan;</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+        </span>
        /* blindly copy data from outbound_profile. They will be overwritten
         * by calling zap_caller_data if needed after */
        caller_data.cid_num.type = outbound_profile->caller_ton;
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
more loopback improvements
<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 727de27..be9b499 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">@@ -82,6 +82,7 @@ struct private_object {</span>
        int32_t bowout_frame_count;
        char *other_uuid;
        switch_queue_t *frame_queue;
<span style="color: #00A000">+        int64_t packet_count;</span>
};
typedef struct private_object private_t;
<span style="color: #800080; font-weight: bold">@@ -577,40 +578,22 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch</span>
                if (tech_pvt->write_frame) {
                        switch_frame_free(&tech_pvt->write_frame);
                }
<span style="color: #A00000">-</span>
<span style="color: #00A000">+                </span>
                tech_pvt->write_frame = (switch_frame_t *) pop;
                tech_pvt->write_frame->codec = &tech_pvt->read_codec;
                *frame = tech_pvt->write_frame;
<span style="color: #00A000">+                tech_pvt->packet_count++;</span>
<span style="color: #00A000">+                switch_clear_flag_locked(tech_pvt, TFLAG_CNG);</span>
<span style="color: #00A000">+                switch_clear_flag(tech_pvt->write_frame, SFF_CNG);</span>
        } else {
                switch_set_flag(tech_pvt, TFLAG_CNG);
        }
        if (switch_test_flag(tech_pvt, TFLAG_CNG)) {
<span style="color: #A00000">-                unsigned char data[SWITCH_RECOMMENDED_BUFFER_SIZE];</span>
<span style="color: #A00000">-                uint32_t flag = 0;</span>
<span style="color: #A00000">-                switch_status_t encode_status;</span>
<span style="color: #A00000">-                uint32_t rate = tech_pvt->read_codec.implementation->actual_samples_per_second;</span>
<span style="color: #A00000">-</span>
                *frame = &tech_pvt->cng_frame;
                tech_pvt->cng_frame.codec = &tech_pvt->read_codec;
                tech_pvt->cng_frame.datalen = tech_pvt->read_codec.implementation->decoded_bytes_per_packet;
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                memset(tech_pvt->cng_frame.data, 0, tech_pvt->cng_frame.datalen);</span>
<span style="color: #A00000">-                memset(&data, 0, tech_pvt->read_codec.implementation->decoded_bytes_per_packet);</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                if (strcasecmp(tech_pvt->read_codec.implementation->iananame, "L16")) {</span>
<span style="color: #A00000">-                        encode_status = switch_core_codec_encode(&tech_pvt->read_codec,</span>
<span style="color: #A00000">-                                                                                                         NULL,</span>
<span style="color: #A00000">-                                                                                                         data,</span>
<span style="color: #A00000">-                                                                                                         tech_pvt->read_codec.implementation->decoded_bytes_per_packet,</span>
<span style="color: #A00000">-                                                                                                         tech_pvt->read_codec.implementation->actual_samples_per_second,</span>
<span style="color: #A00000">-                                                                                                         tech_pvt->cng_frame.data, &tech_pvt->cng_frame.datalen, &rate, &flag);</span>
<span style="color: #A00000">-                        if (encode_status != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #A00000">-                                switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);</span>
<span style="color: #A00000">-                        }</span>
<span style="color: #A00000">-                } else {</span>
<span style="color: #A00000">-                        switch_set_flag((&tech_pvt->cng_frame), SFF_CNG);</span>
<span style="color: #A00000">-                }</span>
<span style="color: #00A000">+                switch_set_flag((&tech_pvt->cng_frame), SFF_CNG);</span>
                switch_clear_flag_locked(tech_pvt, TFLAG_CNG);
        }
</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:
chlog: freetdm: Fix for only checking first progress indicator for early-media flag
<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 0b52011..578677a 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">@@ -385,8 +385,12 @@ 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: #A00000">-                                        if (cnStEvnt->progInd.eh.pres && cnStEvnt->progInd.progDesc.val == IN_PD_IBAVAIL) {</span>
<span style="color: #00A000">+                                case FTDM_CHANNEL_STATE_RINGING:</span>
<span style="color: #00A000">+                                        if ((cnStEvnt->progInd.eh.pres && cnStEvnt->progInd.progDesc.val == IN_PD_IBAVAIL) ||</span>
<span style="color: #00A000">+                                                (cnStEvnt->progInd1.eh.pres && cnStEvnt->progInd1.progDesc.val == IN_PD_IBAVAIL) ||</span>
<span style="color: #00A000">+                                                (cnStEvnt->progInd2.eh.pres && cnStEvnt->progInd2.progDesc.val == IN_PD_IBAVAIL) ||</span>
<span style="color: #00A000">+                                                (cnStEvnt->progInd3.eh.pres && cnStEvnt->progInd3.progDesc.val == IN_PD_IBAVAIL)) {</span>
<span style="color: #00A000">+                                                </span>
                                                ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Early media available\n");
                                                sngisdn_set_flag(sngisdn_info, FLAG_MEDIA_READY);
                                        } else {
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
only execute execute_on_[answer|media|ring] async when its expressed in app::arg form vs 'app arg form'
<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 de472a9..70b1879 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">@@ -2595,14 +2595,15 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_ring_ready_value(swi</span>
                if (var) {
                        char *arg = NULL;
                        app = switch_core_session_strdup(channel->session, var);
<span style="color: #A00000">-                        if ((arg = strchr(app, ' '))) {</span>
<span style="color: #A00000">-                                *arg++ = '\0';</span>
<span style="color: #A00000">-                        }</span>
<span style="color: #A00000">-                        if (switch_core_session_in_thread(channel->session)) {</span>
<span style="color: #A00000">-                                switch_core_session_execute_application(channel->session, app, arg);</span>
<span style="color: #A00000">-                        } else {</span>
<span style="color: #00A000">+                        if (strstr(app, "::")) {</span>
                                switch_core_session_execute_application_async(channel->session, app, arg);
<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(channel->session, app, arg);</span>
                        }
                }
<span style="color: #800080; font-weight: bold">@@ -2653,14 +2654,16 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_pre_answered(switch_</span>
                         (var = switch_channel_get_variable(channel, SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE))) && !zstr(var)) {
                        char *arg = NULL;
                        app = switch_core_session_strdup(channel->session, var);
<span style="color: #A00000">-                        if ((arg = strchr(app, ' '))) {</span>
<span style="color: #A00000">-                                *arg++ = '\0';</span>
<span style="color: #A00000">-                        }</span>
<span style="color: #A00000">-                        if (switch_core_session_in_thread(channel->session)) {</span>
<span style="color: #A00000">-                                switch_core_session_execute_application(channel->session, app, arg);</span>
<span style="color: #A00000">-                        } else {</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        if (strstr(app, "::")) {</span>
                                switch_core_session_execute_application_async(channel->session, app, arg);
<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(channel->session, app, arg);</span>
                        }
                }
<span style="color: #800080; font-weight: bold">@@ -2825,27 +2828,17 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_chan</span>
                 (!switch_channel_test_flag(channel, CF_EARLY_MEDIA) && (var = switch_channel_get_variable(channel, SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE))))
                && !zstr(var)) {
                char *arg = NULL;
<span style="color: #A00000">-                char *colon = NULL;</span>
                app = switch_core_session_strdup(channel->session, var);
<span style="color: #A00000">-                arg = strchr(app, ' ');</span>
<span style="color: #A00000">-                colon = strchr(app, ':');</span>
<span style="color: #A00000">-                if (colon && (!arg || arg > colon) && *(colon + 1) == ':') {</span>
<span style="color: #A00000">-                        switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_DEBUG, "%s execute on answer: %s (BROADCAST)\n", channel->name, app);</span>
<span style="color: #A00000">-                        switch_ivr_broadcast(switch_core_session_get_uuid(channel->session), app, SMF_NONE);</span>
<span style="color: #00A000">+                if (strstr(app, "::")) {</span>
<span style="color: #00A000">+                        switch_core_session_execute_application_async(channel->session, app, arg);</span>
                } else {
<span style="color: #A00000">-                        if (arg) {</span>
<span style="color: #00A000">+                        if ((arg = strchr(app, ' '))) {</span>
                                *arg++ = '\0';
                        }
<span style="color: #A00000">-                        switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_DEBUG, "%s execute on answer: %s(%s)\n", channel->name, app,</span>
<span style="color: #A00000">-                                                         switch_str_nil(arg));</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                        if (switch_core_session_in_thread(channel->session)) {</span>
<span style="color: #A00000">-                                switch_core_session_execute_application(channel->session, app, arg);</span>
<span style="color: #A00000">-                        } else {</span>
<span style="color: #A00000">-                                switch_core_session_execute_application_async(channel->session, app, arg);</span>
<span style="color: #A00000">-                        }</span>
<span style="color: #00A000">+                        </span>
<span style="color: #00A000">+                        switch_core_session_execute_application(channel->session, app, arg);</span>
                }
        }
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
try another approach to previous mod_loopback fix ... FS-3011
<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..727de27 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">@@ -608,9 +608,9 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch</span>
                        if (encode_status != SWITCH_STATUS_SUCCESS) {
                                switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
                        }
<span style="color: #A00000">-</span>
<span style="color: #00A000">+                } else {</span>
<span style="color: #00A000">+                        switch_set_flag((&tech_pvt->cng_frame), SFF_CNG);</span>
                }
<span style="color: #A00000">-                //switch_set_flag((&tech_pvt->cng_frame), SFF_CNG);</span>
                switch_clear_flag_locked(tech_pvt, TFLAG_CNG);
        }
<span style="color: #800080; font-weight: bold">@@ -642,7 +642,10 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc</span>
        tech_pvt = switch_core_session_get_private(session);
        switch_assert(tech_pvt != NULL);
<span style="color: #A00000">-        if (switch_test_flag(frame, SFF_CNG) || switch_test_flag(tech_pvt, TFLAG_CNG) || (switch_test_flag(tech_pvt, TFLAG_BOWOUT) && switch_test_flag(tech_pvt, TFLAG_BOWOUT_USED))) {</span>
<span style="color: #00A000">+        if (switch_test_flag(frame, SFF_CNG) || </span>
<span style="color: #00A000">+                switch_test_flag(tech_pvt, TFLAG_CNG) || (switch_test_flag(tech_pvt, TFLAG_BOWOUT) && switch_test_flag(tech_pvt, TFLAG_BOWOUT_USED))) {</span>
<span style="color: #00A000">+                switch_core_timer_sync(&tech_pvt->timer);</span>
<span style="color: #00A000">+                switch_core_timer_sync(&tech_pvt->other_tech_pvt->timer);</span>
                return SWITCH_STATUS_SUCCESS;
        }
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
revert 02d1af647bac6b937de02608d53ea1831f51b968
<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 aa57668..f875f6b 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: #00A000">+        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: #A00000">-        switch_codec_implementation_t read_impl;</span>
};
typedef struct private_object private_t;
<span style="color: #800080; font-weight: bold">@@ -111,6 +111,7 @@ 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: #00A000">+        const switch_codec_implementation_t *read_impl;</span>
        if (codec) {
                iananame = codec->implementation->iananame;
<span style="color: #800080; font-weight: bold">@@ -165,7 +166,15 @@ 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">-        tech_pvt->read_impl = *tech_pvt->read_codec.implementation;</span>
<span style="color: #00A000">+        if (tech_pvt->flag_mutex) {</span>
<span style="color: #00A000">+                switch_core_timer_destroy(&tech_pvt->timer);</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        read_impl = tech_pvt->read_codec.implementation;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        switch_core_timer_init(&tech_pvt->timer, "soft",</span>
<span style="color: #00A000">+                                                 read_impl->microseconds_per_packet / 1000, read_impl->samples_per_packet * 4, switch_core_session_get_pool(session));</span>
<span style="color: #00A000">+</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">@@ -367,6 +376,7 @@ 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: #00A000">+                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">@@ -558,10 +568,12 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch</span>
                goto end;
        }
<span style="color: #A00000">-        mutex = tech_pvt->mutex;</span>
<span style="color: #00A000">+        switch_core_timer_next(&tech_pvt->timer);</span>
<span style="color: #00A000">+        mutex = tech_pvt->mutex;</span>
<span style="color: #00A000">+        switch_mutex_lock(mutex);</span>
<span style="color: #A00000">-        if (switch_queue_pop_timeout(tech_pvt->frame_queue, &pop, tech_pvt->read_impl.microseconds_per_packet) == SWITCH_STATUS_SUCCESS && pop) {</span>
<span style="color: #00A000">+        if (switch_queue_trypop(tech_pvt->frame_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) {</span>
                if (tech_pvt->write_frame) {
                        switch_frame_free(&tech_pvt->write_frame);
                }
<span style="color: #800080; font-weight: bold">@@ -573,8 +585,6 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch</span>
                switch_set_flag(tech_pvt, TFLAG_CNG);
        }
<span style="color: #A00000">-        switch_mutex_lock(mutex);</span>
<span style="color: #A00000">-</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">@@ -765,6 +775,8 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s</span>
                                switch_frame_free(&frame);
                        }
<span style="color: #00A000">+                        switch_core_timer_sync(&tech_pvt->timer);</span>
<span style="color: #00A000">+</span>
                }
                break;
        default:
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
try to fix SOA problem with early and answer audio with dissimilar sdp
<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 6c91ce1..8bceb3b 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">@@ -707,11 +707,20 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)</span>
                cid = generate_pai_str(tech_pvt);
<span style="color: #A00000">-                if (switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MODE) && tech_pvt->early_sdp && strcmp(tech_pvt->early_sdp, tech_pvt->local_sdp_str)) {</span>
<span style="color: #A00000">-                        /* The SIP RFC for SOA forbids sending a 183 with one sdp then a 200 with another but it won't do us much good unless </span>
<span style="color: #A00000">-                         we do so in this case we will abandon the SOA rules and go rogue.</span>
<span style="color: #A00000">-                         */</span>
<span style="color: #A00000">-                        sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA);</span>
<span style="color: #00A000">+                if (switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MODE) && tech_pvt->early_sdp) {</span>
<span style="color: #00A000">+                        char *a, *b;</span>
<span style="color: #00A000">+                        </span>
<span style="color: #00A000">+                        /* start at the s= line to avoid some devices who update the o= between messages */</span>
<span style="color: #00A000">+                        a = strstr(tech_pvt->early_sdp, "s=");</span>
<span style="color: #00A000">+                        b = strstr(tech_pvt->local_sdp_str, "s=");</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        if (!a || !b || strcmp(a, b)) {</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                                /* The SIP RFC for SOA forbids sending a 183 with one sdp then a 200 with another but it won't do us much good unless </span>
<span style="color: #00A000">+                                 we do so in this case we will abandon the SOA rules and go rogue.</span>
<span style="color: #00A000">+                                */</span>
<span style="color: #00A000">+                                sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA);</span>
<span style="color: #00A000">+                        }</span>
                }
                if (sofia_use_soa(tech_pvt)) {
</pre></div>
<div class="highlight"><pre>committer: Mathieu Parent
comments:
Skinny: handle Enbloc messages
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/endpoints/mod_skinny/skinny_protocol.h b/src/mod/endpoints/mod_skinny/skinny_protocol.h</span>
<span style="color: #000080; font-weight: bold">index 20e7d7f..1a26558 100644</span>
<span style="color: #A00000">--- a/src/mod/endpoints/mod_skinny/skinny_protocol.h</span>
<span style="color: #00A000">+++ b/src/mod/endpoints/mod_skinny/skinny_protocol.h</span>
<span style="color: #800080; font-weight: bold">@@ -68,6 +68,13 @@ struct PACKED keypad_button_message {</span>
uint32_t call_id;
};
<span style="color: #00A000">+/* EnblocCallMessage */</span>
<span style="color: #00A000">+#define ENBLOC_CALL_MESSAGE 0x0004</span>
<span style="color: #00A000">+struct PACKED enbloc_call_message {</span>
<span style="color: #00A000">+ char called_party[24];</span>
<span style="color: #00A000">+ uint32_t line_instance;</span>
<span style="color: #00A000">+};</span>
<span style="color: #00A000">+</span>
/* StimulusMessage */
#define STIMULUS_MESSAGE 0x0005
struct PACKED stimulus_message {
<span style="color: #800080; font-weight: bold">@@ -562,6 +569,7 @@ union skinny_data {</span>
struct register_message reg;
struct port_message port;
struct keypad_button_message keypad_button;
<span style="color: #00A000">+ struct enbloc_call_message enbloc_call;</span>
struct stimulus_message stimulus;
struct off_hook_message off_hook;
struct on_hook_message on_hook;
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/endpoints/mod_skinny/skinny_server.c b/src/mod/endpoints/mod_skinny/skinny_server.c</span>
<span style="color: #000080; font-weight: bold">index 5874be4..e7c761d 100644</span>
<span style="color: #A00000">--- a/src/mod/endpoints/mod_skinny/skinny_server.c</span>
<span style="color: #00A000">+++ b/src/mod/endpoints/mod_skinny/skinny_server.c</span>
<span style="color: #800080; font-weight: bold">@@ -1171,6 +1171,29 @@ switch_status_t skinny_handle_keypad_button_message(listener_t *listener, skinny</span>
        return SWITCH_STATUS_SUCCESS;
}
<span style="color: #00A000">+switch_status_t skinny_handle_enbloc_call_message(listener_t *listener, skinny_message_t *request)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        uint32_t line_instance = 1;</span>
<span style="color: #00A000">+        switch_core_session_t *session = NULL;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        skinny_check_data_length(request, sizeof(request->data.enbloc_call.called_party));</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if(skinny_check_data_length_soft(request, sizeof(request->data.enbloc_call))) {</span>
<span style="color: #00A000">+                if (request->data.enbloc_call.line_instance > 0) {</span>
<span style="color: #00A000">+                        line_instance = request->data.enbloc_call.line_instance;</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        session = skinny_profile_find_session(listener->profile, listener, &line_instance, 0);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if(session) {</span>
<span style="color: #00A000">+                skinny_session_process_dest(session, listener, line_instance, request->data.enbloc_call.called_party, '\0', 0);</span>
<span style="color: #00A000">+                switch_core_session_rwunlock(session);</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>
switch_status_t skinny_handle_stimulus_message(listener_t *listener, skinny_message_t *request)
{
        switch_status_t status = SWITCH_STATUS_SUCCESS;
<span style="color: #800080; font-weight: bold">@@ -2004,6 +2027,8 @@ switch_status_t skinny_handle_request(listener_t *listener, skinny_message_t *re</span>
                        return skinny_handle_port_message(listener, request);
                case KEYPAD_BUTTON_MESSAGE:
                        return skinny_handle_keypad_button_message(listener, request);
<span style="color: #00A000">+                case ENBLOC_CALL_MESSAGE:</span>
<span style="color: #00A000">+                        return skinny_handle_enbloc_call_message(listener, request);</span>
                case STIMULUS_MESSAGE:
                        return skinny_handle_stimulus_message(listener, request);
                case OFF_HOOK_MESSAGE:
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/endpoints/mod_skinny/skinny_tables.c b/src/mod/endpoints/mod_skinny/skinny_tables.c</span>
<span style="color: #000080; font-weight: bold">index 053b350..466a705 100644</span>
<span style="color: #A00000">--- a/src/mod/endpoints/mod_skinny/skinny_tables.c</span>
<span style="color: #00A000">+++ b/src/mod/endpoints/mod_skinny/skinny_tables.c</span>
<span style="color: #800080; font-weight: bold">@@ -39,6 +39,7 @@ struct skinny_table SKINNY_MESSAGE_TYPES[] = {</span>
{"RegisterMessage", REGISTER_MESSAGE},
{"PortMessage", PORT_MESSAGE},
{"KeypadButtonMessage", KEYPAD_BUTTON_MESSAGE},
<span style="color: #00A000">+ {"EnblocCallMessage", ENBLOC_CALL_MESSAGE},</span>
{"StimulusMessage", STIMULUS_MESSAGE},
{"OffHookMessage", OFF_HOOK_MESSAGE},
{"OnHookMessage", ON_HOOK_MESSAGE},
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/endpoints/mod_skinny/skinny_tables.h b/src/mod/endpoints/mod_skinny/skinny_tables.h</span>
<span style="color: #000080; font-weight: bold">index c119e1f..bc92f9f 100644</span>
<span style="color: #A00000">--- a/src/mod/endpoints/mod_skinny/skinny_tables.h</span>
<span style="color: #00A000">+++ b/src/mod/endpoints/mod_skinny/skinny_tables.h</span>
<span style="color: #800080; font-weight: bold">@@ -87,7 +87,7 @@ uint32_t func(const char *str)\</span>
}
<span style="color: #A00000">-extern struct skinny_table SKINNY_MESSAGE_TYPES[66];</span>
<span style="color: #00A000">+extern struct skinny_table SKINNY_MESSAGE_TYPES[67];</span>
const char *skinny_message_type2str(uint32_t id);
uint32_t skinny_str2message_type(const char *str);
#define SKINNY_PUSH_MESSAGE_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_MESSAGE_TYPES)
</pre></div>
<div class="highlight"><pre>committer: Marc Olivier Chouinard
comments:
switch_xml: Fix a lock on reloadxml when stderr write is blocked. Also remove an error parsing print since reason generated were wrong and duplicate.
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_xml.c b/src/switch_xml.c</span>
<span style="color: #000080; font-weight: bold">index fe6a199..964a769 100644</span>
<span style="color: #A00000">--- a/src/switch_xml.c</span>
<span style="color: #00A000">+++ b/src/switch_xml.c</span>
<span style="color: #800080; font-weight: bold">@@ -1286,9 +1286,7 @@ static int preprocess_glob(const char *cwd, const char *pattern, int write_fd, i</span>
        }
        if (glob(pattern, GLOB_NOCHECK, NULL, &glob_data) != 0) {
<span style="color: #A00000">-                if (stderr) {</span>
<span style="color: #A00000">-                        fprintf(stderr, "Error including %s\n", pattern);</span>
<span style="color: #A00000">-                }</span>
<span style="color: #00A000">+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error including %s\n", pattern);</span>
                goto end;
        }
<span style="color: #800080; font-weight: bold">@@ -1299,11 +1297,9 @@ static int preprocess_glob(const char *cwd, const char *pattern, int write_fd, i</span>
                        *e = '\0';
                }
                if (preprocess(dir_path, glob_data.gl_pathv[n], write_fd, rlevel) < 0) {
<span style="color: #A00000">-                        const char *reason = strerror(errno);</span>
                        if (rlevel > 100) {
<span style="color: #A00000">-                                reason = "Maximum recursion limit reached";</span>
<span style="color: #00A000">+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error including %s (Maximum recursion limit reached)\n", pattern);</span>
                        }
<span style="color: #A00000">-                        fprintf(stderr, "Error including %s (%s)\n", pattern, reason);</span>
                }
                free(dir_path);
        }
</pre></div>
<div class="highlight"><pre>committer: Jeff Lenk
comments:
vs2010 reswig
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx</span>
<span style="color: #000080; font-weight: bold">index 9ebd6ff..808d548 100644</span>
<span style="color: #A00000">--- a/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx</span>
<span style="color: #00A000">+++ b/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx</span>
<span style="color: #800080; font-weight: bold">@@ -8947,6 +8947,22 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_feed(void * jarg1, void * jarg</span>
}
<span style="color: #00A000">+SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_feed_dtmf(void * jarg1, void * jarg2, void * jarg3) {</span>
<span style="color: #00A000">+ int jresult ;</span>
<span style="color: #00A000">+ switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;</span>
<span style="color: #00A000">+ switch_dtmf_t *arg2 = (switch_dtmf_t *) 0 ;</span>
<span style="color: #00A000">+ switch_asr_flag_t *arg3 = (switch_asr_flag_t *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t result;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_handle_t *)jarg1; </span>
<span style="color: #00A000">+ arg2 = (switch_dtmf_t *)jarg2; </span>
<span style="color: #00A000">+ arg3 = (switch_asr_flag_t *)jarg3; </span>
<span style="color: #00A000">+ result = (switch_status_t)switch_core_asr_feed_dtmf(arg1,(switch_dtmf_t const *)arg2,arg3);</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 int SWIGSTDCALL CSharp_switch_core_asr_check_results(void * jarg1, void * jarg2) {
int jresult ;
switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;
<span style="color: #800080; font-weight: bold">@@ -9007,6 +9023,46 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_unload_grammar(void * jarg1, c</span>
}
<span style="color: #00A000">+SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_enable_grammar(void * jarg1, char * jarg2) {</span>
<span style="color: #00A000">+ int jresult ;</span>
<span style="color: #00A000">+ switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;</span>
<span style="color: #00A000">+ char *arg2 = (char *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t result;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_handle_t *)jarg1; </span>
<span style="color: #00A000">+ arg2 = (char *)jarg2; </span>
<span style="color: #00A000">+ result = (switch_status_t)switch_core_asr_enable_grammar(arg1,(char const *)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>
<span style="color: #00A000">+SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_disable_grammar(void * jarg1, char * jarg2) {</span>
<span style="color: #00A000">+ int jresult ;</span>
<span style="color: #00A000">+ switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;</span>
<span style="color: #00A000">+ char *arg2 = (char *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t result;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_handle_t *)jarg1; </span>
<span style="color: #00A000">+ arg2 = (char *)jarg2; </span>
<span style="color: #00A000">+ result = (switch_status_t)switch_core_asr_disable_grammar(arg1,(char const *)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>
<span style="color: #00A000">+SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_disable_all_grammars(void * jarg1) {</span>
<span style="color: #00A000">+ int jresult ;</span>
<span style="color: #00A000">+ switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t result;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_handle_t *)jarg1; </span>
<span style="color: #00A000">+ result = (switch_status_t)switch_core_asr_disable_all_grammars(arg1);</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 int SWIGSTDCALL CSharp_switch_core_asr_pause(void * jarg1) {
int jresult ;
switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;
<span style="color: #800080; font-weight: bold">@@ -18313,6 +18369,94 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_asr_interface_next_get(void * jarg1)</span>
}
<span style="color: #00A000">+SWIGEXPORT void SWIGSTDCALL CSharp_switch_asr_interface_asr_enable_grammar_set(void * jarg1, void * jarg2) {</span>
<span style="color: #00A000">+ switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t (*arg2)(switch_asr_handle_t *,char const *) = (switch_status_t (*)(switch_asr_handle_t *,char const *)) 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_interface *)jarg1; </span>
<span style="color: #00A000">+ arg2 = (switch_status_t (*)(switch_asr_handle_t *,char const *))jarg2; </span>
<span style="color: #00A000">+ if (arg1) (arg1)->asr_enable_grammar = arg2;</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_asr_interface_asr_enable_grammar_get(void * jarg1) {</span>
<span style="color: #00A000">+ void * jresult ;</span>
<span style="color: #00A000">+ switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t (*result)(switch_asr_handle_t *,char const *) = 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_interface *)jarg1; </span>
<span style="color: #00A000">+ result = (switch_status_t (*)(switch_asr_handle_t *,char const *)) ((arg1)->asr_enable_grammar);</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_asr_interface_asr_disable_grammar_set(void * jarg1, void * jarg2) {</span>
<span style="color: #00A000">+ switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t (*arg2)(switch_asr_handle_t *,char const *) = (switch_status_t (*)(switch_asr_handle_t *,char const *)) 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_interface *)jarg1; </span>
<span style="color: #00A000">+ arg2 = (switch_status_t (*)(switch_asr_handle_t *,char const *))jarg2; </span>
<span style="color: #00A000">+ if (arg1) (arg1)->asr_disable_grammar = arg2;</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_asr_interface_asr_disable_grammar_get(void * jarg1) {</span>
<span style="color: #00A000">+ void * jresult ;</span>
<span style="color: #00A000">+ switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t (*result)(switch_asr_handle_t *,char const *) = 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_interface *)jarg1; </span>
<span style="color: #00A000">+ result = (switch_status_t (*)(switch_asr_handle_t *,char const *)) ((arg1)->asr_disable_grammar);</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_asr_interface_asr_disable_all_grammars_set(void * jarg1, void * jarg2) {</span>
<span style="color: #00A000">+ switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t (*arg2)(switch_asr_handle_t *) = (switch_status_t (*)(switch_asr_handle_t *)) 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_interface *)jarg1; </span>
<span style="color: #00A000">+ arg2 = (switch_status_t (*)(switch_asr_handle_t *))jarg2; </span>
<span style="color: #00A000">+ if (arg1) (arg1)->asr_disable_all_grammars = arg2;</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_asr_interface_asr_disable_all_grammars_get(void * jarg1) {</span>
<span style="color: #00A000">+ void * jresult ;</span>
<span style="color: #00A000">+ switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t (*result)(switch_asr_handle_t *) = 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_interface *)jarg1; </span>
<span style="color: #00A000">+ result = (switch_status_t (*)(switch_asr_handle_t *)) ((arg1)->asr_disable_all_grammars);</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_asr_interface_asr_feed_dtmf_set(void * jarg1, void * jarg2) {</span>
<span style="color: #00A000">+ switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t (*arg2)(switch_asr_handle_t *,switch_dtmf_t const *,switch_asr_flag_t *) = (switch_status_t (*)(switch_asr_handle_t *,switch_dtmf_t const *,switch_asr_flag_t *)) 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_interface *)jarg1; </span>
<span style="color: #00A000">+ arg2 = (switch_status_t (*)(switch_asr_handle_t *,switch_dtmf_t const *,switch_asr_flag_t *))jarg2; </span>
<span style="color: #00A000">+ if (arg1) (arg1)->asr_feed_dtmf = arg2;</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_asr_interface_asr_feed_dtmf_get(void * jarg1) {</span>
<span style="color: #00A000">+ void * jresult ;</span>
<span style="color: #00A000">+ switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t (*result)(switch_asr_handle_t *,switch_dtmf_t const *,switch_asr_flag_t *) = 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_interface *)jarg1; </span>
<span style="color: #00A000">+ result = (switch_status_t (*)(switch_asr_handle_t *,switch_dtmf_t const *,switch_asr_flag_t *)) ((arg1)->asr_feed_dtmf);</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>
SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_asr_interface() {
void * jresult ;
switch_asr_interface *result = 0 ;
<span style="color: #800080; font-weight: bold">@@ -26320,6 +26464,46 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_detect_speech_unload_grammar(void *</span>
}
<span style="color: #00A000">+SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_detect_speech_enable_grammar(void * jarg1, char * 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">+ char *arg2 = (char *) 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 = (char *)jarg2; </span>
<span style="color: #00A000">+ result = (switch_status_t)switch_ivr_detect_speech_enable_grammar(arg1,(char const *)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>
<span style="color: #00A000">+SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_detect_speech_disable_grammar(void * jarg1, char * 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">+ char *arg2 = (char *) 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 = (char *)jarg2; </span>
<span style="color: #00A000">+ result = (switch_status_t)switch_ivr_detect_speech_disable_grammar(arg1,(char const *)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>
<span style="color: #00A000">+SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_detect_speech_disable_all_grammars(void * jarg1) {</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_status_t result;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_core_session_t *)jarg1; </span>
<span style="color: #00A000">+ result = (switch_status_t)switch_ivr_detect_speech_disable_all_grammars(arg1);</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 int SWIGSTDCALL CSharp_switch_ivr_set_param_detect_speech(void * jarg1, char * jarg2, char * jarg3) {
int jresult ;
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
<span style="color: #800080; font-weight: bold">@@ -26336,6 +26520,18 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_set_param_detect_speech(void * jarg</span>
}
<span style="color: #00A000">+SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_detect_speech_start_input_timers(void * jarg1) {</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_status_t result;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_core_session_t *)jarg1; </span>
<span style="color: #00A000">+ result = (switch_status_t)switch_ivr_detect_speech_start_input_timers(arg1);</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 int SWIGSTDCALL CSharp_switch_ivr_record_session(void * jarg1, char * jarg2, unsigned long jarg3, void * jarg4) {
int jresult ;
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/languages/mod_managed/managed/swig.2010.cs b/src/mod/languages/mod_managed/managed/swig.2010.cs</span>
<span style="color: #000080; font-weight: bold">index 059fb89..61c0a4e 100644</span>
<span style="color: #A00000">--- a/src/mod/languages/mod_managed/managed/swig.2010.cs</span>
<span style="color: #00A000">+++ b/src/mod/languages/mod_managed/managed/swig.2010.cs</span>
<span style="color: #800080; font-weight: bold">@@ -2000,6 +2000,11 @@ public class freeswitch {</span>
return ret;
}
<span style="color: #00A000">+ public static switch_status_t switch_core_asr_feed_dtmf(switch_asr_handle ah, switch_dtmf_t dtmf, SWIGTYPE_p_unsigned_long flags) {</span>
<span style="color: #00A000">+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_feed_dtmf(switch_asr_handle.getCPtr(ah), switch_dtmf_t.getCPtr(dtmf), SWIGTYPE_p_unsigned_long.getCPtr(flags));</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
public static switch_status_t switch_core_asr_check_results(switch_asr_handle ah, SWIGTYPE_p_unsigned_long flags) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_check_results(switch_asr_handle.getCPtr(ah), SWIGTYPE_p_unsigned_long.getCPtr(flags));
return ret;
<span style="color: #800080; font-weight: bold">@@ -2020,6 +2025,21 @@ public class freeswitch {</span>
return ret;
}
<span style="color: #00A000">+ public static switch_status_t switch_core_asr_enable_grammar(switch_asr_handle ah, string name) {</span>
<span style="color: #00A000">+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_enable_grammar(switch_asr_handle.getCPtr(ah), name);</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ public static switch_status_t switch_core_asr_disable_grammar(switch_asr_handle ah, string name) {</span>
<span style="color: #00A000">+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_disable_grammar(switch_asr_handle.getCPtr(ah), name);</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ public static switch_status_t switch_core_asr_disable_all_grammars(switch_asr_handle ah) {</span>
<span style="color: #00A000">+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_disable_all_grammars(switch_asr_handle.getCPtr(ah));</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
public static switch_status_t switch_core_asr_pause(switch_asr_handle ah) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_pause(switch_asr_handle.getCPtr(ah));
return ret;
<span style="color: #800080; font-weight: bold">@@ -4070,11 +4090,31 @@ public class freeswitch {</span>
return ret;
}
<span style="color: #00A000">+ public static switch_status_t switch_ivr_detect_speech_enable_grammar(SWIGTYPE_p_switch_core_session session, string name) {</span>
<span style="color: #00A000">+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_detect_speech_enable_grammar(SWIGTYPE_p_switch_core_session.getCPtr(session), name);</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ public static switch_status_t switch_ivr_detect_speech_disable_grammar(SWIGTYPE_p_switch_core_session session, string name) {</span>
<span style="color: #00A000">+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_detect_speech_disable_grammar(SWIGTYPE_p_switch_core_session.getCPtr(session), name);</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ public static switch_status_t switch_ivr_detect_speech_disable_all_grammars(SWIGTYPE_p_switch_core_session session) {</span>
<span style="color: #00A000">+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_detect_speech_disable_all_grammars(SWIGTYPE_p_switch_core_session.getCPtr(session));</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
public static switch_status_t switch_ivr_set_param_detect_speech(SWIGTYPE_p_switch_core_session session, string name, string val) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_set_param_detect_speech(SWIGTYPE_p_switch_core_session.getCPtr(session), name, val);
return ret;
}
<span style="color: #00A000">+ public static switch_status_t switch_ivr_detect_speech_start_input_timers(SWIGTYPE_p_switch_core_session session) {</span>
<span style="color: #00A000">+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_detect_speech_start_input_timers(SWIGTYPE_p_switch_core_session.getCPtr(session));</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
public static switch_status_t switch_ivr_record_session(SWIGTYPE_p_switch_core_session session, string file, uint limit, switch_file_handle fh) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_record_session(SWIGTYPE_p_switch_core_session.getCPtr(session), file, limit, switch_file_handle.getCPtr(fh));
return ret;
<span style="color: #800080; font-weight: bold">@@ -7907,6 +7947,9 @@ class freeswitchPINVOKE {</span>
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_feed")]
public static extern int switch_core_asr_feed(HandleRef jarg1, HandleRef jarg2, uint jarg3, HandleRef jarg4);
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_feed_dtmf")]</span>
<span style="color: #00A000">+ public static extern int switch_core_asr_feed_dtmf(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3);</span>
<span style="color: #00A000">+</span>
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_check_results")]
public static extern int switch_core_asr_check_results(HandleRef jarg1, HandleRef jarg2);
<span style="color: #800080; font-weight: bold">@@ -7919,6 +7962,15 @@ class freeswitchPINVOKE {</span>
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_unload_grammar")]
public static extern int switch_core_asr_unload_grammar(HandleRef jarg1, string jarg2);
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_enable_grammar")]</span>
<span style="color: #00A000">+ public static extern int switch_core_asr_enable_grammar(HandleRef jarg1, string jarg2);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_disable_grammar")]</span>
<span style="color: #00A000">+ public static extern int switch_core_asr_disable_grammar(HandleRef jarg1, string jarg2);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_disable_all_grammars")]</span>
<span style="color: #00A000">+ public static extern int switch_core_asr_disable_all_grammars(HandleRef jarg1);</span>
<span style="color: #00A000">+</span>
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_pause")]
public static extern int switch_core_asr_pause(HandleRef jarg1);
<span style="color: #800080; font-weight: bold">@@ -10196,6 +10248,30 @@ class freeswitchPINVOKE {</span>
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_next_get")]
public static extern IntPtr switch_asr_interface_next_get(HandleRef jarg1);
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_enable_grammar_set")]</span>
<span style="color: #00A000">+ public static extern void switch_asr_interface_asr_enable_grammar_set(HandleRef jarg1, HandleRef jarg2);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_enable_grammar_get")]</span>
<span style="color: #00A000">+ public static extern IntPtr switch_asr_interface_asr_enable_grammar_get(HandleRef jarg1);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_disable_grammar_set")]</span>
<span style="color: #00A000">+ public static extern void switch_asr_interface_asr_disable_grammar_set(HandleRef jarg1, HandleRef jarg2);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_disable_grammar_get")]</span>
<span style="color: #00A000">+ public static extern IntPtr switch_asr_interface_asr_disable_grammar_get(HandleRef jarg1);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_disable_all_grammars_set")]</span>
<span style="color: #00A000">+ public static extern void switch_asr_interface_asr_disable_all_grammars_set(HandleRef jarg1, HandleRef jarg2);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_disable_all_grammars_get")]</span>
<span style="color: #00A000">+ public static extern IntPtr switch_asr_interface_asr_disable_all_grammars_get(HandleRef jarg1);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_feed_dtmf_set")]</span>
<span style="color: #00A000">+ public static extern void switch_asr_interface_asr_feed_dtmf_set(HandleRef jarg1, HandleRef jarg2);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_feed_dtmf_get")]</span>
<span style="color: #00A000">+ public static extern IntPtr switch_asr_interface_asr_feed_dtmf_get(HandleRef jarg1);</span>
<span style="color: #00A000">+</span>
[DllImport("mod_managed", EntryPoint="CSharp_new_switch_asr_interface")]
public static extern IntPtr new_switch_asr_interface();
<span style="color: #800080; font-weight: bold">@@ -12140,9 +12216,21 @@ class freeswitchPINVOKE {</span>
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_unload_grammar")]
public static extern int switch_ivr_detect_speech_unload_grammar(HandleRef jarg1, string jarg2);
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_enable_grammar")]</span>
<span style="color: #00A000">+ public static extern int switch_ivr_detect_speech_enable_grammar(HandleRef jarg1, string jarg2);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_disable_grammar")]</span>
<span style="color: #00A000">+ public static extern int switch_ivr_detect_speech_disable_grammar(HandleRef jarg1, string jarg2);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_disable_all_grammars")]</span>
<span style="color: #00A000">+ public static extern int switch_ivr_detect_speech_disable_all_grammars(HandleRef jarg1);</span>
<span style="color: #00A000">+</span>
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_set_param_detect_speech")]
public static extern int switch_ivr_set_param_detect_speech(HandleRef jarg1, string jarg2, string jarg3);
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_start_input_timers")]</span>
<span style="color: #00A000">+ public static extern int switch_ivr_detect_speech_start_input_timers(HandleRef jarg1);</span>
<span style="color: #00A000">+</span>
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_record_session")]
public static extern int switch_ivr_record_session(HandleRef jarg1, string jarg2, uint jarg3, HandleRef jarg4);
<span style="color: #800080; font-weight: bold">@@ -14967,6 +15055,36 @@ namespace FreeSWITCH.Native {</span>
using System;
using System.Runtime.InteropServices;
<span style="color: #00A000">+public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t {</span>
<span style="color: #00A000">+ private HandleRef swigCPtr;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ internal SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {</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">+ protected SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t() {</span>
<span style="color: #00A000">+ swigCPtr = new HandleRef(null, IntPtr.Zero);</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t 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">+</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 2.0.1</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>
<span style="color: #00A000">+using System;</span>
<span style="color: #00A000">+using System.Runtime.InteropServices;</span>
<span style="color: #00A000">+</span>
public class SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t {
private HandleRef swigCPtr;
<span style="color: #800080; font-weight: bold">@@ -19993,6 +20111,50 @@ public class switch_asr_interface : IDisposable {</span>
}
}
<span style="color: #00A000">+ public SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t asr_enable_grammar {</span>
<span style="color: #00A000">+ set {</span>
<span style="color: #00A000">+ freeswitchPINVOKE.switch_asr_interface_asr_enable_grammar_set(swigCPtr, SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t.getCPtr(value));</span>
<span style="color: #00A000">+ } </span>
<span style="color: #00A000">+ get {</span>
<span style="color: #00A000">+ IntPtr cPtr = freeswitchPINVOKE.switch_asr_interface_asr_enable_grammar_get(swigCPtr);</span>
<span style="color: #00A000">+ SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t(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 SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t asr_disable_grammar {</span>
<span style="color: #00A000">+ set {</span>
<span style="color: #00A000">+ freeswitchPINVOKE.switch_asr_interface_asr_disable_grammar_set(swigCPtr, SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t.getCPtr(value));</span>
<span style="color: #00A000">+ } </span>
<span style="color: #00A000">+ get {</span>
<span style="color: #00A000">+ IntPtr cPtr = freeswitchPINVOKE.switch_asr_interface_asr_disable_grammar_get(swigCPtr);</span>
<span style="color: #00A000">+ SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t(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 SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t asr_disable_all_grammars {</span>
<span style="color: #00A000">+ set {</span>
<span style="color: #00A000">+ freeswitchPINVOKE.switch_asr_interface_asr_disable_all_grammars_set(swigCPtr, SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t.getCPtr(value));</span>
<span style="color: #00A000">+ } </span>
<span style="color: #00A000">+ get {</span>
<span style="color: #00A000">+ IntPtr cPtr = freeswitchPINVOKE.switch_asr_interface_asr_disable_all_grammars_get(swigCPtr);</span>
<span style="color: #00A000">+ SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t(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 SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t asr_feed_dtmf {</span>
<span style="color: #00A000">+ set {</span>
<span style="color: #00A000">+ freeswitchPINVOKE.switch_asr_interface_asr_feed_dtmf_set(swigCPtr, SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t.getCPtr(value));</span>
<span style="color: #00A000">+ } </span>
<span style="color: #00A000">+ get {</span>
<span style="color: #00A000">+ IntPtr cPtr = freeswitchPINVOKE.switch_asr_interface_asr_feed_dtmf_get(swigCPtr);</span>
<span style="color: #00A000">+ SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t(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>
public switch_asr_interface() : this(freeswitchPINVOKE.new_switch_asr_interface(), true) {
}
<span style="color: #800080; font-weight: bold">@@ -28589,7 +28751,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">@@ -30446,7 +30609,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">@@ -30463,6 +30626,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: Michael Jerris
comments:
add more details to xml_curl errors
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c b/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c</span>
<span style="color: #000080; font-weight: bold">index 9bf837e..bc143d7 100644</span>
<span style="color: #A00000">--- a/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c</span>
<span style="color: #00A000">+++ b/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c</span>
<span style="color: #800080; font-weight: bold">@@ -293,12 +293,12 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con</span>
        }
        if (config_data.err) {
<span style="color: #A00000">-                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error encountered!\n");</span>
<span style="color: #00A000">+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error encountered! [%s]\ndata: [%s]\n", binding->url, data);</span>
                xml = NULL;
        } else {
                if (httpRes == 200) {
                        if (!(xml = switch_xml_parse_file(filename))) {
<span style="color: #A00000">-                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Parsing Result!\n");</span>
<span style="color: #00A000">+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Parsing Result! [%s]\ndata: [%s]\n", binding->url, data);</span>
                        }
                } else {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received HTTP error %ld trying to fetch %s\ndata: [%s]\n", httpRes, binding->url,
</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 3ee6ff6..e91de6d 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">@@ -9238,6 +9238,22 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_feed(void * jarg1, void * jarg</span>
}
<span style="color: #00A000">+SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_feed_dtmf(void * jarg1, void * jarg2, void * jarg3) {</span>
<span style="color: #00A000">+ int jresult ;</span>
<span style="color: #00A000">+ switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;</span>
<span style="color: #00A000">+ switch_dtmf_t *arg2 = (switch_dtmf_t *) 0 ;</span>
<span style="color: #00A000">+ switch_asr_flag_t *arg3 = (switch_asr_flag_t *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t result;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_handle_t *)jarg1; </span>
<span style="color: #00A000">+ arg2 = (switch_dtmf_t *)jarg2; </span>
<span style="color: #00A000">+ arg3 = (switch_asr_flag_t *)jarg3; </span>
<span style="color: #00A000">+ result = (switch_status_t)switch_core_asr_feed_dtmf(arg1,(switch_dtmf_t const *)arg2,arg3);</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 int SWIGSTDCALL CSharp_switch_core_asr_check_results(void * jarg1, void * jarg2) {
int jresult ;
switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;
<span style="color: #800080; font-weight: bold">@@ -9298,6 +9314,46 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_unload_grammar(void * jarg1, c</span>
}
<span style="color: #00A000">+SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_enable_grammar(void * jarg1, char * jarg2) {</span>
<span style="color: #00A000">+ int jresult ;</span>
<span style="color: #00A000">+ switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;</span>
<span style="color: #00A000">+ char *arg2 = (char *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t result;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_handle_t *)jarg1; </span>
<span style="color: #00A000">+ arg2 = (char *)jarg2; </span>
<span style="color: #00A000">+ result = (switch_status_t)switch_core_asr_enable_grammar(arg1,(char const *)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>
<span style="color: #00A000">+SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_disable_grammar(void * jarg1, char * jarg2) {</span>
<span style="color: #00A000">+ int jresult ;</span>
<span style="color: #00A000">+ switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;</span>
<span style="color: #00A000">+ char *arg2 = (char *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t result;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_handle_t *)jarg1; </span>
<span style="color: #00A000">+ arg2 = (char *)jarg2; </span>
<span style="color: #00A000">+ result = (switch_status_t)switch_core_asr_disable_grammar(arg1,(char const *)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>
<span style="color: #00A000">+SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_asr_disable_all_grammars(void * jarg1) {</span>
<span style="color: #00A000">+ int jresult ;</span>
<span style="color: #00A000">+ switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t result;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_handle_t *)jarg1; </span>
<span style="color: #00A000">+ result = (switch_status_t)switch_core_asr_disable_all_grammars(arg1);</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 int SWIGSTDCALL CSharp_switch_core_asr_pause(void * jarg1) {
int jresult ;
switch_asr_handle_t *arg1 = (switch_asr_handle_t *) 0 ;
<span style="color: #800080; font-weight: bold">@@ -18820,6 +18876,98 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_asr_interface_next_get(void * jarg1)</span>
}
<span style="color: #00A000">+SWIGEXPORT void SWIGSTDCALL CSharp_switch_asr_interface_asr_enable_grammar_set(void * jarg1, void * jarg2) {</span>
<span style="color: #00A000">+ switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t (*arg2)(switch_asr_handle_t *,char const *) = (switch_status_t (*)(switch_asr_handle_t *,char const *)) 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_interface *)jarg1; </span>
<span style="color: #00A000">+ arg2 = (switch_status_t (*)(switch_asr_handle_t *,char const *))jarg2; </span>
<span style="color: #00A000">+ if (arg1) (arg1)->asr_enable_grammar = 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_asr_interface_asr_enable_grammar_get(void * jarg1) {</span>
<span style="color: #00A000">+ void * jresult ;</span>
<span style="color: #00A000">+ switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t (*result)(switch_asr_handle_t *,char const *) = 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_interface *)jarg1; </span>
<span style="color: #00A000">+ result = (switch_status_t (*)(switch_asr_handle_t *,char const *)) ((arg1)->asr_enable_grammar);</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_asr_interface_asr_disable_grammar_set(void * jarg1, void * jarg2) {</span>
<span style="color: #00A000">+ switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t (*arg2)(switch_asr_handle_t *,char const *) = (switch_status_t (*)(switch_asr_handle_t *,char const *)) 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_interface *)jarg1; </span>
<span style="color: #00A000">+ arg2 = (switch_status_t (*)(switch_asr_handle_t *,char const *))jarg2; </span>
<span style="color: #00A000">+ if (arg1) (arg1)->asr_disable_grammar = 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_asr_interface_asr_disable_grammar_get(void * jarg1) {</span>
<span style="color: #00A000">+ void * jresult ;</span>
<span style="color: #00A000">+ switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t (*result)(switch_asr_handle_t *,char const *) = 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_interface *)jarg1; </span>
<span style="color: #00A000">+ result = (switch_status_t (*)(switch_asr_handle_t *,char const *)) ((arg1)->asr_disable_grammar);</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_asr_interface_asr_disable_all_grammars_set(void * jarg1, void * jarg2) {</span>
<span style="color: #00A000">+ switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t (*arg2)(switch_asr_handle_t *) = (switch_status_t (*)(switch_asr_handle_t *)) 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_interface *)jarg1; </span>
<span style="color: #00A000">+ arg2 = (switch_status_t (*)(switch_asr_handle_t *))jarg2; </span>
<span style="color: #00A000">+ if (arg1) (arg1)->asr_disable_all_grammars = 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_asr_interface_asr_disable_all_grammars_get(void * jarg1) {</span>
<span style="color: #00A000">+ void * jresult ;</span>
<span style="color: #00A000">+ switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t (*result)(switch_asr_handle_t *) = 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_interface *)jarg1; </span>
<span style="color: #00A000">+ result = (switch_status_t (*)(switch_asr_handle_t *)) ((arg1)->asr_disable_all_grammars);</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_asr_interface_asr_feed_dtmf_set(void * jarg1, void * jarg2) {</span>
<span style="color: #00A000">+ switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t (*arg2)(switch_asr_handle_t *,switch_dtmf_t const *,switch_asr_flag_t *) = (switch_status_t (*)(switch_asr_handle_t *,switch_dtmf_t const *,switch_asr_flag_t *)) 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_interface *)jarg1; </span>
<span style="color: #00A000">+ arg2 = (switch_status_t (*)(switch_asr_handle_t *,switch_dtmf_t const *,switch_asr_flag_t *))jarg2; </span>
<span style="color: #00A000">+ if (arg1) (arg1)->asr_feed_dtmf = 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_asr_interface_asr_feed_dtmf_get(void * jarg1) {</span>
<span style="color: #00A000">+ void * jresult ;</span>
<span style="color: #00A000">+ switch_asr_interface *arg1 = (switch_asr_interface *) 0 ;</span>
<span style="color: #00A000">+ switch_status_t (*result)(switch_asr_handle_t *,switch_dtmf_t const *,switch_asr_flag_t *) = 0 ;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_asr_interface *)jarg1; </span>
<span style="color: #00A000">+ result = (switch_status_t (*)(switch_asr_handle_t *,switch_dtmf_t const *,switch_asr_flag_t *)) ((arg1)->asr_feed_dtmf);</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>
SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_asr_interface() {
void * jresult ;
switch_asr_interface *result = 0 ;
<span style="color: #800080; font-weight: bold">@@ -27013,6 +27161,46 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_detect_speech_unload_grammar(void *</span>
}
<span style="color: #00A000">+SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_detect_speech_enable_grammar(void * jarg1, char * 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">+ char *arg2 = (char *) 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 = (char *)jarg2; </span>
<span style="color: #00A000">+ result = (switch_status_t)switch_ivr_detect_speech_enable_grammar(arg1,(char const *)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>
<span style="color: #00A000">+SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_detect_speech_disable_grammar(void * jarg1, char * 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">+ char *arg2 = (char *) 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 = (char *)jarg2; </span>
<span style="color: #00A000">+ result = (switch_status_t)switch_ivr_detect_speech_disable_grammar(arg1,(char const *)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>
<span style="color: #00A000">+SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_detect_speech_disable_all_grammars(void * jarg1) {</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_status_t result;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_core_session_t *)jarg1; </span>
<span style="color: #00A000">+ result = (switch_status_t)switch_ivr_detect_speech_disable_all_grammars(arg1);</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 int SWIGSTDCALL CSharp_switch_ivr_set_param_detect_speech(void * jarg1, char * jarg2, char * jarg3) {
int jresult ;
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
<span style="color: #800080; font-weight: bold">@@ -27029,6 +27217,18 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_set_param_detect_speech(void * jarg</span>
}
<span style="color: #00A000">+SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_detect_speech_start_input_timers(void * jarg1) {</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_status_t result;</span>
<span style="color: #00A000">+ </span>
<span style="color: #00A000">+ arg1 = (switch_core_session_t *)jarg1; </span>
<span style="color: #00A000">+ result = (switch_status_t)switch_ivr_detect_speech_start_input_timers(arg1);</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 int SWIGSTDCALL CSharp_switch_ivr_record_session(void * jarg1, char * jarg2, unsigned long jarg3, void * jarg4) {
int jresult ;
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
<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 48d585e..1f02c3f 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">@@ -1990,6 +1990,11 @@ public class freeswitch {</span>
return ret;
}
<span style="color: #00A000">+ public static switch_status_t switch_core_asr_feed_dtmf(switch_asr_handle ah, switch_dtmf_t dtmf, SWIGTYPE_p_unsigned_long flags) {</span>
<span style="color: #00A000">+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_feed_dtmf(switch_asr_handle.getCPtr(ah), switch_dtmf_t.getCPtr(dtmf), SWIGTYPE_p_unsigned_long.getCPtr(flags));</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
public static switch_status_t switch_core_asr_check_results(switch_asr_handle ah, SWIGTYPE_p_unsigned_long flags) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_check_results(switch_asr_handle.getCPtr(ah), SWIGTYPE_p_unsigned_long.getCPtr(flags));
return ret;
<span style="color: #800080; font-weight: bold">@@ -2010,6 +2015,21 @@ public class freeswitch {</span>
return ret;
}
<span style="color: #00A000">+ public static switch_status_t switch_core_asr_enable_grammar(switch_asr_handle ah, string name) {</span>
<span style="color: #00A000">+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_enable_grammar(switch_asr_handle.getCPtr(ah), name);</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ public static switch_status_t switch_core_asr_disable_grammar(switch_asr_handle ah, string name) {</span>
<span style="color: #00A000">+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_disable_grammar(switch_asr_handle.getCPtr(ah), name);</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ public static switch_status_t switch_core_asr_disable_all_grammars(switch_asr_handle ah) {</span>
<span style="color: #00A000">+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_disable_all_grammars(switch_asr_handle.getCPtr(ah));</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
public static switch_status_t switch_core_asr_pause(switch_asr_handle ah) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_asr_pause(switch_asr_handle.getCPtr(ah));
return ret;
<span style="color: #800080; font-weight: bold">@@ -4060,11 +4080,31 @@ public class freeswitch {</span>
return ret;
}
<span style="color: #00A000">+ public static switch_status_t switch_ivr_detect_speech_enable_grammar(SWIGTYPE_p_switch_core_session session, string name) {</span>
<span style="color: #00A000">+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_detect_speech_enable_grammar(SWIGTYPE_p_switch_core_session.getCPtr(session), name);</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ public static switch_status_t switch_ivr_detect_speech_disable_grammar(SWIGTYPE_p_switch_core_session session, string name) {</span>
<span style="color: #00A000">+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_detect_speech_disable_grammar(SWIGTYPE_p_switch_core_session.getCPtr(session), name);</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ public static switch_status_t switch_ivr_detect_speech_disable_all_grammars(SWIGTYPE_p_switch_core_session session) {</span>
<span style="color: #00A000">+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_detect_speech_disable_all_grammars(SWIGTYPE_p_switch_core_session.getCPtr(session));</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
public static switch_status_t switch_ivr_set_param_detect_speech(SWIGTYPE_p_switch_core_session session, string name, string val) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_set_param_detect_speech(SWIGTYPE_p_switch_core_session.getCPtr(session), name, val);
return ret;
}
<span style="color: #00A000">+ public static switch_status_t switch_ivr_detect_speech_start_input_timers(SWIGTYPE_p_switch_core_session session) {</span>
<span style="color: #00A000">+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_detect_speech_start_input_timers(SWIGTYPE_p_switch_core_session.getCPtr(session));</span>
<span style="color: #00A000">+ return ret;</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
public static switch_status_t switch_ivr_record_session(SWIGTYPE_p_switch_core_session session, string file, uint limit, switch_file_handle fh) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_record_session(SWIGTYPE_p_switch_core_session.getCPtr(session), file, limit, switch_file_handle.getCPtr(fh));
return ret;
<span style="color: #800080; font-weight: bold">@@ -7893,6 +7933,9 @@ class freeswitchPINVOKE {</span>
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_feed")]
public static extern int switch_core_asr_feed(HandleRef jarg1, HandleRef jarg2, uint jarg3, HandleRef jarg4);
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_feed_dtmf")]</span>
<span style="color: #00A000">+ public static extern int switch_core_asr_feed_dtmf(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3);</span>
<span style="color: #00A000">+</span>
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_check_results")]
public static extern int switch_core_asr_check_results(HandleRef jarg1, HandleRef jarg2);
<span style="color: #800080; font-weight: bold">@@ -7905,6 +7948,15 @@ class freeswitchPINVOKE {</span>
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_unload_grammar")]
public static extern int switch_core_asr_unload_grammar(HandleRef jarg1, string jarg2);
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_enable_grammar")]</span>
<span style="color: #00A000">+ public static extern int switch_core_asr_enable_grammar(HandleRef jarg1, string jarg2);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_disable_grammar")]</span>
<span style="color: #00A000">+ public static extern int switch_core_asr_disable_grammar(HandleRef jarg1, string jarg2);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_disable_all_grammars")]</span>
<span style="color: #00A000">+ public static extern int switch_core_asr_disable_all_grammars(HandleRef jarg1);</span>
<span style="color: #00A000">+</span>
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_asr_pause")]
public static extern int switch_core_asr_pause(HandleRef jarg1);
<span style="color: #800080; font-weight: bold">@@ -10182,6 +10234,30 @@ class freeswitchPINVOKE {</span>
[DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_next_get")]
public static extern IntPtr switch_asr_interface_next_get(HandleRef jarg1);
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_enable_grammar_set")]</span>
<span style="color: #00A000">+ public static extern void switch_asr_interface_asr_enable_grammar_set(HandleRef jarg1, HandleRef jarg2);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_enable_grammar_get")]</span>
<span style="color: #00A000">+ public static extern IntPtr switch_asr_interface_asr_enable_grammar_get(HandleRef jarg1);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_disable_grammar_set")]</span>
<span style="color: #00A000">+ public static extern void switch_asr_interface_asr_disable_grammar_set(HandleRef jarg1, HandleRef jarg2);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_disable_grammar_get")]</span>
<span style="color: #00A000">+ public static extern IntPtr switch_asr_interface_asr_disable_grammar_get(HandleRef jarg1);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_disable_all_grammars_set")]</span>
<span style="color: #00A000">+ public static extern void switch_asr_interface_asr_disable_all_grammars_set(HandleRef jarg1, HandleRef jarg2);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_disable_all_grammars_get")]</span>
<span style="color: #00A000">+ public static extern IntPtr switch_asr_interface_asr_disable_all_grammars_get(HandleRef jarg1);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_feed_dtmf_set")]</span>
<span style="color: #00A000">+ public static extern void switch_asr_interface_asr_feed_dtmf_set(HandleRef jarg1, HandleRef jarg2);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_asr_interface_asr_feed_dtmf_get")]</span>
<span style="color: #00A000">+ public static extern IntPtr switch_asr_interface_asr_feed_dtmf_get(HandleRef jarg1);</span>
<span style="color: #00A000">+</span>
[DllImport("mod_managed", EntryPoint="CSharp_new_switch_asr_interface")]
public static extern IntPtr new_switch_asr_interface();
<span style="color: #800080; font-weight: bold">@@ -12126,9 +12202,21 @@ class freeswitchPINVOKE {</span>
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_unload_grammar")]
public static extern int switch_ivr_detect_speech_unload_grammar(HandleRef jarg1, string jarg2);
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_enable_grammar")]</span>
<span style="color: #00A000">+ public static extern int switch_ivr_detect_speech_enable_grammar(HandleRef jarg1, string jarg2);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_disable_grammar")]</span>
<span style="color: #00A000">+ public static extern int switch_ivr_detect_speech_disable_grammar(HandleRef jarg1, string jarg2);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_disable_all_grammars")]</span>
<span style="color: #00A000">+ public static extern int switch_ivr_detect_speech_disable_all_grammars(HandleRef jarg1);</span>
<span style="color: #00A000">+</span>
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_set_param_detect_speech")]
public static extern int switch_ivr_set_param_detect_speech(HandleRef jarg1, string jarg2, string jarg3);
<span style="color: #00A000">+ [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_detect_speech_start_input_timers")]</span>
<span style="color: #00A000">+ public static extern int switch_ivr_detect_speech_start_input_timers(HandleRef jarg1);</span>
<span style="color: #00A000">+</span>
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_record_session")]
public static extern int switch_ivr_record_session(HandleRef jarg1, string jarg2, uint jarg3, HandleRef jarg4);
<span style="color: #800080; font-weight: bold">@@ -14943,6 +15031,36 @@ namespace FreeSWITCH.Native {</span>
using System;
using System.Runtime.InteropServices;
<span style="color: #00A000">+public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t {</span>
<span style="color: #00A000">+ private HandleRef swigCPtr;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ internal SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {</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">+ protected SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t() {</span>
<span style="color: #00A000">+ swigCPtr = new HandleRef(null, IntPtr.Zero);</span>
<span style="color: #00A000">+ }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t 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">+</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>
<span style="color: #00A000">+using System;</span>
<span style="color: #00A000">+using System.Runtime.InteropServices;</span>
<span style="color: #00A000">+</span>
public class SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t {
private HandleRef swigCPtr;
<span style="color: #800080; font-weight: bold">@@ -19959,6 +20077,50 @@ public class switch_asr_interface : IDisposable {</span>
}
}
<span style="color: #00A000">+ public SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t asr_enable_grammar {</span>
<span style="color: #00A000">+ set {</span>
<span style="color: #00A000">+ freeswitchPINVOKE.switch_asr_interface_asr_enable_grammar_set(swigCPtr, SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t.getCPtr(value));</span>
<span style="color: #00A000">+ } </span>
<span style="color: #00A000">+ get {</span>
<span style="color: #00A000">+ IntPtr cPtr = freeswitchPINVOKE.switch_asr_interface_asr_enable_grammar_get(swigCPtr);</span>
<span style="color: #00A000">+ SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t(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 SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t asr_disable_grammar {</span>
<span style="color: #00A000">+ set {</span>
<span style="color: #00A000">+ freeswitchPINVOKE.switch_asr_interface_asr_disable_grammar_set(swigCPtr, SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t.getCPtr(value));</span>
<span style="color: #00A000">+ } </span>
<span style="color: #00A000">+ get {</span>
<span style="color: #00A000">+ IntPtr cPtr = freeswitchPINVOKE.switch_asr_interface_asr_disable_grammar_get(swigCPtr);</span>
<span style="color: #00A000">+ SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t(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 SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t asr_disable_all_grammars {</span>
<span style="color: #00A000">+ set {</span>
<span style="color: #00A000">+ freeswitchPINVOKE.switch_asr_interface_asr_disable_all_grammars_set(swigCPtr, SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t.getCPtr(value));</span>
<span style="color: #00A000">+ } </span>
<span style="color: #00A000">+ get {</span>
<span style="color: #00A000">+ IntPtr cPtr = freeswitchPINVOKE.switch_asr_interface_asr_disable_all_grammars_get(swigCPtr);</span>
<span style="color: #00A000">+ SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t(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 SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t asr_feed_dtmf {</span>
<span style="color: #00A000">+ set {</span>
<span style="color: #00A000">+ freeswitchPINVOKE.switch_asr_interface_asr_feed_dtmf_set(swigCPtr, SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t.getCPtr(value));</span>
<span style="color: #00A000">+ } </span>
<span style="color: #00A000">+ get {</span>
<span style="color: #00A000">+ IntPtr cPtr = freeswitchPINVOKE.switch_asr_interface_asr_feed_dtmf_get(swigCPtr);</span>
<span style="color: #00A000">+ SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t(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>
public switch_asr_interface() : this(freeswitchPINVOKE.new_switch_asr_interface(), true) {
}
</pre></div>
<div class="highlight"><pre>committer: Travis Cross
comments:
lower log-level of a mod_spy message
When a session loses a race to bridge a call, the CHANNEL_BRIDGE event
handler is still run, yet session_locate is going to return null as it
won't get a read-lock on the peer's session. Since this is a normal
and common condition, let's log this as a debug message rather than as
an error condition.
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/applications/mod_spy/mod_spy.c b/src/mod/applications/mod_spy/mod_spy.c</span>
<span style="color: #000080; font-weight: bold">index e0a9317..1797539 100644</span>
<span style="color: #A00000">--- a/src/mod/applications/mod_spy/mod_spy.c</span>
<span style="color: #00A000">+++ b/src/mod/applications/mod_spy/mod_spy.c</span>
<span style="color: #800080; font-weight: bold">@@ -201,7 +201,7 @@ static void event_handler(switch_event_t *event)</span>
                }
                if (!(peer_session = switch_core_session_locate(peer_uuid))) {
<span style="color: #A00000">-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't locate peer session for uuid %s\n", peer_uuid);</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't locate peer session for uuid %s\n", peer_uuid);</span>
                        return;
                }
</pre></div>
<div class="highlight"><pre>committer: Travis Cross
comments:
fix typo: cant -> can't
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/applications/mod_spy/mod_spy.c b/src/mod/applications/mod_spy/mod_spy.c</span>
<span style="color: #000080; font-weight: bold">index 9986703..e0a9317 100644</span>
<span style="color: #A00000">--- a/src/mod/applications/mod_spy/mod_spy.c</span>
<span style="color: #00A000">+++ b/src/mod/applications/mod_spy/mod_spy.c</span>
<span style="color: #800080; font-weight: bold">@@ -201,14 +201,14 @@ static void event_handler(switch_event_t *event)</span>
                }
                if (!(peer_session = switch_core_session_locate(peer_uuid))) {
<span style="color: #A00000">-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cant locate peer session for uuid %s\n", peer_uuid);</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't locate peer session for uuid %s\n", peer_uuid);</span>
                        return;
                }
                peer_channel = switch_core_session_get_channel(peer_session);
                
                if (switch_event_create(&peer_event, SWITCH_EVENT_CHANNEL_BRIDGE) != SWITCH_STATUS_SUCCESS) {
<span style="color: #A00000">-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cant create bridge event for peer channel %s\n", peer_uuid);</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't create bridge event for peer channel %s\n", peer_uuid);</span>
                        goto end;
                }
<span style="color: #800080; font-weight: bold">@@ -249,7 +249,7 @@ SWITCH_STANDARD_APP(userspy_function)</span>
                        status = switch_core_hash_insert(globals.spy_hash, argv[0], (void *) uuid);
                        if ((status != SWITCH_STATUS_SUCCESS)) {
<span style="color: #A00000">-                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cant insert to spy hash\n");</span>
<span style="color: #00A000">+                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Can't insert to spy hash\n");</span>
                                switch_channel_hangup(channel, SWITCH_CAUSE_SERVICE_NOT_IMPLEMENTED);
                                switch_thread_rwlock_unlock(globals.spy_hash_lock);
                                return;
</pre></div>
<div class="highlight"><pre>committer: Brian West
comments:
Merge branch 'openmethods-merged-dtmf-20110126' of git://scm.dashjr.org/var/scmroot/git/freeswitch
</pre></div>
<div class="highlight"><pre>committer: Jeff Lenk
comments:
OPENZAP-140 VS2010 build cleanup
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/msvc/testboost/testboost.2010.vcxproj b/libs/freetdm/msvc/testboost/testboost.2010.vcxproj</span>
<span style="color: #000080; font-weight: bold">index 6206148..314440b 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/msvc/testboost/testboost.2010.vcxproj</span>
<span style="color: #00A000">+++ b/libs/freetdm/msvc/testboost/testboost.2010.vcxproj</span>
<span style="color: #800080; font-weight: bold">@@ -105,7 +105,7 @@</span>
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<span style="color: #A00000">- <AdditionalDependencies>..\..\debug\freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies></span>
<span style="color: #00A000">+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies></span>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<span style="color: #800080; font-weight: bold">@@ -162,7 +162,7 @@</span>
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<span style="color: #A00000">- <AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies></span>
<span style="color: #00A000">+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies></span>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<span style="color: #800080; font-weight: bold">@@ -199,7 +199,7 @@</span>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
<span style="color: #A00000">- <AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies></span>
<span style="color: #00A000">+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies></span>
<AdditionalLibraryDirectories>../../$(PlatformName)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/msvc/testboost/testsangomaboost.2010.vcxproj b/libs/freetdm/msvc/testboost/testsangomaboost.2010.vcxproj</span>
<span style="color: #000080; font-weight: bold">index 5994da6..4077a60 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/msvc/testboost/testsangomaboost.2010.vcxproj</span>
<span style="color: #00A000">+++ b/libs/freetdm/msvc/testboost/testsangomaboost.2010.vcxproj</span>
<span style="color: #800080; font-weight: bold">@@ -105,7 +105,7 @@</span>
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<span style="color: #A00000">- <AdditionalDependencies>..\..\debug\freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies></span>
<span style="color: #00A000">+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies></span>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<span style="color: #800080; font-weight: bold">@@ -162,7 +162,7 @@</span>
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<span style="color: #A00000">- <AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies></span>
<span style="color: #00A000">+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies></span>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<span style="color: #800080; font-weight: bold">@@ -199,7 +199,7 @@</span>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
<span style="color: #A00000">- <AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies></span>
<span style="color: #00A000">+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies></span>
<AdditionalLibraryDirectories>../../$(PlatformName)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_boost/ftmod_sangoma_boost.2010.vcxproj b/libs/freetdm/src/ftmod/ftmod_sangoma_boost/ftmod_sangoma_boost.2010.vcxproj</span>
<span style="color: #000080; font-weight: bold">index 78689c3..684e432 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/src/ftmod/ftmod_sangoma_boost/ftmod_sangoma_boost.2010.vcxproj</span>
<span style="color: #00A000">+++ b/libs/freetdm/src/ftmod/ftmod_sangoma_boost/ftmod_sangoma_boost.2010.vcxproj</span>
<span style="color: #800080; font-weight: bold">@@ -61,11 +61,11 @@</span>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<span style="color: #A00000">- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir></span>
<span style="color: #A00000">- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir></span>
<span style="color: #00A000">+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir></span>
<span style="color: #00A000">+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir></span>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<span style="color: #A00000">- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir></span>
<span style="color: #A00000">- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir></span>
<span style="color: #00A000">+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir></span>
<span style="color: #00A000">+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir></span>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
<span style="color: #800080; font-weight: bold">@@ -102,7 +102,7 @@</span>
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<span style="color: #A00000">- <AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies></span>
<span style="color: #00A000">+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies></span>
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<span style="color: #800080; font-weight: bold">@@ -151,7 +151,7 @@</span>
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<span style="color: #A00000">- <AdditionalDependencies>freetdm.lib;%(AdditionalDependencies)</AdditionalDependencies></span>
<span style="color: #00A000">+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies></span>
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.2010.vcxproj b/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.2010.vcxproj</span>
<span style="color: #000080; font-weight: bold">index 40d0a73..a21be22 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.2010.vcxproj</span>
<span style="color: #00A000">+++ b/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.2010.vcxproj</span>
<span style="color: #800080; font-weight: bold">@@ -61,14 +61,14 @@</span>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<span style="color: #A00000">- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir></span>
<span style="color: #A00000">- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir></span>
<span style="color: #00A000">+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir></span>
<span style="color: #00A000">+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir></span>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<span style="color: #A00000">- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir></span>
<span style="color: #A00000">- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir></span>
<span style="color: #00A000">+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir></span>
<span style="color: #00A000">+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir></span>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
</pre></div>
<div class="highlight"><pre>committer: Daniel Swarbrick
comments:
mostly complete implementation of channel list via 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>
<span style="color: #000080; font-weight: bold">index 11c3999..8448526 100644</span>
<span style="color: #A00000">--- a/src/mod/event_handlers/mod_snmp/FREESWITCH-MIB</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_snmp/FREESWITCH-MIB</span>
<span style="color: #800080; font-weight: bold">@@ -3,11 +3,14 @@ FREESWITCH-MIB DEFINITIONS ::= BEGIN</span>
IMPORTS
OBJECT-TYPE, MODULE-IDENTITY,
Integer32, Gauge32, Counter32, Counter64, TimeTicks,
<span style="color: #A00000">- enterprises,</span>
<span style="color: #00A000">+ enterprises</span>
FROM SNMPv2-SMI
<span style="color: #A00000">- DisplayString</span>
<span style="color: #00A000">+ DisplayString, DateAndTime</span>
FROM SNMPv2-TC
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ InetAddressType, InetAddress</span>
<span style="color: #00A000">+ FROM INET-ADDRESS-MIB</span>
;
<span style="color: #800080; font-weight: bold">@@ -109,13 +112,27 @@ maxSessionsPerSecond OBJECT-TYPE</span>
ChannelEntry ::= SEQUENCE {
<span style="color: #A00000">- chanUUID DisplayString,</span>
<span style="color: #A00000">- chanDirection DisplayString,</span>
<span style="color: #A00000">- chanCreated DisplayString,</span>
<span style="color: #A00000">- chanName DisplayString,</span>
<span style="color: #A00000">- chanState DisplayString,</span>
<span style="color: #A00000">- chanCIDName DisplayString,</span>
<span style="color: #A00000">- chanCIDNum DisplayString</span>
<span style="color: #00A000">+ chanIndex Integer32,</span>
<span style="color: #00A000">+ chanUUID DisplayString,</span>
<span style="color: #00A000">+ chanDirection DisplayString,</span>
<span style="color: #00A000">+ chanCreated DateAndTime,</span>
<span style="color: #00A000">+ chanName DisplayString,</span>
<span style="color: #00A000">+ chanState DisplayString,</span>
<span style="color: #00A000">+ chanCIDName DisplayString,</span>
<span style="color: #00A000">+ chanCIDNum DisplayString,</span>
<span style="color: #00A000">+ chanInetAddressType InetAddressType,</span>
<span style="color: #00A000">+ chanInetAddress InetAddress,</span>
<span style="color: #00A000">+ chanDest DisplayString,</span>
<span style="color: #00A000">+ chanApplication DisplayString,</span>
<span style="color: #00A000">+ chanAppData DisplayString,</span>
<span style="color: #00A000">+ chanDialplan DisplayString,</span>
<span style="color: #00A000">+ chanContext DisplayString,</span>
<span style="color: #00A000">+ chanReadCodec DisplayString,</span>
<span style="color: #00A000">+ chanReadRate Gauge32,</span>
<span style="color: #00A000">+ chanReadBitRate Gauge32,</span>
<span style="color: #00A000">+ chanWriteCodec DisplayString,</span>
<span style="color: #00A000">+ chanWriteRate Gauge32,</span>
<span style="color: #00A000">+ chanWriteBitRate Gauge32</span>
}
channelList OBJECT-TYPE
<span style="color: #800080; font-weight: bold">@@ -135,60 +152,172 @@ channelEntry OBJECT-TYPE</span>
INDEX { chanIndex }
::= { channelList 1 }
<span style="color: #00A000">+chanIndex OBJECT-TYPE</span>
<span style="color: #00A000">+ SYNTAX Integer32</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">+ "Channel SNMP index."</span>
<span style="color: #00A000">+ ::= { channelEntry 1 }</span>
<span style="color: #00A000">+</span>
chanUUID OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
<span style="color: #A00000">- "The channel UUID."</span>
<span style="color: #A00000">- ::= { channelEntry 1 }</span>
<span style="color: #00A000">+ "Channel UUID."</span>
<span style="color: #00A000">+ ::= { channelEntry 2 }</span>
chanDirection OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
<span style="color: #A00000">- "The channel direction."</span>
<span style="color: #A00000">- ::= { channelEntry 2 }</span>
<span style="color: #00A000">+ "Channel direction."</span>
<span style="color: #00A000">+ ::= { channelEntry 3 }</span>
chanCreated OBJECT-TYPE
<span style="color: #A00000">- SYNTAX DisplayString</span>
<span style="color: #00A000">+ SYNTAX DateAndTime</span>
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Channel creation timestamp."
<span style="color: #A00000">- ::= { channelEntry 3 }</span>
<span style="color: #00A000">+ ::= { channelEntry 4 }</span>
chanName OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
<span style="color: #A00000">- "The channel name."</span>
<span style="color: #A00000">- ::= { channelEntry 4 }</span>
<span style="color: #00A000">+ "Channel name."</span>
<span style="color: #00A000">+ ::= { channelEntry 5 }</span>
chanState OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
<span style="color: #A00000">- "The channel state."</span>
<span style="color: #A00000">- ::= { channelEntry 5 }</span>
<span style="color: #00A000">+ "Channel state."</span>
<span style="color: #00A000">+ ::= { channelEntry 6 }</span>
chanCIDName OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
<span style="color: #A00000">- "The channel caller ID name."</span>
<span style="color: #A00000">- ::= { channelEntry 6 }</span>
<span style="color: #00A000">+ "Channel caller ID name."</span>
<span style="color: #00A000">+ ::= { channelEntry 7 }</span>
chanCIDNum OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
<span style="color: #A00000">- "The channel caller ID number."</span>
<span style="color: #A00000">- ::= { channelEntry 7 }</span>
<span style="color: #00A000">+ "Channel caller ID number."</span>
<span style="color: #00A000">+ ::= { channelEntry 8 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+chanInetAddressType OBJECT-TYPE</span>
<span style="color: #00A000">+ SYNTAX InetAddressType</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">+ "Channel originator's IP address type (IPv4 or IPv6)."</span>
<span style="color: #00A000">+ ::= { channelEntry 9 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+chanInetAddress OBJECT-TYPE</span>
<span style="color: #00A000">+ SYNTAX InetAddress</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">+ "Channel originator's IP address."</span>
<span style="color: #00A000">+ ::= { channelEntry 10 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+chanDest 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">+ "Channel destination."</span>
<span style="color: #00A000">+ ::= { channelEntry 11 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+chanApplication 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">+ "Channel application."</span>
<span style="color: #00A000">+ ::= { channelEntry 12 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+chanAppData 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">+ "Channel application data."</span>
<span style="color: #00A000">+ ::= { channelEntry 13 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+chanDialplan 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">+ "Channel dialplan."</span>
<span style="color: #00A000">+ ::= { channelEntry 14 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+chanContext 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">+ "Channel dialplan context."</span>
<span style="color: #00A000">+ ::= { channelEntry 15 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+chanReadCodec 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">+ "Channel read codec."</span>
<span style="color: #00A000">+ ::= { channelEntry 16 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+chanReadRate 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">+ "Channel read samples per second."</span>
<span style="color: #00A000">+ ::= { channelEntry 17 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+chanReadBitRate 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">+ "Channel read bits per second."</span>
<span style="color: #00A000">+ ::= { channelEntry 18 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+chanWriteCodec 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">+ "Channel write codec."</span>
<span style="color: #00A000">+ ::= { channelEntry 19 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+chanWriteRate 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">+ "Channel write samples per second."</span>
<span style="color: #00A000">+ ::= { channelEntry 20 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+chanWriteBitRate 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">+ "Channel write bits per second."</span>
<span style="color: #00A000">+ ::= { channelEntry 21 }</span>
END
<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 7b9faa7..43975ee 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">@@ -42,6 +42,17 @@ netsnmp_handler_registration *ch_reginfo;</span>
uint32_t idx;
<span style="color: #00A000">+static void time_t_to_datetime(time_t epoch, char *buf, switch_size_t buflen)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        struct tm *dt;</span>
<span style="color: #00A000">+        uint16_t year;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        dt = gmtime(&epoch);</span>
<span style="color: #00A000">+        year = dt->tm_year + 1900;</span>
<span style="color: #00A000">+        switch_snprintf(buf, buflen, "%c%c%c%c%c%c%c%c+%c%c", year >> 8, year & 0xff, dt->tm_mon + 1, dt->tm_mday, dt->tm_hour, dt->tm_min, dt->tm_sec, 0, 0, 0);</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
static int sql_count_callback(void *pArg, int argc, char **argv, char **columnNames)
{
        uint32_t *count = (uint32_t *) pArg;
<span style="color: #800080; font-weight: bold">@@ -69,11 +80,31 @@ static int channelList_callback(void *pArg, int argc, char **argv, char **column</span>
        entry->idx = idx++;
        strncpy(entry->uuid, argv[0], sizeof(entry->uuid));
        strncpy(entry->direction, argv[1], sizeof(entry->direction));
<span style="color: #A00000">-        strncpy(entry->created, argv[2], sizeof(entry->created));</span>
<span style="color: #00A000">+        entry->created_epoch = atoi(argv[3]);</span>
        strncpy(entry->name, argv[4], sizeof(entry->name));
        strncpy(entry->state, argv[5], sizeof(entry->state));
        strncpy(entry->cid_name, argv[6], sizeof(entry->cid_name));
        strncpy(entry->cid_num, argv[7], sizeof(entry->cid_num));
<span style="color: #00A000">+        strncpy(entry->dest, argv[9], sizeof(entry->dest));</span>
<span style="color: #00A000">+        strncpy(entry->application, argv[10], sizeof(entry->application));</span>
<span style="color: #00A000">+        strncpy(entry->application_data, argv[11], sizeof(entry->application_data));</span>
<span style="color: #00A000">+        strncpy(entry->dialplan, argv[12], sizeof(entry->dialplan));</span>
<span style="color: #00A000">+        strncpy(entry->context, argv[13], sizeof(entry->context));</span>
<span style="color: #00A000">+        strncpy(entry->read_codec, argv[14], sizeof(entry->read_codec));</span>
<span style="color: #00A000">+        entry->read_rate = atoi(argv[15]);</span>
<span style="color: #00A000">+        entry->read_bitrate = atoi(argv[16]);</span>
<span style="color: #00A000">+        strncpy(entry->write_codec, argv[17], sizeof(entry->write_codec));</span>
<span style="color: #00A000">+        entry->write_rate = atoi(argv[18]);</span>
<span style="color: #00A000">+        entry->write_bitrate = atoi(argv[19]);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        memset(&entry->ip_addr, 0, sizeof(entry->ip_addr));</span>
<span style="color: #00A000">+        if (strchr(argv[8], ':')) {</span>
<span style="color: #00A000">+                switch_inet_pton(AF_INET6, argv[8], &entry->ip_addr);</span>
<span style="color: #00A000">+                entry->addr_family = AF_INET6;</span>
<span style="color: #00A000">+        } else {</span>
<span style="color: #00A000">+                switch_inet_pton(AF_INET, argv[8], &entry->ip_addr);</span>
<span style="color: #00A000">+                entry->addr_family = AF_INET;</span>
<span style="color: #00A000">+        }</span>
        netsnmp_tdata_row_add_index(row, ASN_INTEGER, &entry->idx, sizeof(entry->idx));
        netsnmp_tdata_add_row(ch_table, row);
<span style="color: #800080; font-weight: bold">@@ -128,9 +159,9 @@ void init_subagent(switch_memory_pool_t *pool)</span>
        netsnmp_register_scalar_group(netsnmp_create_handler_registration("systemStats", handle_systemStats, systemStats_oid, OID_LENGTH(systemStats_oid), HANDLER_CAN_RONLY), 1, 7);
        ch_table_info = switch_core_alloc(pool, sizeof(netsnmp_table_registration_info));
<span style="color: #A00000">-        netsnmp_table_helper_add_index(ch_table_info, ASN_INTEGER);</span>
<span style="color: #A00000">-        ch_table_info->min_column = 1;</span>
<span style="color: #A00000">-        ch_table_info->max_column = 7;</span>
<span style="color: #00A000">+        netsnmp_table_helper_add_indexes(ch_table_info, ASN_INTEGER, 0);</span>
<span style="color: #00A000">+        ch_table_info->min_column = CH_INDEX;</span>
<span style="color: #00A000">+        ch_table_info->max_column = CH_WRITE_BITRATE;</span>
        ch_table = netsnmp_tdata_create_table("channelList", 0);
        ch_reginfo = netsnmp_create_handler_registration("channelList", handle_channelList, channelList_oid, OID_LENGTH(channelList_oid), HANDLER_CAN_RONLY);
        netsnmp_tdata_register(ch_reginfo, ch_table, ch_table_info);
<span style="color: #800080; font-weight: bold">@@ -191,15 +222,15 @@ int handle_systemStats(netsnmp_mib_handler *handler, netsnmp_handler_registratio</span>
                        break;
                case SS_SESSIONS_SINCE_STARTUP:
                        int_val = switch_core_session_id() - 1;
<span style="color: #A00000">-                        snmp_set_var_typed_value(requests->requestvb, ASN_COUNTER, (u_char *) &int_val, sizeof(int_val));</span>
<span style="color: #00A000">+                        snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER, int_val);</span>
                        break;
                case SS_CURRENT_SESSIONS:
                        int_val = switch_core_session_count();
<span style="color: #A00000">-                        snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));</span>
<span style="color: #00A000">+                        snmp_set_var_typed_integer(requests->requestvb, ASN_GAUGE, int_val);</span>
                        break;
                case SS_MAX_SESSIONS:
                        switch_core_session_ctl(SCSC_MAX_SESSIONS, &int_val);
<span style="color: #A00000">-                        snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));</span>
<span style="color: #00A000">+                        snmp_set_var_typed_integer(requests->requestvb, ASN_GAUGE, int_val);</span>
                        break;
                case SS_CURRENT_CALLS:
                        {
<span style="color: #800080; font-weight: bold">@@ -213,17 +244,17 @@ int handle_systemStats(netsnmp_mib_handler *handler, netsnmp_handler_registratio</span>
                        gethostname(hostname, sizeof(hostname));
                        sprintf(sql, "SELECT COUNT(*) FROM calls WHERE hostname='%s'", hostname);
                        switch_cache_db_execute_sql_callback(dbh, sql, sql_count_callback, &int_val, NULL);
<span style="color: #A00000">-                        snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));</span>
<span style="color: #00A000">+                        snmp_set_var_typed_integer(requests->requestvb, ASN_GAUGE, int_val);</span>
                        switch_cache_db_release_db_handle(&dbh);
                        }
                        break;
                case SS_SESSIONS_PER_SECOND:
                        switch_core_session_ctl(SCSC_LAST_SPS, &int_val);
<span style="color: #A00000">-                        snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));</span>
<span style="color: #00A000">+                        snmp_set_var_typed_integer(requests->requestvb, ASN_GAUGE, int_val);</span>
                        break;
                case SS_MAX_SESSIONS_PER_SECOND:
                        switch_core_session_ctl(SCSC_SPS, &int_val);
<span style="color: #A00000">-                        snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));</span>
<span style="color: #00A000">+                        snmp_set_var_typed_integer(requests->requestvb, ASN_GAUGE, int_val);</span>
                        break;
                default:
                        snmp_log(LOG_WARNING, "Unregistered OID-suffix requested (%d)\n", (int) subid);
<span style="color: #800080; font-weight: bold">@@ -246,6 +277,7 @@ int handle_channelList(netsnmp_mib_handler *handler, netsnmp_handler_registratio</span>
        netsnmp_request_info *request;
        netsnmp_table_request_info *table_info;
        chan_entry_t *entry;
<span style="color: #00A000">+        char dt_str[12];</span>
        switch (reqinfo->mode) {
        case MODE_GET:
<span style="color: #800080; font-weight: bold">@@ -254,6 +286,9 @@ int handle_channelList(netsnmp_mib_handler *handler, netsnmp_handler_registratio</span>
                        entry = (chan_entry_t *) netsnmp_tdata_extract_entry(request);
                        switch (table_info->colnum) {
<span style="color: #00A000">+                        case CH_INDEX:</span>
<span style="color: #00A000">+                                snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, entry->idx);</span>
<span style="color: #00A000">+                                break;</span>
                        case CH_UUID:
                                snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->uuid, strlen(entry->uuid));
                                break;
<span style="color: #800080; font-weight: bold">@@ -261,7 +296,8 @@ int handle_channelList(netsnmp_mib_handler *handler, netsnmp_handler_registratio</span>
                                snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->direction, strlen(entry->direction));
                                break;
                        case CH_CREATED:
<span style="color: #A00000">-                                snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->created, strlen(entry->created));</span>
<span style="color: #00A000">+                                time_t_to_datetime(entry->created_epoch, (char *) &dt_str, sizeof(dt_str));</span>
<span style="color: #00A000">+                                snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) &dt_str, sizeof(dt_str));</span>
                                break;
                        case CH_NAME:
                                snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->name, strlen(entry->name));
<span style="color: #800080; font-weight: bold">@@ -275,6 +311,53 @@ int handle_channelList(netsnmp_mib_handler *handler, netsnmp_handler_registratio</span>
                        case CH_CID_NUM:
                                snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->cid_num, strlen(entry->cid_num));
                                break;
<span style="color: #00A000">+                        case CH_IP_ADDR_TYPE:</span>
<span style="color: #00A000">+                                if (entry->addr_family == AF_INET6) {</span>
<span style="color: #00A000">+                                        snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, INETADDRESSTYPE_IPV6);</span>
<span style="color: #00A000">+                                } else {</span>
<span style="color: #00A000">+                                        snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, INETADDRESSTYPE_IPV4);</span>
<span style="color: #00A000">+                                }</span>
<span style="color: #00A000">+                                break;</span>
<span style="color: #00A000">+                        case CH_IP_ADDR:</span>
<span style="color: #00A000">+                                if (entry->addr_family == AF_INET6) {</span>
<span style="color: #00A000">+                                        snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) &entry->ip_addr.v6, sizeof(entry->ip_addr.v6));</span>
<span style="color: #00A000">+                                } else {</span>
<span style="color: #00A000">+                                        snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) &entry->ip_addr.v4, sizeof(entry->ip_addr.v4));</span>
<span style="color: #00A000">+                                }</span>
<span style="color: #00A000">+                                break;</span>
<span style="color: #00A000">+                        case CH_DEST:</span>
<span style="color: #00A000">+                                snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->dest, strlen(entry->dest));</span>
<span style="color: #00A000">+                                break;</span>
<span style="color: #00A000">+                        case CH_APPLICATION:</span>
<span style="color: #00A000">+                                snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->application, strlen(entry->application));</span>
<span style="color: #00A000">+                                break;</span>
<span style="color: #00A000">+                        case CH_APPLICATION_DATA:</span>
<span style="color: #00A000">+                                snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->application_data, strlen(entry->application_data));</span>
<span style="color: #00A000">+                                break;</span>
<span style="color: #00A000">+                        case CH_DIALPLAN:</span>
<span style="color: #00A000">+                                snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->dialplan, strlen(entry->dialplan));</span>
<span style="color: #00A000">+                                break;</span>
<span style="color: #00A000">+                        case CH_CONTEXT:</span>
<span style="color: #00A000">+                                snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->context, strlen(entry->context));</span>
<span style="color: #00A000">+                                break;</span>
<span style="color: #00A000">+                        case CH_READ_CODEC:</span>
<span style="color: #00A000">+                                snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->read_codec, strlen(entry->read_codec));</span>
<span style="color: #00A000">+                                break;</span>
<span style="color: #00A000">+                        case CH_READ_RATE:</span>
<span style="color: #00A000">+                                snmp_set_var_typed_value(request->requestvb, ASN_GAUGE, (u_char *) &entry->read_rate, sizeof(entry->read_rate));</span>
<span style="color: #00A000">+                                break;</span>
<span style="color: #00A000">+                        case CH_READ_BITRATE:</span>
<span style="color: #00A000">+                                snmp_set_var_typed_value(request->requestvb, ASN_GAUGE, (u_char *) &entry->read_bitrate, sizeof(entry->read_bitrate));</span>
<span style="color: #00A000">+                                break;</span>
<span style="color: #00A000">+                        case CH_WRITE_CODEC:</span>
<span style="color: #00A000">+                                snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->write_codec, strlen(entry->write_codec));</span>
<span style="color: #00A000">+                                break;</span>
<span style="color: #00A000">+                        case CH_WRITE_RATE:</span>
<span style="color: #00A000">+                                snmp_set_var_typed_value(request->requestvb, ASN_GAUGE, (u_char *) &entry->write_rate, sizeof(entry->write_rate));</span>
<span style="color: #00A000">+                                break;</span>
<span style="color: #00A000">+                        case CH_WRITE_BITRATE:</span>
<span style="color: #00A000">+                                snmp_set_var_typed_value(request->requestvb, ASN_GAUGE, (u_char *) &entry->write_bitrate, sizeof(entry->write_bitrate));</span>
<span style="color: #00A000">+                                break;</span>
                        default:
                                snmp_log(LOG_WARNING, "Unregistered OID-suffix requested (%d)\n", table_info->colnum);
                                netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
<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 0070b2c..5da87a6 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">@@ -15,23 +15,58 @@</span>
#define SS_MAX_SESSIONS_PER_SECOND        7
/* .1.3.6.1.4.1.27880.1.9 */
<span style="color: #A00000">-#define CH_UUID                                1</span>
<span style="color: #A00000">-#define CH_DIRECTION                        2</span>
<span style="color: #A00000">-#define CH_CREATED                        3</span>
<span style="color: #A00000">-#define CH_NAME                                4</span>
<span style="color: #A00000">-#define CH_STATE                        5</span>
<span style="color: #A00000">-#define CH_CID_NAME                        6</span>
<span style="color: #A00000">-#define CH_CID_NUM                        7</span>
<span style="color: #00A000">+#define CH_INDEX                        1</span>
<span style="color: #00A000">+#define CH_UUID                                2</span>
<span style="color: #00A000">+#define CH_DIRECTION                        3</span>
<span style="color: #00A000">+#define CH_CREATED                        4</span>
<span style="color: #00A000">+#define CH_NAME                                5</span>
<span style="color: #00A000">+#define CH_STATE                        6</span>
<span style="color: #00A000">+#define CH_CID_NAME                        7</span>
<span style="color: #00A000">+#define CH_CID_NUM                        8</span>
<span style="color: #00A000">+#define CH_IP_ADDR_TYPE                        9</span>
<span style="color: #00A000">+#define CH_IP_ADDR                        10</span>
<span style="color: #00A000">+#define CH_DEST                                11</span>
<span style="color: #00A000">+#define CH_APPLICATION                        12</span>
<span style="color: #00A000">+#define CH_APPLICATION_DATA                13</span>
<span style="color: #00A000">+#define CH_DIALPLAN                        14</span>
<span style="color: #00A000">+#define CH_CONTEXT                        15</span>
<span style="color: #00A000">+#define CH_READ_CODEC                        16</span>
<span style="color: #00A000">+#define CH_READ_RATE                        17</span>
<span style="color: #00A000">+#define CH_READ_BITRATE                        18</span>
<span style="color: #00A000">+#define CH_WRITE_CODEC                        19</span>
<span style="color: #00A000">+#define CH_WRITE_RATE                        20</span>
<span style="color: #00A000">+#define CH_WRITE_BITRATE                21</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+/* Why aren't these in net-snmp-includes.h ? */</span>
<span style="color: #00A000">+#define INETADDRESSTYPE_UNKNOWN                0</span>
<span style="color: #00A000">+#define INETADDRESSTYPE_IPV4                1</span>
<span style="color: #00A000">+#define INETADDRESSTYPE_IPV6                2</span>
<span style="color: #00A000">+#define INETADDRESSTYPE_IPV4Z                3</span>
<span style="color: #00A000">+#define INETADDRESSTYPE_IPV6Z                4</span>
<span style="color: #00A000">+#define INETADDRESSTYPE_DNS                16</span>
typedef struct {
        uint32_t idx;
        char uuid[38];
        char direction[32];
<span style="color: #A00000">-        char created[128];</span>
<span style="color: #00A000">+        time_t created_epoch;</span>
        char name[1024];
        char state[64];
        char cid_name[1024];
        char cid_num[256];
<span style="color: #00A000">+        ip_t ip_addr;</span>
<span style="color: #00A000">+        uint8_t addr_family;</span>
<span style="color: #00A000">+        char dest[1024];</span>
<span style="color: #00A000">+        char application[128];</span>
<span style="color: #00A000">+        char application_data[4096];</span>
<span style="color: #00A000">+        char dialplan[128];</span>
<span style="color: #00A000">+        char context[128];</span>
<span style="color: #00A000">+        char read_codec[128];</span>
<span style="color: #00A000">+        uint32_t read_rate;</span>
<span style="color: #00A000">+        uint32_t read_bitrate;</span>
<span style="color: #00A000">+        char write_codec[128];</span>
<span style="color: #00A000">+        uint32_t write_rate;</span>
<span style="color: #00A000">+        uint32_t write_bitrate;</span>
} chan_entry_t;
void init_subagent(switch_memory_pool_t *pool);
</pre></div>
<div class="highlight"><pre>committer: Anthony Minessale
comments:
fix || where it should be or in sql stmt that may cause stray records in the calls table
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c</span>
<span style="color: #000080; font-weight: bold">index 4167b4a..35311c9 100644</span>
<span style="color: #A00000">--- a/src/switch_core_sqldb.c</span>
<span style="color: #00A000">+++ b/src/switch_core_sqldb.c</span>
<span style="color: #800080; font-weight: bold">@@ -1160,15 +1160,14 @@ static void core_event_handler(switch_event_t *event)</span>
        case SWITCH_EVENT_CHANNEL_DESTROY:
                {
                        const char *uuid = switch_event_get_header(event, "unique-id");
<span style="color: #A00000">-                        const char *sig = switch_event_get_header(event, "signal_bridge");</span>
                        
                        if (uuid) {
                                new_sql() = switch_mprintf("delete from channels where uuid='%q' and hostname='%q'",
                                                                                 uuid, switch_core_get_variable("hostname"));
<span style="color: #A00000">-                                if (switch_true(sig)) {</span>
<span style="color: #A00000">-                                        new_sql() = switch_mprintf("delete from calls where (caller_uuid='%q' || callee_uuid='%q') and hostname='%q'",</span>
<span style="color: #A00000">-                                                                                         uuid, uuid, switch_core_get_variable("hostname"));</span>
<span style="color: #A00000">-                                }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                                new_sql() = switch_mprintf("delete from calls where (caller_uuid='%q' or callee_uuid='%q') and hostname='%q'",</span>
<span style="color: #00A000">+                                                                                 uuid, uuid, switch_core_get_variable("hostname"));</span>
<span style="color: #00A000">+</span>
                        }
                }
                break;
<span style="color: #800080; font-weight: bold">@@ -1410,7 +1409,7 @@ static void core_event_handler(switch_event_t *event)</span>
                }
                break;
        case SWITCH_EVENT_CHANNEL_UNBRIDGE:
<span style="color: #A00000">-                new_sql() = switch_mprintf("delete from calls where caller_uuid='%s' and hostname='%q'",</span>
<span style="color: #00A000">+                new_sql() = switch_mprintf("delete from calls where (caller_uuid='%s' or callee_uuid='%q') and hostname='%q'",</span>
                                                                 switch_event_get_header_nil(event, "caller-unique-id"), switch_core_get_variable("hostname"));
                break;
        case SWITCH_EVENT_SHUTDOWN:
</pre></div>
<div class="highlight"><pre>committer: Marc Olivier Chouinard
comments:
mod_callcenter: Add error response for queue load and queue reload (FS-2988)
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/applications/mod_callcenter/mod_callcenter.c b/src/mod/applications/mod_callcenter/mod_callcenter.c</span>
<span style="color: #000080; font-weight: bold">index d1de632..61305bb 100644</span>
<span style="color: #A00000">--- a/src/mod/applications/mod_callcenter/mod_callcenter.c</span>
<span style="color: #00A000">+++ b/src/mod/applications/mod_callcenter/mod_callcenter.c</span>
<span style="color: #800080; font-weight: bold">@@ -2625,8 +2625,10 @@ SWITCH_STANDARD_API(cc_config_api_function)</span>
                                cc_queue_t *queue = NULL;
                                if ((queue = get_queue(queue_name))) {
                                        queue_rwunlock(queue);
<span style="color: #00A000">+                                        stream->write_function(stream, "%s", "+OK\n");</span>
<span style="color: #00A000">+                                } else {</span>
<span style="color: #00A000">+                                        stream->write_function(stream, "%s", "-ERR Invalid Queue not found!\n");</span>
                                }
<span style="color: #A00000">-                                stream->write_function(stream, "%s", "+OK\n");</span>
                        }
                } else if (action && !strcasecmp(action, "unload")) {
                        if (argc-initial_argc < 1) {
<span style="color: #800080; font-weight: bold">@@ -2648,8 +2650,10 @@ SWITCH_STANDARD_API(cc_config_api_function)</span>
                                destroy_queue(queue_name, SWITCH_FALSE);
                                if ((queue = get_queue(queue_name))) {
                                        queue_rwunlock(queue);
<span style="color: #00A000">+                                        stream->write_function(stream, "%s", "+OK\n");</span>
<span style="color: #00A000">+                                } else {</span>
<span style="color: #00A000">+                                        stream->write_function(stream, "%s", "-ERR Invalid Queue not found!\n");</span>
                                }
<span style="color: #A00000">-                                stream->write_function(stream, "%s", "+OK\n");</span>
                        }
                } else if (action && !strcasecmp(action, "list")) {
                        if (argc-initial_argc < 1) {
<span style="color: #800080; font-weight: bold">@@ -2671,7 +2675,6 @@ SWITCH_STANDARD_API(cc_config_api_function)</span>
                                goto done;
                        } else {
                                const char *queue_name = argv[0 + initial_argc];
<span style="color: #A00000">-</span>
                                struct list_result cbt;
                                cbt.row_process = 0;
                                cbt.stream = stream;
</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-002
<span style="color: #000080; font-weight: bold">diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml</span>
<span style="color: #000080; font-weight: bold">index 5fc9402..6914128 100644</span>
<span style="color: #A00000">--- a/conf/freeswitch.xml</span>
<span style="color: #00A000">+++ b/conf/freeswitch.xml</span>
<span style="color: #800080; font-weight: bold">@@ -61,5 +61,4 @@</span>
<X-PRE-PROCESS cmd="include" data="lang/ru/*.xml"/>
</macros>
</section>
<span style="color: #A00000">-</span>
</document>
</pre></div>
<div class="highlight"><pre>committer: Daniel Swarbrick
comments:
partial implementation of channel list via 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>
<span style="color: #000080; font-weight: bold">index 9584c8b..11c3999 100644</span>
<span style="color: #A00000">--- a/src/mod/event_handlers/mod_snmp/FREESWITCH-MIB</span>
<span style="color: #00A000">+++ b/src/mod/event_handlers/mod_snmp/FREESWITCH-MIB</span>
<span style="color: #800080; font-weight: bold">@@ -107,4 +107,88 @@ maxSessionsPerSecond OBJECT-TYPE</span>
"Maximum permissible sessions per second"
::= { systemStats 7 }
<span style="color: #00A000">+</span>
<span style="color: #00A000">+ChannelEntry ::= SEQUENCE {</span>
<span style="color: #00A000">+ chanUUID DisplayString,</span>
<span style="color: #00A000">+ chanDirection DisplayString,</span>
<span style="color: #00A000">+ chanCreated DisplayString,</span>
<span style="color: #00A000">+ chanName DisplayString,</span>
<span style="color: #00A000">+ chanState DisplayString,</span>
<span style="color: #00A000">+ chanCIDName DisplayString,</span>
<span style="color: #00A000">+ chanCIDNum DisplayString</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+channelList OBJECT-TYPE</span>
<span style="color: #00A000">+ SYNTAX SEQUENCE OF ChannelEntry</span>
<span style="color: #00A000">+ MAX-ACCESS not-accessible</span>
<span style="color: #00A000">+ STATUS current</span>
<span style="color: #00A000">+ DESCRIPTION</span>
<span style="color: #00A000">+ "A table containing a list of active channels"</span>
<span style="color: #00A000">+ ::= { core 9 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+channelEntry OBJECT-TYPE</span>
<span style="color: #00A000">+ SYNTAX ChannelEntry</span>
<span style="color: #00A000">+ MAX-ACCESS not-accessible</span>
<span style="color: #00A000">+ STATUS current</span>
<span style="color: #00A000">+ DESCRIPTION</span>
<span style="color: #00A000">+ "A channel entry"</span>
<span style="color: #00A000">+ INDEX { chanIndex }</span>
<span style="color: #00A000">+ ::= { channelList 1 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+chanUUID 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">+ "The channel UUID."</span>
<span style="color: #00A000">+ ::= { channelEntry 1 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+chanDirection 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">+ "The channel direction."</span>
<span style="color: #00A000">+ ::= { channelEntry 2 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+chanCreated 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">+ "Channel creation timestamp."</span>
<span style="color: #00A000">+ ::= { channelEntry 3 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+chanName 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">+ "The channel name."</span>
<span style="color: #00A000">+ ::= { channelEntry 4 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+chanState 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">+ "The channel state."</span>
<span style="color: #00A000">+ ::= { channelEntry 5 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+chanCIDName 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">+ "The channel caller ID name."</span>
<span style="color: #00A000">+ ::= { channelEntry 6 }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+chanCIDNum 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">+ "The channel caller ID number."</span>
<span style="color: #00A000">+ ::= { channelEntry 7 }</span>
<span style="color: #00A000">+</span>
END
<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 56c7be1..d415d4f 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">@@ -109,7 +109,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_snmp_load)</span>
         */
        netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL, 2);
<span style="color: #A00000">-        init_subagent(); </span>
<span style="color: #00A000">+        init_subagent(pool);</span>
        init_snmp("mod_snmp");
        return status;
<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 bad3dc6..7b9faa7 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">@@ -36,27 +36,108 @@</span>
#include <net-snmp/agent/net-snmp-agent-includes.h>
#include "subagent.h"
<span style="color: #00A000">+netsnmp_table_registration_info *ch_table_info;</span>
<span style="color: #00A000">+netsnmp_tdata *ch_table;</span>
<span style="color: #00A000">+netsnmp_handler_registration *ch_reginfo;</span>
<span style="color: #00A000">+uint32_t idx;</span>
<span style="color: #A00000">-void init_subagent(void)</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+static int sql_count_callback(void *pArg, int argc, char **argv, char **columnNames)</span>
{
<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: #00A000">+        uint32_t *count = (uint32_t *) pArg;</span>
<span style="color: #00A000">+        *count = atoi(argv[0]);</span>
<span style="color: #00A000">+        return 0;</span>
<span style="color: #00A000">+}</span>
<span style="color: #A00000">-        DEBUGMSGTL(("init_subagent", "Initializing\n"));</span>
<span style="color: #A00000">-        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: #A00000">-        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: #00A000">+static int channelList_callback(void *pArg, int argc, char **argv, char **columnNames)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        chan_entry_t *entry;</span>
<span style="color: #00A000">+        netsnmp_tdata_row *row;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        switch_zmalloc(entry, sizeof(chan_entry_t));</span>
<span style="color: #00A000">+        if (!entry)</span>
<span style="color: #00A000">+                return 0;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        row = netsnmp_tdata_create_row();</span>
<span style="color: #00A000">+        if (!row) {</span>
<span style="color: #00A000">+                switch_safe_free(entry);</span>
<span style="color: #00A000">+                return 0;</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+        row->data = entry;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        entry->idx = idx++;</span>
<span style="color: #00A000">+        strncpy(entry->uuid, argv[0], sizeof(entry->uuid));</span>
<span style="color: #00A000">+        strncpy(entry->direction, argv[1], sizeof(entry->direction));</span>
<span style="color: #00A000">+        strncpy(entry->created, argv[2], sizeof(entry->created));</span>
<span style="color: #00A000">+        strncpy(entry->name, argv[4], sizeof(entry->name));</span>
<span style="color: #00A000">+        strncpy(entry->state, argv[5], sizeof(entry->state));</span>
<span style="color: #00A000">+        strncpy(entry->cid_name, argv[6], sizeof(entry->cid_name));</span>
<span style="color: #00A000">+        strncpy(entry->cid_num, argv[7], sizeof(entry->cid_num));</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        netsnmp_tdata_row_add_index(row, ASN_INTEGER, &entry->idx, sizeof(entry->idx));</span>
<span style="color: #00A000">+        netsnmp_tdata_add_row(ch_table, row);</span>
<span style="color: #00A000">+        return 0;</span>
}
<span style="color: #A00000">-static int sql_count_callback(void *pArg, int argc, char **argv, char **columnNames)</span>
<span style="color: #00A000">+void channelList_free(netsnmp_cache *cache, void *magic)</span>
{
<span style="color: #A00000">-        uint32_t *count = (uint32_t *) pArg;</span>
<span style="color: #A00000">-        *count = atoi(argv[0]);</span>
<span style="color: #00A000">+        netsnmp_tdata_row *row = netsnmp_tdata_row_first(ch_table);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        /* Delete table rows one by one */</span>
<span style="color: #00A000">+        while (row) {</span>
<span style="color: #00A000">+                netsnmp_tdata_remove_and_delete_row(ch_table, row);</span>
<span style="color: #00A000">+                switch_safe_free(row->data);</span>
<span style="color: #00A000">+                row = netsnmp_tdata_row_first(ch_table);</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">+int channelList_load(netsnmp_cache *cache, void *vmagic)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        switch_cache_db_handle_t *dbh;</span>
<span style="color: #00A000">+        char sql[1024] = "", hostname[256] = "";</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        channelList_free(cache, NULL);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (switch_core_db_handle(&dbh) != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                return 0;</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        idx = 1;</span>
<span style="color: #00A000">+        gethostname(hostname, sizeof(hostname));</span>
<span style="color: #00A000">+        sprintf(sql, "SELECT * FROM channels WHERE hostname='%s' ORDER BY created_epoch", hostname);</span>
<span style="color: #00A000">+        switch_cache_db_execute_sql_callback(dbh, sql, channelList_callback, NULL, NULL);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        switch_cache_db_release_db_handle(&dbh);</span>
<span style="color: #00A000">+</span>
        return 0;
}
<span style="color: #00A000">+void init_subagent(switch_memory_pool_t *pool)</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">+        static oid channelList_oid[] = { 1,3,6,1,4,1,27880,1,9 };</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        DEBUGMSGTL(("init_subagent", "mod_snmp subagent initializing\n"));</span>
<span style="color: #00A000">+</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: #00A000">+</span>
<span style="color: #00A000">+        ch_table_info = switch_core_alloc(pool, sizeof(netsnmp_table_registration_info));</span>
<span style="color: #00A000">+        netsnmp_table_helper_add_index(ch_table_info, ASN_INTEGER);</span>
<span style="color: #00A000">+        ch_table_info->min_column = 1;</span>
<span style="color: #00A000">+        ch_table_info->max_column = 7;</span>
<span style="color: #00A000">+        ch_table = netsnmp_tdata_create_table("channelList", 0);</span>
<span style="color: #00A000">+        ch_reginfo = netsnmp_create_handler_registration("channelList", handle_channelList, channelList_oid, OID_LENGTH(channelList_oid), HANDLER_CAN_RONLY);</span>
<span style="color: #00A000">+        netsnmp_tdata_register(ch_reginfo, ch_table, ch_table_info);</span>
<span style="color: #00A000">+        netsnmp_inject_handler(ch_reginfo, netsnmp_get_cache_handler(5, channelList_load, channelList_free, channelList_oid, OID_LENGTH(channelList_oid)));</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
int handle_identity(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests)
{
        netsnmp_request_info *request = NULL;
<span style="color: #800080; font-weight: bold">@@ -97,7 +178,7 @@ int handle_systemStats(netsnmp_mib_handler *handler, netsnmp_handler_registratio</span>
        netsnmp_request_info *request = NULL;
        oid subid;
        switch_time_t uptime;
<span style="color: #A00000">-        uint32_t int_val;</span>
<span style="color: #00A000">+        uint32_t int_val = 0;</span>
        switch(reqinfo->mode) {
        case MODE_GET:
<span style="color: #800080; font-weight: bold">@@ -160,6 +241,55 @@ int handle_systemStats(netsnmp_mib_handler *handler, netsnmp_handler_registratio</span>
}
<span style="color: #00A000">+int handle_channelList(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;</span>
<span style="color: #00A000">+        netsnmp_table_request_info *table_info;</span>
<span style="color: #00A000">+        chan_entry_t *entry;</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">+                        table_info = netsnmp_extract_table_info(request);</span>
<span style="color: #00A000">+                        entry = (chan_entry_t *) netsnmp_tdata_extract_entry(request);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        switch (table_info->colnum) {</span>
<span style="color: #00A000">+                        case CH_UUID:</span>
<span style="color: #00A000">+                                snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->uuid, strlen(entry->uuid));</span>
<span style="color: #00A000">+                                break;</span>
<span style="color: #00A000">+                        case CH_DIRECTION:</span>
<span style="color: #00A000">+                                snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->direction, strlen(entry->direction));</span>
<span style="color: #00A000">+                                break;</span>
<span style="color: #00A000">+                        case CH_CREATED:</span>
<span style="color: #00A000">+                                snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->created, strlen(entry->created));</span>
<span style="color: #00A000">+                                break;</span>
<span style="color: #00A000">+                        case CH_NAME:</span>
<span style="color: #00A000">+                                snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->name, strlen(entry->name));</span>
<span style="color: #00A000">+                                break;</span>
<span style="color: #00A000">+                        case CH_STATE:</span>
<span style="color: #00A000">+                                snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->state, strlen(entry->state));</span>
<span style="color: #00A000">+                                break;</span>
<span style="color: #00A000">+                        case CH_CID_NAME:</span>
<span style="color: #00A000">+                                snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->cid_name, strlen(entry->cid_name));</span>
<span style="color: #00A000">+                                break;</span>
<span style="color: #00A000">+                        case CH_CID_NUM:</span>
<span style="color: #00A000">+                                snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, (u_char *) entry->cid_num, strlen(entry->cid_num));</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", table_info->colnum);</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">+        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_foo\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>
/* For Emacs:
* Local Variables:
<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 3315378..0070b2c 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">@@ -14,9 +14,29 @@</span>
#define SS_SESSIONS_PER_SECOND                6
#define SS_MAX_SESSIONS_PER_SECOND        7
<span style="color: #00A000">+/* .1.3.6.1.4.1.27880.1.9 */</span>
<span style="color: #00A000">+#define CH_UUID                                1</span>
<span style="color: #00A000">+#define CH_DIRECTION                        2</span>
<span style="color: #00A000">+#define CH_CREATED                        3</span>
<span style="color: #00A000">+#define CH_NAME                                4</span>
<span style="color: #00A000">+#define CH_STATE                        5</span>
<span style="color: #00A000">+#define CH_CID_NAME                        6</span>
<span style="color: #00A000">+#define CH_CID_NUM                        7</span>
<span style="color: #A00000">-void init_subagent(void);</span>
<span style="color: #00A000">+typedef struct {</span>
<span style="color: #00A000">+        uint32_t idx;</span>
<span style="color: #00A000">+        char uuid[38];</span>
<span style="color: #00A000">+        char direction[32];</span>
<span style="color: #00A000">+        char created[128];</span>
<span style="color: #00A000">+        char name[1024];</span>
<span style="color: #00A000">+        char state[64];</span>
<span style="color: #00A000">+        char cid_name[1024];</span>
<span style="color: #00A000">+        char cid_num[256];</span>
<span style="color: #00A000">+} chan_entry_t;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+void init_subagent(switch_memory_pool_t *pool);</span>
Netsnmp_Node_Handler handle_identity;
Netsnmp_Node_Handler handle_systemStats;
<span style="color: #00A000">+Netsnmp_Node_Handler handle_channelList;</span>
#endif /* subagent_H */
</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-001
<span style="color: #000080; font-weight: bold">diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml</span>
<span style="color: #000080; font-weight: bold">index 6ed99ef..5fc9402 100644</span>
<span style="color: #A00000">--- a/conf/freeswitch.xml</span>
<span style="color: #00A000">+++ b/conf/freeswitch.xml</span>
<span style="color: #800080; font-weight: bold">@@ -63,4 +63,3 @@</span>
</section>
</document>
<span style="color: #A00000">-</span>
</pre></div>
<div class="highlight"><pre>committer: Daniel Swarbrick
comments:
add support for getting current call count
<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 8f08baf..bad3dc6 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">@@ -49,6 +49,14 @@ void init_subagent(void)</span>
}
<span style="color: #00A000">+static int sql_count_callback(void *pArg, int argc, char **argv, char **columnNames)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        uint32_t *count = (uint32_t *) pArg;</span>
<span style="color: #00A000">+        *count = atoi(argv[0]);</span>
<span style="color: #00A000">+        return 0;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
int handle_identity(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests)
{
        netsnmp_request_info *request = NULL;
<span style="color: #800080; font-weight: bold">@@ -113,13 +121,20 @@ int handle_systemStats(netsnmp_mib_handler *handler, netsnmp_handler_registratio</span>
                        snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));
                        break;
                case SS_CURRENT_CALLS:
<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: #00A000">+                        {</span>
<span style="color: #00A000">+                        switch_cache_db_handle_t *dbh;</span>
<span style="color: #00A000">+                        char sql[1024] = "", hostname[256] = "";</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        if (switch_core_db_handle(&dbh) != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                                return SNMP_ERR_GENERR;</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        gethostname(hostname, sizeof(hostname));</span>
<span style="color: #00A000">+                        sprintf(sql, "SELECT COUNT(*) FROM calls WHERE hostname='%s'", hostname);</span>
<span style="color: #00A000">+                        switch_cache_db_execute_sql_callback(dbh, sql, sql_count_callback, &int_val, NULL);</span>
                        snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));
<span style="color: #00A000">+                        switch_cache_db_release_db_handle(&dbh);</span>
<span style="color: #00A000">+                        }</span>
                        break;
                case SS_SESSIONS_PER_SECOND:
                        switch_core_session_ctl(SCSC_LAST_SPS, &int_val);
</pre></div>
<div class="highlight"><pre>committer: Raymond Chandler
comments:
test
<span style="color: #000080; font-weight: bold">diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml</span>
<span style="color: #000080; font-weight: bold">index 80e7728..6ed99ef 100644</span>
<span style="color: #A00000">--- a/conf/freeswitch.xml</span>
<span style="color: #00A000">+++ b/conf/freeswitch.xml</span>
<span style="color: #800080; font-weight: bold">@@ -64,4 +64,3 @@</span>
</document>
<span style="color: #A00000">-</span>
</pre></div>
<div class="highlight"><pre>committer: Raymond Chandler
comments:
test
<span style="color: #000080; font-weight: bold">diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml</span>
<span style="color: #000080; font-weight: bold">index 6ed99ef..80e7728 100644</span>
<span style="color: #A00000">--- a/conf/freeswitch.xml</span>
<span style="color: #00A000">+++ b/conf/freeswitch.xml</span>
<span style="color: #800080; font-weight: bold">@@ -64,3 +64,4 @@</span>
</document>
<span style="color: #00A000">+</span>
</pre></div>
<div class="highlight"><pre>committer: Raymond Chandler
comments:
test
<span style="color: #000080; font-weight: bold">diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml</span>
<span style="color: #000080; font-weight: bold">index 5fc9402..6ed99ef 100644</span>
<span style="color: #A00000">--- a/conf/freeswitch.xml</span>
<span style="color: #00A000">+++ b/conf/freeswitch.xml</span>
<span style="color: #800080; font-weight: bold">@@ -63,3 +63,4 @@</span>
</section>
</document>
<span style="color: #00A000">+</span>
</pre></div>
<div class="highlight"><pre>committer: Raymond Chandler
comments:
test
<span style="color: #000080; font-weight: bold">diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml</span>
<span style="color: #000080; font-weight: bold">index 6ed99ef..5fc9402 100644</span>
<span style="color: #A00000">--- a/conf/freeswitch.xml</span>
<span style="color: #00A000">+++ b/conf/freeswitch.xml</span>
<span style="color: #800080; font-weight: bold">@@ -63,4 +63,3 @@</span>
</section>
</document>
<span style="color: #A00000">-</span>
</pre></div>
<div class="highlight"><pre>committer: Raymond Chandler
comments:
test
<span style="color: #000080; font-weight: bold">diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml</span>
<span style="color: #000080; font-weight: bold">index 80e7728..6ed99ef 100644</span>
<span style="color: #A00000">--- a/conf/freeswitch.xml</span>
<span style="color: #00A000">+++ b/conf/freeswitch.xml</span>
<span style="color: #800080; font-weight: bold">@@ -64,4 +64,3 @@</span>
</document>
<span style="color: #A00000">-</span>
</pre></div>
<div class="highlight"><pre>committer: Daniel Swarbrick
comments:
typo
<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 2da9ebe..8f08baf 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">@@ -109,7 +109,7 @@ int handle_systemStats(netsnmp_mib_handler *handler, netsnmp_handler_registratio</span>
                        snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));
                        break;
                case SS_MAX_SESSIONS:
<span style="color: #A00000">-                        switch_core_session_ctl(SCSC_MAX_SESSIONS, &int_val);;</span>
<span style="color: #00A000">+                        switch_core_session_ctl(SCSC_MAX_SESSIONS, &int_val);</span>
                        snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE, (u_char *) &int_val, sizeof(int_val));
                        break;
                case SS_CURRENT_CALLS:
</pre></div>
<div class="highlight"><pre>committer: Luke Dashjr
comments:
MERGE: OpenMethods DTMF recognition via ASR modules
</pre></div>
<div class="highlight"><pre>committer: Luke Dashjr
comments:
MERGE: OpenMethods ASR enhancements: multiple concurrent grammars and dialplan access to start-input-timers
<span style="color: #000080; font-weight: bold">diff --cc src/mod/applications/mod_dptools/mod_dptools.c</span>
<span style="color: #000080; font-weight: bold">index 5a3be03,fe089a6..928a9b8</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">@@@ -95,181 -96,7 +96,181 @@@ SWITCH_STANDARD_DIALPLAN(inline_dialpla</span>
        return extension;
}
+struct action_binding {
+        char *realm;
+        char *input;
+        char *string;
+        char *value;
+        switch_core_session_t *session;
+};
+
+static switch_status_t digit_nomatch_action_callback(switch_ivr_dmachine_match_t *match)
+{
+        switch_core_session_t *session = (switch_core_session_t *) match->user_data;
+        switch_channel_t *channel = switch_core_session_get_channel(session);
+        char str[DMACHINE_MAX_DIGIT_LEN + 2];
+        switch_event_t *event;
+        switch_status_t status;
+
+        switch_channel_set_variable(channel, "last_non_matching_digits", match->match_digits);
+
+        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Digit NOT match binding [%s]\n",
+                                         switch_channel_get_name(channel), match->match_digits);
+
+        if (switch_event_create_plain(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) {
+                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "digits", match->match_digits);
+
+                if ((status = switch_core_session_queue_event(session, &event)) != SWITCH_STATUS_SUCCESS) {
+                        switch_event_destroy(&event);
+                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s event queue faiure.\n",
+                                                         switch_core_session_get_name(session));
+                }
+        }
+
+        /* send it back around flagged to skip the dmachine */
+        switch_snprintf(str, sizeof(str), "!%s", match->match_digits);
+        
+        switch_channel_queue_dtmf_string(channel, str);
+        
+        return SWITCH_STATUS_SUCCESS;
+}
+
+static switch_status_t digit_action_callback(switch_ivr_dmachine_match_t *match)
+{
+        struct action_binding *act = (struct action_binding *) match->user_data;
+        switch_event_t *event;
+        switch_status_t status;
+        int exec = 0;
+        char *string = act->string;
+        switch_channel_t *channel = switch_core_session_get_channel(act->session);
+
+        switch_channel_set_variable(channel, "last_matching_digits", match->match_digits);
+        
+        if (switch_event_create_plain(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) {
+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(act->session), SWITCH_LOG_DEBUG, "%s Digit match binding [%s][%s]\n",
+                                                 switch_channel_get_name(channel), act->string, act->value);
+
+                if (!strncasecmp(string, "exec:", 5)) {
+                        string += 5;
+                        exec = 1;
+                }
+
+                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, string, act->value);
+                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "digits", match->match_digits);
+
+                if (exec) {
+                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute", exec == 2 ? "non-blocking" : "blocking");
+                }
+
+                if ((status = switch_core_session_queue_event(act->session, &event)) != SWITCH_STATUS_SUCCESS) {
+                        switch_event_destroy(&event);
+                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(act->session), SWITCH_LOG_WARNING, "%s event queue faiure.\n",
+                                                         switch_core_session_get_name(act->session));
+                }
+        }
+
+        if (exec) {
+                char *cmd = switch_core_session_sprintf(act->session, "%s::%s", string, act->value);
+                switch_ivr_broadcast_in_thread(act->session, cmd, SMF_ECHO_ALEG|SMF_HOLD_BLEG);
+        }
+        
+        return SWITCH_STATUS_SUCCESS;
+}
+
+#define CLEAR_DIGIT_ACTION_USAGE "<realm>|all"
+SWITCH_STANDARD_APP(clear_digit_action_function)
+{
+        //switch_channel_t *channel = switch_core_session_get_channel(session);
+        switch_ivr_dmachine_t *dmachine;
+        char *realm = (char *) data;
+
+        if ((dmachine = switch_core_session_get_dmachine(session))) {
+                if (zstr(realm) || !strcasecmp(realm, "all")) {
+                        switch_core_session_set_dmachine(session, NULL);
+                        switch_ivr_dmachine_destroy(&dmachine);
+                } else {
+                        switch_ivr_dmachine_clear_realm(dmachine, realm);
+                }
+        }
+}
+
+#define DIGIT_ACTION_SET_REALM_USAGE "<realm>"
+SWITCH_STANDARD_APP(digit_action_set_realm_function)
+{
+        switch_ivr_dmachine_t *dmachine;
+        char *realm = (char *) data;
+
+        if (zstr(data)) {
+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Syntax Error, USAGE %s\n", DIGIT_ACTION_SET_REALM_USAGE);
+                return;
+        }
+        
+        if ((dmachine = switch_core_session_get_dmachine(session))) {
+                switch_ivr_dmachine_set_realm(dmachine, realm);
+        }
+
+}
+
+#define BIND_DIGIT_ACTION_USAGE "<realm>,<digits|~regex>,<string>,<value>"
+SWITCH_STANDARD_APP(bind_digit_action_function)
+{
+        switch_channel_t *channel = switch_core_session_get_channel(session);
+        switch_ivr_dmachine_t *dmachine;
+        char *mydata;
+        int argc = 0;
+        char *argv[4] = { 0 };
+        struct action_binding *act;
+
+        if (zstr(data)) {
+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Syntax Error, USAGE %s\n", BIND_DIGIT_ACTION_USAGE);
+                return;
+        }
+
+        mydata = switch_core_session_strdup(session, data);
+
+        argc = switch_separate_string(mydata, ',', argv, (sizeof(argv) / sizeof(argv[0])));
+        
+        if (argc < 4 || zstr(argv[0]) || zstr(argv[1]) || zstr(argv[2]) || zstr(argv[3])) {
+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Syntax Error, USAGE %s\n", BIND_DIGIT_ACTION_USAGE);
+                return;
+        }
+
+        
+        if (!(dmachine = switch_core_session_get_dmachine(session))) {
+                uint32_t digit_timeout = 1500;
+                uint32_t input_timeout = 0;
+                const char *var;
+                uint32_t tmp;
+
+                if ((var = switch_channel_get_variable(channel, "bind_digit_digit_timeout"))) {
+                        tmp = (uint32_t) atol(var);
+                        if (tmp < 0) tmp = 0;
+                        digit_timeout = tmp;
+                }
+                
+                if ((var = switch_channel_get_variable(channel, "bind_digit_input_timeout"))) {
+                        tmp = (uint32_t) atol(var);
+                        if (tmp < 0) tmp = 0;
+                        input_timeout = tmp;
+                }
+                
+                switch_ivr_dmachine_create(&dmachine, "DPTOOLS", NULL, digit_timeout, input_timeout, NULL, digit_nomatch_action_callback, session);
+                switch_core_session_set_dmachine(session, dmachine);
+        }
+
+        
+        act = switch_core_session_alloc(session, sizeof(*act));
+        act->realm = argv[0];
+        act->input = argv[1];
+        act->string = argv[2];
+        act->value = argv[3];
+        act->session = session;
+        
+        switch_ivr_dmachine_bind(dmachine, act->realm, act->input, 0, digit_action_callback, act);
+}
+
+
<span style="color: #A00000">- #define DETECT_SPEECH_SYNTAX "<mod_name> <gram_name> <gram_path> [<addr>] OR grammar <gram_name> [<path>] OR nogrammar <gram_name> OR pause OR resume OR stop OR param <name> <value>"</span>
<span style="color: #00A000">+ #define DETECT_SPEECH_SYNTAX "<mod_name> <gram_name> <gram_path> [<addr>] OR grammar <gram_name> [<path>] OR nogrammar <gram_name> OR grammaron/grammaroff <gram_name> OR grammarsalloff OR pause OR resume OR start_input_timers OR stop OR param <name> <value>"</span>
SWITCH_STANDARD_APP(detect_speech_function)
{
        char *argv[4];
</pre></div>
<div class="highlight"><pre>committer: Luke Dashjr
comments:
MERGE: DTMF recognition via ASR modules (implemented in UniMRCP)
<span style="color: #000080; font-weight: bold">diff --git a/src/include/switch_core.h b/src/include/switch_core.h</span>
<span style="color: #000080; font-weight: bold">index 26a048c..a3d74e9 100644</span>
<span style="color: #A00000">--- a/src/include/switch_core.h</span>
<span style="color: #00A000">+++ b/src/include/switch_core.h</span>
<span style="color: #800080; font-weight: bold">@@ -1715,6 +1715,15 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_close(switch_asr_handle_t *ah, s</span>
SWITCH_DECLARE(switch_status_t) switch_core_asr_feed(switch_asr_handle_t *ah, void *data, unsigned int len, switch_asr_flag_t *flags);
/*!
<span style="color: #00A000">+ \brief Feed DTMF to an asr handle</span>
<span style="color: #00A000">+ \param ah the handle to feed data to</span>
<span style="color: #00A000">+ \param dtmf a string of DTMF digits</span>
<span style="color: #00A000">+ \param flags flags to influence behaviour</span>
<span style="color: #00A000">+ \return SWITCH_STATUS_SUCCESS</span>
<span style="color: #00A000">+*/</span>
<span style="color: #00A000">+SWITCH_DECLARE(switch_status_t) switch_core_asr_feed_dtmf(switch_asr_handle_t *ah, const switch_dtmf_t *dtmf, switch_asr_flag_t *flags);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+/*!</span>
\brief Check an asr handle for results
\param ah the handle to check
\param flags flags to influence behaviour
<span style="color: #000080; font-weight: bold">diff --git a/src/include/switch_module_interfaces.h b/src/include/switch_module_interfaces.h</span>
<span style="color: #000080; font-weight: bold">index e0119b4..8303af7 100644</span>
<span style="color: #A00000">--- a/src/include/switch_module_interfaces.h</span>
<span style="color: #00A000">+++ b/src/include/switch_module_interfaces.h</span>
<span style="color: #800080; font-weight: bold">@@ -400,6 +400,8 @@ struct switch_asr_interface {</span>
        switch_status_t (*asr_disable_grammar) (switch_asr_handle_t *ah, const char *name);
        /*! function to disable all grammars to the asr interface */
        switch_status_t (*asr_disable_all_grammars) (switch_asr_handle_t *ah);
<span style="color: #00A000">+        /*! function to feed DTMF to the ASR */</span>
<span style="color: #00A000">+        switch_status_t (*asr_feed_dtmf) (switch_asr_handle_t *ah, const switch_dtmf_t *dtmf, switch_asr_flag_t *flags);</span>
};
/*! an abstract representation of an asr speech interface. */
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c</span>
<span style="color: #000080; font-weight: bold">index b9cecd1..b3679cf 100644</span>
<span style="color: #A00000">--- a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c</span>
<span style="color: #00A000">+++ b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c</span>
<span style="color: #800080; font-weight: bold">@@ -49,6 +49,7 @@</span>
#include "mrcp_resource_loader.h"
#include "mpf_engine.h"
#include "mpf_codec_manager.h"
<span style="color: #00A000">+#include "mpf_dtmf_generator.h"</span>
#include "mpf_rtp_termination_factory.h"
#include "mrcp_sofiasip_client_agent.h"
#include "mrcp_unirtsp_client_agent.h"
<span style="color: #800080; font-weight: bold">@@ -442,6 +443,12 @@ struct recognizer_data {</span>
        int start_of_input;
        /** true, if input timers have started */
        int timers_started;
<span style="color: #00A000">+        /** UniMRCP mpf stream */</span>
<span style="color: #00A000">+        mpf_audio_stream_t *unimrcp_stream;</span>
<span style="color: #00A000">+        /** DTMF generator */</span>
<span style="color: #00A000">+        mpf_dtmf_generator_t *dtmf_generator;</span>
<span style="color: #00A000">+        /** true, if presently transmitting DTMF */</span>
<span style="color: #00A000">+        char dtmf_generator_active;</span>
};
typedef struct recognizer_data recognizer_data_t;
<span style="color: #800080; font-weight: bold">@@ -457,6 +464,7 @@ static switch_status_t recog_asr_disable_grammar(switch_asr_handle_t *ah, const</span>
static switch_status_t recog_asr_disable_all_grammars(switch_asr_handle_t *ah);
static switch_status_t recog_asr_close(switch_asr_handle_t *ah, switch_asr_flag_t *flags);
static switch_status_t recog_asr_feed(switch_asr_handle_t *ah, void *data, unsigned int len, switch_asr_flag_t *flags);
<span style="color: #00A000">+static switch_status_t recog_asr_feed_dtmf(switch_asr_handle_t *ah, const switch_dtmf_t *dtmf, switch_asr_flag_t *flags);</span>
#if 0
static switch_status_t recog_asr_start(switch_asr_handle_t *ah, const char *name);
#endif
<span style="color: #800080; font-weight: bold">@@ -472,6 +480,7 @@ static void recog_asr_float_param(switch_asr_handle_t *ah, char *param, double v</span>
/* recognizer's interface for UniMRCP */
static apt_bool_t recog_message_handler(const mrcp_app_message_t *app_message);
static apt_bool_t recog_on_message_receive(mrcp_application_t *application, mrcp_session_t *session, mrcp_channel_t *channel, mrcp_message_t *message);
<span style="color: #00A000">+static apt_bool_t recog_stream_open(mpf_audio_stream_t *stream, mpf_codec_t *codec);</span>
static apt_bool_t recog_stream_read(mpf_audio_stream_t *stream, mpf_frame_t *frame);
/* recognizer specific speech_channel_funcs */
<span style="color: #800080; font-weight: bold">@@ -3114,6 +3123,9 @@ static switch_status_t recog_asr_close(switch_asr_handle_t *ah, switch_asr_flag_</span>
        speech_channel_destroy(schannel);
        switch_core_hash_destroy(&r->grammars);
        switch_core_hash_destroy(&r->enabled_grammars);
<span style="color: #00A000">+        if (r->dtmf_generator) {</span>
<span style="color: #00A000">+                mpf_dtmf_generator_destroy(r->dtmf_generator);</span>
<span style="color: #00A000">+        }</span>
        /* this lets FreeSWITCH's speech_thread know the handle is closed */
        switch_set_flag(ah, SWITCH_ASR_FLAG_CLOSED);
<span style="color: #800080; font-weight: bold">@@ -3134,6 +3146,39 @@ static switch_status_t recog_asr_feed(switch_asr_handle_t *ah, void *data, unsig</span>
        return speech_channel_write(schannel, data, &slen);
}
<span style="color: #00A000">+/**</span>
<span style="color: #00A000">+ * Process asr_feed_dtmf request from FreeSWITCH</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * @param ah the FreeSWITCH speech recognition handle</span>
<span style="color: #00A000">+ * @return SWITCH_STATUS_SUCCESS if successful </span>
<span style="color: #00A000">+ */</span>
<span style="color: #00A000">+static switch_status_t recog_asr_feed_dtmf(switch_asr_handle_t *ah, const switch_dtmf_t *dtmf, switch_asr_flag_t *flags)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        speech_channel_t *schannel = (speech_channel_t *) ah->private_info;</span>
<span style="color: #00A000">+        recognizer_data_t *r = (recognizer_data_t *) schannel->data;</span>
<span style="color: #00A000">+        char digits[2];</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (!r->dtmf_generator) {</span>
<span style="color: #00A000">+                if (!r->unimrcp_stream) {</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "(%s) Cannot queue DTMF: No UniMRCP stream object open\n", schannel->name);</span>
<span style="color: #00A000">+                        return SWITCH_STATUS_FALSE;</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+                r->dtmf_generator = mpf_dtmf_generator_create(r->unimrcp_stream, schannel->unimrcp_session->pool);</span>
<span style="color: #00A000">+                if (!r->dtmf_generator) {</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "(%s) Cannot queue DTMF: Failed to create DTMF generator\n", schannel->name);</span>
<span style="color: #00A000">+                        return SWITCH_STATUS_FALSE;</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        digits[0] = dtmf->digit;</span>
<span style="color: #00A000">+        digits[1] = '\0';</span>
<span style="color: #00A000">+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) Queued DTMF: %s\n", schannel->name, digits);</span>
<span style="color: #00A000">+        mpf_dtmf_generator_enqueue(r->dtmf_generator, digits);</span>
<span style="color: #00A000">+        r->dtmf_generator_active = 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>
#if 0
/**
* Process asr_start request from FreeSWITCH
<span style="color: #800080; font-weight: bold">@@ -3380,6 +3425,23 @@ static apt_bool_t recog_on_message_receive(mrcp_application_t *application, mrcp</span>
}
/**
<span style="color: #00A000">+ * UniMRCP callback requesting open for speech recognition</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * @param stream the UniMRCP stream</span>
<span style="color: #00A000">+ * @param codec the codec</span>
<span style="color: #00A000">+ * @return TRUE</span>
<span style="color: #00A000">+ */</span>
<span style="color: #00A000">+static apt_bool_t recog_stream_open(mpf_audio_stream_t *stream, mpf_codec_t *codec)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        speech_channel_t *schannel = (speech_channel_t *) stream->obj;</span>
<span style="color: #00A000">+        recognizer_data_t *r = (recognizer_data_t *) schannel->data;</span>
<span style="color: #00A000">+        </span>
<span style="color: #00A000">+        r->unimrcp_stream = stream;</span>
<span style="color: #00A000">+        </span>
<span style="color: #00A000">+        return TRUE;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+/**</span>
* UniMRCP callback requesting next frame for speech recognition
*
* @param stream the UniMRCP stream
<span style="color: #800080; font-weight: bold">@@ -3389,6 +3451,7 @@ static apt_bool_t recog_on_message_receive(mrcp_application_t *application, mrcp</span>
static apt_bool_t recog_stream_read(mpf_audio_stream_t *stream, mpf_frame_t *frame)
{
        speech_channel_t *schannel = (speech_channel_t *) stream->obj;
<span style="color: #00A000">+        recognizer_data_t *r = (recognizer_data_t *) schannel->data;</span>
        switch_size_t to_read = frame->codec_frame.size;
        /* grab the data. pad it if there isn't enough */
<span style="color: #800080; font-weight: bold">@@ -3398,6 +3461,13 @@ static apt_bool_t recog_stream_read(mpf_audio_stream_t *stream, mpf_frame_t *fra</span>
                }
                frame->type |= MEDIA_FRAME_TYPE_AUDIO;
        }
<span style="color: #00A000">+        </span>
<span style="color: #00A000">+        if (r->dtmf_generator_active) {</span>
<span style="color: #00A000">+                if (!mpf_dtmf_generator_put_frame(r->dtmf_generator, frame)) {</span>
<span style="color: #00A000">+                        if (!mpf_dtmf_generator_sending(r->dtmf_generator))</span>
<span style="color: #00A000">+                                r->dtmf_generator_active = 0;</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+        }</span>
        return TRUE;
}
<span style="color: #800080; font-weight: bold">@@ -3421,6 +3491,7 @@ static switch_status_t recog_load(switch_loadable_module_interface_t *module_int</span>
        asr_interface->asr_disable_all_grammars = recog_asr_disable_all_grammars;
        asr_interface->asr_close = recog_asr_close;
        asr_interface->asr_feed = recog_asr_feed;
<span style="color: #00A000">+        asr_interface->asr_feed_dtmf = recog_asr_feed_dtmf;</span>
#if 0
        asr_interface->asr_start = recog_asr_start;
#endif
<span style="color: #800080; font-weight: bold">@@ -3443,7 +3514,7 @@ static switch_status_t recog_load(switch_loadable_module_interface_t *module_int</span>
        globals.recog.dispatcher.on_channel_remove = speech_on_channel_remove;
        globals.recog.dispatcher.on_message_receive = recog_on_message_receive;
        globals.recog.audio_stream_vtable.destroy = NULL;
<span style="color: #A00000">-        globals.recog.audio_stream_vtable.open_rx = NULL;</span>
<span style="color: #00A000">+        globals.recog.audio_stream_vtable.open_rx = recog_stream_open;</span>
        globals.recog.audio_stream_vtable.close_rx = NULL;
        globals.recog.audio_stream_vtable.read_frame = recog_stream_read;
        globals.recog.audio_stream_vtable.open_tx = NULL;
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_core_asr.c b/src/switch_core_asr.c</span>
<span style="color: #000080; font-weight: bold">index 691011a..7f231ef 100644</span>
<span style="color: #A00000">--- a/src/switch_core_asr.c</span>
<span style="color: #00A000">+++ b/src/switch_core_asr.c</span>
<span style="color: #800080; font-weight: bold">@@ -239,6 +239,19 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_feed(switch_asr_handle_t *ah, vo</span>
        return ah->asr_interface->asr_feed(ah, data, len, flags);
}
<span style="color: #00A000">+SWITCH_DECLARE(switch_status_t) switch_core_asr_feed_dtmf(switch_asr_handle_t *ah, const switch_dtmf_t *dtmf, switch_asr_flag_t *flags)</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">+        switch_assert(ah != NULL);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (ah->asr_interface->asr_feed_dtmf) {</span>
<span style="color: #00A000">+                status = ah->asr_interface->asr_feed_dtmf(ah, dtmf, flags);</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        return status;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
SWITCH_DECLARE(switch_status_t) switch_core_asr_check_results(switch_asr_handle_t *ah, switch_asr_flag_t *flags)
{
        switch_assert(ah != NULL);
<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 66cd369..5df7af3 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">@@ -2660,6 +2660,20 @@ static switch_bool_t speech_callback(switch_media_bug_t *bug, void *user_data, s</span>
        return SWITCH_TRUE;
}
<span style="color: #00A000">+static switch_status_t speech_on_dtmf(switch_core_session_t *session, const switch_dtmf_t *dtmf, switch_dtmf_direction_t direction)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        switch_channel_t *channel = switch_core_session_get_channel(session);</span>
<span style="color: #00A000">+        struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);</span>
<span style="color: #00A000">+        switch_status_t status = SWITCH_STATUS_SUCCESS;</span>
<span style="color: #00A000">+        switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (switch_core_asr_feed_dtmf(sth->ah, dtmf, &flags) != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error Feeding DTMF\n");</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        return status;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
SWITCH_DECLARE(switch_status_t) switch_ivr_stop_detect_speech(switch_core_session_t *session)
{
        switch_channel_t *channel = switch_core_session_get_channel(session);
<span style="color: #800080; font-weight: bold">@@ -2875,6 +2889,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech(switch_core_session_t *</span>
                return status;
        }
<span style="color: #00A000">+        if ((status = switch_core_event_hook_add_recv_dtmf(session, speech_on_dtmf)) != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                switch_ivr_stop_detect_speech(session);</span>
<span style="color: #00A000">+                return status;</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+</span>
        switch_channel_set_private(channel, SWITCH_SPEECH_KEY, sth);
        return SWITCH_STATUS_SUCCESS;
</pre></div>
<div class="highlight"><pre>committer: Luke Dashjr
comments:
MERGE: expose ASR start_input_timers to dialplan via IVR and mod_dptools
<span style="color: #000080; font-weight: bold">diff --cc src/mod/applications/mod_dptools/mod_dptools.c</span>
<span style="color: #000080; font-weight: bold">index f573661,2f49630..fe089a6</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">@@@ -96,7 -96,7 +96,7 @@@ SWITCH_STANDARD_DIALPLAN(inline_dialpla</span>
        return extension;
}
<span style="color: #A00000">- #define DETECT_SPEECH_SYNTAX "<mod_name> <gram_name> <gram_path> [<addr>] OR grammar <gram_name> [<path>] OR nogrammar <gram_name> OR grammaron/grammaroff <gram_name> OR grammarsalloff OR pause OR resume OR stop OR param <name> <value>"</span>
-#define DETECT_SPEECH_SYNTAX "<mod_name> <gram_name> <gram_path> [<addr>] OR grammar <gram_name> [<path>] OR pause OR resume OR start_input_timers"
<span style="color: #00A000">++#define DETECT_SPEECH_SYNTAX "<mod_name> <gram_name> <gram_path> [<addr>] OR grammar <gram_name> [<path>] OR nogrammar <gram_name> OR grammaron/grammaroff <gram_name> OR grammarsalloff OR pause OR resume OR start_input_timers OR stop OR param <name> <value>"</span>
SWITCH_STANDARD_APP(detect_speech_function)
{
        char *argv[4];
</pre></div>
<div class="highlight"><pre>committer: Luke Dashjr
comments:
MERGE: document all of detect_speech's valid syntax
<span style="color: #000080; font-weight: bold">diff --cc src/mod/applications/mod_dptools/mod_dptools.c</span>
<span style="color: #000080; font-weight: bold">index e942bc6,6d014fa..f573661</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">@@@ -96,7 -96,7 +96,7 @@@ SWITCH_STANDARD_DIALPLAN(inline_dialpla</span>
        return extension;
}
<span style="color: #A00000">- #define DETECT_SPEECH_SYNTAX "<mod_name> <gram_name> <gram_path> [<addr>] OR grammar <gram_name> [<path>] OR pause OR resume OR grammaron/grammaroff <gram_name> OR grammarsalloff"</span>
-#define DETECT_SPEECH_SYNTAX "<mod_name> <gram_name> <gram_path> [<addr>] OR grammar <gram_name> [<path>] OR nogrammar <gram_name> OR pause OR resume OR stop OR param <name> <value>"
<span style="color: #00A000">++#define DETECT_SPEECH_SYNTAX "<mod_name> <gram_name> <gram_path> [<addr>] OR grammar <gram_name> [<path>] OR nogrammar <gram_name> OR grammaron/grammaroff <gram_name> OR grammarsalloff OR pause OR resume OR stop OR param <name> <value>"</span>
SWITCH_STANDARD_APP(detect_speech_function)
{
        char *argv[4];
</pre></div>
<div class="highlight"><pre>committer: Luke Dashjr
comments:
expose ASR enable/disable grammar (and disable all grammars) to dialplan via mod_dptools
<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 5a1b8c5..e942bc6 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">@@ -28,6 +28,7 @@</span>
* Michael Murdock <mike at mmurdock dot org>
* Neal Horman <neal at wanlink dot com>
* Bret McDanel <trixter AT 0xdecafbad dot com>
<span style="color: #00A000">+ * Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)</span>
*
* mod_dptools.c -- Raw Audio File Streaming Application Module
*
<span style="color: #800080; font-weight: bold">@@ -95,7 +96,7 @@ SWITCH_STANDARD_DIALPLAN(inline_dialplan_hunt)</span>
        return extension;
}
<span style="color: #A00000">-#define DETECT_SPEECH_SYNTAX "<mod_name> <gram_name> <gram_path> [<addr>] OR grammar <gram_name> [<path>] OR pause OR resume"</span>
<span style="color: #00A000">+#define DETECT_SPEECH_SYNTAX "<mod_name> <gram_name> <gram_path> [<addr>] OR grammar <gram_name> [<path>] OR pause OR resume OR grammaron/grammaroff <gram_name> OR grammarsalloff"</span>
SWITCH_STANDARD_APP(detect_speech_function)
{
        char *argv[4];
<span style="color: #800080; font-weight: bold">@@ -108,6 +109,12 @@ SWITCH_STANDARD_APP(detect_speech_function)</span>
                        switch_ivr_detect_speech_load_grammar(session, argv[1], argv[2]);
                } else if (!strcasecmp(argv[0], "nogrammar")) {
                        switch_ivr_detect_speech_unload_grammar(session, argv[1]);
<span style="color: #00A000">+                } else if (!strcasecmp(argv[0], "grammaron")) {</span>
<span style="color: #00A000">+                        switch_ivr_detect_speech_enable_grammar(session, argv[1]);</span>
<span style="color: #00A000">+                } else if (!strcasecmp(argv[0], "grammaroff")) {</span>
<span style="color: #00A000">+                        switch_ivr_detect_speech_disable_grammar(session, argv[1]);</span>
<span style="color: #00A000">+                } else if (!strcasecmp(argv[0], "grammarsalloff")) {</span>
<span style="color: #00A000">+                        switch_ivr_detect_speech_disable_all_grammars(session);</span>
                } else if (!strcasecmp(argv[0], "pause")) {
                        switch_ivr_pause_detect_speech(session);
                } else if (!strcasecmp(argv[0], "resume")) {
</pre></div>
<div class="highlight"><pre>committer: Luke Dashjr
comments:
switch_ivr interfaces to enable/disable grammar: switch_ivr_detect_speech_enable_grammar, switch_ivr_detect_speech_disable_grammar, and switch_ivr_detect_speech_disable_all_grammars
<span style="color: #000080; font-weight: bold">diff --git a/src/include/switch_ivr.h b/src/include/switch_ivr.h</span>
<span style="color: #000080; font-weight: bold">index 40ba1dc..8641766 100644</span>
<span style="color: #A00000">--- a/src/include/switch_ivr.h</span>
<span style="color: #00A000">+++ b/src/include/switch_ivr.h</span>
<span style="color: #800080; font-weight: bold">@@ -26,6 +26,7 @@</span>
* Anthony Minessale II <anthm@freeswitch.org>
* Neal Horman <neal at wanlink dot com>
* Bret McDanel <trixter AT 0xdecafbad dot com>
<span style="color: #00A000">+ * Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)</span>
*
* switch_ivr.h -- IVR Library
*
<span style="color: #800080; font-weight: bold">@@ -198,6 +199,29 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_load_grammar(switch_cor</span>
*/
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_core_session_t *session, const char *name);
<span style="color: #00A000">+/*!</span>
<span style="color: #00A000">+ \brief Enable a grammar on a background speech detection handle</span>
<span style="color: #00A000">+ \param session The session to change the grammar on</span>
<span style="color: #00A000">+ \param name the grammar name</span>
<span style="color: #00A000">+ \return SWITCH_STATUS_SUCCESS if all is well</span>
<span style="color: #00A000">+*/</span>
<span style="color: #00A000">+SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_enable_grammar(switch_core_session_t *session, const char *name);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+/*!</span>
<span style="color: #00A000">+ \brief Disable a grammar on a background speech detection handle</span>
<span style="color: #00A000">+ \param session The session to change the grammar on</span>
<span style="color: #00A000">+ \param name the grammar name</span>
<span style="color: #00A000">+ \return SWITCH_STATUS_SUCCESS if all is well</span>
<span style="color: #00A000">+*/</span>
<span style="color: #00A000">+SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_disable_grammar(switch_core_session_t *session, const char *name);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+/*!</span>
<span style="color: #00A000">+ \brief Disable all grammars on a background speech detection handle</span>
<span style="color: #00A000">+ \param session The session to change the grammar on</span>
<span style="color: #00A000">+ \return SWITCH_STATUS_SUCCESS if all is well</span>
<span style="color: #00A000">+*/</span>
<span style="color: #00A000">+SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_disable_all_grammars(switch_core_session_t *session);</span>
<span style="color: #00A000">+</span>
SWITCH_DECLARE(switch_status_t) switch_ivr_set_param_detect_speech(switch_core_session_t *session, const char *name, const char *val);
/*!
<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 4fe5732..672750a 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">@@ -26,6 +26,7 @@</span>
* Anthony Minessale II <anthm@freeswitch.org>
* Michael Jerris <mike@jerris.com>
* Bret McDanel <bret AT 0xdecafbad dot com>
<span style="color: #00A000">+ * Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)</span>
*
* switch_ivr_async.c -- IVR Library (async operations)
*
<span style="color: #800080; font-weight: bold">@@ -2745,6 +2746,57 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_c</span>
        return SWITCH_STATUS_FALSE;
}
<span style="color: #00A000">+SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_enable_grammar(switch_core_session_t *session, const char *name)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        switch_channel_t *channel = switch_core_session_get_channel(session);</span>
<span style="color: #00A000">+        switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;</span>
<span style="color: #00A000">+        struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);</span>
<span style="color: #00A000">+        switch_status_t status;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (sth) {</span>
<span style="color: #00A000">+                if ((status = switch_core_asr_enable_grammar(sth->ah, name)) != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Error enabling Grammar\n");</span>
<span style="color: #00A000">+                        switch_core_asr_close(sth->ah, &flags);</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+                return status;</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+        return SWITCH_STATUS_FALSE;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_disable_grammar(switch_core_session_t *session, const char *name)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        switch_channel_t *channel = switch_core_session_get_channel(session);</span>
<span style="color: #00A000">+        switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;</span>
<span style="color: #00A000">+        struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);</span>
<span style="color: #00A000">+        switch_status_t status;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (sth) {</span>
<span style="color: #00A000">+                if ((status = switch_core_asr_disable_grammar(sth->ah, name)) != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Error disabling Grammar\n");</span>
<span style="color: #00A000">+                        switch_core_asr_close(sth->ah, &flags);</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+                return status;</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+        return SWITCH_STATUS_FALSE;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_disable_all_grammars(switch_core_session_t *session)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        switch_channel_t *channel = switch_core_session_get_channel(session);</span>
<span style="color: #00A000">+        switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;</span>
<span style="color: #00A000">+        struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);</span>
<span style="color: #00A000">+        switch_status_t status;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (sth) {</span>
<span style="color: #00A000">+                if ((status = switch_core_asr_disable_all_grammars(sth->ah)) != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Error disabling all Grammars\n");</span>
<span style="color: #00A000">+                        switch_core_asr_close(sth->ah, &flags);</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+                return status;</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+        return SWITCH_STATUS_FALSE;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech(switch_core_session_t *session,
                                                                                                                 const char *mod_name,
                                                                                                                 const char *grammar, const char *name, const char *dest, switch_asr_handle_t *ah)
</pre></div>
<div class="highlight"><pre>committer: Luke Dashjr
comments:
Implement UniMRCP asr_enable_grammar, asr_disable_grammar, and asr_disable_all_grammars which allow for multiple grammar recognition
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c</span>
<span style="color: #000080; font-weight: bold">index a27ddf0..b9cecd1 100644</span>
<span style="color: #A00000">--- a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c</span>
<span style="color: #00A000">+++ b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c</span>
<span style="color: #800080; font-weight: bold">@@ -434,8 +434,8 @@ static const char *grammar_type_to_mime(grammar_type_t type, profile_t *profile)</span>
struct recognizer_data {
        /** the available grammars */
        switch_hash_t *grammars;
<span style="color: #A00000">-        /** the last grammar used (for pause/resume) */</span>
<span style="color: #A00000">-        grammar_t *last_grammar;</span>
<span style="color: #00A000">+        /** the enabled grammars */</span>
<span style="color: #00A000">+        switch_hash_t *enabled_grammars;</span>
        /** recognize result */
        char *result;
        /** true, if voice has started */
<span style="color: #800080; font-weight: bold">@@ -452,6 +452,9 @@ static switch_status_t recog_shutdown();</span>
static switch_status_t recog_asr_open(switch_asr_handle_t *ah, const char *codec, int rate, const char *dest, switch_asr_flag_t *flags);
static switch_status_t recog_asr_load_grammar(switch_asr_handle_t *ah, const char *grammar, const char *name);
static switch_status_t recog_asr_unload_grammar(switch_asr_handle_t *ah, const char *name);
<span style="color: #00A000">+static switch_status_t recog_asr_enable_grammar(switch_asr_handle_t *ah, const char *name);</span>
<span style="color: #00A000">+static switch_status_t recog_asr_disable_grammar(switch_asr_handle_t *ah, const char *name);</span>
<span style="color: #00A000">+static switch_status_t recog_asr_disable_all_grammars(switch_asr_handle_t *ah);</span>
static switch_status_t recog_asr_close(switch_asr_handle_t *ah, switch_asr_flag_t *flags);
static switch_status_t recog_asr_feed(switch_asr_handle_t *ah, void *data, unsigned int len, switch_asr_flag_t *flags);
#if 0
<span style="color: #800080; font-weight: bold">@@ -472,9 +475,12 @@ static apt_bool_t recog_on_message_receive(mrcp_application_t *application, mrcp</span>
static apt_bool_t recog_stream_read(mpf_audio_stream_t *stream, mpf_frame_t *frame);
/* recognizer specific speech_channel_funcs */
<span style="color: #A00000">-static switch_status_t recog_channel_start(speech_channel_t *schannel, const char *name);</span>
<span style="color: #00A000">+static switch_status_t recog_channel_start(speech_channel_t *schannel);</span>
static switch_status_t recog_channel_load_grammar(speech_channel_t *schannel, const char *name, grammar_type_t type, const char *data);
static switch_status_t recog_channel_unload_grammar(speech_channel_t *schannel, const char *name);
<span style="color: #00A000">+static switch_status_t recog_channel_enable_grammar(speech_channel_t *schannel, const char *name);</span>
<span style="color: #00A000">+static switch_status_t recog_channel_disable_grammar(speech_channel_t *schannel, const char *name);</span>
<span style="color: #00A000">+static switch_status_t recog_channel_disable_all_grammars(speech_channel_t *schannel);</span>
static switch_status_t recog_channel_check_results(speech_channel_t *schannel);
static switch_status_t recog_channel_set_start_of_input(speech_channel_t *schannel);
static switch_status_t recog_channel_start_input_timers(speech_channel_t *schannel);
<span style="color: #800080; font-weight: bold">@@ -2056,19 +2062,24 @@ static const char *grammar_type_to_mime(grammar_type_t type, profile_t *profile)</span>
* Start RECOGNIZE request
*
* @param schannel the channel to start
<span style="color: #A00000">- * @param name the name of the grammar to use or NULL if to reuse the last grammar</span>
* @return SWITCH_STATUS_SUCCESS if successful
*/
<span style="color: #A00000">-static switch_status_t recog_channel_start(speech_channel_t *schannel, const char *name)</span>
<span style="color: #00A000">+static switch_status_t recog_channel_start(speech_channel_t *schannel)</span>
{
        switch_status_t status = SWITCH_STATUS_SUCCESS;
<span style="color: #00A000">+        switch_hash_index_t *egk;</span>
        mrcp_message_t *mrcp_message;
        mrcp_recog_header_t *recog_header;
        mrcp_generic_header_t *generic_header;
        recognizer_data_t *r;
        char *start_input_timers;
        const char *mime_type;
<span style="color: #A00000">-        grammar_t *grammar = NULL;</span>
<span style="color: #00A000">+        char *key;</span>
<span style="color: #00A000">+        switch_size_t len;</span>
<span style="color: #00A000">+        grammar_t *grammar;</span>
<span style="color: #00A000">+        switch_size_t grammar_uri_count = 0;</span>
<span style="color: #00A000">+        switch_size_t grammar_uri_list_len = 0;</span>
<span style="color: #00A000">+        char *grammar_uri_list = NULL;</span>
        switch_mutex_lock(schannel->mutex);
        if (schannel->state != SPEECH_CHANNEL_READY) {
<span style="color: #800080; font-weight: bold">@@ -2089,21 +2100,55 @@ static switch_status_t recog_channel_start(speech_channel_t *schannel, const cha</span>
        start_input_timers = (char *) switch_core_hash_find(schannel->params, "start-input-timers");
        r->timers_started = zstr(start_input_timers) || strcasecmp(start_input_timers, "false");
<span style="color: #A00000">-        /* get the cached grammar */</span>
<span style="color: #A00000">-        if (zstr(name)) {</span>
<span style="color: #A00000">-                grammar = r->last_grammar;</span>
<span style="color: #A00000">-        } else {</span>
<span style="color: #A00000">-                grammar = (grammar_t *) switch_core_hash_find(r->grammars, name);</span>
<span style="color: #A00000">-                r->last_grammar = grammar;</span>
<span style="color: #A00000">-        }</span>
<span style="color: #A00000">-        if (grammar == NULL) {</span>
<span style="color: #A00000">-                if (name) {</span>
<span style="color: #A00000">-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "(%s) Undefined grammar, %s\n", schannel->name, name);</span>
<span style="color: #A00000">-                } else {</span>
<span style="color: #A00000">-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "(%s) No grammar specified\n", schannel->name);</span>
<span style="color: #00A000">+        /* count enabled grammars */</span>
<span style="color: #00A000">+        for (egk = switch_hash_first(NULL, r->enabled_grammars); egk; egk = switch_hash_next(egk)) {</span>
<span style="color: #00A000">+                // NOTE: This postponed type check is necessary to allow a non-URI-list grammar to execute alone</span>
<span style="color: #00A000">+                if (grammar_uri_count == 1 && grammar->type != GRAMMAR_TYPE_URI)</span>
<span style="color: #00A000">+                        goto no_grammar_alone;</span>
<span style="color: #00A000">+                ++grammar_uri_count;</span>
<span style="color: #00A000">+                switch_hash_this(egk, (void *) &key, NULL, (void *) &grammar);</span>
<span style="color: #00A000">+                if (grammar->type != GRAMMAR_TYPE_URI && grammar_uri_count != 1) {</span>
<span style="color: #00A000">+                 no_grammar_alone:</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "(%s) Grammar '%s' can only be used alone (not a URI list)\n", schannel->name, key);</span>
<span style="color: #00A000">+                        status = SWITCH_STATUS_FALSE;</span>
<span style="color: #00A000">+                        goto done;</span>
                }
<span style="color: #00A000">+                len = strlen(grammar->data);</span>
<span style="color: #00A000">+                if (!len)</span>
<span style="color: #00A000">+                        continue;</span>
<span style="color: #00A000">+                grammar_uri_list_len += len;</span>
<span style="color: #00A000">+                if (grammar->data[len - 1] != '\n')</span>
<span style="color: #00A000">+                        grammar_uri_list_len += 2;</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        switch (grammar_uri_count) {</span>
<span style="color: #00A000">+        case 0:</span>
<span style="color: #00A000">+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "(%s) No grammar specified\n", schannel->name);</span>
                status = SWITCH_STATUS_FALSE;
                goto done;
<span style="color: #00A000">+        case 1:</span>
<span style="color: #00A000">+                /* grammar should already be the unique grammar */</span>
<span style="color: #00A000">+                break;</span>
<span style="color: #00A000">+        default:</span>
<span style="color: #00A000">+                /* get the enabled grammars list */</span>
<span style="color: #00A000">+                grammar_uri_list = switch_core_alloc(schannel->memory_pool, grammar_uri_list_len + 1);</span>
<span style="color: #00A000">+                grammar_uri_list_len = 0;</span>
<span style="color: #00A000">+                for (egk = switch_hash_first(NULL, r->enabled_grammars); egk; egk = switch_hash_next(egk)) {</span>
<span style="color: #00A000">+                        switch_hash_this(egk, (void *) &key, NULL, (void *) &grammar);</span>
<span style="color: #00A000">+                        len = strlen(grammar->data);</span>
<span style="color: #00A000">+                        if (!len)</span>
<span style="color: #00A000">+                                continue;</span>
<span style="color: #00A000">+                        memcpy(&(grammar_uri_list[grammar_uri_list_len]), grammar->data, len);</span>
<span style="color: #00A000">+                        grammar_uri_list_len += len;</span>
<span style="color: #00A000">+                        if (grammar_uri_list[grammar_uri_list_len - 1] != '\n')</span>
<span style="color: #00A000">+                        {</span>
<span style="color: #00A000">+                                grammar_uri_list_len += 2;</span>
<span style="color: #00A000">+                                grammar_uri_list[grammar_uri_list_len - 2] = '\r';</span>
<span style="color: #00A000">+                                grammar_uri_list[grammar_uri_list_len - 1] = '\n';</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+                grammar_uri_list[grammar_uri_list_len++] = '\0';</span>
<span style="color: #00A000">+                grammar = NULL;</span>
        }
        /* create MRCP message */
<span style="color: #800080; font-weight: bold">@@ -2121,7 +2166,7 @@ static switch_status_t recog_channel_start(speech_channel_t *schannel, const cha</span>
        }
        /* set Content-Type */
<span style="color: #A00000">-        mime_type = grammar_type_to_mime(grammar->type, schannel->profile);</span>
<span style="color: #00A000">+        mime_type = grammar_type_to_mime(grammar ? grammar->type : GRAMMAR_TYPE_URI, schannel->profile);</span>
        if (zstr(mime_type)) {
                status = SWITCH_STATUS_FALSE;
                goto done;
<span style="color: #800080; font-weight: bold">@@ -2130,7 +2175,7 @@ static switch_status_t recog_channel_start(speech_channel_t *schannel, const cha</span>
        mrcp_generic_header_property_add(mrcp_message, GENERIC_HEADER_CONTENT_TYPE);
        /* set Content-ID for inline grammars */
<span style="color: #A00000">-        if (grammar->type != GRAMMAR_TYPE_URI) {</span>
<span style="color: #00A000">+        if (grammar && grammar->type != GRAMMAR_TYPE_URI) {</span>
                apt_string_assign(&generic_header->content_id, grammar->name, mrcp_message->pool);
                mrcp_generic_header_property_add(mrcp_message, GENERIC_HEADER_CONTENT_ID);
        }
<span style="color: #800080; font-weight: bold">@@ -2152,7 +2197,7 @@ static switch_status_t recog_channel_start(speech_channel_t *schannel, const cha</span>
        recog_channel_set_params(schannel, mrcp_message, generic_header, recog_header);
        /* set message body */
<span style="color: #A00000">-        apt_string_assign(&mrcp_message->body, grammar->data, mrcp_message->pool);</span>
<span style="color: #00A000">+        apt_string_assign(&mrcp_message->body, grammar ? grammar->data : grammar_uri_list, mrcp_message->pool);</span>
        /* Empty audio queue and send RECOGNIZE to MRCP server */
        audio_queue_clear(schannel->audio_queue);
<span style="color: #800080; font-weight: bold">@@ -2287,6 +2332,7 @@ static switch_status_t recog_channel_unload_grammar(speech_channel_t *schannel,</span>
        } else {
                recognizer_data_t *r = (recognizer_data_t *) schannel->data;
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) Unloading grammar %s\n", schannel->name, grammar_name);
<span style="color: #00A000">+                switch_core_hash_delete(r->enabled_grammars, grammar_name);</span>
                switch_core_hash_delete(r->grammars, grammar_name);
        }
<span style="color: #800080; font-weight: bold">@@ -2294,6 +2340,77 @@ static switch_status_t recog_channel_unload_grammar(speech_channel_t *schannel,</span>
}
/**
<span style="color: #00A000">+ * Enable speech recognition grammar</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * @param schannel the recognizer channel</span>
<span style="color: #00A000">+ * @param grammar_name the name of the grammar to enable</span>
<span style="color: #00A000">+ * @return SWITCH_STATUS_SUCCESS if successful</span>
<span style="color: #00A000">+ */</span>
<span style="color: #00A000">+static switch_status_t recog_channel_enable_grammar(speech_channel_t *schannel, const char *grammar_name)</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">+        if (zstr(grammar_name)) {</span>
<span style="color: #00A000">+                status = SWITCH_STATUS_FALSE;</span>
<span style="color: #00A000">+        } else {</span>
<span style="color: #00A000">+                recognizer_data_t *r = (recognizer_data_t *) schannel->data;</span>
<span style="color: #00A000">+                grammar_t *grammar;</span>
<span style="color: #00A000">+                grammar = (grammar_t *) switch_core_hash_find(r->grammars, grammar_name);</span>
<span style="color: #00A000">+                if (grammar == NULL)</span>
<span style="color: #00A000">+                {</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "(%s) Undefined grammar, %s\n", schannel->name, grammar_name);</span>
<span style="color: #00A000">+                        status = SWITCH_STATUS_FALSE;</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+                else {</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) Enabling grammar %s\n", schannel->name, grammar_name);</span>
<span style="color: #00A000">+                        switch_core_hash_insert(r->enabled_grammars, grammar_name, grammar);</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+        }</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">+ * Disable speech recognition grammar</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * @param schannel the recognizer channel</span>
<span style="color: #00A000">+ * @param grammar_name the name of the grammar to disable</span>
<span style="color: #00A000">+ * @return SWITCH_STATUS_SUCCESS if successful</span>
<span style="color: #00A000">+ */</span>
<span style="color: #00A000">+static switch_status_t recog_channel_disable_grammar(speech_channel_t *schannel, const char *grammar_name)</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">+        if (zstr(grammar_name)) {</span>
<span style="color: #00A000">+                status = SWITCH_STATUS_FALSE;</span>
<span style="color: #00A000">+        } else {</span>
<span style="color: #00A000">+                recognizer_data_t *r = (recognizer_data_t *) schannel->data;</span>
<span style="color: #00A000">+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) Disabling grammar %s\n", schannel->name, grammar_name);</span>
<span style="color: #00A000">+                switch_core_hash_delete(r->enabled_grammars, grammar_name);</span>
<span style="color: #00A000">+        }</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">+ * Disable all speech recognition grammars</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * @param schannel the recognizer channel</span>
<span style="color: #00A000">+ * @return SWITCH_STATUS_SUCCESS if successful</span>
<span style="color: #00A000">+ */</span>
<span style="color: #00A000">+static switch_status_t recog_channel_disable_all_grammars(speech_channel_t *schannel)</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">+        recognizer_data_t *r = (recognizer_data_t *) schannel->data;</span>
<span style="color: #00A000">+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) Disabling all grammars\n", schannel->name);</span>
<span style="color: #00A000">+        switch_core_hash_destroy(&r->enabled_grammars);</span>
<span style="color: #00A000">+        switch_core_hash_init(&r->enabled_grammars, schannel->memory_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>
* Check if recognition is complete
*
* @return SWITCH_STATUS_SUCCESS if results available or start of input
<span style="color: #800080; font-weight: bold">@@ -2740,6 +2857,7 @@ static switch_status_t recog_asr_open(switch_asr_handle_t *ah, const char *codec</span>
        schannel->data = r;
        memset(r, 0, sizeof(recognizer_data_t));
        switch_core_hash_init(&r->grammars, ah->memory_pool);
<span style="color: #00A000">+        switch_core_hash_init(&r->enabled_grammars, ah->memory_pool);</span>
        /* Open the channel */
        if (zstr(profile_name)) {
<span style="color: #800080; font-weight: bold">@@ -2892,7 +3010,17 @@ static switch_status_t recog_asr_load_grammar(switch_asr_handle_t *ah, const cha</span>
        start_recognize = (char *) switch_core_hash_find(schannel->params, "start-recognize");
        if (zstr(start_recognize) || strcasecmp(start_recognize, "false"))
<span style="color: #A00000">-                status = recog_channel_start(schannel, name);</span>
<span style="color: #00A000">+        {</span>
<span style="color: #00A000">+                if (recog_channel_disable_all_grammars(schannel) != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                        status = SWITCH_STATUS_FALSE;</span>
<span style="color: #00A000">+                        goto done;</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+                if (recog_channel_enable_grammar(schannel, name) != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                        status = SWITCH_STATUS_FALSE;</span>
<span style="color: #00A000">+                        goto done;</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+                status = recog_channel_start(schannel);</span>
<span style="color: #00A000">+        }</span>
done:
<span style="color: #800080; font-weight: bold">@@ -2921,6 +3049,57 @@ static switch_status_t recog_asr_unload_grammar(switch_asr_handle_t *ah, const c</span>
}
/**
<span style="color: #00A000">+ * Process asr_enable_grammar request from FreeSWITCH.</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * FreeSWITCH sends this request to enable recognition on this grammar.</span>
<span style="color: #00A000">+ * @param ah the FreeSWITCH speech recognition handle</span>
<span style="color: #00A000">+ * @param name the grammar name.</span>
<span style="color: #00A000">+ */</span>
<span style="color: #00A000">+static switch_status_t recog_asr_enable_grammar(switch_asr_handle_t *ah, const char *name)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        switch_status_t status = SWITCH_STATUS_SUCCESS;</span>
<span style="color: #00A000">+        speech_channel_t *schannel = (speech_channel_t *) ah->private_info;</span>
<span style="color: #00A000">+        if (zstr(name) || speech_channel_stop(schannel) != SWITCH_STATUS_SUCCESS || recog_channel_enable_grammar(schannel, name) != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                status = SWITCH_STATUS_FALSE;</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">+ * Process asr_disable_grammar request from FreeSWITCH.</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * FreeSWITCH sends this request to disable recognition on this grammar.</span>
<span style="color: #00A000">+ * @param ah the FreeSWITCH speech recognition handle</span>
<span style="color: #00A000">+ * @param name the grammar name.</span>
<span style="color: #00A000">+ */</span>
<span style="color: #00A000">+static switch_status_t recog_asr_disable_grammar(switch_asr_handle_t *ah, const char *name)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        switch_status_t status = SWITCH_STATUS_SUCCESS;</span>
<span style="color: #00A000">+        speech_channel_t *schannel = (speech_channel_t *) ah->private_info;</span>
<span style="color: #00A000">+        if (zstr(name) || speech_channel_stop(schannel) != SWITCH_STATUS_SUCCESS || recog_channel_disable_grammar(schannel, name) != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                status = SWITCH_STATUS_FALSE;</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">+ * Process asr_disable_all_grammars request from FreeSWITCH.</span>
<span style="color: #00A000">+ *</span>
<span style="color: #00A000">+ * FreeSWITCH sends this request to disable recognition of all grammars.</span>
<span style="color: #00A000">+ * @param ah the FreeSWITCH speech recognition handle</span>
<span style="color: #00A000">+ * @param name the grammar name.</span>
<span style="color: #00A000">+ */</span>
<span style="color: #00A000">+static switch_status_t recog_asr_disable_all_grammars(switch_asr_handle_t *ah)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        switch_status_t status = SWITCH_STATUS_SUCCESS;</span>
<span style="color: #00A000">+        speech_channel_t *schannel = (speech_channel_t *) ah->private_info;</span>
<span style="color: #00A000">+        if (speech_channel_stop(schannel) != SWITCH_STATUS_SUCCESS || recog_channel_disable_all_grammars(schannel) != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                status = SWITCH_STATUS_FALSE;</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>
* Process asr_close request from FreeSWITCH
*
* @param ah the FreeSWITCH speech recognition handle
<span style="color: #800080; font-weight: bold">@@ -2934,6 +3113,7 @@ static switch_status_t recog_asr_close(switch_asr_handle_t *ah, switch_asr_flag_</span>
        speech_channel_stop(schannel);
        speech_channel_destroy(schannel);
        switch_core_hash_destroy(&r->grammars);
<span style="color: #00A000">+        switch_core_hash_destroy(&r->enabled_grammars);</span>
        /* this lets FreeSWITCH's speech_thread know the handle is closed */
        switch_set_flag(ah, SWITCH_ASR_FLAG_CLOSED);
<span style="color: #800080; font-weight: bold">@@ -2958,14 +3138,13 @@ static switch_status_t recog_asr_feed(switch_asr_handle_t *ah, void *data, unsig</span>
/**
* Process asr_start request from FreeSWITCH
* @param ah the FreeSWITCH speech recognition handle
<span style="color: #A00000">- * @param name name of the grammar to use</span>
* @return SWITCH_STATUS_SUCCESS if successful
*/
<span style="color: #A00000">-static switch_status_t recog_asr_start(switch_asr_handle_t *ah, const char *name)</span>
<span style="color: #00A000">+static switch_status_t recog_asr_start(switch_asr_handle_t *ah)</span>
{
        switch_status_t status;
        speech_channel_t *schannel = (speech_channel_t *) ah->private_info;
<span style="color: #A00000">-        status = recog_channel_start(schannel, name);</span>
<span style="color: #00A000">+        status = recog_channel_start(schannel);</span>
        return status;
}
#endif
<span style="color: #800080; font-weight: bold">@@ -2978,7 +3157,7 @@ static switch_status_t recog_asr_start(switch_asr_handle_t *ah, const char *name</span>
static switch_status_t recog_asr_resume(switch_asr_handle_t *ah)
{
        speech_channel_t *schannel = (speech_channel_t *) ah->private_info;
<span style="color: #A00000">-        return recog_channel_start(schannel, NULL);</span>
<span style="color: #00A000">+        return recog_channel_start(schannel);</span>
}
/**
<span style="color: #800080; font-weight: bold">@@ -3237,6 +3416,9 @@ static switch_status_t recog_load(switch_loadable_module_interface_t *module_int</span>
        asr_interface->asr_open = recog_asr_open;
        asr_interface->asr_load_grammar = recog_asr_load_grammar;
        asr_interface->asr_unload_grammar = recog_asr_unload_grammar;
<span style="color: #00A000">+        asr_interface->asr_enable_grammar = recog_asr_enable_grammar;</span>
<span style="color: #00A000">+        asr_interface->asr_disable_grammar = recog_asr_disable_grammar;</span>
<span style="color: #00A000">+        asr_interface->asr_disable_all_grammars = recog_asr_disable_all_grammars;</span>
        asr_interface->asr_close = recog_asr_close;
        asr_interface->asr_feed = recog_asr_feed;
#if 0
</pre></div>
<div class="highlight"><pre>committer: Luke Dashjr
comments:
switch_core_asr interfaces for enable_grammar, disable_grammar, and disable_all_grammars
<span style="color: #000080; font-weight: bold">diff --git a/src/include/switch_core.h b/src/include/switch_core.h</span>
<span style="color: #000080; font-weight: bold">index 650ffc1..26a048c 100644</span>
<span style="color: #A00000">--- a/src/include/switch_core.h</span>
<span style="color: #00A000">+++ b/src/include/switch_core.h</span>
<span style="color: #800080; font-weight: bold">@@ -24,6 +24,7 @@</span>
* Contributor(s):
*
* Anthony Minessale II <anthm@freeswitch.org>
<span style="color: #00A000">+ * Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)</span>
*
*
* switch_core.h -- Core Library
<span style="color: #800080; font-weight: bold">@@ -1748,6 +1749,29 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_load_grammar(switch_asr_handle_t</span>
SWITCH_DECLARE(switch_status_t) switch_core_asr_unload_grammar(switch_asr_handle_t *ah, const char *name);
/*!
<span style="color: #00A000">+ \brief Enable a grammar from an asr handle</span>
<span style="color: #00A000">+ \param ah the handle to enable the grammar from</span>
<span style="color: #00A000">+ \param name the name of the grammar to enable</span>
<span style="color: #00A000">+ \return SWITCH_STATUS_SUCCESS</span>
<span style="color: #00A000">+*/</span>
<span style="color: #00A000">+SWITCH_DECLARE(switch_status_t) switch_core_asr_enable_grammar(switch_asr_handle_t *ah, const char *name);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+/*!</span>
<span style="color: #00A000">+ \brief Disable a grammar from an asr handle</span>
<span style="color: #00A000">+ \param ah the handle to disable the grammar from</span>
<span style="color: #00A000">+ \param name the name of the grammar to disable</span>
<span style="color: #00A000">+ \return SWITCH_STATUS_SUCCESS</span>
<span style="color: #00A000">+*/</span>
<span style="color: #00A000">+SWITCH_DECLARE(switch_status_t) switch_core_asr_disable_grammar(switch_asr_handle_t *ah, const char *name);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+/*!</span>
<span style="color: #00A000">+ \brief Disable all grammars from an asr handle</span>
<span style="color: #00A000">+ \param ah the handle to disable the grammars from</span>
<span style="color: #00A000">+ \return SWITCH_STATUS_SUCCESS</span>
<span style="color: #00A000">+*/</span>
<span style="color: #00A000">+SWITCH_DECLARE(switch_status_t) switch_core_asr_disable_all_grammars(switch_asr_handle_t *ah);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+/*!</span>
\brief Pause detection on an asr handle
\param ah the handle to pause
\return SWITCH_STATUS_SUCCESS
<span style="color: #000080; font-weight: bold">diff --git a/src/include/switch_module_interfaces.h b/src/include/switch_module_interfaces.h</span>
<span style="color: #000080; font-weight: bold">index 078b83d..e0119b4 100644</span>
<span style="color: #A00000">--- a/src/include/switch_module_interfaces.h</span>
<span style="color: #00A000">+++ b/src/include/switch_module_interfaces.h</span>
<span style="color: #800080; font-weight: bold">@@ -24,6 +24,7 @@</span>
* Contributor(s):
*
* Anthony Minessale II <anthm@freeswitch.org>
<span style="color: #00A000">+ * Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)</span>
*
*
* switch_module_interfaces.h -- Module Interface Definitions
<span style="color: #800080; font-weight: bold">@@ -393,6 +394,12 @@ struct switch_asr_interface {</span>
        switch_mutex_t *reflock;
        switch_loadable_module_interface_t *parent;
        struct switch_asr_interface *next;
<span style="color: #00A000">+        /*! function to enable a grammar to the asr interface */</span>
<span style="color: #00A000">+        switch_status_t (*asr_enable_grammar) (switch_asr_handle_t *ah, const char *name);</span>
<span style="color: #00A000">+        /*! function to disable a grammar to the asr interface */</span>
<span style="color: #00A000">+        switch_status_t (*asr_disable_grammar) (switch_asr_handle_t *ah, const char *name);</span>
<span style="color: #00A000">+        /*! function to disable all grammars to the asr interface */</span>
<span style="color: #00A000">+        switch_status_t (*asr_disable_all_grammars) (switch_asr_handle_t *ah);</span>
};
/*! an abstract representation of an asr speech interface. */
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_core_asr.c b/src/switch_core_asr.c</span>
<span style="color: #000080; font-weight: bold">index fa4446e..691011a 100644</span>
<span style="color: #A00000">--- a/src/switch_core_asr.c</span>
<span style="color: #00A000">+++ b/src/switch_core_asr.c</span>
<span style="color: #800080; font-weight: bold">@@ -27,6 +27,7 @@</span>
* Michael Jerris <mike@jerris.com>
* Paul D. Tinsley <pdt at jackhammer.org>
* Christopher M. Rienzo <chris@rienzo.net>
<span style="color: #00A000">+ * Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)</span>
*
*
* switch_core_asr.c -- Main Core Library (Speech Detection Interface)
<span style="color: #800080; font-weight: bold">@@ -160,6 +161,45 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_unload_grammar(switch_asr_handle</span>
        return status;
}
<span style="color: #00A000">+SWITCH_DECLARE(switch_status_t) switch_core_asr_enable_grammar(switch_asr_handle_t *ah, const char *name)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        switch_status_t status = SWITCH_STATUS_FALSE;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        switch_assert(ah != NULL);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (ah->asr_interface->asr_enable_grammar) {</span>
<span style="color: #00A000">+                status = ah->asr_interface->asr_enable_grammar(ah, name);</span>
<span style="color: #00A000">+        }</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">+SWITCH_DECLARE(switch_status_t) switch_core_asr_disable_grammar(switch_asr_handle_t *ah, const char *name)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        switch_status_t status = SWITCH_STATUS_FALSE;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        switch_assert(ah != NULL);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (ah->asr_interface->asr_disable_grammar) {</span>
<span style="color: #00A000">+                status = ah->asr_interface->asr_disable_grammar(ah, name);</span>
<span style="color: #00A000">+        }</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">+SWITCH_DECLARE(switch_status_t) switch_core_asr_disable_all_grammars(switch_asr_handle_t *ah)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        switch_status_t status = SWITCH_STATUS_FALSE;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        switch_assert(ah != NULL);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (ah->asr_interface->asr_disable_all_grammars) {</span>
<span style="color: #00A000">+                status = ah->asr_interface->asr_disable_all_grammars(ah);</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        return status;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
SWITCH_DECLARE(switch_status_t) switch_core_asr_pause(switch_asr_handle_t *ah)
{
        switch_assert(ah != NULL);
</pre></div>
<div class="highlight"><pre>committer: Luke Dashjr
comments:
Allow loading grammars without sending RECOGNIZE with start-recognize=false parameter
<span style="color: #000080; font-weight: bold">diff --git a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c</span>
<span style="color: #000080; font-weight: bold">index 41c0ccd..a27ddf0 100644</span>
<span style="color: #A00000">--- a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c</span>
<span style="color: #00A000">+++ b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c</span>
<span style="color: #800080; font-weight: bold">@@ -26,6 +26,7 @@</span>
*
* Brian West <brian@freeswitch.org>
* Christopher M. Rienzo <chris@rienzo.net>
<span style="color: #00A000">+ * Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)</span>
*
* mod_unimrcp.c -- UniMRCP module (MRCP client)
*
<span style="color: #800080; font-weight: bold">@@ -2451,6 +2452,8 @@ static switch_status_t recog_channel_set_params(speech_channel_t *schannel, mrcp</span>
                        if (id) {
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) \"%s\": \"%s\"\n", schannel->name, param_name, param_val);
                                recog_channel_set_header(schannel, id->id, param_val, msg, recog_hdr);
<span style="color: #00A000">+                        } else if (!strcasecmp(param_name, "start-recognize")) {</span>
<span style="color: #00A000">+                                // This parameter is used internally only, not in MRCP headers</span>
                        } else {
                                /* this is probably a vendor-specific MRCP param */
                                apt_str_t apt_param_name = { 0 };
<span style="color: #800080; font-weight: bold">@@ -2782,6 +2785,7 @@ static switch_status_t recog_asr_load_grammar(switch_asr_handle_t *ah, const cha</span>
        speech_channel_t *schannel = (speech_channel_t *) ah->private_info;
        const char *grammar_data = NULL;
        char *grammar_file_data = NULL;
<span style="color: #00A000">+        char *start_recognize;</span>
        switch_file_t *grammar_file = NULL;
        switch_size_t grammar_file_size = 0, to_read = 0;
        grammar_type_t type = GRAMMAR_TYPE_UNKNOWN;
<span style="color: #800080; font-weight: bold">@@ -2886,7 +2890,9 @@ static switch_status_t recog_asr_load_grammar(switch_asr_handle_t *ah, const cha</span>
                goto done;
        }
<span style="color: #A00000">-        status = recog_channel_start(schannel, name);</span>
<span style="color: #00A000">+        start_recognize = (char *) switch_core_hash_find(schannel->params, "start-recognize");</span>
<span style="color: #00A000">+        if (zstr(start_recognize) || strcasecmp(start_recognize, "false"))</span>
<span style="color: #00A000">+                status = recog_channel_start(schannel, name);</span>
done:
</pre></div>
<div class="highlight"><pre>committer: Luke Dashjr
comments:
document all of detect_speech's valid syntax
<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 5a1b8c5..6d014fa 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">@@ -28,6 +28,7 @@</span>
* Michael Murdock <mike at mmurdock dot org>
* Neal Horman <neal at wanlink dot com>
* Bret McDanel <trixter AT 0xdecafbad dot com>
<span style="color: #00A000">+ * Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)</span>
*
* mod_dptools.c -- Raw Audio File Streaming Application Module
*
<span style="color: #800080; font-weight: bold">@@ -95,7 +96,7 @@ SWITCH_STANDARD_DIALPLAN(inline_dialplan_hunt)</span>
        return extension;
}
<span style="color: #A00000">-#define DETECT_SPEECH_SYNTAX "<mod_name> <gram_name> <gram_path> [<addr>] OR grammar <gram_name> [<path>] OR pause OR resume"</span>
<span style="color: #00A000">+#define DETECT_SPEECH_SYNTAX "<mod_name> <gram_name> <gram_path> [<addr>] OR grammar <gram_name> [<path>] OR nogrammar <gram_name> OR pause OR resume OR stop OR param <name> <value>"</span>
SWITCH_STANDARD_APP(detect_speech_function)
{
        char *argv[4];
</pre></div>
<div class="highlight"><pre>committer: Luke Dashjr
comments:
expose ASR start_input_timers to dialplan via mod_dptools
<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 5a1b8c5..2f49630 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">@@ -28,6 +28,7 @@</span>
* Michael Murdock <mike at mmurdock dot org>
* Neal Horman <neal at wanlink dot com>
* Bret McDanel <trixter AT 0xdecafbad dot com>
<span style="color: #00A000">+ * Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)</span>
*
* mod_dptools.c -- Raw Audio File Streaming Application Module
*
<span style="color: #800080; font-weight: bold">@@ -95,7 +96,7 @@ SWITCH_STANDARD_DIALPLAN(inline_dialplan_hunt)</span>
        return extension;
}
<span style="color: #A00000">-#define DETECT_SPEECH_SYNTAX "<mod_name> <gram_name> <gram_path> [<addr>] OR grammar <gram_name> [<path>] OR pause OR resume"</span>
<span style="color: #00A000">+#define DETECT_SPEECH_SYNTAX "<mod_name> <gram_name> <gram_path> [<addr>] OR grammar <gram_name> [<path>] OR pause OR resume OR start_input_timers"</span>
SWITCH_STANDARD_APP(detect_speech_function)
{
        char *argv[4];
<span style="color: #800080; font-weight: bold">@@ -116,6 +117,8 @@ SWITCH_STANDARD_APP(detect_speech_function)</span>
                        switch_ivr_stop_detect_speech(session);
                } else if (!strcasecmp(argv[0], "param")) {
                        switch_ivr_set_param_detect_speech(session, argv[1], argv[2]);
<span style="color: #00A000">+                } else if (!strcasecmp(argv[0], "start_input_timers")) {</span>
<span style="color: #00A000">+                        switch_ivr_detect_speech_start_input_timers(session);</span>
                } else if (argc >= 3) {
                        switch_ivr_detect_speech(session, argv[0], argv[1], argv[2], argv[3], NULL);
                }
</pre></div>
<div class="highlight"><pre>committer: Luke Dashjr
comments:
expose ASR start_input_timers on the IVR abstraction level
<span style="color: #000080; font-weight: bold">diff --git a/src/include/switch_ivr.h b/src/include/switch_ivr.h</span>
<span style="color: #000080; font-weight: bold">index 40ba1dc..692ad8d 100644</span>
<span style="color: #A00000">--- a/src/include/switch_ivr.h</span>
<span style="color: #00A000">+++ b/src/include/switch_ivr.h</span>
<span style="color: #800080; font-weight: bold">@@ -26,6 +26,7 @@</span>
* Anthony Minessale II <anthm@freeswitch.org>
* Neal Horman <neal at wanlink dot com>
* Bret McDanel <trixter AT 0xdecafbad dot com>
<span style="color: #00A000">+ * Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)</span>
*
* switch_ivr.h -- IVR Library
*
<span style="color: #800080; font-weight: bold">@@ -201,6 +202,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_c</span>
SWITCH_DECLARE(switch_status_t) switch_ivr_set_param_detect_speech(switch_core_session_t *session, const char *name, const char *val);
/*!
<span style="color: #00A000">+ \brief Start input timers on a background speech detection handle</span>
<span style="color: #00A000">+ \param session The session to start the timers on</span>
<span style="color: #00A000">+ \return SWITCH_STATUS_SUCCESS if all is well</span>
<span style="color: #00A000">+*/</span>
<span style="color: #00A000">+SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_start_input_timers(switch_core_session_t *session);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+/*!</span>
\brief Record a session to disk
\param session the session to record
\param file the path to the file
<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 4fe5732..ae23d0a 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">@@ -26,6 +26,7 @@</span>
* Anthony Minessale II <anthm@freeswitch.org>
* Michael Jerris <mike@jerris.com>
* Bret McDanel <bret AT 0xdecafbad dot com>
<span style="color: #00A000">+ * Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)</span>
*
* switch_ivr_async.c -- IVR Library (async operations)
*
<span style="color: #800080; font-weight: bold">@@ -2728,6 +2729,18 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_set_param_detect_speech(switch_core_s</span>
        return status;
}
<span style="color: #00A000">+SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_start_input_timers(switch_core_session_t *session)</span>
<span style="color: #00A000">+{</span>
<span style="color: #00A000">+        switch_channel_t *channel = switch_core_session_get_channel(session);</span>
<span style="color: #00A000">+        struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        if (sth) {</span>
<span style="color: #00A000">+                switch_core_asr_start_input_timers(sth->ah);</span>
<span style="color: #00A000">+                return SWITCH_STATUS_SUCCESS;</span>
<span style="color: #00A000">+        }</span>
<span style="color: #00A000">+        return SWITCH_STATUS_FALSE;</span>
<span style="color: #00A000">+}</span>
<span style="color: #00A000">+</span>
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_core_session_t *session, const char *name)
{
        switch_channel_t *channel = switch_core_session_get_channel(session);
</pre></div>
========================================================================<pre>
Summary of changes:
conf/freeswitch.xml | 3 -
fscomm/widgets/codecwidget.cpp | 2 +
libs/freetdm/mod_freetdm/mod_freetdm.c | 7 +
libs/freetdm/msvc/testboost/testboost.2010.vcxproj | 6 +-
.../msvc/testboost/testsangomaboost.2010.vcxproj | 6 +-
.../ftmod_sangoma_boost.2010.vcxproj | 12 +-
.../ftmod_sangoma_isdn_stack_hndl.c | 8 +-
.../ftmod/ftmod_wanpipe/ftmod_wanpipe.2010.vcxproj | 8 +-
libs/openzap/mod_openzap/mod_openzap.c | 34 ++-
.../sofia/libsofia_sip_ua_static.2010.vcxproj | 6 +
src/include/private/switch_core_pvt.h | 1 +
src/include/switch_core.h | 36 +++
src/include/switch_cpp.h | 4 +
src/include/switch_ivr.h | 31 ++
src/include/switch_module_interfaces.h | 9 +
src/include/switch_nat.h | 2 +-
.../applications/mod_callcenter/mod_callcenter.c | 9 +-
src/mod/applications/mod_commands/mod_commands.c | 29 ++-
.../applications/mod_conference/mod_conference.c | 1 +
src/mod/applications/mod_dptools/mod_dptools.c | 28 ++-
src/mod/applications/mod_redis/mod_redis.c | 10 +-
src/mod/applications/mod_spy/mod_spy.c | 6 +-
src/mod/applications/mod_voicemail/mod_voicemail.c | 6 +-
src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c | 313 ++++++++++++++++++--
.../mod_dialplan_asterisk/mod_dialplan_asterisk.c | 2 +-
src/mod/endpoints/mod_dingaling/mod_dingaling.c | 4 +-
src/mod/endpoints/mod_khomp/src/khomp_pvt.cpp | 3 +-
src/mod/endpoints/mod_loopback/mod_loopback.c | 58 ++--
src/mod/endpoints/mod_skinny/skinny_protocol.h | 8 +
src/mod/endpoints/mod_skinny/skinny_server.c | 25 ++
src/mod/endpoints/mod_skinny/skinny_tables.c | 1 +
src/mod/endpoints/mod_skinny/skinny_tables.h | 2 +-
src/mod/endpoints/mod_sofia/mod_sofia.c | 23 +-
src/mod/endpoints/mod_sofia/sofia.c | 11 +-
src/mod/endpoints/mod_sofia/sofia_glue.c | 25 +-
src/mod/endpoints/mod_sofia/sofia_presence.c | 62 +++--
.../mod_event_socket/mod_event_socket.c | 4 +-
src/mod/event_handlers/mod_snmp/FREESWITCH-MIB | 217 ++++++++++++++-
src/mod/event_handlers/mod_snmp/mod_snmp.c | 2 +-
src/mod/event_handlers/mod_snmp/subagent.c | 260 +++++++++++++++-
src/mod/event_handlers/mod_snmp/subagent.h | 57 ++++-
src/mod/formats/mod_file_string/mod_file_string.c | 2 +-
.../languages/mod_managed/freeswitch_wrap.2010.cxx | 196 ++++++++++++
src/mod/languages/mod_managed/freeswitch_wrap.cxx | 224 ++++++++++++++
src/mod/languages/mod_managed/managed/swig.2010.cs | 168 +++++++++++-
src/mod/languages/mod_managed/managed/swig.cs | 170 +++++++++++
.../languages/mod_spidermonkey/mod_spidermonkey.c | 3 +-
src/mod/xml_int/mod_xml_curl/mod_xml_curl.c | 4 +-
src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c | 6 +-
src/switch_channel.c | 58 ++--
src/switch_console.c | 32 +-
src/switch_core.c | 47 +++-
src/switch_core_asr.c | 53 ++++
src/switch_core_file.c | 2 +-
src/switch_core_sqldb.c | 71 +++---
src/switch_cpp.cpp | 7 +
src/switch_event.c | 7 +-
src/switch_ivr_async.c | 83 +++++
src/switch_nat.c | 7 +
src/switch_rtp.c | 4 +-
src/switch_utils.c | 10 +-
src/switch_xml.c | 11 +-
62 files changed, 2206 insertions(+), 300 deletions(-)
</pre>
<p>this email was generated because of /git/your-repo.git/hooks/post-receive by the file /git-core/contrib/hooks/post-receive-email<br />
For more info, see <a href="http://blog.chomperstomp.com/?p=630">http://blog.chomperstomp.com/?p=630</a>
-- <br />
FreeSWITCH Source</p>