Commit ebb5e5c1 authored by Sébastien Blin's avatar Sébastien Blin

contrib: bump pjproject

Now that RFC6062 is merged upstream, we can remove the patch from
our stack. The API changed a bit, so this patch also updates
turn_transport.cpp to follow changes

Change-Id: If6e0bae8280d586b2e5fcb0babe83df8127789b6
parent 5b6063dc
e203f3846db1a380b2bcb2e18fb73f6296a87c25d5b0b38d44df88a398c597bcb31c85a0e72b476908e4b56fdeb6fc5c586cf595f9723091d6a09659b75d1d5c pjproject-6b9212dcb4b3f781c1e922ae544b063880bc46ac.tar.gz
\ No newline at end of file
a9433b47294434288d61524dea556687fb02137ed56a10e8e2ba85d7888a2ca2a5bea4ae4a9ad008a4c208c5ec53fe364b10ed14481700d6aa8b9b6137e5e9ee pjproject-5dfa75be7d69047387f9b0436dd9492bbbf03fe4.tar.gz
\ No newline at end of file
set BUILD=%SRC%..\build
set PJPROJECT_VERSION=6b9212dcb4b3f781c1e922ae544b063880bc46ac
set PJPROJECT_VERSION=5dfa75be7d69047387f9b0436dd9492bbbf03fe4
set PJPROJECT_URL=https://github.com/pjsip/pjproject/archive/%PJPROJECT_VERSION%.tar.gz
mkdir %BUILD%
......@@ -33,7 +33,6 @@ bash -c "%PATCH_CMD% %UNIXPATH%pjproject/pj_ice_sess.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/fix_turn_fallback.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/fix_ioqueue_ipv6_sendto.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/add_dtls_transport.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/rfc6062.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/rfc6544.patch"
bash -c "%PATCH_CMD% %UNIXPATH%pjproject/ice_config.patch"
......
This diff is collapsed.
This diff is collapsed.
# PJPROJECT
PJPROJECT_VERSION := 6b9212dcb4b3f781c1e922ae544b063880bc46ac
PJPROJECT_VERSION := 5dfa75be7d69047387f9b0436dd9492bbbf03fe4
PJPROJECT_URL := https://github.com/pjsip/pjproject/archive/$(PJPROJECT_VERSION).tar.gz
PJPROJECT_OPTIONS := --disable-oss \
......@@ -61,7 +61,6 @@ endif
$(APPLY) $(SRC)/pjproject/fix_turn_fallback.patch
$(APPLY) $(SRC)/pjproject/fix_ioqueue_ipv6_sendto.patch
$(APPLY) $(SRC)/pjproject/add_dtls_transport.patch
$(APPLY) $(SRC)/pjproject/rfc6062.patch
$(APPLY) $(SRC)/pjproject/rfc6544.patch
$(APPLY) $(SRC)/pjproject/ice_config.patch
$(APPLY) $(SRC)/pjproject/sip_config.patch
......
......@@ -162,7 +162,7 @@ public:
void onTurnState(pj_turn_state_t old_state, pj_turn_state_t new_state);
void onRxData(const uint8_t* pkt, unsigned pkt_len, const pj_sockaddr_t* peer_addr, unsigned addr_len);
void onPeerConnection(pj_uint32_t conn_id, const pj_sockaddr_t* peer_addr, unsigned addr_len, pj_status_t status);
pj_status_t onPeerConnection(pj_uint32_t conn_id, const pj_sockaddr_t* peer_addr, unsigned addr_len);
void ioJob();
std::mutex apiMutex_;
......@@ -238,25 +238,22 @@ TurnTransportPimpl::onRxData(const uint8_t* pkt, unsigned pkt_len,
(channel_it->second) << std::string(reinterpret_cast<const char*>(pkt), pkt_len);
}
void
pj_status_t
TurnTransportPimpl::onPeerConnection(pj_uint32_t conn_id,
const pj_sockaddr_t* addr, unsigned addr_len,
pj_status_t status)
const pj_sockaddr_t* addr, unsigned addr_len)
{
IpAddr peer_addr (*static_cast<const pj_sockaddr*>(addr), addr_len);
if (status == PJ_SUCCESS) {
JAMI_DBG() << "Received connection attempt from " << peer_addr.toString(true, true)
<< ", id=" << std::hex << conn_id;
pj_turn_connect_peer(relay, conn_id, addr, addr_len);
{
MutexGuard lk {apiMutex_};
peerChannels_.emplace(peer_addr, PeerChannel {});
}
JAMI_DBG() << "Received connection attempt from "
<< peer_addr.toString(true, true) << ", id=" << std::hex
<< conn_id;
{
MutexGuard lk {apiMutex_};
peerChannels_.emplace(peer_addr, PeerChannel {});
}
if (settings.onPeerConnection)
settings.onPeerConnection(conn_id, peer_addr, status == PJ_SUCCESS);
settings.onPeerConnection(conn_id, peer_addr, true);
return PJ_SUCCESS;
}
void
......@@ -317,11 +314,12 @@ TurnTransport::TurnTransport(const TurnTransportParams& params)
auto pimpl = static_cast<TurnTransportPimpl*>(pj_turn_sock_get_user_data(relay));
pimpl->onTurnState(old_state, new_state);
};
relay_cb.on_peer_connection = [](pj_turn_sock* relay, pj_uint32_t conn_id,
const pj_sockaddr_t* peer_addr, unsigned addr_len,
pj_status_t status) {
auto pimpl = static_cast<TurnTransportPimpl*>(pj_turn_sock_get_user_data(relay));
pimpl->onPeerConnection(conn_id, peer_addr, addr_len, status);
relay_cb.on_connection_attempt = [](pj_turn_sock *relay,
pj_uint32_t conn_id,
const pj_sockaddr_t *peer_addr,
unsigned addr_len) {
auto pimpl = static_cast<TurnTransportPimpl *>(pj_turn_sock_get_user_data(relay));
return pimpl->onPeerConnection(conn_id, peer_addr, addr_len);
};
// TURN socket config
......
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