summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2012-06-26 06:29:53 +0000
committerNanang Izzuddin <nanang@teluu.com>2012-06-26 06:29:53 +0000
commit959ba9df8ca588924ad8c6485607e3c6614e77c3 (patch)
treec21068ba9d8f69df943da83946329f6c045f45c1 /tests
parentfe6325e5fb8839a3a8624941a3c898e2d13edd4a (diff)
Re #1523: added sipp scenario for call transfer (attended & unattended).
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4178 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'tests')
-rw-r--r--tests/pjsua/scripts-sipp/transfer-attended.py51
-rw-r--r--tests/pjsua/scripts-sipp/transfer-attended.xml26
-rw-r--r--tests/pjsua/scripts-sipp/transfer-unattended.py30
-rw-r--r--tests/pjsua/scripts-sipp/transfer-unattended.xml26
4 files changed, 133 insertions, 0 deletions
diff --git a/tests/pjsua/scripts-sipp/transfer-attended.py b/tests/pjsua/scripts-sipp/transfer-attended.py
new file mode 100644
index 00000000..2cd6ddef
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/transfer-attended.py
@@ -0,0 +1,51 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio", # UA0 @ port 5060
+ "--null-audio", # UA1 @ port 5062
+ "--null-audio" # UA2 @ port 5064
+ ]
+
+PJSUA_EXPECTS = [
+ # A calls B
+ [0, "", "m"],
+ [0, "", "sip:localhost:5062"],
+ [1, const.EVENT_INCOMING_CALL, "a"],
+ [1, "", "200"],
+ [0, const.STATE_CONFIRMED, ""],
+ [1, const.STATE_CONFIRMED, ""],
+
+ # B holds A
+ [1, "", "H"],
+ [0, const.MEDIA_HOLD, ""],
+ [1, const.MEDIA_HOLD, ""],
+
+ # B calls C
+ [1, "", "m"],
+ [1, "", "sip:localhost:5064"],
+ [2, const.EVENT_INCOMING_CALL, "a"],
+ [2, "", "200"],
+ [1, const.STATE_CONFIRMED, ""],
+ [2, const.STATE_CONFIRMED, ""],
+
+ # B holds C
+ [1, "", "]"],
+ [1, "", "H"],
+ [2, const.MEDIA_HOLD, ""],
+ [1, const.MEDIA_HOLD, ""],
+ [1, "", "]"],
+
+ # B transfer A to C
+ [1, "", "X"],
+ [1, "", "1"],
+ [0, "Call .* is being transfered", ""],
+ [1, "Subscription state .* ACCEPTED", ""],
+ [0, const.STATE_CALLING, ""],
+ [2, "Call .* is being replaced", ""],
+ [1, "call transfered successfully", ""],
+ [0, const.MEDIA_ACTIVE, ""],
+ [2, const.MEDIA_ACTIVE, ""],
+ [1, "", " "],
+ [1, "have 0 active call", ""],
+ ]
diff --git a/tests/pjsua/scripts-sipp/transfer-attended.xml b/tests/pjsua/scripts-sipp/transfer-attended.xml
new file mode 100644
index 00000000..bd184d22
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/transfer-attended.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Dummy scenario for call transfer">
+
+ <send retrans="500">
+ <![CDATA[
+
+ OPTIONS sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
+ To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
+ Call-ID: [call_id]
+ Max-Forwards: 70
+ CSeq: 1 OPTIONS
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="200">
+ </recv>
+
+ <pause milliseconds="1000"/>
+
+</scenario>
diff --git a/tests/pjsua/scripts-sipp/transfer-unattended.py b/tests/pjsua/scripts-sipp/transfer-unattended.py
new file mode 100644
index 00000000..da404426
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/transfer-unattended.py
@@ -0,0 +1,30 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio", # UA0 @ port 5060
+ "--null-audio", # UA1 @ port 5062
+ "--null-audio" # UA2 @ port 5064
+ ]
+
+PJSUA_EXPECTS = [
+ # A calls B
+ [0, "", "m"],
+ [0, "", "sip:localhost:5062"],
+ [1, const.EVENT_INCOMING_CALL, "a"],
+ [1, "", "200"],
+ [0, const.STATE_CONFIRMED, ""],
+ [1, const.STATE_CONFIRMED, ""],
+
+ # B transfer A to C
+ [1, "", "x"],
+ [1, "", "sip:localhost:5064"],
+ [0, const.STATE_CALLING, ""],
+ [2, const.EVENT_INCOMING_CALL, "a"],
+ [2, "", "200"],
+ [0, const.MEDIA_ACTIVE, ""],
+ [2, const.MEDIA_ACTIVE, ""],
+ [1, "call transfered successfully", ""],
+ [1, "", " "],
+ [1, "have 0 active call", ""],
+ ]
diff --git a/tests/pjsua/scripts-sipp/transfer-unattended.xml b/tests/pjsua/scripts-sipp/transfer-unattended.xml
new file mode 100644
index 00000000..bd184d22
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/transfer-unattended.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Dummy scenario for call transfer">
+
+ <send retrans="500">
+ <![CDATA[
+
+ OPTIONS sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
+ To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
+ Call-ID: [call_id]
+ Max-Forwards: 70
+ CSeq: 1 OPTIONS
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="200">
+ </recv>
+
+ <pause milliseconds="1000"/>
+
+</scenario>