diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index d5a5eb690..eabe1e338 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -1442,24 +1442,6 @@ LinphoneStatus linphone_call_transfer_to_another(LinphoneCall *call, LinphoneCal #endif } -int linphone_call_abort(LinphoneCall *call, const char *error) { -#if 0 - LinphoneCore *lc = linphone_call_get_core(call); - - sal_call_terminate(call->op); - - /* Stop ringing */ - linphone_core_stop_ringing(lc); - linphone_call_stop_media_streams(call); - - linphone_core_notify_display_status(lc, _("Call aborted")); - linphone_call_set_state(call, LinphoneCallError, error); - return 0; -#else - return 0; -#endif -} - int linphone_call_proceed_with_invite_if_ready(LinphoneCall *call, LinphoneProxyConfig *dest_proxy) { return 0; } diff --git a/coreapi/private.h b/coreapi/private.h index a8ee78145..a7e650847 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -340,7 +340,6 @@ const LinphoneAuthInfo *_linphone_core_find_tls_auth_info(LinphoneCore *lc); const LinphoneAuthInfo *_linphone_core_find_auth_info(LinphoneCore *lc, const char *realm, const char *username, const char *domain, bool_t ignore_realm); void linphone_core_update_proxy_register(LinphoneCore *lc); -int linphone_call_abort(LinphoneCall *call, const char *error); const char *linphone_core_get_nat_address_resolved(LinphoneCore *lc); int linphone_proxy_config_send_publish(LinphoneProxyConfig *cfg, LinphonePresenceModel *presence); diff --git a/src/conference/session/call-session-p.h b/src/conference/session/call-session-p.h index 915120e17..eb5e672a5 100644 --- a/src/conference/session/call-session-p.h +++ b/src/conference/session/call-session-p.h @@ -44,6 +44,7 @@ public: LinphoneProxyConfig * getDestProxy () const { return destProxy; } SalOp * getOp () const { return op; } + virtual void abort (const std::string &errorMsg); virtual void accepted (); void ackBeingSent (LinphoneHeaders *headers); virtual void ackReceived (LinphoneHeaders *headers); diff --git a/src/conference/session/call-session.cpp b/src/conference/session/call-session.cpp index de05172b7..b88a80ae8 100644 --- a/src/conference/session/call-session.cpp +++ b/src/conference/session/call-session.cpp @@ -218,6 +218,12 @@ bool CallSessionPrivate::startPing () { // ----------------------------------------------------------------------------- +void CallSessionPrivate::abort (const string &errorMsg) { + sal_call_terminate(op); + linphone_core_notify_display_status(core, "Call aborted"); + setState(LinphoneCallError, errorMsg); +} + void CallSessionPrivate::accepted () { L_Q(CallSession); char *msg = nullptr; diff --git a/src/conference/session/media-session-p.h b/src/conference/session/media-session-p.h index 3d4258bac..44171ebfb 100644 --- a/src/conference/session/media-session-p.h +++ b/src/conference/session/media-session-p.h @@ -46,6 +46,7 @@ public: public: static void stunAuthRequestedCb (void *userData, const char *realm, const char *nonce, const char **username, const char **password, const char **ha1); + void abort (const std::string &errorMsg); void accepted (); void ackReceived (LinphoneHeaders *headers); bool failure (); diff --git a/src/conference/session/media-session.cpp b/src/conference/session/media-session.cpp index 8add69a49..6ae54fb87 100644 --- a/src/conference/session/media-session.cpp +++ b/src/conference/session/media-session.cpp @@ -117,6 +117,14 @@ void MediaSessionPrivate::stunAuthRequestedCb (void *userData, const char *realm // ----------------------------------------------------------------------------- +void MediaSessionPrivate::abort (const string &errorMsg) { +#if 0 + linphone_core_stop_ringing(lc); +#endif + stopStreams(); + CallSessionPrivate::abort(errorMsg); +} + void MediaSessionPrivate::accepted () { L_Q(MediaSession); CallSessionPrivate::accepted(); @@ -201,9 +209,7 @@ void MediaSessionPrivate::accepted () { case LinphoneCallIncomingReceived: case LinphoneCallIncomingEarlyMedia: lError() << "Incompatible SDP answer received, need to abort the call"; -#if 0 - linphone_call_abort(call, _("Incompatible, check codecs or security settings...")); -#endif + abort("Incompatible, check codecs or security settings..."); break; /* Otherwise we are able to resume previous state */ default: