Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
f571af20
Commit
f571af20
authored
14 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#4233] Test for call on/off hold
parent
69933253
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
sflphone-common/test/sippxml/test_3.xml
+187
-0
187 additions, 0 deletions
sflphone-common/test/sippxml/test_3.xml
sflphone-common/test/siptest.cpp
+41
-0
41 additions, 0 deletions
sflphone-common/test/siptest.cpp
sflphone-common/test/siptest.h
+4
-1
4 additions, 1 deletion
sflphone-common/test/siptest.h
with
232 additions
and
1 deletion
sflphone-common/test/sippxml/test_3.xml
0 → 100644
+
187
−
0
View file @
f571af20
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<scenario
name=
"UAS HOLD/OFFHOLD"
>
<!-- Receive a new call -->
<recv
request=
"INVITE"
crlf=
"true"
>
<action>
<ereg
regexp=
"sendrecv"
search_in=
"body"
check_it=
"true"
assign_to=
"1"
/>
<log
message=
"Media is [$1]"
/>
</action>
</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"
optional=
"true"
rtd=
"true"
crlf=
"true"
>
</recv>
<!-- This call is now on HOLD: sendonly tell to PBX to send music on hold-->
<recv
request=
"INVITE"
crlf=
"true"
>
<action>
<ereg
regexp=
"sendonly"
search_in=
"body"
check_it=
"true"
assign_to=
"2"
/>
<log
message=
"Media is [$2]"
/>
</action>
</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"
optional=
"true"
rtd=
"true"
crlf=
"true"
>
</recv>
<!-- OFFHOLD this call -->
<recv
request=
"INVITE"
crlf=
"true"
>
<action>
<ereg
regexp=
"sendrecv"
search_in=
"body"
check_it=
"true"
assign_to=
"3"
/>
<log
message=
"Media is [$3]"
/>
</action>
</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"
optional=
"true"
rtd=
"true"
crlf=
"true"
>
</recv>
<!-- Hangup this call -->
<recv
request=
"BYE"
>
</recv>
<send>
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>
<pause
milliseconds=
"4000"
/>
<ResponseTimeRepartition
value=
"10, 20, 30, 40, 50, 100, 150, 200"
/>
<CallLengthRepartition
value=
"10, 50, 100, 500, 1000, 5000, 10000"
/>
</scenario>
This diff is collapsed.
Click to expand it.
sflphone-common/test/siptest.cpp
+
41
−
0
View file @
f571af20
...
...
@@ -320,3 +320,44 @@ void SIPTest::testTwoIncomingIpCall ()
}
void
SIPTest
::
testHoldIpCall
()
{
pthread_t
callThread
;
void
*
status
;
// pthread_attr_t attr;
// pthread_attr_init(&attr);
// pthreaq_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
std
::
string
callCommand
(
"sipp -sf sippxml/test_3.xml -i 127.0.0.1 -p 5062 -m 1"
);
/*
int rc = pthread_create(&callThread, NULL, sippThread, (void *)(&callCommand));
if(rc) {
std::cout << "SIPTest: ERROR; return code from pthread_create(): " << rc << std::endl;
}
else
std::cout << "SIPTest: completed thread creation" << std::endl;
*/
std
::
string
testAccount
(
"IP2IP"
);
std
::
string
testCallID
(
"callid1234"
);
std
::
string
testCallNumber
(
"sip:test@127.0.0.1:5062"
);
Manager
::
instance
().
outgoingCall
(
testAccount
,
testCallID
,
testCallNumber
);
sleep
(
1
);
Manager
::
instance
().
onHoldCall
(
testCallID
);
sleep
(
1
);
Manager
::
instance
().
offHoldCall
(
testCallID
);
sleep
(
1
);
Manager
::
instance
().
hangupCall
(
testCallID
);
}
This diff is collapsed.
Click to expand it.
sflphone-common/test/siptest.h
+
4
−
1
View file @
f571af20
...
...
@@ -55,8 +55,9 @@ class SIPTest : public CppUnit::TestCase {
CPPUNIT_TEST_SUITE
(
SIPTest
);
CPPUNIT_TEST
(
testSimpleOutgoingIpCall
);
CPPUNIT_TEST
(
testSimpleIncomingIpCall
);
CPPUNIT_TEST
(
testTwoOutgoingIpCall
);
//
CPPUNIT_TEST ( testTwoOutgoingIpCall );
// CPPUNIT_TEST ( testTwoIncomingIpCall );
// CPPUNIT_TEST ( testHoldIpCall);
CPPUNIT_TEST_SUITE_END
();
public:
...
...
@@ -83,6 +84,8 @@ class SIPTest : public CppUnit::TestCase {
void
testTwoIncomingIpCall
(
void
);
void
testHoldIpCall
(
void
);
private
:
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment