summaryrefslogtreecommitdiff
path: root/main/dsp.c
AgeCommit message (Collapse)Author
2016-10-27Remove ASTERISK_REGISTER_FILE.Corey Farrell
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes all traces of it. Previously exported symbols removed: * __ast_register_file * __ast_unregister_file * ast_complete_source_filename This also removes the mtx_prof static variable that was declared when MTX_PROFILE was enabled. This variable was only used in lock.c so it is now initialized in that file only. ASTERISK-26480 #close Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2016-07-26dsp.c: Add fax and DTMF detection unit tests.Richard Mudgett
* Add fax amplitude and frequency sweep tests. * Add DTMF amplitude and twist unit tests. Change-Id: I8d77c9a1eec89e440d715f998c928687e870c3f7
2016-07-26dsp.c: Added descriptive comments to Goertzel calculations.Richard Mudgett
* Added doxygen to describe some struct members and what is going on in the code. Change-Id: I2ec706a33b52aee42b16dcc356c2bd916a45190d
2016-07-26dsp.c: Fix incorrect format reference typo.Richard Mudgett
Change-Id: Ia131da3ec29acf385cb43a586a29ecc975eb3896
2016-07-26dsp.c: Fix erroneous fax tone detection.Richard Mudgett
The Goertzel calculations get less accurate the lower the signal level being worked with becomes because there is less resolution remaining. If it is too low we can erroneously detect a tone where none really exists. The searched for fax frequencies not only need to be so much stronger than the background noise they must also be a minimum strength. * Add needed minimum threshold test to tone_detect(). * Set TONE_THRESHOLD to allow low volume frequency spread detection. ASTERISK-26237 #close Reported by: Richard Mudgett Change-Id: I84dbba7f7628fa13720add6a88eae3b129e066fc
2015-04-13git migration: Refactor the ASTERISK_FILE_VERSION macroMatt Jordan
Git does not support the ability to replace a token with a version string during check-in. While it does have support for replacing a token on clone, this is somewhat sub-optimal: the token is replaced with the object hash, which is not particularly easy for human consumption. What's more, in practice, the source file version was often not terribly useful. Generally, when triaging bugs, the overall version of Asterisk is far more useful than an individual SVN version of a file. As a result, this patch removes Asterisk's support for showing source file versions. Specifically, it does the following: * Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and remove passing the version in with the macro. Other facilities than 'core show file version' make use of the file names, such as setting a debug level only on a specific file. As such, the act of registering source files with the Asterisk core still has use. The macro rename now reflects the new macro purpose. * main/asterisk: - Refactor the file_version structure to reflect that it no longer tracks a version field. - Remove the "core show file version" CLI command. Without the file version, it is no longer useful. - Remove the ast_file_version_find function. The file version is no longer tracked. - Rename ast_register_file_version/ast_unregister_file_version to ast_register_file/ast_unregister_file, respectively. * main/manager: Remove value from the Version key of the ModuleCheck Action. The actual key itself has not been removed, as doing so would absolutely constitute a backwards incompatible change. However, since the file version is no longer tracked, there is no need to attempt to include it in the Version key. * UPGRADE: Add notes for: - Modification to the ModuleCheck AMI Action - Removal of the "core show file version" CLI command Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
2015-04-10res_pjsip: Add an 'auto' option for DTMF ModeMatthew Jordan
This patch adds support for automatically detecting the type of DTMF that a PJSIP endpoint supports. When the 'dtmf_mode' endpoint option is set to 'auto', the channel created for an endpoint will attempt to determine if RFC 4733 DTMF is supported. If so, it will use that DTMF type. If not, the DTMF type for the channel will be set to inband. Review: https://reviewboard.asterisk.org/r/4438 ASTERISK-24706 #close Reported by: yaron nahum patches: yaron_patch_3_Feb.diff submitted by yaron nahum (License 6676) ........ Merged revisions 434637 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-06build: Fixes for gcc 5 compilationGeorge Joseph
These are fixes for compilation under gcc 5.0... chan_sip.c: In parse_request needed to make 'lim' unsigned. inline_api.h: Needed to add a check for '__GNUC_STDC_INLINE__' to detect C99 inline semantics (same as clang). ccss.c: In ast_cc_set_parm, needed to fix weird comparison. dsp.c: Needed to work around a possible compiler bug. It was throwing an array-bounds error but neither sgriepentrog, rmudgett nor I could figure out why. manager.c: In action_atxfer, needed to correct an array allocation. This patch will go to 11, 13, trunk. Review: https://reviewboard.asterisk.org/r/4581/ Reported-by: Jeffrey Ollie Tested-by: George Joseph ASTERISK-24932 #close ........ Merged revisions 434113 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 434114 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434115 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-28clang compiler warnings: Fix -Wunused-function; make inline function staticMatthew Jordan
This patch fixes clang compilers warnings for unused functions. Specifically: * channels/chan_iax2: removed user_ref function * main/dsp.c: removed goertzel_update function * main/config.c: made variable_list_switch static Review: https://reviewboard.asterisk.org/r/4527 ASTERISK-24917 Reported by: dkdegroot patches: rb4527.patch submitted by dkdegroot (License 6600) ........ Merged revisions 433678 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 433680 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433681 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-20media formats: re-architect handling of media for performance improvementsMatthew Jordan
In the old times media formats were represented using a bit field. This was fast but had a few limitations. 1. Asterisk was limited in how many formats it could handle. 2. Formats, being a bit field, could not include any attribute information. A format was strictly its type, e.g., "this is ulaw". This was changed in Asterisk 10 (see https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal for notes on that work) which led to the creation of the ast_format structure. This structure allowed Asterisk to handle attributes and bundle information with a format. Additionally, ast_format_cap was created to act as a container for multiple formats that, together, formed the capability of some entity. Another mechanism was added to allow logic to be registered which performed format attribute negotiation. Everywhere throughout the codebase Asterisk was changed to use this strategy. Unfortunately, in software, there is no free lunch. These new capabilities came at a cost. Performance analysis and profiling showed that we spend an inordinate amount of time comparing, copying, and generally manipulating formats and their related structures. Basic prototyping has shown that a reasonably large performance improvement could be made in this area. This patch is the result of that project, which overhauled the media format architecture and its usage in Asterisk to improve performance. Generally, the new philosophy for handling formats is as follows: * The ast_format structure is reference counted. This removed a large amount of the memory allocations and copying that was done in prior versions. * In order to prevent race conditions while keeping things performant, the ast_format structure is immutable by convention and lock-free. Violate this tenet at your peril! * Because formats are reference counted, codecs are also reference counted. The Asterisk core generally provides built-in codecs and caches the ast_format structures created to represent them. Generally, to prevent inordinate amounts of module reference bumping, codecs and formats can be added at run-time but cannot be removed. * All compatibility with the bit field representation of codecs/formats has been moved to a compatibility API. The primary user of this representation is chan_iax2, which must continue to maintain its bit-field usage of formats for interoperability concerns. * When a format is negotiated with attributes, or when a format cannot be represented by one of the cached formats, a new format object is created or cloned from an existing format. That format may have the same codec underlying it, but is a different format than a version of the format with different attributes or without attributes. * While formats are reference counted objects, the reference count maintained on the format should be manipulated with care. Formats are generally cached and will persist for the lifetime of Asterisk and do not explicitly need to have their lifetime modified. An exception to this is when the user of a format does not know where the format came from *and* the user may outlive the provider of the format. This occurs, for example, when a format is read from a channel: the channel may have a format with attributes (hence, non-cached) and the user of the format may last longer than the channel (if the reference to the channel is released prior to the format's reference). For more information on this work, see the API design notes: https://wiki.asterisk.org/wiki/display/AST/Media+Format+Rewrite Finally, this work was the culmination of a large number of developer's efforts. Extra thanks goes to Corey Farrell, who took on a large amount of the work in the Asterisk core, chan_sip, and was an invaluable resource in peer reviews throughout this project. There were a substantial number of patches contributed during this work; the following issues/patch names simply reflect some of the work (and will cause the release scripts to give attribution to the individuals who work on them). Reviews: https://reviewboard.asterisk.org/r/3814 https://reviewboard.asterisk.org/r/3808 https://reviewboard.asterisk.org/r/3805 https://reviewboard.asterisk.org/r/3803 https://reviewboard.asterisk.org/r/3801 https://reviewboard.asterisk.org/r/3798 https://reviewboard.asterisk.org/r/3800 https://reviewboard.asterisk.org/r/3794 https://reviewboard.asterisk.org/r/3793 https://reviewboard.asterisk.org/r/3792 https://reviewboard.asterisk.org/r/3791 https://reviewboard.asterisk.org/r/3790 https://reviewboard.asterisk.org/r/3789 https://reviewboard.asterisk.org/r/3788 https://reviewboard.asterisk.org/r/3787 https://reviewboard.asterisk.org/r/3786 https://reviewboard.asterisk.org/r/3784 https://reviewboard.asterisk.org/r/3783 https://reviewboard.asterisk.org/r/3778 https://reviewboard.asterisk.org/r/3774 https://reviewboard.asterisk.org/r/3775 https://reviewboard.asterisk.org/r/3772 https://reviewboard.asterisk.org/r/3761 https://reviewboard.asterisk.org/r/3754 https://reviewboard.asterisk.org/r/3753 https://reviewboard.asterisk.org/r/3751 https://reviewboard.asterisk.org/r/3750 https://reviewboard.asterisk.org/r/3748 https://reviewboard.asterisk.org/r/3747 https://reviewboard.asterisk.org/r/3746 https://reviewboard.asterisk.org/r/3742 https://reviewboard.asterisk.org/r/3740 https://reviewboard.asterisk.org/r/3739 https://reviewboard.asterisk.org/r/3738 https://reviewboard.asterisk.org/r/3737 https://reviewboard.asterisk.org/r/3736 https://reviewboard.asterisk.org/r/3734 https://reviewboard.asterisk.org/r/3722 https://reviewboard.asterisk.org/r/3713 https://reviewboard.asterisk.org/r/3703 https://reviewboard.asterisk.org/r/3689 https://reviewboard.asterisk.org/r/3687 https://reviewboard.asterisk.org/r/3674 https://reviewboard.asterisk.org/r/3671 https://reviewboard.asterisk.org/r/3667 https://reviewboard.asterisk.org/r/3665 https://reviewboard.asterisk.org/r/3625 https://reviewboard.asterisk.org/r/3602 https://reviewboard.asterisk.org/r/3519 https://reviewboard.asterisk.org/r/3518 https://reviewboard.asterisk.org/r/3516 https://reviewboard.asterisk.org/r/3515 https://reviewboard.asterisk.org/r/3512 https://reviewboard.asterisk.org/r/3506 https://reviewboard.asterisk.org/r/3413 https://reviewboard.asterisk.org/r/3410 https://reviewboard.asterisk.org/r/3387 https://reviewboard.asterisk.org/r/3388 https://reviewboard.asterisk.org/r/3389 https://reviewboard.asterisk.org/r/3390 https://reviewboard.asterisk.org/r/3321 https://reviewboard.asterisk.org/r/3320 https://reviewboard.asterisk.org/r/3319 https://reviewboard.asterisk.org/r/3318 https://reviewboard.asterisk.org/r/3266 https://reviewboard.asterisk.org/r/3265 https://reviewboard.asterisk.org/r/3234 https://reviewboard.asterisk.org/r/3178 ASTERISK-23114 #close Reported by: mjordan media_formats_translation_core.diff uploaded by kharwell (License 6464) rb3506.diff uploaded by mjordan (License 6283) media_format_app_file.diff uploaded by kharwell (License 6464) misc-2.diff uploaded by file (License 5000) chan_mild-3.diff uploaded by file (License 5000) chan_obscure.diff uploaded by file (License 5000) jingle.diff uploaded by file (License 5000) funcs.diff uploaded by file (License 5000) formats.diff uploaded by file (License 5000) core.diff uploaded by file (License 5000) bridges.diff uploaded by file (License 5000) mf-codecs-2.diff uploaded by file (License 5000) mf-app_fax.diff uploaded by file (License 5000) mf-apps-3.diff uploaded by file (License 5000) media-formats-3.diff uploaded by file (License 5000) ASTERISK-23715 rb3713.patch uploaded by coreyfarrell (License 5909) rb3689.patch uploaded by mjordan (License 6283) ASTERISK-23957 rb3722.patch uploaded by mjordan (License 6283) mf-attributes-3.diff uploaded by file (License 5000) ASTERISK-23958 Tested by: jrose rb3822.patch uploaded by coreyfarrell (License 5909) rb3800.patch uploaded by jrose (License 6182) chan_sip.diff uploaded by mjordan (License 6283) rb3747.patch uploaded by jrose (License 6182) ASTERISK-23959 #close Tested by: sgriepentrog, mjordan, coreyfarrell sip_cleanup.diff uploaded by opticron (License 6273) chan_sip_caps.diff uploaded by mjordan (License 6283) rb3751.patch uploaded by coreyfarrell (License 5909) chan_sip-3.diff uploaded by file (License 5000) ASTERISK-23960 #close Tested by: opticron direct_media.diff uploaded by opticron (License 6273) pjsip-direct-media.diff uploaded by file (License 5000) format_cap_remove.diff uploaded by opticron (License 6273) media_format_fixes.diff uploaded by opticron (License 6273) chan_pjsip-2.diff uploaded by file (License 5000) ASTERISK-23966 #close Tested by: rmudgett rb3803.patch uploaded by rmudgetti (License 5621) chan_dahdi.diff uploaded by file (License 5000) ASTERISK-24064 #close Tested by: coreyfarrell, mjordan, opticron, file, rmudgett, sgriepentrog, jrose rb3814.patch uploaded by rmudgett (License 5621) moh_cleanup.diff uploaded by opticron (License 6273) bridge_leak.diff uploaded by opticron (License 6273) translate.diff uploaded by file (License 5000) rb3795.patch uploaded by rmudgett (License 5621) tls_fix.diff uploaded by mjordan (License 6283) fax-mf-fix-2.diff uploaded by file (License 5000) rtp_transfer_stuff uploaded by mjordan (License 6283) rb3787.patch uploaded by rmudgett (License 5621) media-formats-explicit-translate-format-3.diff uploaded by file (License 5000) format_cache_case_fix.diff uploaded by opticron (License 6273) rb3774.patch uploaded by rmudgett (License 5621) rb3775.patch uploaded by rmudgett (License 5621) rtp_engine_fix.diff uploaded by opticron (License 6273) rtp_crash_fix.diff uploaded by opticron (License 6273) rb3753.patch uploaded by mjordan (License 6283) rb3750.patch uploaded by mjordan (License 6283) rb3748.patch uploaded by rmudgett (License 5621) media_format_fixes.diff uploaded by opticron (License 6273) rb3740.patch uploaded by mjordan (License 6283) rb3739.patch uploaded by mjordan (License 6283) rb3734.patch uploaded by mjordan (License 6283) rb3689.patch uploaded by mjordan (License 6283) rb3674.patch uploaded by coreyfarrell (License 5909) rb3671.patch uploaded by coreyfarrell (License 5909) rb3667.patch uploaded by coreyfarrell (License 5909) rb3665.patch uploaded by mjordan (License 6283) rb3625.patch uploaded by coreyfarrell (License 5909) rb3602.patch uploaded by coreyfarrell (License 5909) format_compatibility-2.diff uploaded by file (License 5000) core.diff uploaded by file (License 5000) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-09Allow Asterisk to compile under GCC 4.10Kinsey Moore
This resolves a large number of compiler warnings from GCC 4.10 which cause the build to fail under dev mode. The vast majority are signed/unsigned mismatches in printf-style format strings. ........ Merged revisions 413586 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413587 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413588 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-18Doxygen Updates - Title updateAndrew Latham
Update and extend the configuration_file group and enable linking. Commit other cleanups from multi-version Doxygen testing. Update title that was left behind many years ago. (issue ASTERISK-20259) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-04dsp.c User Configurable DTMF_HITS_TO_BEGIN and DTMF_MISSES_TO_ENDAlec L Davis
Instead of a recompile, allow values to be adjusted in dsp.conf For binary distributions allows easy adjustment for wobbly GSM calls, and other reasons. Defaults to DTMF_HITS_TO_BEGIN=2 and DTMF_MISSES_TO_END=3 (closes issue ASTERISK-17493) Reported by: alecdavis Tested by: alecdavis alecdavis (license 585) Review https://reviewboard.asterisk.org/r/2144/ ........ Merged revisions 374479 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 374481 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 374485 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-04dsp.c fix incorrect DTMF Digit_Duration.Alec L Davis
it's always short by 'hits_to_begin*DTMF_GSIZE', or 25.5ms if hitstobegin=2 (issue ASTERISK-16003) Tested by: alecdavis alecdavis (license 585) Review https://reviewboard.asterisk.org/r/2145/ ........ Merged revisions 374475 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 374476 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 374477 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374478 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-04dsp.c User configuration of DTMF_NORMAL_TWIST and DTMF_REVERSE_TWIST valuesAlec L Davis
Asterisk's DTMF Specifications are based on AT&T specs, which may not be compatible in other countries. Various countries have different specifications for the maximum power level differences between the DTMF low group and high group of frequencies. Power level difference between frequencies for different Administrations/RPOAs NTT = Max. 5 dB AT&T = 4dB(reverse) to 8dB(normal) Danish = Max. 6 dB Australian = Max. 10 dB Brazilian = Max. 9 dB ETSI = Max. 6 dB from ETSI ES 201 235-3 V1.3.1 (2006-03) Now allow 4 variables to be individually configured in dsp.conf, with reasonable min/max of 2dB to 20dB. Default is AT&T specifications Add's the following variables to dsp.conf ;dtmf_normal_twist=6.31 ;dtmf_reverse_twist=2.51 ;relax_dtmf_normal_twist=6.31 ;relax_dtmf_reverse_twist=3.98 (closes issue ASTERISK-20442) Reported by: tbsky Tested by: tbsky,alecdavis alecdavis (license 585) Review https://reviewboard.asterisk.org/r/2141/ ........ Merged revisions 374384 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 374385 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 374386 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374387 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-21dsp.c: remove more whitespace mentioned in review2107Alec L Davis
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-21dsp.c ast_dsp_call_progress use local short variable in loop, plus other cleanupAlec L Davis
janitor cleanup. No functional change. 1). ast_dsp_call_progress: use 'short samp' instead of s[x] inside loop. apply same casting as other _init, dsp->energy = (int32_t) samp * (int32_t) samp 2). ast_dtmf_detect_init: move repeated setting of s->energy to outside of loop. do goertzel_init loop first before setting s->lasthit and s->current_hit, consistant with ast_dsp_digitreset() 3). ast_mf_detect_init: do goertzel_init loop first before setting s->hits[] and s->current_hit, consistant with ast_dsp_digitreset() 4). Don't chain init different variables, as the type may change Review https://reviewboard.asterisk.org/r/2107/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-20dsp.c: remove whitespace mentioned in review2107Alec L Davis
Related https://reviewboard.asterisk.org/r/2107/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373202 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-05dsp.c: in ast_mf_detect_init incorrectly sets goertzel samples to 160, ↵Alec L Davis
should be MF_GSIZE Remove unused goertzel_state_t member 'samples'. Related https://reviewboard.asterisk.org/r/2097/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372343 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-05dsp.c: Fix multiple issues when no-interdigit delay is present, and fast ↵Alec L Davis
DTMF 50ms/50ms Revert DTMF hit/miss detector to original -r349249 method with some changes, remove unnecessary; 1. reseting of hits=0, when no signal, only need to set it once. 2. incrementing of hits, when the hit is the same as the current hit. 3. setting of lasthit, when it's the same as before. Change HITS_TO_BEGIN to 2, MISSES_TO_END to 3 & 3 spelling mistakes (closes issue ASTERISK-19610) alecdavis (license 585) Reported by: Jean-Philippe Lord Tested by: alecdavis Review: https://reviewboard.asterisk.org/r/2085/ ........ Merged revisions 372239 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 372240 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 372241 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372242 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-05dsp.c: optimize goerztzel sample loops, in dtmf_detect, mf_detect and ↵Alec L Davis
tone_detect use a temporary short int when repeatedly used to call goertzel_sample. alecdavis (license 585) Reported by: alecdavis Tested by: alecdavis Review: https://reviewboard.asterisk.org/r/2093/ ........ Merged revisions 372212 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 372213 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 372214 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372215 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-26mf_detect: incorrectly used DTMF_GSIZE instead of MF_GSIZEAlec L Davis
........ Merged revisions 371662 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 371663 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 371664 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371665 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-31Clean up and ensure proper usage of alloca()Kinsey Moore
This replaces all calls to alloca() with ast_alloca() which calls gcc's __builtin_alloca() to avoid BSD semantics and removes all NULL checks on memory allocated via ast_alloca() and ast_strdupa(). (closes issue ASTERISK-20125) Review: https://reviewboard.asterisk.org/r/2032/ Patch-by: Walter Doekes (wdoekes) ........ Merged revisions 370642 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 370643 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15Multiple revisions 369001-369002Kevin P. Fleming
........ r369001 | kpfleming | 2012-06-15 10:56:08 -0500 (Fri, 15 Jun 2012) | 11 lines Add support-level indications to many more source files. Since we now have tools that scan through the source tree looking for files with specific support levels, we need to ensure that every file that is a component of a 'core' or 'extended' module (or the main Asterisk binary) is explicitly marked with its support level. This patch adds support-level indications to many more source files in tree, but avoids adding them to third-party libraries that are included in the tree and to source files that don't end up involved in Asterisk itself. ........ r369002 | kpfleming | 2012-06-15 10:57:14 -0500 (Fri, 15 Jun 2012) | 3 lines Add a script to enable finding source files without support-levels defined. ........ Merged revisions 369001-369002 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369005 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-22Kill off red blobs in most of main/*Kinsey Moore
Everything still compiled after making these changes, so I assume these whitespace-only changes didn't break anything (and shouldn't have). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-01Opaquify ast_channel typedefs, fd arrays, and softhangup flagTerry Wilson
Review: https://reviewboard.asterisk.org/r/1784/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357721 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09Replace direct access to channel name with accessor functionsTerry Wilson
There are many benefits to making the ast_channel an opaque handle, from increasing maintainability to presenting ways to kill masquerades. This patch kicks things off by taking things a field at a time, renaming the field to '__do_not_use_${fieldname}' and then writing setters/getters and converting the existing code to using them. When all fields are done, we can move ast_channel to a C file from channel.h and lop off the '__do_not_use_'. This patch sets up main/channel_interal_api.c to be the only file that actually accesses the ast_channel's fields directly. The intent would be for any API functions in channel.c to use the accessor functions. No more monkeying around with channel internals. We should use our own APIs. The interesting changes in this patch are the addition of channel_internal_api.c, the moving of the AST_DATA stuff from channel.c to channel_internal_api.c (note: the AST_DATA stuff will have to be reworked to use accessor functions when ast_channel is really opaque), and some re-working of the way channel iterators/callbacks are handled so as to avoid creating fake ast_channels on the stack to pass in matching data by directly accessing fields (since "name" is a stringfield and the fake channel doesn't init the stringfields, you can't use the ast_channel_name_set() function). I went with ast_channel_name(chan) for a getter, and ast_channel_name_set(chan, name) for a setter. The majority of the grunt-work for this change was done by writing a semantic patch using Coccinelle ( http://coccinelle.lip6.fr/ ). Review: https://reviewboard.asterisk.org/r/1655/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-05Fix an issue where dsp.c would interpret multiple dtmf events from a single ↵Jonathan Rose
key press. When receiving calls from a mobile phone into a DISA system on a connection with significant interference, the reporter's Asterisk system would interpret DTMF incorrectly and replicate digits received. This patch resolves that by increasing the number of frames a mismatch has to be detected before assuming the DTMF is over by 1 frame and adjusts dtmf_detect function to reset hits and misses only when an edge is detected. (closes issue ASTERISK-17493) Reported by: Alec Davis Patches: bug18904-refactor.diff.txt uploaded by Alec Davis (license 5546) Review: https://reviewboard.asterisk.org/r/1130/ ........ Merged revisions 349728 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 349729 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349730 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-28Improve T.38 gateway V.21 preamble detection.Kevin P. Fleming
This commit removes the V.21 preamble detection code previously added to the generic DSP implementation in Asterisk, and instead enhances the res_fax module to be able to utilize V.21 preamble detection functionality made available by FAX technology modules. This commit also adds such support to res_fax_spandsp, which uses the Spandsp modem tone detection code to do the V.21 preamble detection. There should be no functional change here, other than much more reliable V.21 preamble detection (and thus T.38 gateway initiation). ........ Merged revisions 349248 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349249 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-27tweak the v21 detector to detect an additional pattern of hits and missesMatthew Nicholson
........ Merged revisions 342605 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@342606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-13Clean up dsp.conf parsingPaul Belanger
Review: https://reviewboard.asterisk.org/r/1434/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@335603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-25dsp_process was enhanced to work with alaw and ulaw in addition to slin.Gregory Nietsky
noticed that some functions could be refactored here it is. Reported by: irroot Tested by: irroot, mnicholson Review: https://reviewboard.asterisk.org/r/1304/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@329432 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-14Merged revisions 328162 via svnmerge from Matthew Nicholson
https://origsvn.digium.com/svn/asterisk/branches/1.10 ........ r328162 | mnicholson | 2011-07-14 12:46:32 -0500 (Thu, 14 Jul 2011) | 3 lines tune the v21 preamble detector to properly detect the desired sequence of hits and misses ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328163 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-12do v21 detection instead of CED detection for the fax gatewayMatthew Nicholson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@327769 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-30Video support for ConfBridge.David Vossel
Review: https://reviewboard.asterisk.org/r/1288/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@325931 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-16Merged revisions 319261 via svnmerge from Jonathan Rose
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r319261 | jrose | 2011-05-16 16:00:55 -0500 (Mon, 16 May 2011) | 2 lines Makes busy detection in dsp.c always allow for at least one frame (20ms) of error so that 200ms tone lengths don't get ignored by single frame error lengths. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@319262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-05Merged revisions 317429 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r317429 | russell | 2011-05-05 17:11:19 -0500 (Thu, 05 May 2011) | 5 lines Only display inband DTMF warning if inband DTMF detection is enabled. (closes issue #18901) Reported by: irroot ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317430 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-03Merged revisions 316265 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r316265 | russell | 2011-05-03 14:55:49 -0500 (Tue, 03 May 2011) | 5 lines Fix a bunch of compiler warnings generated by gcc 4.6.0. Most of these are -Wunused-but-set-variable, but there were a few others mixed in here, as well. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@316293 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-21New HD ConfBridge conferencing application.David Vossel
Includes a new highly optimized and customizable ConfBridge application capable of mixing audio at sample rates ranging from 8khz-192khz. Review: https://reviewboard.asterisk.org/r/1147/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@314598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-01New Feature for chan_dahdi. 4 length pattern matching.Jonathan Rose
In chan_dahdi.conf, the user can now use length 4 patterns in addition to the usual length 2 patterns. The s ntax remains the same and the method used to track the pattern history will only change when using the length 4 patterns. (closes issue SWP-3250) Code: jrose rmudgett git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@312384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03Asterisk media architecture conversion - no more format bitfieldsDavid Vossel
This patch is the foundation of an entire new way of looking at media in Asterisk. The code present in this patch is everything required to complete phase1 of my Media Architecture proposal. For more information about this project visit the link below. https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal The primary function of this patch is to convert all the usages of format bitfields in Asterisk to use the new format and format_cap APIs. Functionally no change in behavior should be present in this patch. Thanks to twilson and russell for all the time they spent reviewing these changes. Review: https://reviewboard.asterisk.org/r/1083/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-07Set threshold for silence detection defaults to 256Paul Belanger
(closes issue #15685) Reported by: david_s5 Patches: dsp-silence-threshold-init.diff uploaded by dant (license 670) issue15685.patch.v5 uploaded by pabelanger (license 224) Tested by: danti Review: https://reviewboard.asterisk.org/r/670/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@268690 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-05Fix crash in DTMF detection.Tilghman Lesher
What I did not originally see in my previous commit was that even though the next digit could be detected before the previous was considered ended, the detection of the next digit effectively ends the detection of the previous. Therefore, the length moves in lockstep with the digit, and no separate counter is needed for the length alone. (closes issue #17371) Reported by: alecdavis (closes issue #17474) Reported by: kenner git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@268456 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-19Keep track of digit duration, when we're decoding inband to pass DTMF frames.Tilghman Lesher
(closes issue #17235) Reported by: frawd Patches: new_dtmf_dsp_len.patch uploaded by frawd (license 610) 20100518__issue17235.diff.txt uploaded by tilghman (license 14) Tested by: frawd git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@264204 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-19Merged revisions 263949 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r263949 | tilghman | 2010-05-19 01:32:27 -0500 (Wed, 19 May 2010) | 8 lines Because progress is called multiple times, across several frames, we must persist states when detecting multitone sequences. (closes issue #16749) Reported by: dant Patches: dsp.c-bug16749-1.patch uploaded by dant (license 670) Tested by: dant ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@263950 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-20restarts busydetector (if enabled) when DTMF is received after call is bridged.Alec L Davis
(closes issue 0016389) Reported by: alecdavis Tested by: alecdavis Patch dtmf_busydetector.diff2.txt uploaded by alecdavis (license 585) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@235774 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-15Whitespace.Alec L Davis
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@234940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-15restarts busydetector (if enabled) when DTMF is received.Alec L Davis
(closes issue #16389) Reported by: alecdavis Tested by: alecdavis Patch dtmf_busydetector.diff.txt uploaded by alecdavis (license 585) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@234897 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-04Merged revisions 233014 via svnmerge from Matthias Nick
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r233014 | mnick | 2009-12-04 09:17:03 -0600 (Fri, 04 Dec 2009) | 11 lines Warning message gets displayed only once Added additional field 'int display_inband_dtmf_warning', which when set to '1' displays the warning ('Inband DTMF is not supported on codec %s. Use RFC2833'), and when set to '0' doesn't display the warning. Otherwise you would get hundreds of warnings every second. (closes issue #15769) Reported by: falves11 Patches: patch_15769_14.txt uploaded by mnick (license 874) Tested by: mnick, falves11 ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04Expand codec bitfield from 32 bits to 64 bits.Tilghman Lesher
Reviewboard: https://reviewboard.asterisk.org/r/416/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227580 65c4cc65-6c06-0410-ace0-fbb531ad65f3