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
54187dd7
Commit
54187dd7
authored
14 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#4233]
parent
b1f6ef09
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
sflphone-common/test/sflphoned-sample.yml
+2
-2
2 additions, 2 deletions
sflphone-common/test/sflphoned-sample.yml
sflphone-common/test/siptest.cpp
+40
-15
40 additions, 15 deletions
sflphone-common/test/siptest.cpp
sflphone-common/test/siptest.h
+6
-3
6 additions, 3 deletions
sflphone-common/test/siptest.h
with
48 additions
and
20 deletions
sflphone-common/test/sflphoned-sample.yml
+
2
−
2
View file @
54187dd7
...
...
@@ -11,7 +11,7 @@ accounts:
hostname
:
id
:
IP2IP
interface
:
default
mailbox
:
97
mailbox
:
password
:
port
:
5060
publishAddr
:
...
...
@@ -54,7 +54,7 @@ preferences:
historyMaxCalls
:
20
md5Hash
:
false
notifyMails
:
false
order
:
Account:1285624877/Account:1285265589/Account:1285257971/Account:1285253592/Account:1285252571/Account:1285251984/Account:1285251811/Account:1285251597/Account:1285192081/Account:1285184087/Account:1285182355/
order
:
portNum
:
5060
registrationExpire
:
180
searchBarDisplay
:
true
...
...
This diff is collapsed.
Click to expand it.
sflphone-common/test/siptest.cpp
+
40
−
15
View file @
54187dd7
...
...
@@ -248,17 +248,19 @@ void SIPTest::testTwoOutgoingIpCall ()
std
::
cout
<<
"SIPTest: completed join with thread"
<<
std
::
endl
;
}
/*
void
SIPTest
::
testTwoIncomingIpCall
()
{
pthread_t
thet
hread;
pthread_t
firstCallThread
,
secondCallT
hread
;
void
*
status
;
// the first call is supposed to be put on hold when answering teh second incoming call
std
::
string
firstCallCommand
(
"sipp -sf sippxml/test_2.xml 127.0.0.1 -i 127.0.0.1 -p 5064 -m 1"
);
// command to be executed by the thread, user agent client which initiate a call and hangup
std::string
c
ommand("sipp -sn uac 127.0.0.1 -i 127.0.0.1 -p 5062 -m 1");
std
::
string
secondCallC
ommand
(
"sipp -sn uac 127.0.0.1 -i 127.0.0.1 -p 5062 -m 1
-d 1000
"
);
int rc = pthread_create(&
thet
hread, NULL, sippThread, (void *)(&
c
ommand));
int
rc
=
pthread_create
(
&
firstCallT
hread
,
NULL
,
sippThread
,
(
void
*
)(
&
firstCallC
ommand
));
if
(
rc
)
{
std
::
cout
<<
"SIPTest: ERROR; return code from pthread_create()"
<<
std
::
endl
;
}
...
...
@@ -269,26 +271,49 @@ void SIPTest::testTwoIncomingIpCall ()
sleep
(
2
);
// gtrab call id from sipvoiplink
SIPVoIPLink *sip
l
ink = SIPVoIPLink::instance ("");
SIPVoIPLink
*
sip
L
ink
=
SIPVoIPLink
::
instance
(
""
);
CPPUNIT_ASSERT(siplink->_callMap.size() == 1);
CallMap::iterator iterCallId = siplink->_callMap.begin();
std::string testcallid = iterCallId->first;
// TODO: hmmm, should IP2IP call be stored in call list....
CPPUNIT_ASSERT(Manager::instance().getCallList().size() == 0);
CPPUNIT_ASSERT
(
sipLink
->
_callMap
.
size
()
==
1
);
CallMap
::
iterator
iterCallId
=
sipLink
->
_callMap
.
begin
();
std
::
string
firstCallID
=
iterCallId
->
first
;
// Answer this call
CPPUNIT_ASSERT(Manager::instance().answerCall(
te
st
c
all
id
));
CPPUNIT_ASSERT
(
Manager
::
instance
().
answerCall
(
fir
st
C
all
ID
));
sleep
(
1
);
rc
=
pthread_create
(
&
secondCallThread
,
NULL
,
sippThread
,
(
void
*
)(
&
secondCallCommand
));
if
(
rc
)
{
std
::
cout
<<
"SIPTest: Error; return code from pthread_create()"
<<
std
::
endl
;
}
sleep
(
1
);
rc = pthread_join(thethread, &status);
CPPUNIT_ASSERT
(
sipLink
->
_callMap
.
size
()
==
2
);
iterCallId
=
sipLink
->
_callMap
.
begin
();
if
(
iterCallId
->
first
==
firstCallID
)
iterCallId
++
;
std
::
string
secondCallID
=
iterCallId
->
first
;
CPPUNIT_ASSERT
(
Manager
::
instance
().
answerCall
(
secondCallID
));
rc
=
pthread_join
(
firstCallThread
,
&
status
);
if
(
rc
)
{
std
::
cout
<<
"SIPTest: ERROR; return code from pthread_join(): "
<<
rc
<<
std
::
endl
;
}
else
std::cout << "SIPTest: completed join with thread" << std::endl;
std
::
cout
<<
"SIPTest: completed join with thread 1"
<<
std
::
endl
;
rc
=
pthread_join
(
secondCallThread
,
&
status
);
if
(
rc
)
{
std
::
cout
<<
"SIPTest: ERROR; return code from pthread_join(): "
<<
rc
<<
std
::
endl
;
}
*/
else
std
::
cout
<<
"SIPTest: completed join with thread 2"
<<
std
::
endl
;
std
::
cout
<<
"---------------------------"
<<
std
::
endl
;
}
This diff is collapsed.
Click to expand it.
sflphone-common/test/siptest.h
+
6
−
3
View file @
54187dd7
...
...
@@ -53,9 +53,10 @@ class SIPTest : public CppUnit::TestCase {
* Use cppunit library macros to add unit test the factory
*/
CPPUNIT_TEST_SUITE
(
SIPTest
);
CPPUNIT_TEST
(
testSimpleOutgoingIpCall
);
CPPUNIT_TEST
(
testSimpleIncomingIpCall
);
CPPUNIT_TEST
(
testTwoOutgoingIpCall
);
// CPPUNIT_TEST ( testSimpleOutgoingIpCall );
// CPPUNIT_TEST ( testSimpleIncomingIpCall );
// CPPUNIT_TEST ( testTwoOutgoingIpCall );
CPPUNIT_TEST
(
testTwoIncomingIpCall
);
CPPUNIT_TEST_SUITE_END
();
public:
...
...
@@ -80,6 +81,8 @@ class SIPTest : public CppUnit::TestCase {
void
testTwoOutgoingIpCall
(
void
);
void
testTwoIncomingIpCall
(
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