1
/* $Id: ice_strans.h 4606 2013-10-01 05:00:57Z ming $ */
3
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
#ifndef __PJNATH_ICE_STRANS_H__
21
#define __PJNATH_ICE_STRANS_H__
26
* @brief ICE Stream Transport
28
#include <pjnath/ice_session.h>
29
#include <pjnath/stun_sock.h>
30
#include <pjnath/turn_sock.h>
31
#include <pjlib-util/resolver.h>
32
#include <pj/ioqueue.h>
40
* @addtogroup PJNATH_ICE_STREAM_TRANSPORT
43
* This module describes ICE stream transport, as represented by #pj_ice_strans
44
* structure, and is part of PJNATH - the Open Source NAT traversal helper
47
* ICE stream transport, as represented by #pj_ice_strans structure, is an ICE
48
* capable class for transporting media streams within a media session.
49
* It consists of one or more transport sockets (typically two for RTP
50
* based communication - one for RTP and one for RTCP), and an
51
* \ref PJNATH_ICE_SESSION for performing connectivity checks among the.
52
* various candidates of the transport addresses.
55
* \section ice_strans_using_sec Using the ICE stream transport
57
* The steps below describe how to use ICE session:
59
* - initialize a #pj_ice_strans_cfg structure. This contains various
60
* settings for the ICE stream transport, and among other things contains
61
* the STUN and TURN settings.\n\n
62
* - create the instance with #pj_ice_strans_create(). Among other things,
63
* the function needs the following arguments:
64
* - the #pj_ice_strans_cfg structure for the main configurations
65
* - number of components to be supported
66
* - instance of #pj_ice_strans_cb structure to report callbacks to
68
* - while the #pj_ice_strans_create() call completes immediately, the
69
* initialization will be running in the background to gather the
70
* candidates (for example STUN and TURN candidates, if they are enabled
71
* in the #pj_ice_strans_cfg setting). Application will be notified when
72
* the initialization completes in the \a on_ice_complete callback of
73
* the #pj_ice_strans_cb structure (the \a op argument of this callback
74
* will be PJ_ICE_STRANS_OP_INIT).\n\n
75
* - when media stream is to be started (for example, a call is to be
76
* started), create an ICE session by calling #pj_ice_strans_init_ice().\n\n
77
* - the application now typically will need to communicate local ICE
78
* information to remote host. It can achieve this by using the following
79
* functions to query local ICE information:
80
* - #pj_ice_strans_get_ufrag_pwd()
81
* - #pj_ice_strans_enum_cands()
82
* - #pj_ice_strans_get_def_cand()\n
83
* The application may need to encode the above information as SDP.\n\n
84
* - when the application receives remote ICE information (for example, from
85
* the SDP received from remote), it can now start ICE negotiation, by
86
* calling #pj_ice_strans_start_ice(). This function requires some
87
* information about remote ICE agent such as remote ICE username fragment
88
* and password as well as array of remote candidates.\n\n
89
* - note that the PJNATH library does not work with SDP; application would
90
* need to encode and parse the SDP itself.\n\n
91
* - once ICE negotiation has been started, application will be notified
92
* about the completion in the \a on_ice_complete() callback of the
93
* #pj_ice_strans_cb.\n\n
94
* - at any time, application may send or receive data. However the ICE
95
* stream transport may not be able to send it depending on its current
96
* state. Before ICE negotiation is started, the data will be sent using
97
* default candidate of the component. After negotiation is completed,
98
* data will be sent using the candidate from the successful/nominated
99
* pair. The ICE stream transport may not be able to send data while
100
* negotiation is in progress.\n\n
101
* - application sends data by using #pj_ice_strans_sendto(). Incoming
102
* data will be reported in \a on_rx_data() callback of the
103
* #pj_ice_strans_cb.\n\n
104
* - once the media session has finished (e.g. user hangs up the call),
105
* destroy the ICE session with #pj_ice_strans_stop_ice().\n\n
106
* - at this point, application may destroy the ICE stream transport itself,
107
* or let it run so that it can be reused to create other ICE session.
108
* The benefit of letting the ICE stream transport alive (without any
109
* session active) is to avoid delay with the initialization, howerver
110
* keeping the transport alive means the transport needs to keep the
111
* STUN binding open by using keep-alive and also TURN allocation alive,
112
* and this will consume power which is an important issue for mobile
116
/** Forward declaration for ICE stream transport. */
117
typedef struct pj_ice_strans pj_ice_strans;
119
/** Transport operation types to be reported on \a on_status() callback */
120
typedef enum pj_ice_strans_op
122
/** Initialization (candidate gathering) */
123
PJ_ICE_STRANS_OP_INIT,
126
PJ_ICE_STRANS_OP_NEGOTIATION,
128
/** This operatino is used to report failure in keep-alive operation.
129
* Currently it is only used to report TURN Refresh failure.
131
PJ_ICE_STRANS_OP_KEEP_ALIVE
136
* This structure contains callbacks that will be called by the
137
* ICE stream transport.
139
typedef struct pj_ice_strans_cb
142
* This callback will be called when the ICE transport receives
143
* incoming packet from the sockets which is not related to ICE
144
* (for example, normal RTP/RTCP packet destined for application).
146
* @param ice_st The ICE stream transport.
147
* @param comp_id The component ID.
148
* @param pkt The packet.
149
* @param size Size of the packet.
150
* @param src_addr Source address of the packet.
151
* @param src_addr_len Length of the source address.
153
void (*on_rx_data)(pj_ice_strans *ice_st,
155
void *pkt, pj_size_t size,
156
const pj_sockaddr_t *src_addr,
157
unsigned src_addr_len);
160
* Callback to report status of various ICE operations.
162
* @param ice_st The ICE stream transport.
163
* @param op The operation which status is being reported.
164
* @param status Operation status.
166
void (*on_ice_complete)(pj_ice_strans *ice_st,
174
* This structure describes ICE stream transport configuration. Application
175
* should initialize the structure by calling #pj_ice_strans_cfg_default()
176
* before changing the settings.
178
typedef struct pj_ice_strans_cfg
181
* Address family, IPv4 or IPv6. Currently only pj_AF_INET() (IPv4)
182
* is supported, and this is the default value.
187
* STUN configuration which contains the timer heap and
188
* ioqueue instance to be used, and STUN retransmission
189
* settings. This setting is mandatory.
191
* The default value is all zero. Application must initialize
192
* this setting with #pj_stun_config_init().
194
pj_stun_config stun_cfg;
197
* DNS resolver to be used to resolve servers. If DNS SRV
198
* resolution is required, the resolver must be set.
200
* The default value is NULL.
202
pj_dns_resolver *resolver;
205
* This contains various STUN session options. Once the ICE stream
206
* transport is created, application may also change the options
207
* with #pj_ice_strans_set_options().
209
pj_ice_sess_options opt;
212
* STUN and local transport settings. This specifies the
213
* settings for local UDP socket, which will be resolved
214
* to get the STUN mapped address.
218
* Optional configuration for STUN transport. The default
219
* value will be initialized with #pj_stun_sock_cfg_default().
221
pj_stun_sock_cfg cfg;
224
* Maximum number of host candidates to be added. If the
225
* value is zero, no host candidates will be added.
229
unsigned max_host_cands;
232
* Include loopback addresses in the host candidates.
239
* Specify the STUN server domain or hostname or IP address.
240
* If DNS SRV resolution is required, application must fill
241
* in this setting with the domain name of the STUN server
242
* and set the resolver instance in the \a resolver field.
243
* Otherwise if the \a resolver setting is not set, this
244
* field will be resolved with hostname resolution and in
245
* this case the \a port field must be set.
247
* The \a port field should also be set even when DNS SRV
248
* resolution is used, in case the DNS SRV resolution fails.
250
* When this field is empty, STUN mapped address resolution
251
* will not be performed. In this case only ICE host candidates
252
* will be added to the ICE transport, unless if \a no_host_cands
253
* field is set. In this case, both host and srflx candidates
256
* The default value is empty.
261
* The port number of the STUN server, when \a server
262
* field specifies a hostname rather than domain name. This
263
* field should also be set even when the \a server
264
* specifies a domain name, to allow DNS SRV resolution
265
* to fallback to DNS A/AAAA resolution when the DNS SRV
268
* The default value is PJ_STUN_PORT.
273
* Ignore STUN resolution error and proceed with just local
276
* The default is PJ_FALSE
278
pj_bool_t ignore_stun_error;
283
* TURN specific settings.
287
* Optional TURN socket settings. The default values will be
288
* initialized by #pj_turn_sock_cfg_default(). This contains
289
* settings such as QoS.
291
pj_turn_sock_cfg cfg;
294
* Specify the TURN server domain or hostname or IP address.
295
* If DNS SRV resolution is required, application must fill
296
* in this setting with the domain name of the TURN server
297
* and set the resolver instance in the \a resolver field.
298
* Otherwise if the \a resolver setting is not set, this
299
* field will be resolved with hostname resolution and in
300
* this case the \a port field must be set.
302
* The \a port field should also be set even when DNS SRV
303
* resolution is used, in case the DNS SRV resolution fails.
305
* When this field is empty, relay candidate will not be
308
* The default value is empty.
313
* The port number of the TURN server, when \a server
314
* field specifies a hostname rather than domain name. This
315
* field should also be set even when the \a server
316
* specifies a domain name, to allow DNS SRV resolution
317
* to fallback to DNS A/AAAA resolution when the DNS SRV
325
* Type of connection to the TURN server.
327
* Default is PJ_TURN_TP_UDP.
329
pj_turn_tp_type conn_type;
332
* Credential to be used for the TURN session. This setting
335
* Default is to have no credential.
337
pj_stun_auth_cred auth_cred;
340
* Optional TURN Allocate parameter. The default value will be
341
* initialized by #pj_turn_alloc_param_default().
343
pj_turn_alloc_param alloc_param;
348
* Component specific settings, which will override the settings in
349
* the STUN and TURN settings above. For example, setting the QoS
350
* parameters here allows the application to have different QoS
351
* traffic type for RTP and RTCP component.
355
* QoS traffic type to be set on this transport. When application
356
* wants to apply QoS tagging to the transport, it's preferable to
357
* set this field rather than \a qos_param fields since this is
360
* Default value is PJ_QOS_TYPE_BEST_EFFORT.
362
pj_qos_type qos_type;
365
* Set the low level QoS parameters to the transport. This is a
366
* lower level operation than setting the \a qos_type field and
367
* may not be supported on all platforms.
369
* By default all settings in this structure are disabled.
371
pj_qos_params qos_params;
374
* Specify target value for socket receive buffer size. It will be
375
* applied using setsockopt(). When it fails to set the specified
376
* size, it will try with lower value until the highest possible is
379
* When this is set to zero, this component will apply socket receive
380
* buffer size settings specified in STUN and TURN socket config
381
* above, i.e: \a stun::cfg::so_rcvbuf_size and
382
* \a turn::cfg::so_rcvbuf_size. Otherwise, this setting will be
383
* applied to STUN and TURN sockets for this component, overriding
384
* the setting specified in STUN/TURN socket config.
388
unsigned so_rcvbuf_size;
391
* Specify target value for socket send buffer size. It will be
392
* applied using setsockopt(). When it fails to set the specified
393
* size, it will try with lower value until the highest possible is
396
* When this is set to zero, this component will apply socket send
397
* buffer size settings specified in STUN and TURN socket config
398
* above, i.e: \a stun::cfg::so_sndbuf_size and
399
* \a turn::cfg::so_sndbuf_size. Otherwise, this setting will be
400
* applied to STUN and TURN sockets for this component, overriding
401
* the setting specified in STUN/TURN socket config.
405
unsigned so_sndbuf_size;
407
} comp[PJ_ICE_MAX_COMP];
413
* ICE stream transport's state.
415
typedef enum pj_ice_strans_state
418
* ICE stream transport is not created.
420
PJ_ICE_STRANS_STATE_NULL,
423
* ICE candidate gathering process is in progress.
425
PJ_ICE_STRANS_STATE_INIT,
428
* ICE stream transport initialization/candidate gathering process is
429
* complete, ICE session may be created on this stream transport.
431
PJ_ICE_STRANS_STATE_READY,
434
* New session has been created and the session is ready.
436
PJ_ICE_STRANS_STATE_SESS_READY,
439
* ICE negotiation is in progress.
441
PJ_ICE_STRANS_STATE_NEGO,
444
* ICE negotiation has completed successfully and media is ready
447
PJ_ICE_STRANS_STATE_RUNNING,
450
* ICE negotiation has completed with failure.
452
PJ_ICE_STRANS_STATE_FAILED
454
} pj_ice_strans_state;
458
* Initialize ICE transport configuration with default values.
460
* @param cfg The configuration to be initialized.
462
PJ_DECL(void) pj_ice_strans_cfg_default(pj_ice_strans_cfg *cfg);
466
* Copy configuration.
469
* @param dst Destination.
472
PJ_DECL(void) pj_ice_strans_cfg_copy(pj_pool_t *pool,
473
pj_ice_strans_cfg *dst,
474
const pj_ice_strans_cfg *src);
478
* Create and initialize the ICE stream transport with the specified
481
* @param name Optional name for logging identification.
482
* @param cfg Configuration.
483
* @param comp_cnt Number of components.
484
* @param user_data Arbitrary user data to be associated with this
485
* ICE stream transport.
486
* @param cb Callback.
487
* @param p_ice_st Pointer to receive the ICE stream transport
490
* @return PJ_SUCCESS if ICE stream transport is created
493
PJ_DECL(pj_status_t) pj_ice_strans_create(const char *name,
494
const pj_ice_strans_cfg *cfg,
497
const pj_ice_strans_cb *cb,
498
pj_ice_strans **p_ice_st);
501
* Get ICE session state.
503
* @param ice_st The ICE stream transport.
505
* @return ICE session state.
507
PJ_DECL(pj_ice_strans_state) pj_ice_strans_get_state(pj_ice_strans *ice_st);
511
* Get string representation of ICE state.
513
* @param state ICE stream transport state.
517
PJ_DECL(const char*) pj_ice_strans_state_name(pj_ice_strans_state state);
521
* Destroy the ICE stream transport. This will destroy the ICE session
522
* inside the ICE stream transport, close all sockets and release all
525
* @param ice_st The ICE stream transport.
527
* @return PJ_SUCCESS, or the appropriate error code.
529
PJ_DECL(pj_status_t) pj_ice_strans_destroy(pj_ice_strans *ice_st);
533
* Get the user data associated with the ICE stream transport.
535
* @param ice_st The ICE stream transport.
537
* @return The user data.
539
PJ_DECL(void*) pj_ice_strans_get_user_data(pj_ice_strans *ice_st);
543
* Get the value of various options of the ICE stream transport.
545
* @param ice_st The ICE stream transport.
546
* @param opt The options to be initialized with the values
547
* from the ICE stream transport.
549
* @return PJ_SUCCESS on success, or the appropriate error.
551
PJ_DECL(pj_status_t) pj_ice_strans_get_options(pj_ice_strans *ice_st,
552
pj_ice_sess_options *opt);
555
* Specify various options for this ICE stream transport. Application
556
* should call #pj_ice_strans_get_options() to initialize the options
557
* with their default values.
559
* @param ice_st The ICE stream transport.
560
* @param opt Options to be applied to this ICE stream transport.
562
* @return PJ_SUCCESS on success, or the appropriate error.
564
PJ_DECL(pj_status_t) pj_ice_strans_set_options(pj_ice_strans *ice_st,
565
const pj_ice_sess_options *opt);
568
* Get the group lock for this ICE stream transport.
570
* @param ice_st The ICE stream transport.
572
* @return The group lock.
574
PJ_DECL(pj_grp_lock_t *) pj_ice_strans_get_grp_lock(pj_ice_strans *ice_st);
577
* Initialize the ICE session in the ICE stream transport.
578
* When application is about to send an offer containing ICE capability,
579
* or when it receives an offer containing ICE capability, it must
580
* call this function to initialize the internal ICE session. This would
581
* register all transport address aliases for each component to the ICE
582
* session as candidates. Then application can enumerate all local
583
* candidates by calling #pj_ice_strans_enum_cands(), and encode these
584
* candidates in the SDP to be sent to remote agent.
586
* @param ice_st The ICE stream transport.
587
* @param role ICE role.
588
* @param local_ufrag Optional local username fragment.
589
* @param local_passwd Optional local password.
591
* @return PJ_SUCCESS, or the appropriate error code.
593
PJ_DECL(pj_status_t) pj_ice_strans_init_ice(pj_ice_strans *ice_st,
594
pj_ice_sess_role role,
595
const pj_str_t *local_ufrag,
596
const pj_str_t *local_passwd);
599
* Check if the ICE stream transport has the ICE session created. The
600
* ICE session is created with #pj_ice_strans_init_ice().
602
* @param ice_st The ICE stream transport.
604
* @return PJ_TRUE if #pj_ice_strans_init_ice() has been
607
PJ_DECL(pj_bool_t) pj_ice_strans_has_sess(pj_ice_strans *ice_st);
611
* Check if ICE negotiation is still running.
613
* @param ice_st The ICE stream transport.
615
* @return PJ_TRUE if ICE session has been created and ICE
616
* negotiation negotiation is in progress.
618
PJ_DECL(pj_bool_t) pj_ice_strans_sess_is_running(pj_ice_strans *ice_st);
622
* Check if ICE negotiation has completed.
624
* @param ice_st The ICE stream transport.
626
* @return PJ_TRUE if ICE session has been created and the
627
* negotiation is complete.
629
PJ_DECL(pj_bool_t) pj_ice_strans_sess_is_complete(pj_ice_strans *ice_st);
633
* Get the current/running component count. If ICE negotiation has not
634
* been started, the number of components will be equal to the number
635
* when the ICE stream transport was created. Once negotiation been
636
* started, the number of components will be the lowest number of
637
* component between local and remote agents.
639
* @param ice_st The ICE stream transport.
641
* @return The running number of components.
643
PJ_DECL(unsigned) pj_ice_strans_get_running_comp_cnt(pj_ice_strans *ice_st);
647
* Get the ICE username fragment and password of the ICE session. The
648
* local username fragment and password can only be retrieved once ICE
649
* session has been created with #pj_ice_strans_init_ice(). The remote
650
* username fragment and password can only be retrieved once ICE session
651
* has been started with #pj_ice_strans_start_ice().
653
* Note that the string returned by this function is only valid throughout
654
* the duration of the ICE session, and the application must not modify
655
* these strings. Once the ICE session has been stopped with
656
* #pj_ice_strans_stop_ice(), the pointer in the string will no longer be
659
* @param ice_st The ICE stream transport.
660
* @param loc_ufrag Optional pointer to receive ICE username fragment
661
* of local endpoint from the ICE session.
662
* @param loc_pwd Optional pointer to receive ICE password of local
663
* endpoint from the ICE session.
664
* @param rem_ufrag Optional pointer to receive ICE username fragment
665
* of remote endpoint from the ICE session.
666
* @param rem_pwd Optional pointer to receive ICE password of remote
667
* endpoint from the ICE session.
669
* @return PJ_SUCCESS if the strings have been retrieved
672
PJ_DECL(pj_status_t) pj_ice_strans_get_ufrag_pwd(pj_ice_strans *ice_st,
680
* Get the number of local candidates for the specified component ID.
682
* @param ice_st The ICE stream transport.
683
* @param comp_id Component ID.
685
* @return The number of candidates.
687
PJ_DECL(unsigned) pj_ice_strans_get_cands_count(pj_ice_strans *ice_st,
691
* Enumerate the local candidates for the specified component.
693
* @param ice_st The ICE stream transport.
694
* @param comp_id Component ID.
695
* @param count On input, it specifies the maximum number of
696
* elements. On output, it will be filled with
697
* the number of candidates copied to the
699
* @param cand Array of candidates.
701
* @return PJ_SUCCESS, or the appropriate error code.
703
PJ_DECL(pj_status_t) pj_ice_strans_enum_cands(pj_ice_strans *ice_st,
706
pj_ice_sess_cand cand[]);
709
* Get the default candidate for the specified component. When this
710
* function is called before ICE negotiation completes, the default
711
* candidate is selected according to local preference criteria. When
712
* this function is called after ICE negotiation completes, the
713
* default candidate is the candidate that forms the valid pair.
715
* @param ice_st The ICE stream transport.
716
* @param comp_id Component ID.
717
* @param cand Pointer to receive the default candidate
720
PJ_DECL(pj_status_t) pj_ice_strans_get_def_cand(pj_ice_strans *ice_st,
722
pj_ice_sess_cand *cand);
725
* Get the current ICE role. ICE session must have been initialized
726
* before this function can be called.
728
* @param ice_st The ICE stream transport.
730
* @return Current ICE role.
732
PJ_DECL(pj_ice_sess_role) pj_ice_strans_get_role(pj_ice_strans *ice_st);
736
* Change session role. This happens for example when ICE session was
737
* created with controlled role when receiving an offer, but it turns out
738
* that the offer contains "a=ice-lite" attribute when the SDP gets
739
* inspected. ICE session must have been initialized before this function
742
* @param ice_st The ICE stream transport.
743
* @param new_role The new role to be set.
745
* @return PJ_SUCCESS on success, or the appropriate error.
747
PJ_DECL(pj_status_t) pj_ice_strans_change_role(pj_ice_strans *ice_st,
748
pj_ice_sess_role new_role);
752
* Start ICE connectivity checks. This function can only be called
753
* after the ICE session has been created in the ICE stream transport
754
* with #pj_ice_strans_init_ice().
756
* This function must be called once application has received remote
757
* candidate list (typically from the remote SDP). This function pairs
758
* local candidates with remote candidates, and starts ICE connectivity
759
* checks. The ICE session/transport will then notify the application
760
* via the callback when ICE connectivity checks completes, either
761
* successfully or with failure.
763
* @param ice_st The ICE stream transport.
764
* @param rem_ufrag Remote ufrag, as seen in the SDP received from
766
* @param rem_passwd Remote password, as seen in the SDP received from
768
* @param rcand_cnt Number of remote candidates in the array.
769
* @param rcand Remote candidates array.
771
* @return PJ_SUCCESS, or the appropriate error code.
773
PJ_DECL(pj_status_t) pj_ice_strans_start_ice(pj_ice_strans *ice_st,
774
const pj_str_t *rem_ufrag,
775
const pj_str_t *rem_passwd,
777
const pj_ice_sess_cand rcand[]);
780
* Retrieve the candidate pair that has been nominated and successfully
781
* checked for the specified component. If ICE negotiation is still in
782
* progress or it has failed, this function will return NULL.
784
* @param ice_st The ICE stream transport.
785
* @param comp_id Component ID.
787
* @return The valid pair as ICE checklist structure if the
790
PJ_DECL(const pj_ice_sess_check*)
791
pj_ice_strans_get_valid_pair(const pj_ice_strans *ice_st,
795
* Stop and destroy the ICE session inside this media transport. Application
796
* needs to call this function once the media session is over (the call has
797
* been disconnected).
799
* Application MAY reuse this ICE stream transport for subsequent calls.
800
* In this case, it must call #pj_ice_strans_stop_ice() when the call is
801
* disconnected, and reinitialize the ICE stream transport for subsequent
802
* call with #pj_ice_strans_init_ice()/#pj_ice_strans_start_ice(). In this
803
* case, the ICE stream transport will maintain the internal sockets and
804
* continue to send STUN keep-alive packets and TURN Refresh request to
805
* keep the NAT binding/TURN allocation open and to detect change in STUN
808
* If application does not want to reuse the ICE stream transport for
809
* subsequent calls, it must call #pj_ice_strans_destroy() to destroy the
810
* ICE stream transport altogether.
812
* @param ice_st The ICE stream transport.
814
* @return PJ_SUCCESS, or the appropriate error code.
816
PJ_DECL(pj_status_t) pj_ice_strans_stop_ice(pj_ice_strans *ice_st);
820
* Send outgoing packet using this transport.
821
* Application can send data (normally RTP or RTCP packets) at any time
822
* by calling this function. This function takes a destination
823
* address as one of the arguments, and this destination address should
824
* be taken from the default transport address of the component (that is
825
* the address in SDP c= and m= lines, or in a=rtcp attribute).
826
* If ICE negotiation is in progress, this function will send the data
827
* to the destination address. Otherwise if ICE negotiation has completed
828
* successfully, this function will send the data to the nominated remote
829
* address, as negotiated by ICE.
831
* @param ice_st The ICE stream transport.
832
* @param comp_id Component ID.
833
* @param data The data or packet to be sent.
834
* @param data_len Size of data or packet, in bytes.
835
* @param dst_addr The destination address.
836
* @param dst_addr_len Length of destination address.
838
* @return PJ_SUCCESS if data is sent successfully.
840
PJ_DECL(pj_status_t) pj_ice_strans_sendto(pj_ice_strans *ice_st,
844
const pj_sockaddr_t *dst_addr,
857
#endif /* __PJNATH_ICE_STRANS_H__ */