]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 247914 via svnmerge from
authorRichard Mudgett <rmudgett@digium.com>
Fri, 19 Feb 2010 18:13:24 +0000 (18:13 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Fri, 19 Feb 2010 18:13:24 +0000 (18:13 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

................
  r247914 | rmudgett | 2010-02-19 11:33:33 -0600 (Fri, 19 Feb 2010) | 62 lines

  Merged revisions 247910 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.4

  ................
    r247910 | rmudgett | 2010-02-19 11:18:49 -0600 (Fri, 19 Feb 2010) | 55 lines

    Merged revision 247904 from
    https://origsvn.digium.com/svn/asterisk/be/branches/C.2-...

    ..........
    r247904 | rmudgett | 2010-02-19 10:49:44 -0600 (Fri, 19 Feb 2010) | 49 lines

    Make chan_misdn DTMF processing consistent with other channel technologies.

    The processing of DTMF tones on the receiving side of an ISDN channel is
    inconsistent with the way it is handled in other channels, especially
    DAHDI analog.  This causes DTMF tones sent from an ISDN phone to be
    doubled at the connected party.

    We are using the following 2 options of misdn.conf
    1) astdtmf=yes
    2) senddtmf=yes

    Option one is necessary because the asterisk DSP DTMF detection is better
    than mISDN's internal DSP.  Not as many false positives.

    Option two is necessary to transmit DTMF tones end to end when mISDN
    channels are connected to SIP channels with out of band DTMF for example.

    The symptom is that DTMF tones sent by an ISDN phone are doubled on the
    way through asterisk when two mISDN channels are connected with a Local
    channel in between or if it is bridged to an analog channel.

    The doubling of DTMF tones is because DTMF is passed inband to asterisk by
    the mISDN channel and passed out of band once again after the release of
    the DTMF tone.  Passing it inband is wrong.  Neither an analog channel nor
    SIP channel passes DTMF inband if configured to inband DTMF.  Analog and
    SIP channels filter out the DTMF tones because they use the voice frames
    returned by ast_dsp_process.  But chan_misdn passes the unfiltered input
    voice frames instead.

    To overcome one aspect of the problem, the doubling of DTMF tones when two
    mISDN channels are directly bridged, someone made an 'optimization', where
    in that case the DTMF tone passed out-of-band to the peer channel is not
    translated to an inband tone at the transmit side.  This optimization is
    bad because it does not work in general.  For example, analog channels or
    mISDN channels when bridged through an intermediary local channel will
    generate DTMF tones from out-of-band information.  Also, of course, it
    must not be done when there is no inband DTMF available.

    This patch fixes the issue.  Now chan_misdn will filter the received
    inband DTMF signal the same as other channel types.

    Another change included: No need to build an extra translation path
    because ast_process_dsp does it if required.

    Patches:
     misdn-dtmf.patch

    JIRA ABE-2080
  ................
................

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@247922 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_misdn.c

index ea1cecd9d7353a24e34a856844f326d781e59fec..8a3b22c2e393307ec20daf86965e32002d151fe2 100644 (file)
@@ -295,13 +295,6 @@ struct chan_list {
         */
        struct ast_dsp *dsp;
 
-       /*!
-        * \brief Allocated audio frame sample translator
-        * \note ast_translator_build_path() creates the translator path.
-        * \note Must use ast_translator_free_path() to clean up. 
-        */
-       struct ast_trans_pvt *trans;
-  
        /*!
         * \brief Associated Asterisk channel structure.
         */
@@ -2334,8 +2327,6 @@ static int read_config(struct chan_list *ch, int orig)
                        else 
                                ast_dsp_set_features(ch->dsp, DSP_FEATURE_DTMF_DETECT );
                }
-               if (!ch->trans)
-                       ch->trans = ast_translator_build_path(AST_FORMAT_SLINEAR, AST_FORMAT_ALAW);
        }
 
        /* AOCD initialization */
@@ -2574,11 +2565,6 @@ static int misdn_digit_end(struct ast_channel *ast, char digit, unsigned int dur
                misdn_lib_send_event( bc, EVENT_INFORMATION);
                break;
        default:        
-                       /* Do not send Digits in CONNECTED State, when
-                        * the other side is too mISDN. */
-                       if (p->other_ch ) 
-                               return 0;
-
                        if ( bc->send_dtmf ) 
                                send_digit_to_chan(p,digit);
                break;
@@ -2903,21 +2889,17 @@ static int misdn_hangup(struct ast_channel *ast)
 
 static struct ast_frame *process_ast_dsp(struct chan_list *tmp, struct ast_frame *frame)
 {
-       struct ast_frame *f,*f2;
+       struct ast_frame *f;
  
-       if (tmp->trans) {
-               f2 = ast_translate(tmp->trans, frame, 0);
-               f = ast_dsp_process(tmp->ast, tmp->dsp, f2);
+       if (tmp->dsp) {
+               f = ast_dsp_process(tmp->ast, tmp->dsp, frame);
        } else {
-               chan_misdn_log(0, tmp->bc->port, "No T-Path found\n");
+               chan_misdn_log(0, tmp->bc->port, "No DSP-Path found\n");
                return NULL;
        }
 
        if (!f || (f->frametype != AST_FRAME_DTMF)) {
-               if (f) {
-                       ast_frfree(f);
-               }
-               return frame;
+               return f;
        }
  
        ast_debug(1, "Detected inband DTMF digit: %c\n", f->subclass);
@@ -3823,8 +3805,6 @@ static void cl_dequeue_chan(struct chan_list **list, struct chan_list *chan)
 
        if (chan->dsp) 
                ast_dsp_free(chan->dsp);
-       if (chan->trans)
-               ast_translator_free_path(chan->trans);
 
        ast_mutex_lock(&cl_te_lock);
        if (!*list) {
@@ -5872,8 +5852,6 @@ static int misdn_set_opt_exec(struct ast_channel *chan, void *data)
                        ch->dsp = ast_dsp_new();
                if (ch->dsp)
                        ast_dsp_set_features(ch->dsp, DSP_FEATURE_DTMF_DETECT | DSP_FEATURE_FAX_DETECT);
-               if (!ch->trans)
-                       ch->trans = ast_translator_build_path(AST_FORMAT_SLINEAR, AST_FORMAT_ALAW);
        }
 
        if (ch->ast_dsp) {