Commit b8adedf9 authored by Guillaume Roguez's avatar Guillaume Roguez Committed by Olivier SOLDANO

sipcall: make SIPCall::setCallMediaLocal() private

setCallMediaLocal is used to setup transport related options.
We also don't use anymore the local IP argument.
So this patch remove the argument, move it into ctor
and make setCallMediaLocal private (all calls removed).

This has the good side effect to remove the non-permited ICE API call
causing an error in logs.

Change-Id: I69220c253164777e8e88b6a4deef451325458c2c
Reviewed-by: default avatarOlivier Soldano <olivier.soldano@savoirfairelinux.com>
parent 678f9dd7
......@@ -589,7 +589,6 @@ RingAccount::onConnectedOutgoingCall(SIPCall& call, const std::string& to_id, Ip
call.initRecFilename(to_id);
const auto localAddress = ip_utils::getInterfaceAddr(getLocalInterface());
call.setCallMediaLocal(call.getIceMediaTransport()->getDefaultLocalAddress());
IpAddr addrSdp;
if (getUPnPActive()) {
......
......@@ -206,7 +206,6 @@ SIPAccount::newOutgoingCall(const std::string& toUrl)
call->initRecFilename(to);
const auto localAddress = ip_utils::getInterfaceAddr(getLocalInterface(), family);
call->setCallMediaLocal(localAddress);
IpAddr addrSdp;
if (getUPnPActive()) {
......
......@@ -120,6 +120,8 @@ SIPCall::SIPCall(SIPAccountBase& account, const std::string& id, Call::CallType
{
if (account.getUPnPActive())
upnp_.reset(new upnp::Controller());
setCallMediaLocal();
}
SIPCall::~SIPCall()
......@@ -135,7 +137,7 @@ SIPCall::getSIPAccount() const
}
void
SIPCall::setCallMediaLocal(const pj_sockaddr& localIP)
SIPCall::setCallMediaLocal()
{
if (localAudioPort_ == 0
#ifdef RING_VIDEO
......
......@@ -197,8 +197,6 @@ public: // NOT SIP RELATED (good candidates to be moved elsewhere)
return srtpEnabled_;
}
void setCallMediaLocal(const pj_sockaddr& localIP);
void generateMediaPorts();
void startAllMedia();
......@@ -222,6 +220,8 @@ public: // NOT SIP RELATED (good candidates to be moved elsewhere)
private:
NON_COPYABLE(SIPCall);
void setCallMediaLocal();
void waitForIceAndStartMedia();
void stopAllMedia();
......
......@@ -326,7 +326,6 @@ transaction_request_cb(pjsip_rx_data *rdata)
call->setPeerNumber(peerNumber);
call->setPeerDisplayName(peerDisplayName);
call->initRecFilename(peerNumber);
call->setCallMediaLocal(addrToUse);
call->getSDP().setPublishedIP(addrSdp);
if (account->isStunEnabled())
......@@ -896,8 +895,6 @@ sdp_create_offer_cb(pjsip_inv_session *inv, pjmedia_sdp_session **p_offer)
/* fallback on local address */
if (not address) address = ifaceAddr;
call->setCallMediaLocal(address);
auto& localSDP = call->getSDP();
localSDP.setPublishedIP(address);
const bool created = localSDP.createOffer(
......
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