From 3a163296ba74850c91c2feae0029b386df5d8dec Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Sun, 4 Aug 2013 14:43:29 +0200 Subject: [PATCH] fix linphone_core_accept_call_with_params() as it was in exosip implementation so that it does not compute sdp answer two times (for 180 and 200). --- coreapi/bellesip_sal/sal_op_call.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/coreapi/bellesip_sal/sal_op_call.c b/coreapi/bellesip_sal/sal_op_call.c index dae5a4b27..c74922b57 100644 --- a/coreapi/bellesip_sal/sal_op_call.c +++ b/coreapi/bellesip_sal/sal_op_call.c @@ -496,6 +496,16 @@ int sal_call_set_local_media_description(SalOp *op, SalMediaDescription *desc){ if (op->base.local_media) sal_media_description_unref(op->base.local_media); op->base.local_media=desc; + + if (op->base.remote_media){ + /*case of an incoming call where we modify the local capabilities between the time + * the call is ringing and it is accepted (for example if you want to accept without video*/ + /*reset the sdp answer so that it is computed again*/ + if (op->sdp_answer){ + belle_sip_object_unref(op->sdp_answer); + op->sdp_answer=NULL; + } + } return 0; } @@ -558,7 +568,7 @@ static void handle_offer_answer_response(SalOp* op, belle_sip_response_t* respon set_sdp_from_desc(BELLE_SIP_MESSAGE(response),op->base.local_media); }else{ - sdp_process(op); + if (op->sdp_answer==NULL) sdp_process(op); if (op->sdp_answer){ set_sdp(BELLE_SIP_MESSAGE(response),op->sdp_answer);