Commit e6ef9df3 authored by Ronan's avatar Ronan

fix(linphone): supports gcc 8

parent 77799c74
...@@ -516,8 +516,10 @@ static void call_ringing(SalOp *h){ ...@@ -516,8 +516,10 @@ static void call_ringing(SalOp *h){
} }
} }
static void start_pending_refer(LinphoneCall *call){ static unsigned char start_pending_refer (void *call) {
linphone_core_start_refered_call(call->core, call,NULL); LinphoneCall *to_refer = static_cast<LinphoneCall *>(call);
linphone_core_start_refered_call(to_refer->core, to_refer, NULL);
return 0;
} }
static void process_call_accepted(LinphoneCore *lc, LinphoneCall *call, SalOp *op){ static void process_call_accepted(LinphoneCore *lc, LinphoneCall *call, SalOp *op){
...@@ -605,7 +607,7 @@ static void process_call_accepted(LinphoneCore *lc, LinphoneCall *call, SalOp *o ...@@ -605,7 +607,7 @@ static void process_call_accepted(LinphoneCore *lc, LinphoneCall *call, SalOp *o
next_state = LinphoneCallPaused; next_state = LinphoneCallPaused;
next_state_str = "Call paused"; next_state_str = "Call paused";
if (call->refer_pending) if (call->refer_pending)
linphone_task_list_add(&tl, (LinphoneCoreIterateHook)start_pending_refer, call); linphone_task_list_add(&tl, start_pending_refer, call);
break; break;
default: default:
ms_error("call_accepted(): don't know what to do in state [%s]", linphone_call_state_to_string(call->state)); ms_error("call_accepted(): don't know what to do in state [%s]", linphone_call_state_to_string(call->state));
...@@ -692,13 +694,13 @@ static void call_paused_by_remote(LinphoneCore *lc, LinphoneCall *call){ ...@@ -692,13 +694,13 @@ static void call_paused_by_remote(LinphoneCore *lc, LinphoneCall *call){
static void call_updated_by_remote(LinphoneCore *lc, LinphoneCall *call){ static void call_updated_by_remote(LinphoneCore *lc, LinphoneCall *call){
linphone_core_notify_display_status(lc,_("Call is updated by remote.")); linphone_core_notify_display_status(lc,_("Call is updated by remote."));
linphone_call_set_state(call, LinphoneCallUpdatedByRemote,"Call updated by remote"); linphone_call_set_state(call, LinphoneCallUpdatedByRemote,"Call updated by remote");
if (call->ice_session && check_ice_reinvite_needs_defered_response(call)){ if (call->ice_session && check_ice_reinvite_needs_defered_response(call)){
call->defer_update = TRUE; call->defer_update = TRUE;
ms_message("LinphoneCall [%p]: Ice reinvite received, but one or more check list are not completed. Response will be sent later, once ICE has completed.", call); ms_message("LinphoneCall [%p]: Ice reinvite received, but one or more check list are not completed. Response will be sent later, once ICE has completed.", call);
call->incoming_ice_reinvite_pending = TRUE; call->incoming_ice_reinvite_pending = TRUE;
} }
if (call->defer_update == FALSE){ if (call->defer_update == FALSE){
if (call->state == LinphoneCallUpdatedByRemote){ if (call->state == LinphoneCallUpdatedByRemote){
linphone_call_accept_update(call, NULL); linphone_call_accept_update(call, NULL);
...@@ -905,19 +907,20 @@ static void call_terminated(SalOp *op, const char *from){ ...@@ -905,19 +907,20 @@ static void call_terminated(SalOp *op, const char *from){
linphone_call_set_state(call, LinphoneCallEnd,"Call ended"); linphone_call_set_state(call, LinphoneCallEnd,"Call ended");
} }
static int resume_call_after_failed_transfer(LinphoneCall *call){ static int resume_call_after_failed_transfer (void *call, unsigned int) {
if (call->was_automatically_paused && call->state==LinphoneCallPausing) LinphoneCall *to_resume = static_cast<LinphoneCall *>(call);
if (to_resume->was_automatically_paused && to_resume->state==LinphoneCallPausing)
return BELLE_SIP_CONTINUE; /*was still in pausing state*/ return BELLE_SIP_CONTINUE; /*was still in pausing state*/
if (call->was_automatically_paused && call->state==LinphoneCallPaused){ if (to_resume->was_automatically_paused && to_resume->state==LinphoneCallPaused){
if (sal_op_is_idle(call->op)){ if (sal_op_is_idle(to_resume->op)){
linphone_call_resume(call); linphone_call_resume(to_resume);
}else { }else {
ms_message("resume_call_after_failed_transfer(), salop was busy"); ms_message("resume_call_after_failed_transfer(), salop was busy");
return BELLE_SIP_CONTINUE; return BELLE_SIP_CONTINUE;
} }
} }
linphone_call_unref(call); linphone_call_unref(to_resume);
return BELLE_SIP_STOP; return BELLE_SIP_STOP;
} }
...@@ -1080,7 +1083,7 @@ static void call_failure(SalOp *op){ ...@@ -1080,7 +1083,7 @@ static void call_failure(SalOp *op){
/*notify referer of the failure*/ /*notify referer of the failure*/
linphone_core_notify_refer_state(lc,referer,call); linphone_core_notify_refer_state(lc,referer,call);
/*schedule automatic resume of the call. This must be done only after the notifications are completed due to dialog serialization of requests.*/ /*schedule automatic resume of the call. This must be done only after the notifications are completed due to dialog serialization of requests.*/
linphone_core_queue_task(lc,(belle_sip_source_func_t)resume_call_after_failed_transfer,linphone_call_ref(referer),"Automatic call resuming after failed transfer"); linphone_core_queue_task(lc, resume_call_after_failed_transfer,linphone_call_ref(referer),"Automatic call resuming after failed transfer");
} }
} }
......
...@@ -520,8 +520,12 @@ void linphone_friend_invalidate_subscription(LinphoneFriend *lf){ ...@@ -520,8 +520,12 @@ void linphone_friend_invalidate_subscription(LinphoneFriend *lf){
lf->initial_subscribes_sent=FALSE; lf->initial_subscribes_sent=FALSE;
} }
static void sal_notify_presence_close_cb (void *op) {
sal_notify_presence_close(static_cast<SalOp *>(op));
}
static void linphone_friend_close_incoming_subscriptions(LinphoneFriend *lf) { static void linphone_friend_close_incoming_subscriptions(LinphoneFriend *lf) {
bctbx_list_for_each(lf->insubs, (MSIterateFunc) sal_notify_presence_close); bctbx_list_for_each(lf->insubs, sal_notify_presence_close_cb);
lf->insubs = bctbx_list_free_with_data(lf->insubs, (MSIterateFunc)sal_op_release); lf->insubs = bctbx_list_free_with_data(lf->insubs, (MSIterateFunc)sal_op_release);
} }
......
...@@ -93,10 +93,10 @@ void RegisterInfoCommand::exec(Daemon *app, const std::string& args) { ...@@ -93,10 +93,10 @@ void RegisterInfoCommand::exec(Daemon *app, const std::string& args) {
int id; int id;
try { try {
id = atoi(param.c_str()); id = atoi(param.c_str());
} catch (std::invalid_argument) { } catch (const std::invalid_argument &) {
app->sendResponse(Response("Invalid ID.", Response::Error)); app->sendResponse(Response("Invalid ID.", Response::Error));
return; return;
} catch (std::out_of_range) { } catch (const std::out_of_range &) {
app->sendResponse(Response("Out of range ID.", Response::Error)); app->sendResponse(Response("Out of range ID.", Response::Error));
return; return;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment