mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-29 17:29:20 +00:00
Add linphonerc option to disable video during pause.
This commit is contained in:
parent
8352e97861
commit
74ad3ed63f
4 changed files with 42 additions and 25 deletions
|
|
@ -620,12 +620,17 @@ static void call_resumed(LinphoneCore *lc, LinphoneCall *call){
|
|||
}
|
||||
|
||||
static void call_paused_by_remote(LinphoneCore *lc, LinphoneCall *call){
|
||||
LinphoneCallParams *params;
|
||||
/*when we are paused, increment session id, because sdp is changed (a=recvonly appears)*/
|
||||
linphone_call_increment_local_media_description(call);
|
||||
/* we are being paused */
|
||||
linphone_core_notify_display_status(lc,_("We are paused by other party."));
|
||||
_linphone_core_accept_call_update(lc,call,NULL,LinphoneCallPausedByRemote,"Call paused by remote");
|
||||
|
||||
params = linphone_call_params_copy(call->params);
|
||||
if (lp_config_get_int(lc->config, "sip", "inactive_video_on_pause", 0)) {
|
||||
linphone_call_params_set_video_direction(params, LinphoneMediaDirectionInactive);
|
||||
}
|
||||
_linphone_core_accept_call_update(lc,call,params,LinphoneCallPausedByRemote,"Call paused by remote");
|
||||
linphone_call_params_unref(params);
|
||||
}
|
||||
|
||||
static void call_updated_by_remote(LinphoneCore *lc, LinphoneCall *call, bool_t is_update){
|
||||
|
|
|
|||
|
|
@ -574,7 +574,11 @@ static const char *linphone_call_get_public_ip_for_stream(LinphoneCall *call, in
|
|||
return public_ip;
|
||||
}
|
||||
|
||||
void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall *call){
|
||||
void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall *call) {
|
||||
linphone_call_make_local_media_description_with_params(lc, call, call->params);
|
||||
}
|
||||
|
||||
void linphone_call_make_local_media_description_with_params(LinphoneCore *lc, LinphoneCall *call, LinphoneCallParams *params) {
|
||||
MSList *l;
|
||||
SalMediaDescription *old_md=call->localdesc;
|
||||
int i;
|
||||
|
|
@ -596,9 +600,9 @@ void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall *
|
|||
md->streams[1].multicast_role = SalMulticastSender;
|
||||
}
|
||||
|
||||
subject=linphone_call_params_get_session_name(call->params);
|
||||
subject=linphone_call_params_get_session_name(params);
|
||||
|
||||
linphone_core_adapt_to_network(lc,call->ping_time,call->params);
|
||||
linphone_core_adapt_to_network(lc,call->ping_time,params);
|
||||
|
||||
if (call->dest_proxy)
|
||||
me=linphone_proxy_config_get_identity(call->dest_proxy);
|
||||
|
|
@ -615,8 +619,8 @@ void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall *
|
|||
strncpy(md->username,linphone_address_get_username(addr),sizeof(md->username));
|
||||
if (subject) strncpy(md->name,subject,sizeof(md->name));
|
||||
|
||||
if (call->params->down_bw)
|
||||
md->bandwidth=call->params->down_bw;
|
||||
if (params->down_bw)
|
||||
md->bandwidth=params->down_bw;
|
||||
else md->bandwidth=linphone_core_get_download_bandwidth(lc);
|
||||
|
||||
/*set audio capabilities */
|
||||
|
|
@ -625,14 +629,14 @@ void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall *
|
|||
strncpy(md->streams[0].name,"Audio",sizeof(md->streams[0].name)-1);
|
||||
md->streams[0].rtp_port=call->media_ports[0].rtp_port;
|
||||
md->streams[0].rtcp_port=call->media_ports[0].rtcp_port;
|
||||
md->streams[0].proto=get_proto_from_call_params(call->params);
|
||||
md->streams[0].dir=get_audio_dir_from_call_params(call->params);
|
||||
md->streams[0].proto=get_proto_from_call_params(params);
|
||||
md->streams[0].dir=get_audio_dir_from_call_params(params);
|
||||
md->streams[0].type=SalAudio;
|
||||
if (call->params->down_ptime)
|
||||
md->streams[0].ptime=call->params->down_ptime;
|
||||
if (params->down_ptime)
|
||||
md->streams[0].ptime=params->down_ptime;
|
||||
else
|
||||
md->streams[0].ptime=linphone_core_get_download_ptime(lc);
|
||||
codec_hints.bandwidth_limit=call->params->audio_bw;
|
||||
codec_hints.bandwidth_limit=params->audio_bw;
|
||||
codec_hints.max_codecs=-1;
|
||||
codec_hints.previously_used=old_md ? old_md->streams[0].already_assigned_payloads : NULL;
|
||||
l=make_codec_list(lc, &codec_hints, SalAudio, lc->codecs_conf.audio_codecs);
|
||||
|
|
@ -648,14 +652,14 @@ void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall *
|
|||
ms_warning("Cannot get audio local ssrc for call [%p]",call);
|
||||
nb_active_streams++;
|
||||
|
||||
if (call->params->has_video && (!call->params->internal_call_update || !call->current_params->video_declined)){
|
||||
if (params->has_video && (!params->internal_call_update || !call->current_params->video_declined)){
|
||||
strncpy(md->streams[1].rtp_addr,linphone_call_get_public_ip_for_stream(call,1),sizeof(md->streams[1].rtp_addr));
|
||||
strncpy(md->streams[1].rtcp_addr,linphone_call_get_public_ip_for_stream(call,1),sizeof(md->streams[1].rtcp_addr));
|
||||
strncpy(md->streams[1].name,"Video",sizeof(md->streams[1].name)-1);
|
||||
md->streams[1].rtp_port=call->media_ports[1].rtp_port;
|
||||
md->streams[1].rtcp_port=call->media_ports[1].rtcp_port;
|
||||
md->streams[1].proto=md->streams[0].proto;
|
||||
md->streams[1].dir=get_video_dir_from_call_params(call->params);
|
||||
md->streams[1].dir=get_video_dir_from_call_params(params);
|
||||
md->streams[1].type=SalVideo;
|
||||
codec_hints.bandwidth_limit=0;
|
||||
codec_hints.max_codecs=-1;
|
||||
|
|
|
|||
|
|
@ -3987,27 +3987,34 @@ int linphone_core_pause_call(LinphoneCore *lc, LinphoneCall *call){
|
|||
int _linphone_core_pause_call(LinphoneCore *lc, LinphoneCall *call)
|
||||
{
|
||||
const char *subject=NULL;
|
||||
LinphoneCallParams *params;
|
||||
|
||||
if (call->state!=LinphoneCallStreamsRunning && call->state!=LinphoneCallPausedByRemote){
|
||||
ms_warning("Cannot pause this call, it is not active.");
|
||||
return -1;
|
||||
}
|
||||
linphone_call_make_local_media_description(lc,call);
|
||||
if (sal_media_description_has_dir(call->resultdesc, SalStreamSendRecv)) {
|
||||
subject = "Call on hold";
|
||||
} else if (sal_media_description_has_dir(call->resultdesc, SalStreamRecvOnly)) {
|
||||
subject = "Call on hold for me too";
|
||||
} else {
|
||||
ms_error("No reason to pause this call, it is already paused or inactive.");
|
||||
return -1;
|
||||
}
|
||||
params = linphone_call_params_copy(call->params);
|
||||
linphone_call_params_set_audio_direction(params, LinphoneMediaDirectionSendOnly);
|
||||
if (lp_config_get_int(lc->config, "sip", "inactive_video_on_pause", 0)) {
|
||||
linphone_call_params_set_video_direction(params, LinphoneMediaDirectionInactive);
|
||||
} else {
|
||||
linphone_call_params_set_video_direction(params, LinphoneMediaDirectionSendOnly);
|
||||
}
|
||||
linphone_call_make_local_media_description_with_params(lc, call, params);
|
||||
linphone_call_params_unref(params);
|
||||
#ifdef BUILD_UPNP
|
||||
if(call->upnp_session != NULL) {
|
||||
linphone_core_update_local_media_description_from_upnp(call->localdesc, call->upnp_session);
|
||||
}
|
||||
#endif //BUILD_UPNP
|
||||
if (sal_media_description_has_dir(call->resultdesc,SalStreamSendRecv)){
|
||||
sal_media_description_set_dir(call->localdesc,SalStreamSendOnly);
|
||||
subject="Call on hold";
|
||||
}else if (sal_media_description_has_dir(call->resultdesc,SalStreamRecvOnly)){
|
||||
sal_media_description_set_dir(call->localdesc,SalStreamSendOnly);
|
||||
subject="Call on hold for me too";
|
||||
}else{
|
||||
ms_error("No reason to pause this call, it is already paused or inactive.");
|
||||
return -1;
|
||||
}
|
||||
sal_call_set_local_media_description(call->op,call->localdesc);
|
||||
if (sal_call_update(call->op,subject,FALSE) != 0){
|
||||
linphone_core_notify_display_warning(lc,_("Could not pause the call"));
|
||||
|
|
|
|||
|
|
@ -856,6 +856,7 @@ int linphone_core_get_calls_nb(const LinphoneCore *lc);
|
|||
|
||||
void linphone_core_set_state(LinphoneCore *lc, LinphoneGlobalState gstate, const char *message);
|
||||
void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall *call);
|
||||
void linphone_call_make_local_media_description_with_params(LinphoneCore *lc, LinphoneCall *call, LinphoneCallParams *params);
|
||||
void linphone_call_increment_local_media_description(LinphoneCall *call);
|
||||
void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMediaDescription *new_md);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue