Commit d26f0f9e authored by Ghislain MARY's avatar Ghislain MARY

Convert linphone_call_abort() function to abort method of CallSession.

parent 7588a540
......@@ -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;
}
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
......@@ -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 ();
......
......@@ -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:
......
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