Hello Matthew,<div><br></div><div>I am not sure if you understoood my problem. I would like to explain it again and hopefully it will clear up any confusion if there is any;</div><div><br></div><div>"This is a kind of race condition. I understand that SIPPTest launches the SIPP scenarios as soon as it detects that Asterisk has started. But after asterisk is started, it takes some time to load all the</div>
<div>modules. I believe that SIPPTest should wait for asterisk to fully load all the modules before it spawns the SIPP scenarios, because i don't see any point in initiating a call with asterisk if asterisk has not</div>
<div>yet loaded the dialplan. "</div><div><br></div><div>Awaiting your feedback.</div><div><br></div><div>Regards,</div><div>Nitesh Bansal</div><div><br></div><div><br><br><div class="gmail_quote">On Thu, Oct 4, 2012 at 3:33 PM, Matthew Jordan <span dir="ltr"><<a href="mailto:mjordan@digium.com" target="_blank">mjordan@digium.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 10/04/2012 04:37 AM, nitesh bansal wrote:<br>
> Hello All,<br>
><br>
> I am using SIPPTest class to write my own test cases in the asterisk<br>
> testsuite. In most of the cases, run-test looks as follows<br>
><br>
> <<<<<<<br>
><br>
> SIPP_SCENARIOS = [<br>
> {'scenario' : 'uas.xml',},<br>
> {'scenario' : 'uac.xml',},<br>
><br>
> ]<br>
><br>
><br>
> def main():<br>
> test = SIPpTest(WORKING_DIR, TEST_DIR, SIPP_SCENARIOS)<br>
> reactor.run()<br>
> if not test.passed:<br>
> return 1<br>
><br>
> return 0<br>
><br>
>>>>>>><br>
><br>
> All of my cases need Asterisk to go to the diaplan, but i have observed<br>
> that somtimes, my SIPP test cases start running before asterisk has even<br>
> loaded the dialplan, which causes testcas to fail.<br>
><br>
> Is there any work around for this situation.<br>
<br>
</div></div>The SIPpTest class automatically starts the SIPp scenarios when it<br>
detects Asterisk has started. This works well when you have SIPp<br>
scenarios acting as a UAC that do not need to wait on a condition in<br>
Asterisk to start. Many SIP scenarios fall into that category. The<br>
SIPpTest class was written to accommodate those scenarios specifically.<br>
<br>
If, however, you have a scenario where you need to initiate something in<br>
Asterisk prior to starting the SIPp scenario, then the SIPpTest class is<br>
probably not appropriate. In that case, you may want to write a test<br>
that utilizes a SIPp scenario in the framework of a "regular" TestCase<br>
derived test. You can use one of the following:<br>
<br>
* SIPpScenario - manages a single SIPp instance. This class provides<br>
methods to control the SIPp instance, and to report on the<br>
success/failure of the scenario.<br>
<br>
* SIPpScenarioSequence - manage a sequential sequence of SIPpScenario<br>
executions. This is useful when you have multiple SIPp scenarios that<br>
have slight differences in behavior.<br>
<br>
There are a number of tests in the Test Suite that make use of these<br>
classes - you may want to look at any of the following tests for examples:<br>
* info_dtmf<br>
* SDP_attribute_passthrough<br>
* sip_hold<br>
* Any of the sip_custom_presence tests<br>
<br>
As an aside, if you ever do find yourself only needing the functionality<br>
exposed by SIPpTest, the capability to define the test completely in<br>
YAML was added to the Test Suite relatively recently. The<br>
channels/SIP/subscribe test demonstrates how to write such a test.<br>
<br>
--<br>
Matthew Jordan<br>
Digium, Inc. | Engineering Manager<br>
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA<br>
Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> & <a href="http://asterisk.org" target="_blank">http://asterisk.org</a><br>
<br>
<br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br>
</blockquote></div><br></div>