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

<h2>branch: master updated</h2>
<pre>
       via: cd1982ceb7c7a7df598adea002cea51d040a3f62 (commit)
      from: 0bce777a4a06701798e426b13b8b7e0153836077 (commit)


</pre>= COMMIT LOG ===========================================================
<div class="highlight"><pre>committer: Marc Olivier Chouinard
comments: 
mod_callcenter: IMPORTANT UPDATE, DTMF during moh created an loop to reactivate MOH but got canceled right away because of pending DTMF in the queue never been cleaned.  Could cause masive disk write of debug, and can cause problem to the rest of FS stability.  This patch also include basic fundation for DTMF capture support for member waiting.

<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 61305bb..a06520f 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">@@ -2080,6 +2080,32 @@ void *SWITCH_THREAD_FUNC cc_member_thread_run(switch_thread_t *thread, void *obj</span>
         return NULL; 
 }
 
<span style="color: #00A000">+struct moh_dtmf_helper {</span>
<span style="color: #00A000">+        const char *queue_name;</span>
<span style="color: #00A000">+        char dtmf;</span>
<span style="color: #00A000">+};</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+static switch_status_t moh_on_dtmf(switch_core_session_t *session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen) {</span>
<span style="color: #00A000">+        struct moh_dtmf_helper *h = (struct moh_dtmf_helper *) buf;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        switch (itype) {</span>
<span style="color: #00A000">+                case SWITCH_INPUT_TYPE_DTMF:</span>
<span style="color: #00A000">+                        {</span>
<span style="color: #00A000">+                                /* Just laywork for people who want to get some DTMF actions */</span>
<span style="color: #00A000">+                                switch_dtmf_t *dtmf = (switch_dtmf_t *) input;</span>
<span style="color: #00A000">+                                if (strchr(&quot;#&quot;, dtmf-&gt;digit)) {</span>
<span style="color: #00A000">+                                        h-&gt;dtmf = dtmf-&gt;digit;</span>
<span style="color: #00A000">+                                        return SWITCH_STATUS_BREAK;</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">+                        break;</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>
 #define CC_DESC &quot;callcenter&quot;
 #define CC_USAGE &quot;queue_name&quot;
 
<span style="color: #800080; font-weight: bold">@@ -2226,8 +2252,6 @@ SWITCH_STANDARD_APP(callcenter_function)</span>
         switch_thread_create(&amp;thread, thd_attr, cc_member_thread_run, h, h-&gt;pool);
 
         /* Playback MOH */
<span style="color: #A00000">-        /* TODO Add DTMF callback support */</span>
<span style="color: #A00000">-        /* TODO add MOH infitite loop */        </span>
         if (cc_moh_override) {
                 cur_moh = switch_core_session_strdup(member_session, cc_moh_override);
         } else {
<span style="color: #800080; font-weight: bold">@@ -2237,6 +2261,12 @@ SWITCH_STANDARD_APP(callcenter_function)</span>
 
         while (switch_channel_ready(member_channel)) {
                 switch_input_args_t args = { 0 };
<span style="color: #00A000">+                struct moh_dtmf_helper ht;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                ht.dtmf = &#39;\0&#39;;</span>
<span style="color: #00A000">+                args.input_callback = moh_on_dtmf;</span>
<span style="color: #00A000">+                args.buf = (void *) &amp;ht;</span>
<span style="color: #00A000">+                args.buflen = sizeof(h);</span>
 
                 /* An agent was found, time to exit and let the bridge do it job */
                 if ((agent_uuid = switch_channel_get_variable(member_channel, &quot;cc_agent_uuid&quot;))) {
<span style="color: #800080; font-weight: bold">@@ -2260,6 +2290,8 @@ SWITCH_STANDARD_APP(callcenter_function)</span>
                         switch_ivr_collect_digits_callback(session, &amp;args, 0, 0);
                 }
 
<span style="color: #00A000">+                switch_yield(1000);</span>
<span style="color: #00A000">+</span>
         }
 
         /* Stop Member Thread */
</pre></div>
========================================================================<pre>

Summary of changes:
 .../applications/mod_callcenter/mod_callcenter.c   |   36 ++++++++++++++++++-
 1 files changed, 34 insertions(+), 2 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>