mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Fix crash on INVITE without SDP.
This commit is contained in:
parent
d7cf616e07
commit
ba478b89e8
2 changed files with 11 additions and 2 deletions
|
|
@ -462,6 +462,7 @@ LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddr
|
|||
LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to, SalOp *op){
|
||||
LinphoneCall *call=ms_new0(LinphoneCall,1);
|
||||
char *from_str;
|
||||
const SalMediaDescription *md;
|
||||
|
||||
call->dir=LinphoneCallIncoming;
|
||||
sal_op_set_user_pointer(op,call);
|
||||
|
|
@ -484,8 +485,13 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *fro
|
|||
linphone_call_init_common(call, from, to);
|
||||
call->log->call_id=ms_strdup(sal_op_get_call_id(op)); /*must be known at that time*/
|
||||
linphone_core_init_default_params(lc, &call->params);
|
||||
md=sal_call_get_remote_media_description(op);
|
||||
call->params.has_video &= !!lc->video_policy.automatically_accept;
|
||||
call->params.has_video &= linphone_core_media_description_contains_video_stream(sal_call_get_remote_media_description(op));
|
||||
if (md) {
|
||||
// It is licit to receive an INVITE without SDP
|
||||
// In this case WE chose the media parameters according to policy.
|
||||
call->params.has_video &= linphone_core_media_description_contains_video_stream(md);
|
||||
}
|
||||
switch (linphone_core_get_firewall_policy(call->core)) {
|
||||
case LinphonePolicyUseIce:
|
||||
call->ice_session = ice_session_new();
|
||||
|
|
|
|||
|
|
@ -2882,8 +2882,11 @@ int linphone_core_accept_call_with_params(LinphoneCore *lc, LinphoneCall *call,
|
|||
sal_op_set_contact(call->op,contact);
|
||||
|
||||
if (params){
|
||||
const SalMediaDescription *md = sal_call_get_remote_media_description(call->op);
|
||||
call->params=*params;
|
||||
call->params.has_video &= linphone_core_media_description_contains_video_stream(sal_call_get_remote_media_description(call->op));
|
||||
// There might not be a md if the INVITE was lacking an SDP
|
||||
// In this case we use the parameters as is.
|
||||
if (md) call->params.has_video &= linphone_core_media_description_contains_video_stream(md);
|
||||
call->camera_active=call->params.has_video;
|
||||
linphone_call_make_local_media_description(lc,call);
|
||||
sal_call_set_local_media_description(call->op,call->localdesc);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue