Skip to content
Snippets Groups Projects
Commit 0b84e108 authored by Guillaume Roguez's avatar Guillaume Roguez
Browse files

ringaccount: display clearly when no device is found

* Log when a call fails due to "0 devices found" condition.
* Report an error code (no_such_device_or_address)
  to the call failure method.
* Use dgb than warn when devices are found.

Change-Id: Ie3ffa4fc1c9ebf2fea3453c647890a108213bd00
parent a47f5163
Branches
Tags
No related merge requests found
......@@ -75,6 +75,7 @@
#include <cctype>
#include <cstdarg>
#include <string>
#include <system_error>
namespace ring {
......@@ -486,7 +487,7 @@ RingAccount::startOutgoingCall(const std::shared_ptr<SIPCall>& call, const std::
{
auto call = wCall.lock();
if (not call) return;
RING_WARN("[call %s] Found device %s", call->getCallId().c_str(), dev.toString().c_str());
RING_DBG("[call %s] calling device %s", call->getCallId().c_str(), dev.toString().c_str());
auto& manager = Manager::instance();
auto dev_call = manager.callFactory.newCall<SIPCall, RingAccount>(*sthis, manager.getNewCallID(),
......@@ -572,8 +573,10 @@ RingAccount::startOutgoingCall(const std::shared_ptr<SIPCall>& call, const std::
});
}, [=](bool ok){
if (not ok) {
if (auto call = wCall.lock())
call->onFailure();
if (auto call = wCall.lock()) {
RING_WARN("[call:%s] no devices found", call->getCallId().c_str());
call->onFailure(static_cast<int>(std::errc::no_such_device_or_address));
}
}
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment