#2197 closed enhancement (fixed)
Support TURN extensions for TCP allocations (RFC 6062)
Reported by: | nanang | Owned by: | nanang |
---|---|---|---|
Priority: | normal | Milestone: | release-2.9 |
Component: | pjnath | Version: | trunk |
Keywords: | Cc: | ||
Backport to 1.x milestone: | Backported: | no |
Description (last modified by nanang)
This ticket will enable TURN client to establish TCP connection with the client's peers:
client <--[tcp]--> TURN server <--[tcp]--> peer
The RFC 6062 describes two modes: open outgoing TCP connection to peer and accept incoming TCP connection from peer, this ticket implements only the latter mode, i.e: accept mode.
General flow for accept mode:
- Client establishes TCP connection to TURN server, this is called control connection.
- Client sends Allocate request with REQUESTED-TRANSPORT attribute with value set to TCP.
- Client sends CreatePermission request to allow peer to initiate TCP connection to TURN server.
- When peer initiates TCP connection to the allocated address on TURN server, client will receive ConnectionAttempt indication with CONNECTION-ID attribute.
- If client decides to accept the connection, it should establish another TCP connection to TURN server, this connection is for data connection.
- Client sends ConnectionBind request on that data connection with CONNECTION-ID attribute with value set to the same value in previous ConnectionAttempt indication.
- Once client receives ConnectionBind success response, the data connection is fully established, the TURN server will simply relay data until any side closes the connection.
How to use
TURN socket application needs to do the following:
- When calling pj_turn_sock_create(), conn_type must be set to PJ_TURN_TP_TCP.
- When calling pj_turn_sock_alloc(), param.peer_conn_type must be set to PJ_TURN_TP_TCP.
- Implement TURN socket callbacks on_connection_attempt and on_connection_status, please check the TURN socket docs for more info.
- The rest is as usual, e.g: sending data can be done using pj_turn_sock_sendto(), incoming data will be notified via callback on_rx_data.
Thank you Guillaume Roguez and Sébastien Blin from Savoir-faire Linux for the patch.
Change History (3)
comment:1 Changed 6 years ago by nanang
- Owner set to nanang
- Resolution set to fixed
- Status changed from new to closed
comment:2 Changed 6 years ago by nanang
In 5988:
comment:3 Changed 6 years ago by nanang
- Description modified (diff)
Note: See
TracTickets for help on using
tickets.
In 5987: