summaryrefslogtreecommitdiff
path: root/pjsip-apps/src/test-pjsua/mod_call.py
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-06-26 16:27:17 +0000
committerBenny Prijono <bennylp@teluu.com>2008-06-26 16:27:17 +0000
commitf81d332dac01951c95812f27c028b122e333bab0 (patch)
tree91da56326c3f0684e14a749cb61239eb3c74bd1f /pjsip-apps/src/test-pjsua/mod_call.py
parentcff6c1ad2afd0ad64ee562fa80e078a876b38812 (diff)
Set universal_newlines=False in run.py, and added failed UPDATE scenario in mod_call.py
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2062 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src/test-pjsua/mod_call.py')
-rw-r--r--pjsip-apps/src/test-pjsua/mod_call.py69
1 files changed, 55 insertions, 14 deletions
diff --git a/pjsip-apps/src/test-pjsua/mod_call.py b/pjsip-apps/src/test-pjsua/mod_call.py
index 7e30a837..e123b3e7 100644
--- a/pjsip-apps/src/test-pjsua/mod_call.py
+++ b/pjsip-apps/src/test-pjsua/mod_call.py
@@ -70,7 +70,7 @@ def test_func(t, user_data):
# Hold call by caller
caller.send("H")
- caller.sync_stdout()
+ #caller.sync_stdout()
caller.expect(const.MEDIA_HOLD)
callee.expect(const.MEDIA_HOLD)
@@ -81,9 +81,9 @@ def test_func(t, user_data):
# Release hold
time.sleep(2)
caller.send("v")
- caller.sync_stdout()
- callee.expect(const.MEDIA_ACTIVE)
- caller.expect(const.MEDIA_ACTIVE)
+ #caller.sync_stdout()
+ callee.expect(const.MEDIA_ACTIVE, title="waiting for media active after call hold")
+ caller.expect(const.MEDIA_ACTIVE, title="waiting for media active after call hold")
# Synchronize stdout
caller.sync_stdout()
@@ -99,7 +99,7 @@ def test_func(t, user_data):
# Hold call by callee
callee.send("H")
- callee.sync_stdout()
+ #callee.sync_stdout()
caller.expect(const.MEDIA_HOLD)
callee.expect(const.MEDIA_HOLD)
@@ -110,9 +110,9 @@ def test_func(t, user_data):
# Release hold
time.sleep(2)
callee.send("v")
- callee.sync_stdout()
- caller.expect(const.MEDIA_ACTIVE)
- callee.expect(const.MEDIA_ACTIVE)
+ #callee.sync_stdout()
+ caller.expect(const.MEDIA_ACTIVE, title="waiting for media active after call hold")
+ callee.expect(const.MEDIA_ACTIVE, title="waiting for media active after call hold")
# Synchronize stdout
caller.sync_stdout()
@@ -128,9 +128,9 @@ def test_func(t, user_data):
# UPDATE (by caller)
caller.send("U")
- caller.sync_stdout()
- callee.expect(const.MEDIA_ACTIVE)
- caller.expect(const.MEDIA_ACTIVE)
+ #caller.sync_stdout()
+ callee.expect(const.MEDIA_ACTIVE, title="waiting for media active with UPDATE")
+ caller.expect(const.MEDIA_ACTIVE, title="waiting for media active with UPDATE")
# Synchronize stdout
caller.sync_stdout()
@@ -143,9 +143,9 @@ def test_func(t, user_data):
# UPDATE (by callee)
callee.send("U")
- callee.sync_stdout()
- caller.expect(const.MEDIA_ACTIVE)
- callee.expect(const.MEDIA_ACTIVE)
+ #callee.sync_stdout()
+ caller.expect(const.MEDIA_ACTIVE, title="waiting for media active with UPDATE")
+ callee.expect(const.MEDIA_ACTIVE, title="waiting for media active with UPDATE")
# Synchronize stdout
caller.sync_stdout()
@@ -156,6 +156,47 @@ def test_func(t, user_data):
check_media(caller, callee)
check_media(callee, caller)
+ # Synchronize stdout
+ caller.sync_stdout()
+ callee.sync_stdout()
+
+ # Set codecs in both caller and callee so that there is
+ # no common codec between them.
+ # In caller we only enable PCMU, in callee we only enable PCMA
+ caller.send("Cp")
+ caller.send("* 0")
+ caller.send("Cp")
+ caller.send("pcmu 120")
+
+ callee.send("Cp")
+ callee.send("* 0")
+ callee.send("Cp")
+ callee.send("pcma 120")
+
+ # Test when UPDATE fails (by callee)
+ callee.send("U")
+ caller.expect("SIP/2.0 488")
+ callee.expect("SIP/2.0 488")
+ callee.sync_stdout()
+ caller.sync_stdout()
+
+ # Test that media is still okay
+ time.sleep(2)
+ check_media(caller, callee)
+ check_media(callee, caller)
+
+ # Test when UPDATE fails (by caller)
+ caller.send("U")
+ callee.expect("SIP/2.0 488")
+ caller.expect("SIP/2.0 488")
+ caller.sync_stdout()
+ callee.sync_stdout()
+
+ # Test that media is still okay
+ time.sleep(2)
+ check_media(callee, caller)
+ check_media(caller, callee)
+
# Hangup call
time.sleep(1)
caller.send("h")