Commit c974ad81 authored by Damien Riegel's avatar Damien Riegel

logger: suppress many format warnings

Issue: #79584
Change-Id: Ie4183de7cd8b26b7ee38d7ecad5197937bf57c75
parent 1f217e22
......@@ -107,7 +107,7 @@ AccountFactory::removeAccount(Account& account)
RING_DBG("Removing account %s", id.c_str());
auto& map = accountMaps_.at(account.getAccountType());
map.erase(id);
RING_DBG("Remaining %u %s account(s)", map.size(), account_type);
RING_DBG("Remaining %zu %s account(s)", map.size(), account_type);
}
void
......
......@@ -50,7 +50,7 @@ CallFactory::removeCall(Call& call)
const auto& linkType = call.getLinkType();
auto& map = callMaps_.at(linkType);
map.erase(id);
RING_DBG("Remaining %u %s call(s)", map.size(), linkType);
RING_DBG("Remaining %zu %s call(s)", map.size(), linkType);
}
void
......
......@@ -198,7 +198,7 @@ template<class Row, typename Value, typename Accessor>
const Value Matrix1D<Row,Value,Accessor>::operator[](Row v) const {
assert(size_t(v) <= enum_class_size<Row>()+1 && size_t(v)>=0); //COUNT__ is also valid
if (size_t(v) >= enum_class_size<Row>()) {
RING_ERR("State Machine Out of Bounds %d\n", size_t(v));
RING_ERR("State Machine Out of Bounds %zu\n", size_t(v));
assert(false);
throw v;
}
......
......@@ -309,7 +309,7 @@ IceTransport::start(const Attribute& rem_attrs,
}
pj_str_t ufrag, pwd;
RING_DBG("ICE negotiation starting (%u remote candidates)", rem_candidates.size());
RING_DBG("ICE negotiation starting (%zu remote candidates)", rem_candidates.size());
auto status = pj_ice_strans_start_ice(icest_.get(),
pj_cstr(&ufrag, rem_attrs.ufrag.c_str()),
pj_cstr(&pwd, rem_attrs.pwd.c_str()),
......
......@@ -182,12 +182,12 @@ InstantMessaging::appendMimePayloads(const std::map<std::string, std::string>& p
for (const auto& pair : payloads) {
const auto& m = buildMimeMultipartPart(pair.first, {}, pair.second);
if (m.size() > max_message_size) {
RING_DBG("An %s payload is too large to be sent, the maximum lenght is %d",
RING_DBG("An %s payload is too large to be sent, the maximum lenght is %zu",
m.c_str(), max_message_size);
continue;
}
if (m.size() + chunk.size() > max_message_size) {
RING_DBG("Some MIME payloads don't fit into the packet, splitting, max size is %d, the payload would be %d %d %d",
RING_DBG("Some MIME payloads don't fit into the packet, splitting, max size is %zu, the payload would be %zu %zu %zu",
max_message_size, m.size() + chunk.size(), m.size() , chunk.size()
);
chunk += urilist + footer;
......
......@@ -791,7 +791,7 @@ void
Manager::removeConference(const std::string& conference_id)
{
RING_DBG("Remove conference %s", conference_id.c_str());
RING_DBG("number of participants: %u", conferenceMap_.size());
RING_DBG("number of participants: %zu", conferenceMap_.size());
ConferenceMap::iterator iter = conferenceMap_.find(conference_id);
std::shared_ptr<Conference> conf;
......@@ -1212,7 +1212,7 @@ Manager::detachParticipant(const std::string& call_id)
removeParticipant(call_id);
} else {
RING_DBG("Unbind main participant from conference %d");
RING_DBG("Unbind main participant from conference");
getRingBufferPool().unBindAll(RingBufferPool::DEFAULT_ID);
if (not isConference(current_call_id)) {
......@@ -1279,7 +1279,7 @@ Manager::processRemainingParticipants(Conference &conf)
const std::string current_call_id(getCurrentCallId());
ParticipantSet participants(conf.getParticipantList());
const size_t n = participants.size();
RING_DBG("Process remaining %d participant(s) from conference %s",
RING_DBG("Process remaining %zu participant(s) from conference %s",
n, conf.getConfID().c_str());
if (n > 1) {
......
......@@ -822,7 +822,7 @@ void AlsaLayer::audioCallback()
playbackBuff_.resize(ringtoneAvailFrames);
if (file_tone) {
RING_DBG("playback gain %d", playbackGain_);
RING_DBG("playback gain %.3f", playbackGain_);
file_tone->getNext(playbackBuff_, playbackGain_);
}
......
......@@ -75,7 +75,7 @@ AudioLoop::getNext(AudioBuffer& output, double gain)
RING_ERR("Audio loop size is 0");
return;
} else if (pos >= buf_samples) {
RING_ERR("Invalid loop position %d", pos);
RING_ERR("Invalid loop position %zu", pos);
return;
}
......
......@@ -103,7 +103,7 @@ void Resampler::resample(const AudioBuffer &dataIn, AudioBuffer &dataOut)
RING_DBG("SRC channel number changed.");
}
if (nbChans != dataOut.channels()) {
RING_DBG("Output buffer had the wrong number of channels (in: %d, out: %d).", nbChans, dataOut.channels());
RING_DBG("Output buffer had the wrong number of channels (in: %zu, out: %u).", nbChans, dataOut.channels());
dataOut.setChannelNum(nbChans);
}
......
......@@ -94,7 +94,7 @@ size_t RingBuffer::getLength(const std::string &call_id) const
void
RingBuffer::debug()
{
RING_DBG("Start=%d; End=%d; BufferSize=%d", getSmallestReadOffset(), endPos_, buffer_.frames());
RING_DBG("Start=%zu; End=%zu; BufferSize=%zu", getSmallestReadOffset(), endPos_, buffer_.frames());
}
size_t RingBuffer::getReadOffset(const std::string &call_id) const
......@@ -230,7 +230,7 @@ size_t RingBuffer::get(AudioBuffer& buf, const std::string &call_id)
const size_t sample_num = buf.frames();
size_t toCopy = std::min(sample_num, len);
if (toCopy and toCopy != sample_num) {
RING_DBG("Partial get: %d/%d", toCopy, sample_num);
RING_DBG("Partial get: %zu/%zu", toCopy, sample_num);
}
const size_t copied = toCopy;
......@@ -314,7 +314,7 @@ RingBuffer::discard(size_t toDiscard)
for (auto & r : readoffsets_) {
size_t dst = (r.second + buffer_size - endPos_) % buffer_size;
if (dst < toDiscard) {
RING_DBG("%s : discarding: %d frames", r.first.c_str(), toDiscard - dst);
RING_DBG("%s : discarding: %zu frames", r.first.c_str(), toDiscard - dst);
r.second = (r.second + toDiscard - dst) % buffer_size;
}
}
......
......@@ -104,7 +104,7 @@ class ShmHolder
void unMapShmArea() noexcept {
if (area_ != MAP_FAILED and ::munmap(area_, areaSize_) < 0) {
RING_ERR("ShmHolder[%s]: munmap(%u) failed with errno %d",
RING_ERR("ShmHolder[%s]: munmap(%zu) failed with errno %d",
openedName_.c_str(), areaSize_, errno);
}
}
......@@ -186,13 +186,13 @@ ShmHolder::resizeArea(std::size_t frameSize) noexcept
// full area size: +15 to take care of maximum padding size
const auto areaSize = sizeof(SHMHeader) + 2 * frameSize + 15;
RING_DBG("ShmHolder[%s]: new sizes: f=%u, a=%u", openedName_.c_str(),
RING_DBG("ShmHolder[%s]: new sizes: f=%zu, a=%zu", openedName_.c_str(),
frameSize, areaSize);
unMapShmArea();
if (::ftruncate(fd_, areaSize) < 0) {
RING_ERR("ShmHolder[%s]: ftruncate(%u) failed with errno %d",
RING_ERR("ShmHolder[%s]: ftruncate(%zu) failed with errno %d",
openedName_.c_str(), areaSize, errno);
return false;
}
......@@ -203,7 +203,7 @@ ShmHolder::resizeArea(std::size_t frameSize) noexcept
if (area_ == MAP_FAILED) {
areaSize_ = 0;
RING_ERR("ShmHolder[%s]: mmap(%u) failed with errno %d",
RING_ERR("ShmHolder[%s]: mmap(%zu) failed with errno %d",
openedName_.c_str(), areaSize, errno);
return false;
}
......
......@@ -333,7 +333,8 @@ RingAccount::SIPStartCall(const std::shared_ptr<SIPCall>& call, IpAddr target)
}
RING_DBG("contact header: %.*s / %s -> %s / %.*s",
pjContact.slen, pjContact.ptr, from.c_str(), toUri.c_str(), pjTarget.slen, pjTarget.ptr);
(int)pjContact.slen, pjContact.ptr, from.c_str(), toUri.c_str(),
(int)pjTarget.slen, pjTarget.ptr);
pjsip_dialog *dialog = NULL;
if (pjsip_dlg_create_uac(pjsip_ua_instance(), &pjFrom, &pjContact, &pjTo, &pjTarget, &dialog) != PJ_SUCCESS) {
......@@ -621,7 +622,7 @@ RingAccount::handleEvents()
c = pendingCalls_.erase(c);
}
} else if (ice->isFailed() || now - c->start > std::chrono::seconds(ICE_NEGOTIATION_TIMEOUT)) {
RING_WARN("[call:%s] ICE timeout : removing pending call (%d)",
RING_WARN("[call:%s] ICE timeout : removing pending call (%ld)",
call->getCallId().c_str(), call.use_count());
if (c->call_key != dht::InfoHash())
dht_.cancelListen(c->call_key, c->listen_key.get());
......@@ -736,7 +737,7 @@ RingAccount::doRegister_()
std::vector<std::shared_ptr<dht::crypto::Certificate>> ret;
if (cert)
ret.emplace_back(std::move(cert));
RING_DBG("Query for local certificate store: %s: %d found.", pk_id.toString().c_str(), ret.size());
RING_DBG("Query for local certificate store: %s: %zu found.", pk_id.toString().c_str(), ret.size());
return ret;
});
......
......@@ -719,7 +719,7 @@ SipsIceTransport::handleEvents()
for (const auto& pair: ackBuf) {
const auto& f = pair.first;
f.tdata_op_key->tdata = nullptr;
RING_DBG("status: %d", pair.second);
RING_DBG("status: %ld", pair.second);
if (f.tdata_op_key->callback)
f.tdata_op_key->callback(getTransportBase(), f.tdata_op_key->token,
pair.second);
......@@ -738,7 +738,7 @@ SipsIceTransport::setup()
std::lock_guard<std::mutex> l(inputBuffMtx_);
tlsInputBuff_.emplace_back(buf, buf+len);
canRead_ = true;
RING_DBG("TLS(ice): rx %uB", len);
RING_DBG("TLS(ice): rx %zuB", len);
}
cv_.notify_all();
return len;
......
......@@ -345,7 +345,7 @@ PresSubClient::PresSubClient(const std::string& uri, SIPPresence *pres) :
PresSubClient::~PresSubClient()
{
RING_DBG("Destroying pres_client object with uri %.*s", uri_.slen, uri_.ptr);
RING_DBG("Destroying pres_client object with uri %.*s", (int)uri_.slen, uri_.ptr);
rescheduleTimer(PJ_FALSE, 0);
unsubscribe();
pj_pool_release(pool_);
......@@ -394,7 +394,7 @@ void PresSubClient::rescheduleTimer(bool reschedule, unsigned msec)
pj_time_val delay;
RING_WARN("pres_client %.*s will resubscribe in %u ms (reason: %.*s)",
uri_.slen, uri_.ptr, msec, (int) term_reason_.slen, term_reason_.ptr);
(int)uri_.slen, uri_.ptr, msec, (int)term_reason_.slen, term_reason_.ptr);
pj_timer_entry_init(&timer_, 0, this, &pres_client_timer_cb);
delay.sec = 0;
delay.msec = msec;
......@@ -489,7 +489,7 @@ bool PresSubClient::unsubscribe()
}
/* Unsubscribe means send a subscribe with timeout=0s*/
RING_WARN("pres_client %.*s: unsubscribing..", uri_.slen, uri_.ptr);
RING_WARN("pres_client %.*s: unsubscribing..", (int)uri_.slen, uri_.ptr);
retStatus = pjsip_pres_initiate(sub_, 0, &tdata);
if (retStatus == PJ_SUCCESS) {
......@@ -500,7 +500,7 @@ bool PresSubClient::unsubscribe()
if (retStatus != PJ_SUCCESS and sub_) {
pjsip_pres_terminate(sub_, PJ_FALSE);
sub_ = NULL;
RING_WARN("Unable to unsubscribe presence", retStatus);
RING_WARN("Unable to unsubscribe presence (%d)", retStatus);
unlock();
return false;
}
......@@ -517,7 +517,7 @@ bool PresSubClient::subscribe()
if (sub_ and dlg_) { //do not bother if already subscribed
pjsip_evsub_terminate(sub_, PJ_FALSE);
RING_DBG("PreseSubClient %.*s: already subscribed. Refresh it.", uri_.slen, uri_.ptr);
RING_DBG("PreseSubClient %.*s: already subscribed. Refresh it.", (int)uri_.slen, uri_.ptr);
}
//subscribe
......@@ -532,7 +532,7 @@ bool PresSubClient::subscribe()
pres_callback.on_rx_notify = &pres_client_evsub_on_rx_notify;
SIPAccount * acc = pres_->getAccount();
RING_DBG("PresSubClient %.*s: subscribing ", uri_.slen, uri_.ptr);
RING_DBG("PresSubClient %.*s: subscribing ", (int)uri_.slen, uri_.ptr);
/* Create UAC dialog */
......@@ -558,7 +558,7 @@ bool PresSubClient::subscribe()
if (status != PJ_SUCCESS) {
sub_ = NULL;
RING_WARN("Unable to create presence client", status);
RING_WARN("Unable to create presence client (%d)", status);
/* This should destroy the dialog since there's no session
* referencing it
......@@ -591,7 +591,7 @@ bool PresSubClient::subscribe()
if (sub_)
pjsip_pres_terminate(sub_, PJ_FALSE);
sub_ = NULL;
RING_WARN("Unable to create initial SUBSCRIBE", status);
RING_WARN("Unable to create initial SUBSCRIBE (%d)", status);
return false;
}
......@@ -605,7 +605,7 @@ bool PresSubClient::subscribe()
if (sub_)
pjsip_pres_terminate(sub_, PJ_FALSE);
sub_ = NULL;
RING_WARN("Unable to send initial SUBSCRIBE", status);
RING_WARN("Unable to send initial SUBSCRIBE (%d)", status);
return false;
}
......
......@@ -608,7 +608,8 @@ Sdp::getMediaSlots(const pjmedia_sdp_session* session, bool remote) const
if (pjmedia_sdp_attr_get_rtpmap(rtpMapAttribute, &rtpmap) != PJ_SUCCESS ||
rtpmap.enc_name.slen == 0)
{
RING_ERR("Could not find payload type %s in SDP", media->desc.fmt[j]);
RING_ERR("Could not find payload type %.*s in SDP",
(int)media->desc.fmt[j].slen, media->desc.fmt[j].ptr);
descr.enabled = false;
continue;
}
......
......@@ -346,7 +346,7 @@ SIPAccount::SIPStartCall(std::shared_ptr<SIPCall>& call)
pj_str_t pjContact = getContactHeader(transport->get());
RING_DBG("contact header: %.*s / %s -> %s",
pjContact.slen, pjContact.ptr, from.c_str(), toUri.c_str());
(int)pjContact.slen, pjContact.ptr, from.c_str(), toUri.c_str());
pjsip_dialog *dialog = NULL;
......@@ -981,7 +981,7 @@ SIPAccount::sendRegister()
if (transport_) {
if (getUPnPActive() or not getPublishedSameasLocal() or (not received.empty() and received != getPublishedAddress())) {
pjsip_host_port *via = getViaAddr();
RING_DBG("Setting VIA sent-by to %.*s:%d", via->host.slen, via->host.ptr, via->port);
RING_DBG("Setting VIA sent-by to %.*s:%d", (int)via->host.slen, via->host.ptr, via->port);
if (pjsip_regc_set_via_sent_by(regc, via, transport_->get()) != PJ_SUCCESS)
throw VoipLinkException("Unable to set the \"sent-by\" field");
......@@ -1233,7 +1233,7 @@ void SIPAccount::initTlsConfiguration()
pj_cstr(&tlsSetting_.privkey_file, tlsPrivateKeyFile_.c_str());
pj_cstr(&tlsSetting_.password, tlsPassword_.c_str());
RING_DBG("Using %u ciphers", ciphers_.size());
RING_DBG("Using %zu ciphers", ciphers_.size());
tlsSetting_.ciphers_num = ciphers_.size();
tlsSetting_.ciphers = &ciphers_.front();
......@@ -2063,7 +2063,7 @@ SIPAccount::scheduleReregistration(pjsip_endpoint *endpt)
pj_time_val_normalize(&delay);
RING_WARN("Scheduling re-registration retry in %u seconds..", delay.sec);
RING_WARN("Scheduling re-registration retry in %ld seconds..", delay.sec);
auto_rereg_.timer.id = PJ_TRUE;
if (pjsip_endpt_schedule_timer(endpt, &auto_rereg_.timer, &delay) != PJ_SUCCESS)
auto_rereg_.timer.id = PJ_FALSE;
......
......@@ -303,8 +303,7 @@ SIPCall::sendSIPInfo(const char *const body, const char *const subtype)
void
SIPCall::updateSDPFromSTUN()
{
RING_WARN("[call:%s] SIPCall::updateSDPFromSTUN() not implemented", getCallId().c_str(),
__func__);
RING_WARN("[call:%s] SIPCall::updateSDPFromSTUN() not implemented", getCallId().c_str());
}
void
......@@ -321,11 +320,11 @@ SIPCall::terminateSipSession(int status)
sip_utils::addContactHeader(&contact, tdata);
ret = pjsip_inv_send_msg(inv.get(), tdata);
if (ret != PJ_SUCCESS)
RING_ERR("[call:%s] failed to send terminate msg, SIP error %d (%s)",
RING_ERR("[call:%s] failed to send terminate msg, SIP error (%s)",
getCallId().c_str(), sip_utils::sip_strerror(ret).c_str());
}
} else
RING_ERR("[call:%s] failed to terminate INVITE@%p, SIP error %d (%s)",
RING_ERR("[call:%s] failed to terminate INVITE@%p, SIP error (%s)",
getCallId().c_str(), inv.get(), sip_utils::sip_strerror(ret).c_str());
}
......@@ -363,7 +362,8 @@ SIPCall::answer()
// contactStr must stay in scope as long as tdata
if (contactHeader_.slen) {
RING_DBG("[call:%s] Answering with contact header: %.*s", getCallId().c_str(), contactHeader_.slen, contactHeader_.ptr);
RING_DBG("[call:%s] Answering with contact header: %.*s",
getCallId().c_str(), (int)contactHeader_.slen, contactHeader_.ptr);
sip_utils::addContactHeader(&contactHeader_, tdata);
}
......@@ -555,7 +555,7 @@ SIPCall::transfer(const std::string& to)
toUri = account.getToUri(to);
pj_cstr(&dst, toUri.c_str());
RING_DBG("[call:%s] Transferring to %.*s", getCallId().c_str(), dst.slen, dst.ptr);
RING_DBG("[call:%s] Transferring to %.*s", getCallId().c_str(), (int)dst.slen, dst.ptr);
if (!transferCommon(&dst))
throw VoipLinkException("Couldn't transfer");
......
......@@ -239,7 +239,7 @@ void SIPPresence::addPresSubClient(PresSubClient *c)
{
if (sub_client_list_.size() < MAX_N_SUB_CLIENT) {
sub_client_list_.push_back(c);
RING_DBG("New Presence_subscription_client added (list[%i]).", sub_client_list_.size());
RING_DBG("New Presence_subscription_client added (list[%zu]).", sub_client_list_.size());
} else {
RING_WARN("Max Presence_subscription_client is reach.");
// let the client alive //delete c;
......@@ -322,7 +322,7 @@ void SIPPresence::fillDoc(pjsip_tx_data *tdata, const pres_msg_data *msg_data)
while (hdr && hdr != &msg_data->hdr_list) {
pjsip_hdr *new_hdr;
new_hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, hdr);
RING_DBG("adding header", new_hdr->name.ptr);
RING_DBG("adding header %p", new_hdr->name.ptr);
pjsip_msg_add_hdr(tdata->msg, new_hdr);
hdr = hdr->next;
}
......@@ -420,7 +420,7 @@ SIPPresence::send_publish(SIPPresence * pres)
pj_str_t from = pj_strdup3(pres->pool_, acc->getFromUri().c_str());
if (status != PJ_SUCCESS) {
RING_ERR("Error creating PUBLISH request", status);
RING_ERR("Error creating PUBLISH request %d", status);
goto on_error;
}
......
......@@ -89,7 +89,7 @@ SipTransport::SipTransport(pjsip_transport* t)
// Set pointer here, right after the successful pjsip_transport_add_ref
transport_.reset(t);
RING_DBG("SipTransport@%p {tr=%p {rc=%u}}",
RING_DBG("SipTransport@%p {tr=%p {rc=%ld}}",
this, transport_.get(), pj_atomic_get(transport_->ref_cnt));
}
......@@ -102,7 +102,7 @@ SipTransport::SipTransport(pjsip_transport* t,
SipTransport::~SipTransport()
{
RING_DBG("~SipTransport@%p {tr=%p {rc=%u}}",
RING_DBG("~SipTransport@%p {tr=%p {rc=%ld}}",
this, transport_.get(), pj_atomic_get(transport_->ref_cnt));
}
......
......@@ -600,7 +600,7 @@ SIPVoIPLink::~SIPVoIPLink()
// may be called and another instance of SIPVoIPLink can be re-created!
if (not Manager::instance().callFactory.empty<SIPCall>())
RING_ERR("%d SIP calls remains!",
RING_ERR("%zu SIP calls remains!",
Manager::instance().callFactory.callCount<SIPCall>());
sipTransportBroker->shutdown();
......@@ -690,7 +690,7 @@ SIPVoIPLink::handleEvents()
static const pj_time_val timeout = {0, 0}; // polling
auto ret = pjsip_endpt_handle_events(endpt_, &timeout);
if (ret != PJ_SUCCESS)
RING_ERR("pjsip_endpt_handle_events failed with error %d: %s",
RING_ERR("pjsip_endpt_handle_events failed with error %s",
sip_utils::sip_strerror(ret).c_str());
#ifdef RING_VIDEO
......@@ -700,7 +700,7 @@ SIPVoIPLink::handleEvents()
void SIPVoIPLink::registerKeepAliveTimer(pj_timer_entry &timer, pj_time_val &delay)
{
RING_DBG("Register new keep alive timer %d with delay %d", timer.id, delay.sec);
RING_DBG("Register new keep alive timer %d with delay %ld", timer.id, delay.sec);
if (timer.id == -1)
RING_WARN("Timer already scheduled");
......@@ -813,7 +813,7 @@ invite_session_state_changed_cb(pjsip_inv_session *inv, pjsip_event *ev)
RING_DBG("[call:%s] INVITE@%p state changed to %d (%s): cause=%d, tsx@%p status %d (%.*s)",
call->getCallId().c_str(), inv, inv->state, pjsip_inv_state_name(inv->state),
inv->cause, tsx, status_code, description->slen, description->ptr);
inv->cause, tsx, status_code, (int)description->slen, description->ptr);
} else {
status_code = 0;
RING_DBG("[call:%s] INVITE@%p state changed to %d (%s): cause=%d (TX_MSG)",
......@@ -1055,7 +1055,7 @@ replyToRequest(pjsip_inv_session* inv, pjsip_rx_data* rdata, int status_code)
{
const auto ret = pjsip_dlg_respond(inv->dlg, rdata, status_code, nullptr, nullptr, nullptr);
if (ret != PJ_SUCCESS)
RING_WARN("SIP: failed to reply %u to request");
RING_WARN("SIP: failed to reply %d to request", status_code);
}
static void
......@@ -1180,7 +1180,7 @@ transaction_state_changed_cb(pjsip_inv_session* inv, pjsip_transaction* tsx, pjs
// Using method name to dispatch
const std::string methodName {msg->line.req.method.name.ptr, (unsigned)msg->line.req.method.name.slen};
RING_DBG("[INVITE:%p] RX SIP method %d (%#s)", inv, msg->line.req.method.id, methodName.c_str());
RING_DBG("[INVITE:%p] RX SIP method %d (%s)", inv, msg->line.req.method.id, methodName.c_str());
#ifdef DEBUG_SIP_REQUEST_MSG
char msgbuf[1000];
......@@ -1392,7 +1392,7 @@ SIPVoIPLink::findLocalAddressFromSTUN(pjsip_transport* transport,
switch (stunStatus) {
case PJLIB_UTIL_ESTUNNOTRESPOND:
RING_ERR("No response from STUN server %.*s",
stunServerName->slen, stunServerName->ptr);
(int)stunServerName->slen, stunServerName->ptr);
return false;
case PJLIB_UTIL_ESTUNSYMMETRIC:
......@@ -1403,13 +1403,13 @@ SIPVoIPLink::findLocalAddressFromSTUN(pjsip_transport* transport,
port = pj_sockaddr_in_get_port(&mapped_addr);
addr = IpAddr((const pj_sockaddr&)mapped_addr).toString();
RING_DBG("STUN server %.*s replied '%s:%u'",
stunServerName->slen, stunServerName->ptr,
(int)stunServerName->slen, stunServerName->ptr,
addr.c_str(), port);
return true;
default: // use given address, silent any not handled error
RING_WARN("Error from STUN server %.*s, using source address",
stunServerName->slen, stunServerName->ptr);
(int)stunServerName->slen, stunServerName->ptr);
return false;
}
}
......
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