mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
Improved complex sip call tester
This commit is contained in:
parent
489a5f3b8e
commit
3f38e29408
2 changed files with 53 additions and 37 deletions
|
|
@ -3165,21 +3165,21 @@ static void linphone_call_start_text_stream(LinphoneCall *call) {
|
|||
|
||||
tstream = sal_media_description_find_best_stream(call->resultdesc, SalText);
|
||||
if (tstream != NULL && tstream->dir != SalStreamInactive && tstream->rtp_port != 0) {
|
||||
const char *rtp_addr=tstream->rtp_addr[0]!='\0' ? tstream->rtp_addr : call->resultdesc->addr;
|
||||
const char *rtcp_addr=tstream->rtcp_addr[0]!='\0' ? tstream->rtcp_addr : call->resultdesc->addr;
|
||||
const char *rtp_addr = tstream->rtp_addr[0] != '\0' ? tstream->rtp_addr : call->resultdesc->addr;
|
||||
const char *rtcp_addr = tstream->rtcp_addr[0] != '\0' ? tstream->rtcp_addr : call->resultdesc->addr;
|
||||
const SalStreamDescription *local_st_desc = sal_media_description_find_stream(call->localdesc, tstream->proto, SalText);
|
||||
bool_t is_multicast = ms_is_multicast(rtp_addr);
|
||||
call->text_profile = make_profile(call, call->resultdesc, tstream, &used_pt);
|
||||
|
||||
if (used_pt != -1) {
|
||||
call->current_params->text_codec = rtp_profile_get_payload(call->text_profile, used_pt);
|
||||
call->current_params->realtimetext_enabled=TRUE;
|
||||
call->current_params->realtimetext_enabled = TRUE;
|
||||
|
||||
if (sal_stream_description_has_srtp(tstream) == TRUE) {
|
||||
int crypto_idx = find_crypto_index_from_tag(local_st_desc->crypto, tstream->crypto_local_tag);
|
||||
if (crypto_idx >= 0) {
|
||||
ms_media_stream_sessions_set_srtp_recv_key_b64(&call->textstream->ms.sessions, tstream->crypto[0].algo,tstream->crypto[0].master_key);
|
||||
ms_media_stream_sessions_set_srtp_send_key_b64(&call->textstream->ms.sessions, tstream->crypto[0].algo,local_st_desc->crypto[crypto_idx].master_key);
|
||||
ms_media_stream_sessions_set_srtp_recv_key_b64(&call->textstream->ms.sessions, tstream->crypto[0].algo, tstream->crypto[0].master_key);
|
||||
ms_media_stream_sessions_set_srtp_send_key_b64(&call->textstream->ms.sessions, tstream->crypto[0].algo, local_st_desc->crypto[crypto_idx].master_key);
|
||||
}
|
||||
}
|
||||
configure_rtp_session_for_rtcp_fb(call, tstream);
|
||||
|
|
|
|||
|
|
@ -141,15 +141,19 @@ static void call_with_audio_mline_before_video_in_sdp() {
|
|||
|
||||
if (sipp_out) {
|
||||
BC_ASSERT_TRUE(wait_for(mgr->lc, mgr->lc, &mgr->stat.number_of_LinphoneCallIncomingReceived, 1));
|
||||
call = linphone_core_get_current_call(mgr->lc);
|
||||
linphone_core_accept_call(mgr->lc, call);
|
||||
BC_ASSERT_TRUE(wait_for(mgr->lc, mgr->lc, &mgr->stat.number_of_LinphoneCallStreamsRunning, 1));
|
||||
BC_ASSERT_EQUAL(call->main_audio_stream_index, 0, int, "%d");
|
||||
BC_ASSERT_EQUAL(call->main_video_stream_index, 1, int, "%d");
|
||||
BC_ASSERT_TRUE(call->main_text_stream_index > 1);
|
||||
BC_ASSERT_TRUE(linphone_call_log_video_enabled(linphone_call_get_call_log(call)));
|
||||
call = linphone_call_ref(linphone_core_get_current_call(mgr->lc));
|
||||
BC_ASSERT_PTR_NOT_NULL(call);
|
||||
if (call) {
|
||||
linphone_core_accept_call(mgr->lc, call);
|
||||
BC_ASSERT_TRUE(wait_for(mgr->lc, mgr->lc, &mgr->stat.number_of_LinphoneCallStreamsRunning, 1));
|
||||
BC_ASSERT_EQUAL(call->main_audio_stream_index, 0, int, "%d");
|
||||
BC_ASSERT_EQUAL(call->main_video_stream_index, 1, int, "%d");
|
||||
BC_ASSERT_TRUE(call->main_text_stream_index > 1);
|
||||
BC_ASSERT_TRUE(linphone_call_log_video_enabled(linphone_call_get_call_log(call)));
|
||||
|
||||
check_rtcp(call);
|
||||
check_rtcp(call);
|
||||
linphone_call_unref(call);
|
||||
}
|
||||
|
||||
BC_ASSERT_TRUE(wait_for(mgr->lc, mgr->lc, &mgr->stat.number_of_LinphoneCallEnd, 1));
|
||||
pclose(sipp_out);
|
||||
|
|
@ -179,15 +183,19 @@ static void call_with_video_mline_before_audio_in_sdp() {
|
|||
|
||||
if (sipp_out) {
|
||||
BC_ASSERT_TRUE(wait_for(mgr->lc, mgr->lc, &mgr->stat.number_of_LinphoneCallIncomingReceived, 1));
|
||||
call = linphone_core_get_current_call(mgr->lc);
|
||||
linphone_core_accept_call(mgr->lc, call);
|
||||
BC_ASSERT_TRUE(wait_for(mgr->lc, mgr->lc, &mgr->stat.number_of_LinphoneCallStreamsRunning, 1));
|
||||
BC_ASSERT_EQUAL(call->main_audio_stream_index, 1, int, "%d");
|
||||
BC_ASSERT_EQUAL(call->main_video_stream_index, 0, int, "%d");
|
||||
BC_ASSERT_TRUE(call->main_text_stream_index > 1);
|
||||
BC_ASSERT_TRUE(linphone_call_log_video_enabled(linphone_call_get_call_log(call)));
|
||||
call = linphone_call_ref(linphone_core_get_current_call(mgr->lc));
|
||||
BC_ASSERT_PTR_NOT_NULL(call);
|
||||
if (call) {
|
||||
linphone_core_accept_call(mgr->lc, call);
|
||||
BC_ASSERT_TRUE(wait_for(mgr->lc, mgr->lc, &mgr->stat.number_of_LinphoneCallStreamsRunning, 1));
|
||||
BC_ASSERT_EQUAL(call->main_audio_stream_index, 1, int, "%d");
|
||||
BC_ASSERT_EQUAL(call->main_video_stream_index, 0, int, "%d");
|
||||
BC_ASSERT_TRUE(call->main_text_stream_index > 1);
|
||||
BC_ASSERT_TRUE(linphone_call_log_video_enabled(linphone_call_get_call_log(call)));
|
||||
|
||||
check_rtcp(call);
|
||||
check_rtcp(call);
|
||||
linphone_call_unref(call);
|
||||
}
|
||||
|
||||
BC_ASSERT_TRUE(wait_for(mgr->lc, mgr->lc, &mgr->stat.number_of_LinphoneCallEnd, 1));
|
||||
pclose(sipp_out);
|
||||
|
|
@ -217,15 +225,19 @@ static void call_with_multiple_audio_mline_in_sdp() {
|
|||
|
||||
if (sipp_out) {
|
||||
BC_ASSERT_TRUE(wait_for(mgr->lc, mgr->lc, &mgr->stat.number_of_LinphoneCallIncomingReceived, 1));
|
||||
call = linphone_core_get_current_call(mgr->lc);
|
||||
linphone_core_accept_call(mgr->lc, call);
|
||||
BC_ASSERT_TRUE(wait_for(mgr->lc, mgr->lc, &mgr->stat.number_of_LinphoneCallStreamsRunning, 1));
|
||||
BC_ASSERT_EQUAL(call->main_audio_stream_index, 0, int, "%d");
|
||||
BC_ASSERT_EQUAL(call->main_video_stream_index, 2, int, "%d");
|
||||
BC_ASSERT_TRUE(call->main_text_stream_index > 2);
|
||||
BC_ASSERT_TRUE(linphone_call_log_video_enabled(linphone_call_get_call_log(call)));
|
||||
call = linphone_call_ref(linphone_core_get_current_call(mgr->lc));
|
||||
BC_ASSERT_PTR_NOT_NULL(call);
|
||||
if (call) {
|
||||
linphone_core_accept_call(mgr->lc, call);
|
||||
BC_ASSERT_TRUE(wait_for(mgr->lc, mgr->lc, &mgr->stat.number_of_LinphoneCallStreamsRunning, 1));
|
||||
BC_ASSERT_EQUAL(call->main_audio_stream_index, 0, int, "%d");
|
||||
BC_ASSERT_EQUAL(call->main_video_stream_index, 2, int, "%d");
|
||||
BC_ASSERT_TRUE(call->main_text_stream_index > 2);
|
||||
BC_ASSERT_TRUE(linphone_call_log_video_enabled(linphone_call_get_call_log(call)));
|
||||
|
||||
check_rtcp(call);
|
||||
check_rtcp(call);
|
||||
linphone_call_unref(call);
|
||||
}
|
||||
|
||||
BC_ASSERT_TRUE(wait_for(mgr->lc, mgr->lc, &mgr->stat.number_of_LinphoneCallEnd, 1));
|
||||
pclose(sipp_out);
|
||||
|
|
@ -255,15 +267,19 @@ static void call_with_multiple_video_mline_in_sdp() {
|
|||
|
||||
if (sipp_out) {
|
||||
BC_ASSERT_TRUE(wait_for(mgr->lc, mgr->lc, &mgr->stat.number_of_LinphoneCallIncomingReceived, 1));
|
||||
call = linphone_core_get_current_call(mgr->lc);
|
||||
linphone_core_accept_call(mgr->lc, call);
|
||||
BC_ASSERT_TRUE(wait_for(mgr->lc, mgr->lc, &mgr->stat.number_of_LinphoneCallStreamsRunning, 1));
|
||||
BC_ASSERT_EQUAL(call->main_audio_stream_index, 0, int, "%d");
|
||||
BC_ASSERT_EQUAL(call->main_video_stream_index, 1, int, "%d");
|
||||
BC_ASSERT_TRUE(call->main_text_stream_index > 3);
|
||||
BC_ASSERT_TRUE(linphone_call_log_video_enabled(linphone_call_get_call_log(call)));
|
||||
call = linphone_call_ref(linphone_core_get_current_call(mgr->lc));
|
||||
BC_ASSERT_PTR_NOT_NULL(call);
|
||||
if (call) {
|
||||
linphone_core_accept_call(mgr->lc, call);
|
||||
BC_ASSERT_TRUE(wait_for(mgr->lc, mgr->lc, &mgr->stat.number_of_LinphoneCallStreamsRunning, 1));
|
||||
BC_ASSERT_EQUAL(call->main_audio_stream_index, 0, int, "%d");
|
||||
BC_ASSERT_EQUAL(call->main_video_stream_index, 1, int, "%d");
|
||||
BC_ASSERT_TRUE(call->main_text_stream_index > 3);
|
||||
BC_ASSERT_TRUE(linphone_call_log_video_enabled(linphone_call_get_call_log(call)));
|
||||
|
||||
check_rtcp(call);
|
||||
check_rtcp(call);
|
||||
linphone_call_unref(call);
|
||||
}
|
||||
|
||||
BC_ASSERT_TRUE(wait_for(mgr->lc, mgr->lc, &mgr->stat.number_of_LinphoneCallEnd, 1));
|
||||
pclose(sipp_out);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue