Details

    • Type: New Feature New Feature
    • Status: Closed
    • Severity: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Target Release Version/s: None
    • Component/s: PBX/General
    • Labels:
      None
    • SVN Revision Number:
      99085
    • Mantis ID:
      11796
    • Regression:
      No

      Description

      Refactored DTMF digit detection, fax tone detection & added CED fax tone detection. See Additional Infrmation for details.

                • ADDITIONAL INFORMATION ******

      1. Added generic code to detect arbitrary frequency of given duration.

      2. Fax tone detection reimplemented using the new code and it is not part of DTMF digit detection anymore. Previously to detect fax tone you had to do:

      ast_dsp_set_features(dsp, DSP_FEATURE_DTMF_DETECT | DSP_FEATURE_FAX_DETECT);

      eve if you do not want DTMF. Now you can do just:

      ast_dsp_set_features(dsp, DSP_FEATURE_FAX_DETECT);

      3. New code is able to detect both CNG and CED signals (the old was only detecting CNG). By default to be compatible with the old code, only CNG is being detected unless one explicitly does:

      ast_dsp_set_faxmode(i->vad, DSP_FAXMODE_DETECT_CED);
      or
      ast_dsp_set_faxmode(i->vad, DSP_FAXMODE_DETECT_CNG|DSP_FAXMODE_DETECT_CED);
      or
      ast_dsp_set_faxmode(i->vad, DSP_FAXMODE_DETECT_ALL);

      Since default value detects CNG only, all users of the code which request DSP_FEATURE_FAX_DETECT should not notice any changes in the DSP code.

      4. When CED is detected AST_FRAME_DTMF with subclass='e' is returned.

      5. DTMF/MF digit detection refactored a bit - there were identical members in the dtmf_detect_state_t/mf_detect_state_t structures and code for queueing detected digit was copied&pasted. I introduced digit_detect_state_t structure which has all common members and union of the two above.

      1. dsp-faxtones.patch
        27 kB
        Dmitry Andrianov
      2. v2-dsp-faxtones.patch
        26 kB
        Dmitry Andrianov
      3. v3-dsp-faxtones.patch
        27 kB
        Dmitry Andrianov
      4. v4-dsp-faxtones.patch
        27 kB
        Dmitry Andrianov
      5. v5-dsp-faxtones.patch
        27 kB
        Dmitry Andrianov
      6. v6-dsp-faxtones.patch
        28 kB
        Dmitry Andrianov

        Activity

        Hide
        Igor Goncharovsky added a comment -

        Latest version works for me. DTMF, fax CNG and CED successfully detected both on incoming and outgoing calls over mISDN.

        Show
        Igor Goncharovsky added a comment - Latest version works for me. DTMF, fax CNG and CED successfully detected both on incoming and outgoing calls over mISDN.
        Hide
        Dmitry Andrianov added a comment -

        Updated patch. The code was looking for the CNG tone even when DSP_FEATURE_FAX_DETECT was not requested.

        Show
        Dmitry Andrianov added a comment - Updated patch. The code was looking for the CNG tone even when DSP_FEATURE_FAX_DETECT was not requested.
        Hide
        Dmitry Andrianov added a comment -

        Ok, I think it is the last update.

        Changed selection if Goertzel block size to prefer smaller blocks. There are two reasons:
        1. only if we have small enough block it is possible to squelch detected tone from the voice data if we want later. (With large block it is not possible because at the moment tone is detected, it is too late and lots of frames with tone were already passed)
        2. More importantly: it makes detection more reliable. This is because:
        *) Larger block size allows less deviation of frequency
        *) Testing with one of my fax machines i found it regularly produces some clicking sounds which repeated multiple times within the large block makes Goertzel energy for target frequency very low. With small block, that "click" also makes code think there is no tone, but de-bouncing allows these drop-outs in the middle of tone to be handled ok.

        Show
        Dmitry Andrianov added a comment - Ok, I think it is the last update. Changed selection if Goertzel block size to prefer smaller blocks. There are two reasons: 1. only if we have small enough block it is possible to squelch detected tone from the voice data if we want later. (With large block it is not possible because at the moment tone is detected, it is too late and lots of frames with tone were already passed) 2. More importantly: it makes detection more reliable. This is because: *) Larger block size allows less deviation of frequency *) Testing with one of my fax machines i found it regularly produces some clicking sounds which repeated multiple times within the large block makes Goertzel energy for target frequency very low. With small block, that "click" also makes code think there is no tone, but de-bouncing allows these drop-outs in the middle of tone to be handled ok.
        Hide
        cache added a comment -

        Installed patched dsp.c on production 1.4 machine as part of app_fax+T38 installation. No problems noted so far
        Good work dimas. Thanks.

        Show
        cache added a comment - Installed patched dsp.c on production 1.4 machine as part of app_fax+T38 installation. No problems noted so far Good work dimas. Thanks.
        Hide
        Digium Subversion added a comment -

        Repository: asterisk
        Revision: 103903

        U trunk/include/asterisk/dsp.h
        U trunk/main/dsp.c

        ------------------------------------------------------------------------
        r103903 | qwell | 2008-02-20 15:33:19 -0600 (Wed, 20 Feb 2008) | 13 lines

        Largely refactor DSP tone detection routines.

        Separate fax detection from digit detected.
        Added CED (called) tone detection for fax (previously, only CNG (calling) was supported).
        Separate DTMF/MF code paths where appropriate.
        Allow detection of arbitary tones.

        (closes issue ASTERISK-11264)
        Reported by: dimas
        Patches:
        v6-dsp-faxtones.patch uploaded by dimas (license 88)
        Tested by: dimas, IgorG, Cache

        ------------------------------------------------------------------------

        http://svn.digium.com/view/asterisk?view=rev&revision=103903

        Show
        Digium Subversion added a comment - Repository: asterisk Revision: 103903 U trunk/include/asterisk/dsp.h U trunk/main/dsp.c ------------------------------------------------------------------------ r103903 | qwell | 2008-02-20 15:33:19 -0600 (Wed, 20 Feb 2008) | 13 lines Largely refactor DSP tone detection routines. Separate fax detection from digit detected. Added CED (called) tone detection for fax (previously, only CNG (calling) was supported). Separate DTMF/MF code paths where appropriate. Allow detection of arbitary tones. (closes issue ASTERISK-11264 ) Reported by: dimas Patches: v6-dsp-faxtones.patch uploaded by dimas (license 88) Tested by: dimas, IgorG, Cache ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=103903

          People

          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development