Commit 5e57f44a authored by Adrien Béraud's avatar Adrien Béraud Committed by Guillaume Roguez

ringdht: use the sip port in contact header

Refs #63196

Change-Id: Ie75406d52c20a3c950b48f2e6a23448839bb2ad7
parent a87ede8b
......@@ -920,7 +920,7 @@ RingAccount::getContactHeader(pjsip_transport* t)
return contact_;
}
auto ice = reinterpret_cast<SipIceTransport*>(t)->getIceTransport();
auto ice = reinterpret_cast<SipIceTransport*>(t);
// The transport type must be specified, in our case START_OTHER refers to stun transport
/*pjsip_transport_type_e transportType = transportType_;
......@@ -933,7 +933,7 @@ RingAccount::getContactHeader(pjsip_transport* t)
//pj_uint16_t port = getTlsListenerPort();
//link_->sipTransport->findLocalAddressFromTransport(t, transportType, hostname_, address, port);
auto address = ice->getDefaultLocalAddress();
auto address = ice->getLocalAddress();
/*if (addr) {
address = addr;
port =
......
......@@ -171,6 +171,12 @@ SipIceTransport::start()
ice_->setOnRecv(comp_id_, std::bind(&SipIceTransport::onRecv, this, _1, _2));
}
IpAddr
SipIceTransport::getLocalAddress() const
{
return ice_->getLocalAddress(comp_id_);
}
pj_status_t
SipIceTransport::send(pjsip_tx_data *tdata, const pj_sockaddr_t *rem_addr,
int addr_len, void *token,
......
......@@ -31,6 +31,8 @@
#pragma once
#include "ip_utils.h"
#include <pjsip.h>
#include <pj/pool.h>
#include <memory>
......@@ -51,6 +53,8 @@ struct SipIceTransport
*/
void start();
IpAddr getLocalAddress() const;
std::shared_ptr<sfl::IceTransport> getIceTransport() const {
return ice_;
}
......
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