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
cced42eb
Commit
cced42eb
authored
Jan 30, 2015
by
Simon Morlat
Browse files
add test for generic CN, update oRTP and ms2
parent
b4e301ad
Changes
5
Hide whitespace changes
Inline
Side-by-side
coreapi/event.c
View file @
cced42eb
...
...
@@ -106,7 +106,8 @@ void linphone_event_set_publish_state(LinphoneEvent *lev, LinphonePublishState s
linphone_core_notify_publish_state_changed
(
lev
->
lc
,
lev
,
state
);
switch
(
state
){
case
LinphonePublishCleared
:
linphone_event_unref
(
lev
);
if
(
lev
->
expires
!=-
1
)
linphone_event_unref
(
lev
);
break
;
case
LinphonePublishOk
:
case
LinphonePublishError
:
...
...
coreapi/linphonecall.c
View file @
cced42eb
...
...
@@ -340,6 +340,16 @@ static MSList * create_telephone_events(LinphoneCore *lc, const MSList *codecs){
return
ret
;
}
static
MSList
*
create_special_payload_types
(
LinphoneCore
*
lc
,
const
MSList
*
codecs
){
MSList
*
ret
=
create_telephone_events
(
lc
,
codecs
);
if
(
linphone_core_generic_confort_noise_enabled
(
lc
)){
PayloadType
*
cn
=
payload_type_clone
(
&
payload_type_cn
);
payload_type_set_number
(
cn
,
13
);
ret
=
ms_list_append
(
ret
,
cn
);
}
return
ret
;
}
typedef
struct
_CodecConstraints
{
int
bandwidth_limit
;
int
max_codecs
;
...
...
@@ -348,7 +358,7 @@ typedef struct _CodecConstraints{
static
MSList
*
make_codec_list
(
LinphoneCore
*
lc
,
CodecConstraints
*
hints
,
const
MSList
*
codecs
){
MSList
*
l
=
NULL
;
MSList
*
tev
s
=
NULL
;
MSList
*
special
s
=
NULL
;
const
MSList
*
it
;
int
nb
=
0
;
...
...
@@ -379,8 +389,8 @@ static MSList *make_codec_list(LinphoneCore *lc, CodecConstraints * hints, const
nb
++
;
if
((
hints
->
max_codecs
>
0
)
&&
(
nb
>=
hints
->
max_codecs
))
break
;
}
tev
s
=
create_
telephone_event
s
(
lc
,
l
);
l
=
ms_list_concat
(
l
,
tev
s
);
special
s
=
create_
special_payload_type
s
(
lc
,
l
);
l
=
ms_list_concat
(
l
,
special
s
);
linphone_core_assign_payload_type_numbers
(
lc
,
l
);
return
l
;
}
...
...
mediastreamer2
@
02d311ca
Subproject commit
adbdf050e08933859bdc424026adb24fa4b3f951
Subproject commit
02d311ca6158ad707edadcd20121de57182e8972
oRTP
@
753a2d67
Subproject commit
0917823b9b56cb2710da7ce22979804119adef8c
Subproject commit
753a2d67ee0e4e9a8c2f64f92b598ac11187378a
tester/call_tester.c
View file @
cced42eb
...
...
@@ -3463,6 +3463,59 @@ static void call_with_paused_no_sdp_on_resume() {
}
}
static
void
call_with_generic_cn
(
void
)
{
int
begin
;
int
leaked_objects
;
LinphoneCoreManager
*
marie
;
LinphoneCoreManager
*
pauline
;
LinphoneCall
*
pauline_call
;
char
*
audio_file_with_silence
=
ms_strdup_printf
(
"%s/%s"
,
liblinphone_tester_file_prefix
,
"sounds/ahbahouaismaisbon.wav"
);
char
*
recorded_file
=
ms_strdup_printf
(
"%s/%s"
,
liblinphone_tester_writable_dir_prefix
,
"result.wav"
);
belle_sip_object_enable_leak_detector
(
TRUE
);
begin
=
belle_sip_object_get_object_count
();
marie
=
linphone_core_manager_new
(
"marie_rc"
);
pauline
=
linphone_core_manager_new
(
"pauline_rc"
);
remove
(
recorded_file
);
linphone_core_use_files
(
marie
->
lc
,
TRUE
);
linphone_core_use_files
(
pauline
->
lc
,
TRUE
);
linphone_core_set_play_file
(
marie
->
lc
,
audio_file_with_silence
);
/*linphone_core_set_play_file(pauline->lc, NULL);*/
linphone_core_set_record_file
(
pauline
->
lc
,
recorded_file
);
linphone_core_enable_generic_confort_noise
(
marie
->
lc
,
TRUE
);
linphone_core_enable_generic_confort_noise
(
pauline
->
lc
,
TRUE
);
CU_ASSERT_TRUE
(
call
(
marie
,
pauline
));
pauline_call
=
linphone_core_get_current_call
(
pauline
->
lc
);
CU_ASSERT_PTR_NOT_NULL
(
pauline_call
);
if
(
pauline_call
){
const
rtp_stats_t
*
rtps
;
struct
stat
stbuf
;
int
err
;
wait_for_until
(
marie
->
lc
,
pauline
->
lc
,
NULL
,
0
,
8000
);
rtps
=
rtp_session_get_stats
(
pauline_call
->
audiostream
->
ms
.
sessions
.
rtp_session
);
CU_ASSERT_TRUE
(
rtps
->
packet_recv
<=
300
&&
rtps
->
packet_recv
>=
200
);
CU_ASSERT_EQUAL
((
err
=
stat
(
recorded_file
,
&
stbuf
)),
0
);
if
(
err
==
0
){
CU_ASSERT_TRUE
(
stbuf
.
st_size
>
120000
);
}
}
end_call
(
marie
,
pauline
);
linphone_core_manager_destroy
(
marie
);
linphone_core_manager_destroy
(
pauline
);
leaked_objects
=
belle_sip_object_get_object_count
()
-
begin
;
CU_ASSERT_TRUE
(
leaked_objects
==
0
);
if
(
leaked_objects
>
0
){
belle_sip_object_dump_active_objects
();
}
ms_free
(
audio_file_with_silence
);
ms_free
(
recorded_file
);
}
test_t
call_tests
[]
=
{
{
"Early declined call"
,
early_declined_call
},
...
...
@@ -3558,6 +3611,7 @@ test_t call_tests[] = {
{
"Outgoing INVITE without ACK SDP"
,
outgoing_invite_without_sdp
},
{
"Incoming REINVITE without SDP"
,
incoming_reinvite_without_ack_sdp
},
{
"Outgoing REINVITE without ACK SDP"
,
outgoing_reinvite_without_ack_sdp
},
{
"Call with generic CN"
,
call_with_generic_cn
}
};
test_suite_t
call_test_suite
=
{
...
...
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