Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblinphone
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
10
Issues
10
List
Board
Labels
Milestones
Merge Requests
22
Merge Requests
22
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
liblinphone
Commits
1612e329
Commit
1612e329
authored
Jun 19, 2017
by
jehan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid cancel with info testers to crash
parent
199ce2d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
56 deletions
+58
-56
callbacks.c
coreapi/callbacks.c
+3
-2
call_single_tester.c
tester/call_single_tester.c
+55
-54
No files found.
coreapi/callbacks.c
View file @
1612e329
...
...
@@ -272,6 +272,7 @@ static void call_received(SalOp *h){
SalMediaDescription
*
md
;
const
char
*
p_asserted_id
;
LinphoneErrorInfo
*
ei
=
NULL
;
LinphonePresenceActivity
*
activity
=
NULL
;
/* Look if this INVITE is for a call that has already been notified but broken because of network failure */
replaced_call
=
look_for_broken_call_to_replace
(
h
,
lc
);
...
...
@@ -302,8 +303,8 @@ static void call_received(SalOp *h){
to_addr
=
linphone_address_new
(
sal_op_get_to
(
h
));
/* first check if we can answer successfully to this invite */
if
(
linphone_presence_model_get_basic_status
(
lc
->
presence_model
)
==
LinphonePresenceBasicStatusClosed
)
{
LinphonePresenceActivity
*
activity
=
linphone_presence_model_get_activity
(
lc
->
presence_model
);
if
(
linphone_presence_model_get_basic_status
(
lc
->
presence_model
)
==
LinphonePresenceBasicStatusClosed
&&
(
activity
=
linphone_presence_model_get_activity
(
lc
->
presence_model
)))
{
switch
(
linphone_presence_activity_get_type
(
activity
))
{
case
LinphonePresenceActivityPermanentAbsence
:
alt_contact
=
linphone_presence_model_get_contact
(
lc
->
presence_model
);
...
...
tester/call_single_tester.c
View file @
1612e329
...
...
@@ -1104,8 +1104,8 @@ static void cancel_call_with_error(void) {
}
static
void
cancel_other_device_after_accept
(
void
)
{
LinphoneCall
*
call_callee
;
LinphoneCall
*
call_callee_2
;
LinphoneCall
*
call_callee
=
NULL
;
LinphoneCall
*
call_callee_2
=
NULL
;
const
LinphoneErrorInfo
*
rei
=
NULL
;
LinphoneCoreManager
*
callee_mgr
=
linphone_core_manager_new
(
"marie_rc"
);
LinphoneCoreManager
*
callee_mgr_2
=
linphone_core_manager_new
(
"marie_rc"
);
...
...
@@ -1118,44 +1118,45 @@ static void cancel_other_device_after_accept(void) {
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr
->
lc
,
&
callee_mgr
->
stat
.
number_of_LinphoneCallIncomingReceived
,
1
));
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr
->
lc
,
&
caller_mgr
->
stat
.
number_of_LinphoneCallOutgoingProgress
,
1
));
call_callee
=
linphone_core_get_current_call
(
callee_mgr
->
lc
);
linphone_call_ref
(
call_callee
);
BC_ASSERT_PTR_NOT_NULL
(
call_callee
);
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr_2
->
lc
,
&
callee_mgr_2
->
stat
.
number_of_LinphoneCallIncomingReceived
,
1
));
call_callee_2
=
linphone_core_get_current_call
(
callee_mgr_2
->
lc
);
linphone_call_ref
(
call_callee_2
);
BC_ASSERT_PTR_NOT_NULL
(
call_callee_2
);
BC_ASSERT_EQUAL
(
linphone_call_accept
(
call_callee
),
0
,
int
,
"%d"
);
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr
->
lc
,
&
caller_mgr
->
stat
.
number_of_LinphoneCallConnected
,
1
));
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr
->
lc
,
&
caller_mgr
->
stat
.
number_of_LinphoneCallStreamsRunning
,
1
));
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr_2
->
lc
,
&
callee_mgr_2
->
stat
.
number_of_LinphoneCallEnd
,
1
));
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr_2
->
lc
,
&
callee_mgr_2
->
stat
.
number_of_LinphoneCallReleased
,
1
));
rei
=
linphone_call_get_error_info
(
call_callee_2
);
BC_ASSERT_PTR_NOT_NULL
(
rei
);
if
(
rei
){
BC_ASSERT_EQUAL
(
linphone_error_info_get_protocol_code
(
rei
),
200
,
int
,
"%d"
);
BC_ASSERT_PTR_NOT_NULL
(
linphone_error_info_get_phrase
(
rei
));
BC_ASSERT_STRING_EQUAL
(
linphone_error_info_get_phrase
(
rei
),
"Call completed elsewhere"
);
BC_ASSERT_STRING_EQUAL
(
linphone_error_info_get_protocol
(
rei
),
"SIP"
);
if
(
BC_ASSERT_PTR_NOT_NULL
(
call_callee
))
{
linphone_call_ref
(
call_callee
);
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr_2
->
lc
,
&
callee_mgr_2
->
stat
.
number_of_LinphoneCallIncomingReceived
,
1
));
call_callee_2
=
linphone_core_get_current_call
(
callee_mgr_2
->
lc
);
linphone_call_ref
(
call_callee_2
);
BC_ASSERT_PTR_NOT_NULL
(
call_callee_2
);
BC_ASSERT_EQUAL
(
linphone_call_accept
(
call_callee
),
0
,
int
,
"%d"
);
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr
->
lc
,
&
caller_mgr
->
stat
.
number_of_LinphoneCallConnected
,
1
));
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr
->
lc
,
&
caller_mgr
->
stat
.
number_of_LinphoneCallStreamsRunning
,
1
));
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr_2
->
lc
,
&
callee_mgr_2
->
stat
.
number_of_LinphoneCallEnd
,
1
));
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr_2
->
lc
,
&
callee_mgr_2
->
stat
.
number_of_LinphoneCallReleased
,
1
));
rei
=
linphone_call_get_error_info
(
call_callee_2
);
BC_ASSERT_PTR_NOT_NULL
(
rei
);
if
(
rei
){
BC_ASSERT_EQUAL
(
linphone_error_info_get_protocol_code
(
rei
),
200
,
int
,
"%d"
);
BC_ASSERT_PTR_NOT_NULL
(
linphone_error_info_get_phrase
(
rei
));
BC_ASSERT_STRING_EQUAL
(
linphone_error_info_get_phrase
(
rei
),
"Call completed elsewhere"
);
BC_ASSERT_STRING_EQUAL
(
linphone_error_info_get_protocol
(
rei
),
"SIP"
);
}
}
linphone_call_terminate
(
out_call
);
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr
->
lc
,
&
caller_mgr
->
stat
.
number_of_LinphoneCallEnd
,
1
));
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr
->
lc
,
&
caller_mgr
->
stat
.
number_of_LinphoneCallReleased
,
1
));
linphone_call_unref
(
out_call
);
linphone_call_unref
(
call_callee
);
linphone_call_unref
(
call_callee_2
);
if
(
out_call
)
linphone_call_unref
(
out_call
);
if
(
call_callee
)
linphone_call_unref
(
call_callee
);
if
(
call_callee_2
)
linphone_call_unref
(
call_callee_2
);
linphone_core_manager_destroy
(
callee_mgr
);
linphone_core_manager_destroy
(
callee_mgr_2
);
linphone_core_manager_destroy
(
caller_mgr
);
}
static
void
cancel_other_device_after_decline
(
void
)
{
LinphoneCall
*
call_callee
;
LinphoneCall
*
call_callee_2
;
LinphoneCall
*
call_callee
=
NULL
;
LinphoneCall
*
call_callee_2
=
NULL
;
const
LinphoneErrorInfo
*
rei
=
NULL
;
LinphoneCoreManager
*
callee_mgr
=
linphone_core_manager_new
(
"marie_rc"
);
LinphoneCoreManager
*
callee_mgr_2
=
linphone_core_manager_new
(
"marie_rc"
);
...
...
@@ -1168,32 +1169,32 @@ static void cancel_other_device_after_decline(void) {
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr
->
lc
,
&
callee_mgr
->
stat
.
number_of_LinphoneCallIncomingReceived
,
1
));
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr
->
lc
,
&
caller_mgr
->
stat
.
number_of_LinphoneCallOutgoingProgress
,
1
));
call_callee
=
linphone_core_get_current_call
(
callee_mgr
->
lc
);
linphone_call_ref
(
call_callee
);
BC_ASSERT_PTR_NOT_NULL
(
call_callee
);
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr_2
->
lc
,
&
callee_mgr_2
->
stat
.
number_of_LinphoneCallIncomingReceived
,
1
));
call_callee_2
=
linphone_core_get_current_call
(
callee_mgr_2
->
lc
);
linphone_call_ref
(
call_callee_2
);
BC_ASSERT_PTR_NOT_NULL
(
call_callee_2
);
BC_ASSERT_EQUAL
(
linphone_call_decline
(
call_callee
,
LinphoneReasonDeclined
),
0
,
int
,
"%d"
);
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr
->
lc
,
&
caller_mgr
->
stat
.
number_of_LinphoneCallEnd
,
1
));
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr
->
lc
,
&
caller_mgr
->
stat
.
number_of_LinphoneCallReleased
,
1
));
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr_2
->
lc
,
&
callee_mgr_2
->
stat
.
number_of_LinphoneCallEnd
,
1
));
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr_2
->
lc
,
&
callee_mgr_2
->
stat
.
number_of_LinphoneCallReleased
,
1
));
rei
=
linphone_call_get_error_info
(
call_callee_2
);
BC_ASSERT_PTR_NOT_NULL
(
rei
);
if
(
rei
){
BC_ASSERT_EQUAL
(
linphone_error_info_get_protocol_code
(
rei
),
600
,
int
,
"%d"
);
BC_ASSERT_PTR_NOT_NULL
(
linphone_error_info_get_phrase
(
rei
));
BC_ASSERT_STRING_EQUAL
(
linphone_error_info_get_phrase
(
rei
),
"Busy Everywhere"
);
BC_ASSERT_STRING_EQUAL
(
linphone_error_info_get_protocol
(
rei
),
"SIP"
);
if
(
BC_ASSERT_PTR_NOT_NULL
(
call_callee
))
{
linphone_call_ref
(
call_callee
);
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr_2
->
lc
,
&
callee_mgr_2
->
stat
.
number_of_LinphoneCallIncomingReceived
,
1
));
call_callee_2
=
linphone_core_get_current_call
(
callee_mgr_2
->
lc
);
linphone_call_ref
(
call_callee_2
);
BC_ASSERT_PTR_NOT_NULL
(
call_callee_2
);
BC_ASSERT_EQUAL
(
linphone_call_decline
(
call_callee
,
LinphoneReasonDeclined
),
0
,
int
,
"%d"
);
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr
->
lc
,
&
caller_mgr
->
stat
.
number_of_LinphoneCallEnd
,
1
));
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr
->
lc
,
&
caller_mgr
->
stat
.
number_of_LinphoneCallReleased
,
1
));
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr_2
->
lc
,
&
callee_mgr_2
->
stat
.
number_of_LinphoneCallEnd
,
1
));
BC_ASSERT_TRUE
(
wait_for
(
caller_mgr
->
lc
,
callee_mgr_2
->
lc
,
&
callee_mgr_2
->
stat
.
number_of_LinphoneCallReleased
,
1
));
rei
=
linphone_call_get_error_info
(
call_callee_2
);
BC_ASSERT_PTR_NOT_NULL
(
rei
);
if
(
rei
){
BC_ASSERT_EQUAL
(
linphone_error_info_get_protocol_code
(
rei
),
600
,
int
,
"%d"
);
BC_ASSERT_PTR_NOT_NULL
(
linphone_error_info_get_phrase
(
rei
));
BC_ASSERT_STRING_EQUAL
(
linphone_error_info_get_phrase
(
rei
),
"Busy Everywhere"
);
BC_ASSERT_STRING_EQUAL
(
linphone_error_info_get_protocol
(
rei
),
"SIP"
);
}
}
linphone_call_unref
(
out_call
);
linphone_call_unref
(
call_callee
);
linphone_call_unref
(
call_callee_2
);
if
(
out_call
)
linphone_call_unref
(
out_call
);
if
(
call_callee
)
linphone_call_unref
(
call_callee
);
if
(
call_callee_2
)
linphone_call_unref
(
call_callee_2
);
linphone_core_manager_destroy
(
callee_mgr
);
linphone_core_manager_destroy
(
callee_mgr_2
);
linphone_core_manager_destroy
(
caller_mgr
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment