summaryrefslogtreecommitdiff
path: root/pjsip-apps/src/test-pjsua/mod_recvfrom.py
diff options
context:
space:
mode:
Diffstat (limited to 'pjsip-apps/src/test-pjsua/mod_recvfrom.py')
-rw-r--r--pjsip-apps/src/test-pjsua/mod_recvfrom.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/pjsip-apps/src/test-pjsua/mod_recvfrom.py b/pjsip-apps/src/test-pjsua/mod_recvfrom.py
index 259083f5..1510aed1 100644
--- a/pjsip-apps/src/test-pjsua/mod_recvfrom.py
+++ b/pjsip-apps/src/test-pjsua/mod_recvfrom.py
@@ -1,4 +1,4 @@
-# $Id:$
+# $Id$
import imp
import sys
import inc_sip as sip
@@ -67,15 +67,17 @@ def test_func(test):
tname = ""
raise TestError("Excluded pattern " + pat + " found" + tname)
# Create response
- response = dlg.create_response(request, t.resp_code, "Status reason")
- # Add headers to response
- for h in t.resp_hdr:
- response = response + h + "\r\n"
- # Add message body if required
- if t.body:
- response = response + t.body
- # Send response
- dlg.send_msg(response, src_addr)
+ if t.resp_code!=0:
+ response = dlg.create_response(request, t.resp_code, "Status reason")
+ # Add headers to response
+ for h in t.resp_hdr:
+ response = response + h + "\r\n"
+ # Add message body if required
+ if t.body:
+ response = response + t.body
+ # Send response
+ dlg.send_msg(response, src_addr)
+
# Expect something to happen in pjsua
if t.expect != "":
pjsua.expect(t.expect)