Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
5fb5c55e
Commit
5fb5c55e
authored
Nov 08, 2013
by
Simon Morlat
Browse files
add new test to check what happens if a calls gets rejected because of incompatible media types.
restore oRTP
parent
7f69d68d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
16 deletions
+47
-16
coreapi/callbacks.c
coreapi/callbacks.c
+8
-13
oRTP
oRTP
+1
-1
tester/call_tester.c
tester/call_tester.c
+37
-1
tester/presence_tester.c
tester/presence_tester.c
+1
-1
No files found.
coreapi/callbacks.c
View file @
5fb5c55e
...
...
@@ -666,7 +666,7 @@ static void call_failure(SalOp *op, SalError error, SalReason sr, const char *de
case
LinphoneCallResuming
:
ms_message
(
"Call error on state [%s], restoring previous state"
,
linphone_call_state_to_string
(
call
->
prevstate
));
call
->
reason
=
linphone_reason_from_sal
(
sr
);
linphone_call_set_state
(
call
,
call
->
prevstate
,
msg
);
linphone_call_set_state
(
call
,
call
->
prevstate
,
details
);
return
;
default:
break
;
/*nothing to do*/
...
...
@@ -678,19 +678,14 @@ static void call_failure(SalOp *op, SalError error, SalReason sr, const char *de
#ifdef BUILD_UPNP
linphone_call_delete_upnp_session
(
call
);
#endif //BUILD_UPNP
if
(
sr
==
SalReasonDeclined
)
{
call
->
reason
=
Linphone
ReasonDeclined
;
call
->
reason
=
linphone_reason_from_sal
(
sr
);
if
(
sr
==
Sal
ReasonDeclined
){
linphone_call_set_state
(
call
,
LinphoneCallEnd
,
"Call declined."
);
}
else
if
(
sr
==
SalReasonNotFound
)
{
call
->
reason
=
LinphoneReasonNotFound
;
linphone_call_set_state
(
call
,
LinphoneCallError
,
"User not found."
);
}
else
if
(
sr
==
SalReasonBusy
)
{
call
->
reason
=
LinphoneReasonBusy
;
linphone_call_set_state
(
call
,
LinphoneCallError
,
"User is busy."
);
linphone_core_play_named_tone
(
lc
,
LinphoneToneBusy
);
}
else
{
linphone_call_set_state
(
call
,
LinphoneCallError
,
msg
);
}
else
{
linphone_call_set_state
(
call
,
LinphoneCallError
,
details
);
if
(
sr
==
SalReasonBusy
)
linphone_core_play_named_tone
(
lc
,
LinphoneToneBusy
);
}
if
(
referer
){
...
...
oRTP
@
b5d1414e
Subproject commit
e96c55df4436db74656d5feedf3e8fd12adb74e4
Subproject commit
b5d1414e63b21c83eb8e26988a3fe423ff8fc3b3
tester/call_tester.c
View file @
5fb5c55e
...
...
@@ -345,6 +345,40 @@ static void cancelled_call(void) {
linphone_core_manager_destroy
(
pauline
);
}
static
void
disable_all_codecs_except_one
(
LinphoneCore
*
lc
,
const
char
*
mime
){
const
MSList
*
elem
=
linphone_core_get_audio_codecs
(
lc
);
PayloadType
*
pt
;
for
(;
elem
!=
NULL
;
elem
=
elem
->
next
){
pt
=
(
PayloadType
*
)
elem
->
data
;
linphone_core_enable_payload_type
(
lc
,
pt
,
FALSE
);
}
pt
=
linphone_core_find_payload_type
(
lc
,
mime
,
-
1
,
-
1
);
CU_ASSERT_PTR_NOT_NULL_FATAL
(
pt
);
linphone_core_enable_payload_type
(
lc
,
pt
,
TRUE
);
}
static
void
call_failed_because_of_codecs
(
void
)
{
LinphoneCoreManager
*
marie
=
linphone_core_manager_new
(
"marie_rc"
);
LinphoneCoreManager
*
pauline
=
linphone_core_manager_new
(
"pauline_rc"
);
LinphoneCall
*
out_call
;
disable_all_codecs_except_one
(
marie
->
lc
,
"pcmu"
);
disable_all_codecs_except_one
(
pauline
->
lc
,
"pcma"
);
out_call
=
linphone_core_invite
(
pauline
->
lc
,
"marie"
);
linphone_call_ref
(
out_call
);
CU_ASSERT_TRUE
(
wait_for
(
pauline
->
lc
,
marie
->
lc
,
&
pauline
->
stat
.
number_of_LinphoneCallOutgoingInit
,
1
));
/*flexisip will retain the 415 until the "urgent reply" timeout arrives.*/
CU_ASSERT_TRUE
(
wait_for_until
(
pauline
->
lc
,
marie
->
lc
,
&
pauline
->
stat
.
number_of_LinphoneCallError
,
1
,
6000
));
CU_ASSERT_EQUAL
(
linphone_call_get_reason
(
out_call
),
LinphoneReasonMedia
);
CU_ASSERT_EQUAL
(
marie
->
stat
.
number_of_LinphoneCallIncomingReceived
,
0
);
linphone_call_unref
(
out_call
);
linphone_core_manager_destroy
(
marie
);
linphone_core_manager_destroy
(
pauline
);
}
static
void
call_with_dns_time_out
(
void
)
{
LinphoneCoreManager
*
marie
=
linphone_core_manager_new2
(
"empty_rc"
,
FALSE
);
LCSipTransports
transport
=
{
9773
,
0
,
0
,
0
};
...
...
@@ -416,7 +450,8 @@ static void early_declined_call(void) {
out_call
=
linphone_core_invite
(
pauline
->
lc
,
"marie"
);
linphone_call_ref
(
out_call
);
CU_ASSERT_TRUE
(
wait_for
(
pauline
->
lc
,
marie
->
lc
,
&
pauline
->
stat
.
number_of_LinphoneCallError
,
1
));
/*wait until flexisip transfers the busy...*/
CU_ASSERT_TRUE
(
wait_for_until
(
pauline
->
lc
,
marie
->
lc
,
&
pauline
->
stat
.
number_of_LinphoneCallError
,
1
,
33000
));
CU_ASSERT_EQUAL
(
pauline
->
stat
.
number_of_LinphoneCallError
,
1
);
/* FIXME http://git.linphone.org/mantis/view.php?id=757
...
...
@@ -1419,6 +1454,7 @@ test_t call_tests[] = {
{
"Early cancelled call"
,
early_cancelled_call
},
{
"Call with DNS timeout"
,
call_with_dns_time_out
},
{
"Cancelled ringing call"
,
cancelled_ringing_call
},
{
"Call failed because of codecs"
,
call_failed_because_of_codecs
},
{
"Simple call"
,
simple_call
},
{
"Call with media relay"
,
call_with_media_relay
},
{
"Simple call compatibility mode"
,
simple_call_compatibility_mode
},
...
...
tester/presence_tester.c
View file @
5fb5c55e
...
...
@@ -336,7 +336,7 @@ static void presence_information(void) {
test_t
presence_tests
[]
=
{
{
"Simple Subscribe"
,
simple_subscribe
},
{
"Simple Publish"
,
simple_publish
},
{
"Call with
P
resence"
,
call_with_presence
},
{
"Call with
p
resence"
,
call_with_presence
},
{
"Unsubscribe while subscribing"
,
unsubscribe_while_subscribing
},
{
"Presence information"
,
presence_information
},
{
"App managed presence failure"
,
subscribe_failure_handle_by_app
},
...
...
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