diff options
-rw-r--r-- | tests/twisted/sofiatest.py | 6 | ||||
-rw-r--r-- | tests/twisted/voip/voip_test.py | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/tests/twisted/sofiatest.py b/tests/twisted/sofiatest.py index a9ae28d..23142b9 100644 --- a/tests/twisted/sofiatest.py +++ b/tests/twisted/sofiatest.py @@ -33,9 +33,9 @@ class SipProxy(sip.RegisterProxy): def handle_request(self, message, addr): if message.method == 'REGISTER': return sip.RegisterProxy.handle_request(self, message, addr) - elif message.method == 'OPTIONS': - # FIXME: work out why sofiasip keeps sending s:REGISTRATION PROBE - return + elif message.method == 'OPTIONS' and \ + 'REGISTRATION PROBE' == message.headers.get('subject','')[0]: + self.deliverResponse(self.responseFromRequest(200, message)) else: headers = {} for key, values in message.headers.items(): diff --git a/tests/twisted/voip/voip_test.py b/tests/twisted/voip/voip_test.py index 2de6995..0b41828 100644 --- a/tests/twisted/voip/voip_test.py +++ b/tests/twisted/voip/voip_test.py @@ -4,6 +4,8 @@ import uuid import twisted.protocols.sip +from servicetest import assertContains + class VoipTestContext(object): # Default audio codecs for the remote end audio_codecs = [ ('GSM', 3, 8000, {}), @@ -115,7 +117,7 @@ class VoipTestContext(object): def check_call_sdp(self, sdp_string): codec_id_list = [] for name, codec_id, rate, _misc in self.audio_codecs: - assert self._aline_template % locals() in sdp_string + assertContains (self._aline_template % locals(), sdp_string) codec_id_list.append(str(codec_id)) codec_ids = ' '.join(codec_id_list) |