[asterisk-dev] [Code Review]: rfc2833 DTMF detection test replacement for Bamboo

jrose reviewboard at asterisk.org
Mon Jul 25 12:40:41 CDT 2011



> On July 25, 2011, 12:21 p.m., Mark Michelson wrote:
> > While the rewrite to python is all good, the change I disagree with is removing all the SIPp scenarios and replacing them with SendDTMF from the dialplan. Using SIPp, we were able to make sure that we were properly detecting RFC 2833 DTMF both when the DTMF was well-formed and when the DTMF had errors in it. Switching to SendDTMF removes the ability to test that we properly handle malformed RFC 2833 DTMF sequences, which was pretty much the reason this test was originally written.
> 
> Mark Michelson wrote:
>     I should clarify something. When I say "the rewrite to python is all good" I mean that I'm in agreement with doing that as a way of potentially helping the test to pass more often. I haven't looked in-depth at the changes to see if they are actually correct/optimal.

Alrighty, I'll have to take another look later to see about making the test run the SIPp scenarios and also have a look at figuring out what the original test did with malformed RFC 2833 DTMF sequences.  Is there a proper way to invoke SIPp scenarios within Python and the Asterisk test suite or would it be alright to run SIPp using shell commands?

And yeah, I suppose it makes sense that what we are really looking for in this test is what we do with the wrong type of data being sent as DTMF.  This will probably take a decent amount of change.


- jrose


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1329/#review3927
-----------------------------------------------------------


On July 25, 2011, 11:50 a.m., jrose wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1329/
> -----------------------------------------------------------
> 
> (Updated July 25, 2011, 11:50 a.m.)
> 
> 
> Review request for Asterisk Developers and Paul Belanger.
> 
> 
> Summary
> -------
> 
> This is an attempt to replace the rfc2833 dtmf test with a python specific test in order to address the fact that the current test bounces at seemingly random intervals.  This replacement test is based loosely on the sip_tls_call test which for the immediate history of the test has only failed when it was meant to fail.
> 
> This test is also somewhat more verbose than the existing test.
> 
> Adding new strings to the test is fairly simple and requires the following:
> 
> 1.  create a new self.expected_results.append(character_array) in the test class in the appropriate marked section of run-test
> 2.  create an extension using sendDTMF with a string to match that character array in configs/ast1/extensions.conf in the context with the other sendDTMF extensions
> 3.  add the extension to the self.originates array in the test class in run-test
> 
> Note:  If any of my code isn't 'pythonic', just let me know and I'll rewrite it to match those amusing standards.
> 
> As is, this test outright replaces the existing LUA/sipp based rfc2833 dtmf test.  It might perhaps be more ideal to simply add it in as a second test for the same functionality instead.  Or perhaps to put it in as a second test with the intention of killing the other test if this one turns out to be more reliable.
> 
> 
> Diffs
> -----
> 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/configs/ast1/manager.general.conf.inc PRE-CREATION 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/configs/ast1/sip.conf 1790 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/run-test 1790 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/configs/ast1/extensions.conf 1790 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/sipp/broken_dtmf.pcap UNKNOWN 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/sipp/broken_dtmf.xml 1790 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/sipp/dtmf_2833_1.pcap UNKNOWN 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/sipp/dtmf_2833_1_noend.pcap UNKNOWN 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/sipp/dtmf_2833_2.pcap UNKNOWN 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/sipp/dtmf_2833_2_noend.pcap UNKNOWN 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/sipp/dtmf_2833_3.pcap UNKNOWN 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/sipp/dtmf_2833_3_noend.pcap UNKNOWN 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/sipp/dtmf_2833_4.pcap UNKNOWN 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/sipp/dtmf_2833_4_noend.pcap UNKNOWN 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/sipp/dtmf_2833_5.pcap UNKNOWN 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/sipp/dtmf_2833_6.pcap UNKNOWN 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/sipp/dtmf_2833_7.pcap UNKNOWN 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/sipp/dtmf_2833_8.pcap UNKNOWN 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/sipp/dtmf_2833_9.pcap UNKNOWN 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/sipp/dtmf_2833_pound.pcap UNKNOWN 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/sipp/dtmf_2833_star.pcap UNKNOWN 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/sipp/dtmf_baseline.xml 1790 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/sipp/dtmf_noend.xml 1790 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/sipp/register.xml 1790 
>   /asterisk/trunk/tests/rfc2833_dtmf_detect/test.lua 1790 
> 
> Diff: https://reviewboard.asterisk.org/r/1329/diff
> 
> 
> Testing
> -------
> 
> Tested receiving strings that were too short or too long, tested receiving strings with mismatched DTMF values, tested receiving no DTMF at all.  So far it seems pretty robust.  I've probably ran this test 30 times without seeing any unexpected failures on my box, though when things get over to Bamboo, there are more complications to keep in mind than that.
> 
> Example run:
> 
> 
> --> Running test 'tests/rfc2833_dtmf_detect' ...
> 
> Making sure Asterisk isn't running ...
> Running ['tests/rfc2833_dtmf_detect/run-test', '-v', 'SVN-branch-1.8-r329203', '-n', 'tests/rfc2833_dtmf_detect'] ...
> Parsing /tmp/asterisk-testsuite/rfc2833_dtmf_detect/ast1/etc/asterisk/extconfig.conf
> Parsing /tmp/asterisk-testsuite/rfc2833_dtmf_detect/ast1/etc/asterisk/logger.conf
> Parsing /tmp/asterisk-testsuite/rfc2833_dtmf_detect/ast1/etc/asterisk/logger.general.conf.inc
> Parsing /tmp/asterisk-testsuite/rfc2833_dtmf_detect/ast1/etc/asterisk/logger.logfiles.conf.inc
> No handlers could be found for logger "AMI"
> Creating Asterisk instance 1 ...
> Starting Asterisk instance 1 ...
> Executing ['/usr/sbin/asterisk', '-C', '/tmp/asterisk-testsuite/rfc2833_dtmf_detect/ast1/etc/asterisk/asterisk.conf', '-rx', 'core waitfullybooted'] ...
> Asterisk has fully booted.
> Parsing /tmp/asterisk-testsuite/rfc2833_dtmf_detect/ast1/etc/asterisk/extconfig.conf
> Asterisk ending (0).
> Creating AMIFactory 1 ...
> AMI 1 - connected, registering DTMF event...
> 
> Starting Phase 1...
> received: 1234567890*#ABCD
> expected: 1234567890*#ABCD
> Phase 1 passed
> 
> Starting Phase 2...
> received: 8675309***
> expected: 8675309***
> Phase 2 passed
> 
> Starting Phase 3...
> received: 65748392A1B#C*D0
> expected: 65748392A1B#C*D0
> Phase 3 passed
> 
> final phase complete, stopping reactor
> Stopping Asterisk instance 1 ...
> Executing ['/usr/sbin/asterisk', '-C', '/tmp/asterisk-testsuite/rfc2833_dtmf_detect/ast1/etc/asterisk/asterisk.conf', '-rx', 'core stop gracefully'] ...
> 
> rfc2833_dtmf_detect test PASSED. Yay.
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <testsuite errors="0" tests="1" time="26.29" failures="0" name="AsteriskTestSuite">
> 	<testcase time="26.29" name="tests/rfc2833_dtmf_detect"/>
> </testsuite>
> 
> 
> Thanks,
> 
> jrose
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110725/561eace4/attachment-0001.htm>


More information about the asterisk-dev mailing list