Fork me on GitHub
ice.h
Go to the documentation of this file.
1 
17 #ifndef _JANUS_ICE_H
18 #define _JANUS_ICE_H
19 
20 #include <glib.h>
21 #include <agent.h>
22 
23 #include "sdp.h"
24 #include "dtls.h"
25 #include "sctp.h"
26 #include "rtcp.h"
27 #include "text2pcap.h"
28 #include "utils.h"
29 #include "plugins/plugin.h"
30 
31 
38 void janus_ice_init(gboolean ice_lite, gboolean ice_tcp, gboolean ipv6, uint16_t rtp_min_port, uint16_t rtp_max_port);
40 void janus_ice_deinit(void);
45 int janus_ice_set_stun_server(gchar *stun_server, uint16_t stun_port);
53 int janus_ice_set_turn_server(gchar *turn_server, uint16_t turn_port, gchar *turn_type, gchar *turn_user, gchar *turn_pwd);
61 int janus_ice_set_turn_rest_api(gchar *api_server, gchar *api_key, gchar *api_method);
64 char *janus_ice_get_stun_server(void);
67 uint16_t janus_ice_get_stun_port(void);
70 char *janus_ice_get_turn_server(void);
73 uint16_t janus_ice_get_turn_port(void);
76 char *janus_ice_get_turn_rest_api(void);
78 void janus_ice_enable_nat_1_1(void);
85 void janus_ice_enforce_interface(const char *ip);
89 gboolean janus_ice_is_enforced(const char *ip);
97 void janus_ice_ignore_interface(const char *ip);
101 gboolean janus_ice_is_ignored(const char *ip);
104 gboolean janus_ice_is_ice_lite_enabled(void);
107 gboolean janus_ice_is_ice_tcp_enabled(void);
110 gboolean janus_ice_is_ipv6_enabled(void);
113 gboolean janus_ice_is_bundle_forced(void);
116 void janus_ice_force_bundle(gboolean forced);
119 gboolean janus_ice_is_rtcpmux_forced(void);
122 void janus_ice_force_rtcpmux(gboolean forced);
128 void janus_set_max_nack_queue(uint mnq);
131 uint janus_get_max_nack_queue(void);
134 void janus_set_no_media_timer(uint timer);
137 uint janus_get_no_media_timer(void);
140 void janus_ice_set_event_stats_period(int period);
148 void janus_ice_debugging_enable(void);
150 void janus_ice_debugging_disable(void);
151 
152 
156 const gchar *janus_get_ice_state_name(gint state);
157 
158 
167 
168 
169 #define JANUS_ICE_HANDLE_WEBRTC_PROCESSING_OFFER (1 << 0)
170 #define JANUS_ICE_HANDLE_WEBRTC_START (1 << 1)
171 #define JANUS_ICE_HANDLE_WEBRTC_READY (1 << 2)
172 #define JANUS_ICE_HANDLE_WEBRTC_STOP (1 << 3)
173 #define JANUS_ICE_HANDLE_WEBRTC_ALERT (1 << 4)
174 #define JANUS_ICE_HANDLE_WEBRTC_BUNDLE (1 << 5)
175 #define JANUS_ICE_HANDLE_WEBRTC_RTCPMUX (1 << 6)
176 #define JANUS_ICE_HANDLE_WEBRTC_TRICKLE (1 << 7)
177 #define JANUS_ICE_HANDLE_WEBRTC_ALL_TRICKLES (1 << 8)
178 #define JANUS_ICE_HANDLE_WEBRTC_TRICKLE_SYNCED (1 << 9)
179 #define JANUS_ICE_HANDLE_WEBRTC_DATA_CHANNELS (1 << 10)
180 #define JANUS_ICE_HANDLE_WEBRTC_CLEANING (1 << 11)
181 #define JANUS_ICE_HANDLE_WEBRTC_HAS_AUDIO (1 << 12)
182 #define JANUS_ICE_HANDLE_WEBRTC_HAS_VIDEO (1 << 13)
183 #define JANUS_ICE_HANDLE_WEBRTC_GOT_OFFER (1 << 14)
184 #define JANUS_ICE_HANDLE_WEBRTC_GOT_ANSWER (1 << 15)
185 #define JANUS_ICE_HANDLE_WEBRTC_HAS_AGENT (1 << 16)
186 
187 
190 typedef struct janus_ice_stats_info {
192  guint32 packets;
194  guint64 bytes;
198  gint64 updated;
202  guint32 nacks;
204 
207 typedef struct janus_ice_stats {
221 
225 void janus_ice_notify_hangup(janus_ice_handle *handle, const char *reason);
226 
227 
231 gboolean janus_plugin_session_is_alive(janus_plugin_session *plugin_session);
232 
233 
235 typedef struct janus_seq_info {
236  gint64 ts;
237  guint16 seq;
238  guint16 state;
242 enum {
247 };
248 
249 
253  void *session;
255  guint64 handle_id;
257  char *opaque_id;
259  gint64 created;
261  void *app;
267  gboolean force_bundle;
269  gboolean force_rtcp_mux;
271  gint cdone;
273  GMainContext *icectx;
275  GMainLoop *iceloop;
277  GThread *icethread;
279  NiceAgent *agent;
283  gboolean controlling;
285  guint audio_id;
287  guint video_id;
289  guint data_id;
291  gchar *audio_mid;
293  gchar *video_mid;
295  gchar *data_mid;
299  GHashTable *streams;
307  gchar *rtp_profile;
309  gchar *local_sdp;
311  gchar *remote_sdp;
313  const gchar *hangup_reason;
317  GAsyncQueue *queued_packets;
319  GThread *send_thread;
321  volatile gint send_thread_created;
327  volatile gint dump_packets;
332 };
333 
339  guint stream_id;
341  gint cdone:1;
343  guint disabled;
345  guint32 audio_ssrc;
347  guint32 video_ssrc;
351  guint32 video_ssrc_peer[3];
355  char *rid[3];
365  rtcp_context *video_rtcp_ctx[3];
371  gint64 video_first_ntp_ts[3];
373  guint32 video_first_rtp_ts[3];
375  guint32 audio_last_ts;
377  guint32 video_last_ts;
385  gchar *ruser;
387  gchar *rpass;
389  GHashTable *components;
395  gboolean noerrorlog;
398 };
399 
400 #define LAST_SEQS_MAX_LEN 160
401 
406  guint stream_id;
410  guint state;
414  GSList *candidates;
422  gboolean process_started;
424  GSource *icestate_source;
428  GSource *dtlsrt_source;
432  gboolean do_audio_nacks;
434  gboolean do_video_nacks;
438  GHashTable *retransmit_seqs;
450  janus_seq_info *last_seqs_video[3];
456  gboolean noerrorlog;
459 };
460 
466  gint64 received;
468  char *transaction;
471 };
472 
475 
481 janus_ice_trickle *janus_ice_trickle_new(janus_ice_handle *handle, const char *transaction, json_t *candidate);
487 gint janus_ice_trickle_parse(janus_ice_handle *handle, json_t *candidate, const char **error);
492 
493 
496 
501 janus_ice_handle *janus_ice_handle_create(void *gateway_session, const char *opaque_id);
506 janus_ice_handle *janus_ice_handle_find(void *gateway_session, guint64 handle_id);
513 gint janus_ice_handle_attach_plugin(void *gateway_session, guint64 handle_id, janus_plugin *plugin);
518 gint janus_ice_handle_destroy(void *gateway_session, guint64 handle_id);
521 void janus_ice_free(janus_ice_handle *handle);
525 void janus_ice_webrtc_hangup(janus_ice_handle *handle, const char *reason);
532 void janus_ice_stream_free(GHashTable *container, janus_ice_stream *stream);
536 void janus_ice_component_free(GHashTable *container, janus_ice_component *component);
538 
539 
542 
548 void janus_ice_relay_rtp(janus_ice_handle *handle, int video, char *buf, int len);
554 void janus_ice_relay_rtcp(janus_ice_handle *handle, int video, char *buf, int len);
559 void janus_ice_relay_data(janus_ice_handle *handle, char *buf, int len);
564 void janus_ice_incoming_data(janus_ice_handle *handle, char *buffer, int length);
566 
567 
570 
572 void *janus_ice_thread(void *data);
574 void *janus_ice_send_thread(void *data);
585 int janus_ice_setup_local(janus_ice_handle *handle, int offer, int audio, int video, int data, int bundle, int rtcpmux, int trickle);
591 void janus_ice_candidates_to_sdp(janus_ice_handle *handle, janus_sdp_mline *mline, guint stream_id, guint component_id);
596 void janus_ice_setup_remote_candidates(janus_ice_handle *handle, guint stream_id, guint component_id);
603 
604 #endif
guint srtp_errors_count
Count of the recent SRTP replay errors, in order to avoid spamming the logs.
Definition: ice.h:323
void janus_ice_notify_hangup(janus_ice_handle *handle, const char *reason)
Quick helper method to notify a WebRTC hangup through the Janus API.
Definition: ice.c:539
janus_ice_stats in_stats
Stats for incoming data (audio/video/data)
Definition: ice.h:452
gboolean noerrorlog
Helper flag to avoid flooding the console with the same error all over again.
Definition: ice.h:456
const gchar * hangup_reason
Reason this handle has been hung up.
Definition: ice.h:313
gint janus_ice_handle_attach_plugin(void *gateway_session, guint64 handle_id, janus_plugin *plugin)
Method to attach a Janus ICE handle to a plugin.
Definition: ice.c:1033
guint state
libnice ICE component state
Definition: ice.h:410
json_t * candidate
JSON object of the trickle candidate(s)
Definition: ice.h:470
int janus_ice_set_turn_rest_api(gchar *api_server, gchar *api_key, gchar *api_method)
Method to force Janus to contact a TURN REST API server to get a TURN service to use when gathering c...
Definition: ice.c:954
gint64 retransmit_log_ts
Last time a log message about sending retransmits was printed.
Definition: ice.h:440
gchar * audio_mid
Audio mid (media ID)
Definition: ice.h:291
janus_flags webrtc_flags
Mask of WebRTC-related flags for this handle.
Definition: ice.h:265
guint32 audio_ssrc
Audio SSRC of the gateway for this stream (may be bundled)
Definition: ice.h:345
gint janus_ice_handle_destroy(void *gateway_session, guint64 handle_id)
Method to destroy a Janus ICE handle.
Definition: ice.c:1075
SCTP processing for data channels (headers)
guint32 packets
Packets sent or received.
Definition: ice.h:192
gchar * local_sdp
SDP generated locally (just for debugging purposes)
Definition: ice.h:309
guint data_id
libnice ICE DataChannels ID
Definition: ice.h:289
struct janus_seq_info * prev
Definition: ice.h:240
struct json_t json_t
Definition: plugin.h:219
guint nack_sent_recent_cnt
Number of NACKs sent since last log message.
Definition: ice.h:446
guint component_id
libnice ICE component ID
Definition: ice.h:408
janus_ice_stream * stream
Janus ICE stream this component belongs to.
Definition: ice.h:404
gint64 audio_first_ntp_ts
First received audio NTP timestamp.
Definition: ice.h:367
Janus media statistics container.
Definition: ice.h:207
uint16_t janus_ice_get_stun_port(void)
Method to get the STUN server port.
Definition: ice.c:45
gboolean janus_ice_is_ice_lite_enabled(void)
Method to check whether ICE Lite mode is enabled or not (still WIP)
Definition: ice.c:76
janus_mutex mutex
Mutex to lock/unlock this component.
Definition: ice.h:458
GThread * icethread
GLib thread for libnice.
Definition: ice.h:277
int janus_ice_set_stun_server(gchar *stun_server, uint16_t stun_port)
Method to force Janus to use a STUN server when gathering candidates.
Definition: ice.c:764
struct janus_seq_info janus_seq_info
A helper struct for determining when to send NACKs.
janus_mutex mutex
Mutex to lock/unlock this stream.
Definition: ice.h:397
int janus_ice_setup_local(janus_ice_handle *handle, int offer, int audio, int video, int data, int bundle, int rtcpmux, int trickle)
Method to locally set up the ICE candidates (initialization and gathering)
Definition: ice.c:2795
void * janus_ice_thread(void *data)
Janus ICE handle thread.
Definition: ice.c:2454
NiceAgent * agent
libnice ICE agent
Definition: ice.h:279
gint64 nack_sent_log_ts
Last time a log message about sending NACKs was printed.
Definition: ice.h:444
void janus_set_max_nack_queue(uint mnq)
Method to modify the max NACK value (i.e., the number of packets per handle to store for retransmissi...
Definition: ice.c:316
struct janus_ice_stats janus_ice_stats
Janus media statistics container.
GHashTable * streams
GLib hash table of streams (IDs are the keys)
Definition: ice.h:299
char * janus_ice_get_turn_rest_api(void)
Method to get the specified TURN REST API backend, if any.
Definition: ice.c:65
Definition: ice.h:244
gboolean process_started
Whether the setup of remote candidates for this component has started or not.
Definition: ice.h:422
SDP m-line representation.
Definition: sdp-utils.h:122
void janus_ice_relay_data(janus_ice_handle *handle, char *buf, int len)
Gateway SCTP/DataChannel callback, called when a plugin has data to send to a peer.
void janus_ice_component_free(GHashTable *container, janus_ice_component *component)
Method to only free resources related to a specific ICE component allocated by a Janus ICE handle...
Definition: ice.c:1388
Plugin-Gateway communication (implementation)
Janus ICE stream.
Definition: ice.h:335
void janus_ice_webrtc_hangup(janus_ice_handle *handle, const char *reason)
Method to only hangup (e.g., DTLS alert) the WebRTC PeerConnection allocated by a Janus ICE handle...
Definition: ice.c:1201
void janus_ice_set_event_stats_period(int period)
Method to modify the event handler statistics period (i.e., the number of seconds that should pass be...
Definition: ice.c:250
ogg_stream_state * stream
Definition: pp-opus.c:31
void * janus_ice_send_thread(void *data)
Janus ICE thread for sending outgoing packets.
Definition: ice.c:3398
Janus ICE component.
Definition: ice.h:402
janus_ice_stream * data_stream
SCTP/DataChannel stream.
Definition: ice.h:305
gboolean force_bundle
Whether we have to force BUNDLE when negotiating (if true, overrides global configuration) ...
Definition: ice.h:267
void janus_ice_force_bundle(gboolean forced)
Method to set the BUNDLE support mode (true means mandatory, false means optional) ...
Definition: ice.c:94
uint janus_get_no_media_timer(void)
Method to get the current no-media event timer (see above)
Definition: ice.c:305
gboolean janus_plugin_session_is_alive(janus_plugin_session *plugin_session)
Quick helper method to check if a plugin session associated with a Janus handle is still valid...
Definition: ice.c:410
void janus_ice_relay_rtp(janus_ice_handle *handle, int video, char *buf, int len)
Gateway RTP callback, called when a plugin has an RTP packet to send to a peer.
Definition: ice.c:4092
GSList * candidates
GLib list of libnice remote candidates for this component.
Definition: ice.h:414
guint video_id
libnice ICE video ID
Definition: ice.h:287
gboolean janus_ice_is_ignored(const char *ip)
Method to check whether an interface/IP is currently in the ignore list for ICE (that is...
Definition: ice.c:230
janus_ice_handle * janus_ice_handle_find(void *gateway_session, guint64 handle_id)
Method to find an existing Janus ICE handle from its ID.
Definition: ice.c:1025
gboolean janus_ice_is_ipv6_enabled(void)
Method to check whether IPv6 candidates are enabled/supported or not (still WIP)
Definition: ice.c:88
void janus_ice_incoming_data(janus_ice_handle *handle, char *buffer, int length)
Plugin SCTP/DataChannel callback, called by the SCTP stack when when there&#39;s data for a plugin...
Definition: ice.c:2444
Instance of a text2pcap recorder.
Definition: text2pcap.h:47
guint16 seq
Definition: ice.h:237
janus_ice_handle * handle
Janus ICE handle this trickle candidate belongs to.
Definition: ice.h:464
gchar * remote_fingerprint
Hashed fingerprint of the peer&#39;s certificate, as parsed in SDP.
Definition: ice.h:383
GSList * remote_candidates
GLib list of remote candidates for this component (summary)
Definition: ice.h:418
GHashTable * components
GLib hash table of components (IDs are the keys)
Definition: ice.h:389
gint cdone
Number of gathered candidates.
Definition: ice.h:271
guint audio_id
libnice ICE audio ID
Definition: ice.h:285
gchar * video_mid
Video mid (media ID)
Definition: ice.h:293
gboolean janus_ice_is_rtcpmux_forced(void)
Method to check whether rtcp-mux support is forced or not.
Definition: ice.c:152
gchar * rtp_profile
RTP profile set by caller (so that we can match it)
Definition: ice.h:307
TURN REST API client.
char * transaction
Janus API transaction ID of the original trickle request.
Definition: ice.h:468
janus_ice_handle * janus_ice_handle_create(void *gateway_session, const char *opaque_id)
Method to create a new Janus ICE handle.
Definition: ice.c:989
Helper to handle pending trickle candidates (e.g., when we&#39;re still waiting for an offer) ...
Definition: ice.h:462
struct janus_seq_info * next
Definition: ice.h:239
guint stream_id
libnice ICE stream ID
Definition: ice.h:406
gboolean janus_ice_is_ice_tcp_enabled(void)
Method to check whether ICE-TCP support is enabled/supported or not (still WIP)
Definition: ice.c:82
gint64 created
Monotonic time of when the handle has been created.
Definition: ice.h:259
const gchar * janus_get_ice_state_name(gint state)
Helper method to get a string representation of a libnice ICE state.
Definition: ice.c:981
void janus_ice_ignore_interface(const char *ip)
Method to add an interface/IP to the ignore list for ICE (that is, don&#39;t gather candidates) ...
Definition: ice.c:219
GMainLoop * iceloop
GLib loop for libnice.
Definition: ice.h:275
void janus_ice_setup_remote_candidates(janus_ice_handle *handle, guint stream_id, guint component_id)
Method to handle remote candidates and start the connectivity checks.
Definition: ice.c:2728
gint payload_type
RTP payload type of this stream.
Definition: ice.h:361
void janus_ice_init(gboolean ice_lite, gboolean ice_tcp, gboolean ipv6, uint16_t rtp_min_port, uint16_t rtp_max_port)
ICE stuff initialization.
Definition: ice.c:684
janus_ice_stream * audio_stream
Audio stream.
Definition: ice.h:301
GSource * dtlsrt_source
Re-transmission timer for DTLS.
Definition: ice.h:428
gint janus_ice_get_rtcpmux_blackhole_port(void)
Method to get the port that has been assigned for the RTCP component blackhole in case of rtcp-mux...
Definition: ice.c:149
The plugin session and callbacks interface.
Definition: plugin.h:233
uint janus_get_max_nack_queue(void)
Method to get the current max NACK value (i.e., the number of packets per handle to store for retrans...
Definition: ice.c:323
janus_plugin_session * app_handle
Opaque gateway/plugin session pointer.
Definition: ice.h:263
guint retransmit_recent_cnt
Number of retransmitted packets since last log message.
Definition: ice.h:442
janus_ice_handle * handle
Janus ICE handle this stream belongs to.
Definition: ice.h:337
Definition: ice.h:243
GQueue * retransmit_buffer
List of previously sent janus_rtp_packet RTP packets, in case we receive NACKs.
Definition: ice.h:436
janus_ice_stats out_stats
Stats for outgoing data (audio/video/data)
Definition: ice.h:454
void janus_ice_debugging_disable(void)
Method to disable libnice debugging (the default)
Definition: ice.c:177
RTCP processing (headers)
gint64 updated
Time we last updated the last second counter.
Definition: ice.h:198
uint16_t janus_ice_get_turn_port(void)
Method to get the TURN server port.
Definition: ice.c:59
GSList * local_candidates
GLib list of local candidates for this component (summary)
Definition: ice.h:416
void janus_ice_candidates_to_sdp(janus_ice_handle *handle, janus_sdp_mline *mline, guint stream_id, guint component_id)
Method to add local candidates to a janus_sdp SDP object representation.
Definition: ice.c:2482
void janus_ice_webrtc_free(janus_ice_handle *handle)
Method to only free the WebRTC related resources allocated by a Janus ICE handle. ...
Definition: ice.c:1260
void janus_ice_stream_free(GHashTable *container, janus_ice_stream *stream)
Method to only free resources related to a specific ICE stream allocated by a Janus ICE handle...
Definition: ice.c:1327
gint64 ts
Definition: ice.h:236
janus_ice_component * rtcp_component
RTCP component.
Definition: ice.h:393
void janus_ice_enable_nat_1_1(void)
Helper method to force Janus to overwrite all host candidates with the public IP. ...
Definition: ice.c:186
void janus_ice_deinit(void)
ICE stuff de-initialization.
Definition: ice.c:745
janus_ice_stats_info audio
Audio info.
Definition: ice.h:209
gchar * remote_hashing
Hashing algorhitm used by the peer for the DTLS certificate (e.g., "SHA-256")
Definition: ice.h:381
gchar * ruser
The ICE username for this stream.
Definition: ice.h:385
gchar * remote_sdp
SDP received by the peer (just for debugging purposes)
Definition: ice.h:311
A helper struct for determining when to send NACKs.
Definition: ice.h:235
uint32_t janus_flags
Janus flags container.
Definition: utils.h:85
char * janus_ice_get_stun_server(void)
Method to get the STUN server IP address.
Definition: ice.c:42
void * app
Opaque application (plugin) pointer.
Definition: ice.h:261
int janus_ice_get_event_stats_period(void)
Method to get the current event handler statistics period (see above)
Definition: ice.c:253
DTLS/SRTP processing (headers)
void janus_ice_relay_rtcp(janus_ice_handle *handle, int video, char *buf, int len)
Gateway RTCP callback, called when a plugin has an RTCP message to send to a peer.
Definition: ice.c:4153
gboolean janus_ice_is_ice_debugging_enabled(void)
Method to check whether libnice debugging has been enabled (http://nice.freedesktop.org/libnice/libnice-Debug-messages.html)
Definition: ice.c:159
void janus_ice_trickle_destroy(janus_ice_trickle *trickle)
Helper method to destroy a janus_ice_trickle instance.
Definition: ice.c:669
gint cdone
Whether this stream is ready to be used.
Definition: ice.h:341
gboolean notified_lastsec
Whether or not we notified about lastsec issues already.
Definition: ice.h:200
Definition: ice.h:246
guint32 video_ssrc_peer_rtx
Video retransmissions SSRC of the peer for this stream (may be bundled)
Definition: ice.h:353
guint32 audio_first_rtp_ts
First received audio RTP timestamp.
Definition: ice.h:369
Janus ICE handle.
Definition: ice.h:251
guint32 video_ssrc
Video SSRC of the gateway for this stream (may be bundled)
Definition: ice.h:347
volatile gint send_thread_created
Atomic flag to make sure we only create the thread once.
Definition: ice.h:321
char * opaque_id
Opaque identifier, e.g., to provide inter-handle relationships to external tools. ...
Definition: ice.h:257
void janus_ice_free(janus_ice_handle *handle)
Method to actually free the resources allocated by a Janus ICE handle.
Definition: ice.c:1168
int janus_ice_set_turn_server(gchar *turn_server, uint16_t turn_port, gchar *turn_type, gchar *turn_user, gchar *turn_pwd)
Method to force Janus to use a TURN server when gathering candidates.
Definition: ice.c:903
struct janus_ice_stats_info janus_ice_stats_info
Janus media statistics.
GList * video_payload_types
List of payload types we can expect for video.
Definition: ice.h:359
gboolean force_rtcp_mux
Whether we have to force rtcp-mux when negotiating (if true, overrides global configuration) ...
Definition: ice.h:269
GHashTable * retransmit_seqs
HashTable of retransmittable sequence numbers, in case we receive NACKs.
Definition: ice.h:438
gboolean controlling
ICE role (controlling or controlled)
Definition: ice.h:283
GMainContext * icectx
GLib context for libnice.
Definition: ice.h:273
guint32 audio_ssrc_peer
Audio SSRC of the peer for this stream (may be bundled)
Definition: ice.h:349
guint32 audio_last_ts
Last sent audio RTP timestamp.
Definition: ice.h:375
Janus media statistics.
Definition: ice.h:190
GThread * send_thread
GLib thread for sending outgoing packets.
Definition: ice.h:319
gboolean do_audio_nacks
Whether we should do NACKs (in or out) for audio.
Definition: ice.h:432
void * session
Opaque pointer to the gateway/peer session.
Definition: ice.h:253
guint32 video_last_ts
Last sent video RTP timestamp.
Definition: ice.h:377
guint32 nacks
Number of NACKs sent or received.
Definition: ice.h:202
gchar * rpass
The ICE password for this stream.
Definition: ice.h:387
pthread_mutex_t janus_mutex
Janus mutex implementation.
Definition: mutex.h:19
janus_text2pcap * text2pcap
In case this session must be saved to text2pcap, the instance to dump packets to. ...
Definition: ice.h:329
gint64 component_connected
Monotonic time of when this component has successfully connected.
Definition: ice.h:412
Janus DTLS-SRTP handle.
Definition: dtls.h:53
janus_ice_stream * video_stream
Video stream.
Definition: ice.h:303
janus_mutex mutex
Mutex to lock/unlock the ICE session.
Definition: ice.h:331
volatile gint dump_packets
Flag to decide whether or not packets need to be dumped to a text2pcap file.
Definition: ice.h:327
guint64 bytes
Bytes sent or received.
Definition: ice.h:194
gint janus_ice_trickle_parse(janus_ice_handle *handle, json_t *candidate, const char **error)
Helper method to parse trickle candidates.
Definition: ice.c:577
GList * audio_payload_types
List of payload types we can expect for audio.
Definition: ice.h:357
gboolean janus_ice_is_bundle_forced(void)
Method to check whether BUNDLE support is forced or not.
Definition: ice.c:98
guint sl_nack_recent_cnt
Count of recent NACKs (for slow_link)
Definition: ice.h:219
Internal RTCP state context (for RR/SR)
Definition: rtcp.h:209
guint32 bytes_lastsec
Bytes sent or received in the last second.
Definition: ice.h:196
gchar * data_mid
Data channel mid (media ID)
Definition: ice.h:295
rtcp_context * audio_rtcp_ctx
RTCP context for the audio stream (may be bundled)
Definition: ice.h:363
guint64 handle_id
Handle identifier, guaranteed to be non-zero.
Definition: ice.h:255
Plugin-Gateway session mapping.
Definition: plugin.h:222
void janus_ice_force_rtcpmux(gboolean forced)
Method to set the rtcp-mux support mode (true means mandatory, false means optional) ...
Definition: ice.c:106
gint64 agent_created
Monotonic time of when the ICE agent has been created.
Definition: ice.h:281
GAsyncQueue * queued_packets
Queue of outgoing packets to send.
Definition: ice.h:317
janus_dtls_srtp * dtls
DTLS-SRTP stack.
Definition: ice.h:430
janus_seq_info * last_seqs_audio
List of recently received audio sequence numbers (as a support to NACK generation) ...
Definition: ice.h:448
GList * pending_trickles
List of pending trickle candidates (those we received before getting the JSEP offer) ...
Definition: ice.h:315
void janus_ice_enforce_interface(const char *ip)
Method to add an interface/IP to the enforce list for ICE (that is, only gather candidates from these...
Definition: ice.c:194
gint64 received
Monotonic time of when this trickle candidate has been received.
Definition: ice.h:466
gboolean do_video_nacks
Whether we should do NACKs (in or out) for video.
Definition: ice.h:434
gint64 icefailed_detected
Time of when we first detected an ICE failed (we&#39;ll need this for the timer above) ...
Definition: ice.h:426
void janus_ice_debugging_enable(void)
Method to enable libnice debugging (http://nice.freedesktop.org/libnice/libnice-Debug-messages.html)
Definition: ice.c:162
SDP processing (headers)
gboolean janus_ice_is_enforced(const char *ip)
Method to check whether an interface is currently in the enforce list for ICE (that is...
Definition: ice.c:202
guint16 state
Definition: ice.h:238
Dumping of RTP/RTCP packets to text2pcap format (headers)
char * janus_ice_get_turn_server(void)
Method to get the TURN server IP address.
Definition: ice.c:56
gint last_srtp_error
Count of the recent SRTP replay errors, in order to avoid spamming the logs.
Definition: ice.h:325
guint stream_id
libnice ICE stream ID
Definition: ice.h:339
Definition: ice.h:245
void janus_set_no_media_timer(uint timer)
Method to modify the no-media event timer (i.e., the number of seconds where no media arrives before ...
Definition: ice.c:298
gint streams_num
Number of streams.
Definition: ice.h:297
janus_ice_trickle * janus_ice_trickle_new(janus_ice_handle *handle, const char *transaction, json_t *candidate)
Helper method to allocate a janus_ice_trickle instance.
Definition: ice.c:566
GSource * icestate_source
Timer to check when we should consider ICE as failed.
Definition: ice.h:424
guint disabled
Whether the medium associated with this stream has been disabled (e.g., m=audio 0) ...
Definition: ice.h:343
gint64 sl_nack_period_ts
Start time of recent NACKs (for slow_link)
Definition: ice.h:217
gchar * selected_pair
String representation of the selected pair as notified by libnice (foundations)
Definition: ice.h:420
janus_ice_component * rtp_component
RTP (or SCTP, if this is the data stream) component.
Definition: ice.h:391
janus_ice_stats_info data
Data info.
Definition: ice.h:213
janus_dtls_role
DTLS roles.
Definition: dtls.h:38
janus_dtls_role dtls_role
DTLS role of the gateway for this stream.
Definition: ice.h:379
gint64 last_slowlink_time
Last time the slow_link callback (of the plugin) was called.
Definition: ice.h:215
guint32 bytes_lastsec_temp
Definition: ice.h:196
void janus_ice_dtls_handshake_done(janus_ice_handle *handle, janus_ice_component *component)
Callback to be notified when the DTLS handshake for a specific component has been completed...
Definition: ice.c:4174
gboolean noerrorlog
Helper flag to avoid flooding the console with the same error all over again.
Definition: ice.h:395