mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-30 17:59:21 +00:00
linphonecore.c: release adress after usage
This commit is contained in:
parent
f14b6e73eb
commit
028afb264d
1 changed files with 8 additions and 9 deletions
|
|
@ -3854,22 +3854,21 @@ static void terminate_call(LinphoneCore *lc, LinphoneCall *call){
|
|||
}
|
||||
|
||||
int linphone_core_redirect_call(LinphoneCore *lc, LinphoneCall *call, const char *redirect_uri){
|
||||
char *real_url=NULL;
|
||||
LinphoneAddress *real_parsed_url=linphone_core_interpret_url(lc,redirect_uri);
|
||||
|
||||
|
||||
if (!real_parsed_url){
|
||||
/* bad url */
|
||||
ms_error("Bad redirect URI: %s", redirect_uri?:"NULL");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (call->state==LinphoneCallIncomingReceived){
|
||||
char *real_url=NULL;
|
||||
LinphoneAddress *real_parsed_url=linphone_core_interpret_url(lc,redirect_uri);
|
||||
if (!real_parsed_url){
|
||||
/* bad url */
|
||||
ms_error("Bad redirect URI: %s", redirect_uri?:"NULL");
|
||||
return -1;
|
||||
}
|
||||
real_url=linphone_address_as_string (real_parsed_url);
|
||||
sal_call_decline(call->op,SalReasonRedirect,real_url);
|
||||
ms_free(real_url);
|
||||
sal_error_info_set(&call->non_op_error,SalReasonRedirect,603,"Call redirected",NULL);
|
||||
terminate_call(lc,call);
|
||||
linphone_address_unref(real_parsed_url);
|
||||
}else{
|
||||
ms_error("Bad state for call redirection.");
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue