summaryrefslogtreecommitdiff
path: root/pjsip-apps
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-06-12 18:10:22 +0000
committerBenny Prijono <bennylp@teluu.com>2008-06-12 18:10:22 +0000
commit1f539f89c3358b65779097192c62b2fb978f08fb (patch)
tree57782085deabb985cd4ae8131bcfe25a9714bbba /pjsip-apps
parentaf91fd098d9302c4f910ede61b87844f352d1a21 (diff)
More ticket #543: added SRTP negotiation tests
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2012 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps')
-rw-r--r--pjsip-apps/src/test-pjsua/mod_call.py65
-rw-r--r--pjsip-apps/src/test-pjsua/scripts-call/150_srtp_1_2.py10
-rw-r--r--pjsip-apps/src/test-pjsua/scripts-call/150_srtp_2_1.py10
-rw-r--r--pjsip-apps/src/test-pjsua/scripts-call/150_srtp_2_2.py10
4 files changed, 92 insertions, 3 deletions
diff --git a/pjsip-apps/src/test-pjsua/mod_call.py b/pjsip-apps/src/test-pjsua/mod_call.py
index 2cd81951..b047f071 100644
--- a/pjsip-apps/src/test-pjsua/mod_call.py
+++ b/pjsip-apps/src/test-pjsua/mod_call.py
@@ -50,8 +50,22 @@ def test_func(t):
raise TestError("Call failed")
caller.expect(const.STATE_CONFIRMED)
- # Hold call
+ # Synchronize stdout
+ caller.send("echo 1")
+ caller.expect("echo 1")
+ callee.send("echo 1")
+ callee.expect("echo 1")
+
+ # Test that media is okay (with RFC 2833 DTMF)
time.sleep(2)
+ caller.send("#")
+ caller.send("1122")
+ callee.expect(const.RX_DTMF + "1")
+ callee.expect(const.RX_DTMF + "1")
+ callee.expect(const.RX_DTMF + "2")
+ callee.expect(const.RX_DTMF + "2")
+
+ # Hold call
caller.send("H")
caller.expect(const.MEDIA_HOLD)
callee.expect(const.MEDIA_HOLD)
@@ -62,13 +76,58 @@ def test_func(t):
caller.expect(const.MEDIA_ACTIVE)
callee.expect(const.MEDIA_ACTIVE)
- # UPDATE
+ # Synchronize stdout
+ caller.send("echo 1")
+ caller.expect("echo 1")
+ callee.send("echo 1")
+ callee.expect("echo 1")
+
+ # Test that media is okay (with RFC 2833 DTMF)
+ caller.send("#")
+ caller.send("1122")
+ callee.expect(const.RX_DTMF + "1")
+ callee.expect(const.RX_DTMF + "1")
+ callee.expect(const.RX_DTMF + "2")
+ callee.expect(const.RX_DTMF + "2")
+
+ # Synchronize stdout
+ caller.send("echo 1")
+ caller.expect("echo 1")
+ callee.send("echo 1")
+ callee.expect("echo 1")
+
+ # UPDATE (by caller)
+ caller.send("U")
+ caller.expect(const.MEDIA_ACTIVE)
+ callee.expect(const.MEDIA_ACTIVE)
+
+ # Synchronize stdout
+ caller.send("echo 1")
+ caller.expect("echo 1")
+ callee.send("echo 1")
+ callee.expect("echo 1")
+
+ # Test that media is okay (with RFC 2833 DTMF)
time.sleep(2)
+ caller.send("#")
+ caller.send("1122")
+ callee.expect(const.RX_DTMF + "1")
+ callee.expect(const.RX_DTMF + "1")
+ callee.expect(const.RX_DTMF + "2")
+ callee.expect(const.RX_DTMF + "2")
+
+ # UPDATE (by callee)
callee.send("U")
callee.expect(const.MEDIA_ACTIVE)
caller.expect(const.MEDIA_ACTIVE)
- # Send DTMF
+ # Synchronize stdout
+ caller.send("echo 1")
+ caller.expect("echo 1")
+ callee.send("echo 1")
+ callee.expect("echo 1")
+
+ # Test that media is okay (with RFC 2833 DTMF)
time.sleep(2)
caller.send("#")
caller.send("1122")
diff --git a/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_1_2.py b/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_1_2.py
new file mode 100644
index 00000000..7752293b
--- /dev/null
+++ b/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_1_2.py
@@ -0,0 +1,10 @@
+# $Id$
+#
+import inc_cfg
+
+# Simple call
+config = inc_cfg.CallConfig(
+ title = "Callee=optional SRTP, caller=mandatory SRTP",
+ callee_cfg = inc_cfg.Config(arg="--null-audio --use-srtp=1 --srtp-secure=0"),
+ caller_cfg = inc_cfg.Config(arg="--null-audio --use-srtp=2 --srtp-secure=0")
+ )
diff --git a/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_2_1.py b/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_2_1.py
new file mode 100644
index 00000000..8c46b939
--- /dev/null
+++ b/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_2_1.py
@@ -0,0 +1,10 @@
+# $Id$
+#
+import inc_cfg
+
+# Simple call
+config = inc_cfg.CallConfig(
+ title = "Callee=mandatory SRTP, caller=optional SRTP",
+ callee_cfg = inc_cfg.Config(arg="--null-audio --use-srtp=2 --srtp-secure=0"),
+ caller_cfg = inc_cfg.Config(arg="--null-audio --use-srtp=1 --srtp-secure=0")
+ )
diff --git a/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_2_2.py b/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_2_2.py
new file mode 100644
index 00000000..b03978d9
--- /dev/null
+++ b/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_2_2.py
@@ -0,0 +1,10 @@
+# $Id$
+#
+import inc_cfg
+
+# Simple call
+config = inc_cfg.CallConfig(
+ title = "Callee=mandatory SRTP, caller=mandatory SRTP",
+ callee_cfg = inc_cfg.Config(arg="--null-audio --use-srtp=2 --srtp-secure=0"),
+ caller_cfg = inc_cfg.Config(arg="--null-audio --use-srtp=2 --srtp-secure=0")
+ )