From 1f539f89c3358b65779097192c62b2fb978f08fb Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Thu, 12 Jun 2008 18:10:22 +0000 Subject: More ticket #543: added SRTP negotiation tests git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2012 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip-apps/src/test-pjsua/mod_call.py | 65 +++++++++++++++++++++- .../src/test-pjsua/scripts-call/150_srtp_1_2.py | 10 ++++ .../src/test-pjsua/scripts-call/150_srtp_2_1.py | 10 ++++ .../src/test-pjsua/scripts-call/150_srtp_2_2.py | 10 ++++ 4 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 pjsip-apps/src/test-pjsua/scripts-call/150_srtp_1_2.py create mode 100644 pjsip-apps/src/test-pjsua/scripts-call/150_srtp_2_1.py create mode 100644 pjsip-apps/src/test-pjsua/scripts-call/150_srtp_2_2.py (limited to 'pjsip-apps') 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") + ) -- cgit v1.2.3