• Matthew Jordan's avatar
    pluggable_modules: Add a pluggable module for verifying audio files · 404501d1
    Matthew Jordan authored
    This patch adds a new class that acts as a pluggable module to the generic
    pluggable modules package, SoundChecker. It will verify a stored audio
    recording created as the result of a test in a variety of ways:
    1) The module will check whether the given sound file exists using a
       predefined path. That path can be created by either explicitly defining a
       filepath or by using a default path that is relative to the current test's
       var/spool/asterisk folder. From there, the user can add extensions to the
       file name to tack on relative folders (monitor/testaudio.wav being an
       example). This check is always performed.
    2) Optionally, the module can check whether the sound file fits within a
       certain size criteria (measured in bytes). A basis size and degree of size
       tolerance are determined by the user. For example, if the size was 500000
       and the tolerance was set to 50000, then the sound file's size would need to
       be somewhere between 450000 and 550000 in order to pass that test.
    3) Optionally, the module can check the sound file's sound energy levels. This
       is done by creating a Local channel that is sent to a dialplan extension.
       That extension should contain a BackgroundDetect application that fits the
       user's specifications. The variable that will be used to pass the sound file
       must be called SOUNDFILE, and a UserEvent must give off the name soundcheck
       in order for the event to be picked up. A sample extension:
    exten => audio,1,Answer()
    same => n,Set(TALK_DETECTED=0)
    same => n,BackgroundDetect(${SOUNDFILE},1,20,,20000)
    same => n,GoToIf($[${TALK_DETECTED}=0]?pass:fail)
    same => n(fail),UserEvent(soundcheck, status: pass)
    same => n,Hangup()
    same => n(pass),UserEvent(soundcheck, status: fail)
    same => n,Hangup()
    A sound-file test only gets called when a specified trigger has gone off. So
    far, this pluggable module only supports AMI events as triggers. The list of
    triggers matches to each instance of a sound-file test on a one-to-one basis
    (the first trigger starts the first test, and so on).
    The module only passes after all tests specified by the user have been passed
    and the correct triggers have been received.
    Review: https://reviewboard.asterisk.org/r/3733
    ASTERISK-24010 #close
    Reported by: Matt Jordan
      pluggableModule.diff uploaded by cwolfe (License 6609)
    git-svn-id: http://svn.digium.com/svn/testsuite/asterisk/trunk@5431 f64d8a5a-fed3-4b5f-9ffa-d34064e55e19
Last commit
Last update
ami-config.yaml.sample Loading commit data...
apptest-config.yaml.sample Loading commit data...
ari-config.yaml.sample Loading commit data...
bridge-config.yaml.sample Loading commit data...
callfiles-config.yaml.sample Loading commit data...
originator-config.yaml.sample Loading commit data...
simpletestcase-config.yaml.sample Loading commit data...
sipptestcase-config.yaml.sample Loading commit data...
sound-check-config.yaml.sample Loading commit data...
test-config.yaml.sample Loading commit data...