Skip to content
Snippets Groups Projects
Commit 5a462a74 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#2536] Test transfer calling using sipp

parent 658b7c0e
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<!-- This program is free software; you can redistribute it and/or -->
<!-- modify it under the terms of the GNU General Public License as -->
<!-- published by the Free Software Foundation; either version 2 of the -->
<!-- License, or (at your option) any later version. -->
<!-- -->
<!-- This program is distributed in the hope that it will be useful, -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
<!-- GNU General Public License for more details. -->
<!-- -->
<!-- You should have received a copy of the GNU General Public License -->
<!-- along with this program; if not, write to the -->
<!-- Free Software Foundation, Inc., -->
<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
<scenario name="accountcall_client">
<recv request="INVITE">
</recv>
<send>
<![CDATA[
SIP/2.0 180 Ringing
[last_Via:]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>
<send retrans="500">
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Type: application/sdp
Content-Length: [len]
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [media_port] RTP/AVP 0
a=rtpmap:0 PCMU/8000
]]>
</send>
<recv request="ACK">
</recv>
<recv request="INVITE">
</recv>
<pause milliseconds="200">
</recv>
<send retrans="500">
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Type: application/sdp
Content-Length: [len]
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [media_port] RTP/AVP 0
a=rtpmap:0 PCMU/8000
]]>
</send>
<recv request="ACK">
</recv>
</scenario>
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<!-- This program is free software; you can redistribute it and/or -->
<!-- modify it under the terms of the GNU General Public License as -->
<!-- published by the Free Software Foundation; either version 2 of the -->
<!-- License, or (at your option) any later version. -->
<!-- -->
<!-- This program is distributed in the hope that it will be useful, -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
<!-- GNU General Public License for more details. -->
<!-- -->
<!-- You should have received a copy of the GNU General Public License -->
<!-- along with this program; if not, write to the -->
<!-- Free Software Foundation, Inc., -->
<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
<scenario name="accountcall_client">
<recv request="INVITE">
</recv>
<send>
<![CDATA[
SIP/2.0 180 Ringing
[last_Via:]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>
<send retrans="500">
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Type: application/sdp
Content-Length: [len]
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [media_port] RTP/AVP 0
a=rtpmap:0 PCMU/8000
]]>
</send>
<recv request="ACK">
</recv>
<recv request="INVITE">
</recv>
<pause milliseconds="200">
</recv>
<send retrans="500">
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Type: application/sdp
Content-Length: [len]
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [media_port] RTP/AVP 0
a=rtpmap:0 PCMU/8000
]]>
</send>
<recv request="ACK">
</recv>
<!--
<recv request="BYE">
</recv>
<send retrans="500">
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Type: application/sdp
Content-Length: [len]
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [media_port] RTP/AVP 0
a=rtpmap:0 PCMU/8000
]]>
</send>
-->
</scenario>
SERVERPORT=5064
sipp -sf account_uas_register_bis.xml 192.168.50.79 -i 192.168.50.182 -p ${SERVERPORT} -l 1 -m 1
sipp -sf account_uas_receive_transfer.xml 192.168.50.79 -i 192.168.50.182 -p ${SERVERPORT} -l 1
\ No newline at end of file
......@@ -3,6 +3,7 @@
SERVERPORT=5062
# SCENARIO 1 Test 1
function test_ip2ip_send_hangup {
# start sipp server to receive calls from sflphone
......@@ -21,6 +22,7 @@ function test_ip2ip_send_hangup {
# bashtrap
}
# SCENARIO 1 Test 2
function test_ip2ip_send_peer_hungup {
# start sipp server to receive calls from sflphone and then hangup
......@@ -40,6 +42,7 @@ function test_ip2ip_send_peer_hungup {
}
# SCENARIO 1 Test 3
function test_ip2ip_recv_hangup {
# start sflphoned
......@@ -60,6 +63,8 @@ function test_ip2ip_recv_hangup {
# bashtrap
}
# SCENARIO 1 Test 4
function test_ip2ip_recv_peer_hungup {
# start sflphoned
......@@ -80,6 +85,7 @@ function test_ip2ip_recv_peer_hungup {
# bashtrap
}
# SCENARIO 2 Test 1
function test_account_send_hangup {
# start sflphoned
......@@ -103,6 +109,7 @@ function test_account_send_hangup {
# bashtrap
}
# SCENARIO 2 Test 2
function test_account_send_peer_hungup {
# start sflphoned
......@@ -126,6 +133,7 @@ function test_account_send_peer_hungup {
# bashtrap
}
# SCENARIO 2 Test 3
function test_account_recv_hangup {
# start sflphoned
......@@ -149,6 +157,7 @@ function test_account_recv_hangup {
# bashtrap
}
# SCENARIO 2 Test 4
function test_account_recv_peer_hungup {
# start sflphoned
......@@ -172,7 +181,7 @@ function test_account_recv_peer_hungup {
# bashtrap
}
# SCENARIO 3 Test 1
function test_ip2ip_send_hold_offhold {
# start sflphoned
......@@ -192,6 +201,30 @@ function test_ip2ip_send_hold_offhold {
# bashtrap
}
# SCENARIO 4 Test 1
function test_account_send_transfer {
# start sflphoned
# /usr/lib/sflphone/sflphoned&
# wait some time to make sure sflphoned is started
# sleep 1;
# python ../tools/pysflphone/pysflphone_testdbus.py &
# wait some time to make sure client is bound
# sleep 1;
# process only one registration
sipp -sf account_uas_register.xml 192.168.50.79 -i 192.168.50.182 -p ${SERVERPORT} -l 1 -m 1
# start sipp client and send calls
sipp -sf account_uas_recv_transfered.xml 192.168.50.79 -i 192.168.50.182 -p ${SERVERPORT} -l 1
# kill every one
# bashtrap
}
# function called if CTRL-C detected
bashtrap()
......@@ -215,5 +248,8 @@ bashtrap()
# test_account_recv_hangup
# test_account_recv_peer_hungup
# SCENARIO 3: Hold/offHoldcalls (Account)
test_ip2ip_send_hold_offhold
\ No newline at end of file
# SCENARIO 3: Hold/offHold calls (Account)
# test_ip2ip_send_hold_offhold
# SCENARIO 4: Transfer calls (Account)
test_account_send_transfer
\ No newline at end of file
......@@ -125,7 +125,7 @@ class SflPhoneTests():
def test_account_send_hangup(self):
"""Send new account call, hangup once peer answered"""
print "test account send hangup"
i = 0
while(i < 1):
......@@ -142,7 +142,7 @@ class SflPhoneTests():
def test_account_send_peer_hungup(self):
"""Send new account call, hangup once peer answered"""
print "test account send hangup"
i = 0
while(i < 10):
......@@ -196,6 +196,23 @@ class SflPhoneTests():
del self.sflphone
def test_account_send_transfer(self):
"""Send new calls, transfer it to a new instance"""
i = 0
while(i < 1):
callid = self.sflphone.Call("27182")
time.sleep(1.0)
self.sflphone.Transfer(callid,"14142")
# self.sflphone.HangUp(callid)
# time.sleep(1.0)
i = i+1
# Open sflphone and connect to sflphoned through dbus
sflphone = SflPhoneCtrlSimple(True)
......@@ -251,4 +268,12 @@ sflphone.setFirstRegisteredAccount();
# - Put this call on HOLD
# - Off HOLD this call
# - Hangup
testsuite.test_ip2ip_send_hold_offhold()
# testsuite.test_ip2ip_send_hold_offhold()
# SCENARIO 4: IP2IP Call, HOLD/OFFHOLD
# Test 1: - Send an IP2IP call
# - Transfer this call to another sipp instance
# - Hangup
testsuite.test_account_send_transfer()
......@@ -518,13 +518,13 @@ class SflPhoneCtrlSimple(Thread):
self.callmanager.hangUp(callid)
def Transfert(self, callid, to):
def Transfer(self, callid, to):
"""Transfert a call identified by a CallID"""
if not self.account:
self.setFirstRegisteredAccount()
# if not self.account:
# self.setFirstRegisteredAccount()
if not self.isAccountRegistered():
raise SflPhoneError("Can't transfert a call without a registered account")
# if not self.isAccountRegistered():
# raise SflPhoneError("Can't transfert a call without a registered account")
if callid is None or callid == "":
raise SflPhoneError("Invalid callID")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment