mojolingo / sippy_cup

Create SIP load test scenarios the easy way
http://mojolingo.github.io/sippy_cup
MIT License
218 stars 78 forks source link

[FEATURE] Split receive_200 into its own method #61

Closed chewi closed 10 years ago

chewi commented 10 years ago

It was an alias of receive_answer but receive_answer also stores the record set and the response time duration, which you probably don't want to do on every 200 received. Also simplify wait_for_answer and fix the documentation, which stated that these expectations are optional by default when they are not.

A couple of other noteworthy points...

Should send_bye automatically call receive_200? Under normal circumstances, a 200 should always be expected but perhaps someone would want to use Sippy Cup to test abnormal circumstances. Or maybe such a user should be expected to drop back to raw SIPp. I did include okay in my new receive_message method and recv response: 200 in my new send_dtmf INFO stuff, although the latter really is necessary because it has to be done after every single digit.

The rtd stuff in receive_answer doesn't really do anything at present because we're not setting start_rtd anywhere. These timers can also be used for more than just answering. Greater control over this would be nice.

benlangfeld commented 10 years ago

Can I get a changelog entry for this also, please?

chewi commented 10 years ago

D'oh. You'd think I would have remembered this time...

bklang commented 10 years ago

Should send_bye automatically call receive_200? Under normal circumstances, a 200 should always be expected but perhaps someone would want to use Sippy Cup to test abnormal circumstances.

Helper methods like send_bye are intended to be conveniences that set up common expectations. If you are testing something abnormal, then you should use lower-level document items. We should probably rename send_bye to hangup or similar, so that send_bye can be only for sending an actual BYE.