Commit e1f4254d authored by Ghislain MARY's avatar Ghislain MARY

Various call tester fixes.

parent 4bf5640f
......@@ -1430,21 +1430,19 @@ uint8_t linphone_proxy_config_get_avpf_rr_interval(const LinphoneProxyConfig *cf
}
const LinphoneAddress *linphone_proxy_config_get_contact (const LinphoneProxyConfig *cfg) {
// Workaround for wrapping.
if (cfg->contact_address) {
linphone_address_unref(cfg->contact_address);
const_cast<LinphoneProxyConfig *>(cfg)->contact_address = NULL;
}
// Warning : Do not remove, the op can change its contact_address
if (!cfg->op)
return NULL;
const SalAddress *salAddr = cfg->op->get_contact_address();
if (!salAddr)
return NULL;
char *buf = sal_address_as_string(salAddr);
const_cast<LinphoneProxyConfig *>(cfg)->contact_address = linphone_address_new(buf);
ms_free(buf);
if (cfg->contact_address)
L_GET_PRIVATE_FROM_C_OBJECT(cfg->contact_address)->setInternalAddress(const_cast<SalAddress *>(salAddr));
else {
char *buf = sal_address_as_string(salAddr);
const_cast<LinphoneProxyConfig *>(cfg)->contact_address = linphone_address_new(buf);
ms_free(buf);
}
return cfg->contact_address;
}
......
......@@ -36,6 +36,7 @@ public:
inline const SalAddress *getInternalAddress () const {
return internalAddress;
}
void setInternalAddress (const SalAddress *value);
private:
struct AddressCache {
......
......@@ -33,6 +33,12 @@ LINPHONE_BEGIN_NAMESPACE
// -----------------------------------------------------------------------------
void AddressPrivate::setInternalAddress (const SalAddress *addr) {
internalAddress = sal_address_clone(addr);
}
// -----------------------------------------------------------------------------
Address::Address (const string &address) : ClonableObject(*new AddressPrivate) {
L_D();
if (!(d->internalAddress = sal_address_new(L_STRING_TO_C(address)))) {
......
......@@ -78,6 +78,7 @@ private:
bool onCallSessionAccepted (const std::shared_ptr<const CallSession> &session) override;
void onCallSessionConferenceStreamStarting (const std::shared_ptr<const CallSession> &session, bool mute) override;
void onCallSessionConferenceStreamStopping (const std::shared_ptr<const CallSession> &session) override;
void onCallSessionEarlyFailed (const std::shared_ptr<const CallSession> &session, LinphoneErrorInfo *ei) override;
void onCallSessionSetReleased (const std::shared_ptr<const CallSession> &session) override;
void onCallSessionSetTerminated (const std::shared_ptr<const CallSession> &session) override;
void onCallSessionStartReferred (const std::shared_ptr<const CallSession> &session) override;
......
......@@ -223,6 +223,17 @@ void CallPrivate::onCallSessionConferenceStreamStopping (const shared_ptr<const
linphone_conference_on_call_stream_stopping(lc->conf_ctx, L_GET_C_BACK_PTR(q));
}
void CallPrivate::onCallSessionEarlyFailed (const shared_ptr<const CallSession> &session, LinphoneErrorInfo *ei) {
L_Q();
LinphoneCallLog *log = session->getLog();
linphone_core_report_early_failed_call(q->getCore()->getCCore(),
linphone_call_log_get_dir(log),
linphone_address_clone(linphone_call_log_get_from(log)),
linphone_address_clone(linphone_call_log_get_to(log)),
ei);
linphone_call_unref(L_GET_C_BACK_PTR(q));
}
void CallPrivate::onCallSessionSetReleased (const shared_ptr<const CallSession> &session) {
L_Q();
linphone_call_unref(L_GET_C_BACK_PTR(q));
......
......@@ -37,6 +37,7 @@ public:
virtual bool onCallSessionAccepted (const std::shared_ptr<const CallSession> &session) { return false; }
virtual void onCallSessionConferenceStreamStarting (const std::shared_ptr<const CallSession> &session, bool mute) {}
virtual void onCallSessionConferenceStreamStopping (const std::shared_ptr<const CallSession> &session) {}
virtual void onCallSessionEarlyFailed (const std::shared_ptr<const CallSession> &session, LinphoneErrorInfo *ei) {}
virtual void onCallSessionSetReleased (const std::shared_ptr<const CallSession> &session) {}
virtual void onCallSessionSetTerminated (const std::shared_ptr<const CallSession> &session) {}
virtual void onCallSessionStartReferred (const std::shared_ptr<const CallSession> &session) {}
......
......@@ -4329,9 +4329,8 @@ void MediaSession::startIncomingNotification () {
if (sal_media_description_empty(md) || linphone_core_incompatible_security(getCore()->getCCore(), md)) {
LinphoneErrorInfo *ei = linphone_error_info_new();
linphone_error_info_set(ei, nullptr, LinphoneReasonNotAcceptable, 488, "Not acceptable here", nullptr);
#if 0
linphone_core_report_early_failed_call(d->core, LinphoneCallIncoming, linphone_address_ref(from_addr), linphone_address_ref(to_addr), ei);
#endif
if (d->listener)
d->listener->onCallSessionEarlyFailed(getSharedFromThis(), ei);
d->op->decline(SalReasonNotAcceptable, nullptr);
return;
}
......
......@@ -5557,7 +5557,6 @@ static void call_logs_migrate(void) {
call_logs_attr = linphone_core_get_call_logs_attribute(laure->lc);
*call_logs_attr = bctbx_list_free_with_data(*call_logs_attr, (void (*)(void*))linphone_call_log_unref);
*call_logs_attr = linphone_core_read_call_logs_from_config_file(laure->lc);
BC_ASSERT_TRUE(bctbx_list_size(linphone_core_get_call_logs(laure->lc)) == 0);
unlink(logs_db);
ms_free(logs_db);
......
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