Changeset 1487 for pjproject/trunk/pjnath/include/pjnath/ice_session.h
- Timestamp:
- Oct 7, 2007 12:51:15 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/include/pjnath/ice_session.h
r1435 r1487 46 46 * This module describes #pj_ice_sess, a transport independent ICE session, 47 47 * part of PJNATH - the Open Source NAT helper library. 48 * 49 * \section pj_ice_sess_sec ICE Session 48 50 * 49 51 * An ICE session, represented by #pj_ice_sess structure, is the lowest … … 63 65 * For higher abstraction of ICE where transport is included, please 64 66 * see \ref PJNATH_ICE_STREAM_TRANSPORT. 67 * 68 * \subsection pj_ice_sess_using_sec Using The ICE Session 69 * 70 * The steps below describe how to use ICE session. Alternatively application 71 * can use the higher level ICE API, \ref PJNATH_ICE_STREAM_TRANSPORT, 72 * which has provided the integration of ICE with socket transport. 73 * 74 * The steps to use ICE session is similar for both offerer and 75 * answerer: 76 * - create ICE session with #pj_ice_sess_create(). Among other things, 77 * application needs to specify: 78 * - STUN configuration (pj_stun_config), containing STUN settings 79 * such as timeout values and the instances of timer heap and 80 * ioqueue. 81 * - Session name, useful for identifying this session in the log. 82 * - Initial ICE role (#pj_ice_sess_role). The role can be changed 83 * at later time with #pj_ice_sess_change_role(), and ICE session 84 * can also change its role automatically when it detects role 85 * conflict. 86 * - Number of components in the media session. 87 * - Callback to receive ICE events (#pj_ice_sess_cb) 88 * - Optional local ICE username and password. If these arguments 89 * are NULL, they will be generated randomly. 90 * - Add local candidates for each component, with #pj_ice_sess_add_cand(). 91 * A candidate is represented with #pj_ice_sess_cand structure. 92 * Each component must be provided with at least one candidate, and 93 * all components must have the same number of candidates. Failing 94 * to comply with this will cause failure during pairing process. 95 * - Create offer to describe local ICE candidates. ICE session does not 96 * provide a function to create such offer, but application should be 97 * able to create one since it knows about all components and candidates. 98 * If application uses \ref PJNATH_ICE_STREAM_TRANSPORT, it can 99 * enumerate local candidates by calling #pj_ice_strans_enum_cands(). 100 * Application may use #pj_ice_sess_find_default_cand() to let ICE 101 * session chooses the default transport address to be used in SDP 102 * c= and m= lines. 103 * - Send the offer to remote endpoint using signaling such as SIP. 104 * - Once application has received the answer, it should parse this 105 * answer, build array of remote candidates, and create check lists by 106 * calling #pj_ice_sess_create_check_list(). This process is known as 107 * pairing the candidates, and will result in the creation of check lists. 108 * - Once checklist has been created, application then can call 109 * #pj_ice_sess_start_check() to instruct ICE session to start 110 * performing connectivity checks. The ICE session performs the 111 * connectivity checks by processing each check in the checklists. 112 * - Application will be notified about the result of ICE connectivity 113 * checks via the callback that was given in #pj_ice_sess_create() 114 * above. 115 * 116 * To send data, application calls #pj_ice_sess_send_data(). If ICE 117 * negotiation has not completed, ICE session would simply drop the data, 118 * and return error to caller. If ICE negotiation has completed 119 * successfully, ICE session will in turn call the \a on_tx_pkt 120 * callback of #pj_ice_sess_cb instance that was previously registered 121 * in #pj_ice_sess_create() above. 122 * 123 * When application receives any packets on the underlying sockets, it 124 * must call #pj_ice_sess_on_rx_pkt(). The ICE session will inspect the 125 * packet to decide whether to process it locally (if the packet is a 126 * STUN message and is part of ICE session) or otherwise pass it back to 127 * application via \a on_rx_data callback. 65 128 */ 66 129
Note: See TracChangeset
for help on using the changeset viewer.