Changeset 1932
- Timestamp:
- Apr 17, 2008 5:25:37 PM (17 years ago)
- Location:
- pjproject/branches/projects/ice-turn07
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/ice-turn07/pjnath/src/pjnath/ice_session.c
r1926 r1932 107 107 struct msg_data 108 108 { 109 pj_bool_t is_request; 109 pj_bool_t is_request; 110 unsigned cand_id; 110 111 111 112 union data { … … 115 116 unsigned ckid; 116 117 } req; 117 118 struct response_data {119 unsigned cand_id;120 } res;121 118 } data; 122 119 }; … … 1401 1398 * completes and on_stun_request_complete() callback is called. 1402 1399 */ 1403 msg_data = PJ_POOL_ZALLOC_T( check->tdata->pool, struct msg_data);1400 msg_data = PJ_POOL_ZALLOC_T(ice->pool, struct msg_data); 1404 1401 msg_data->is_request = PJ_TRUE; 1402 msg_data->cand_id = lcand - ice->lcand; 1405 1403 msg_data->data.req.ice = ice; 1406 1404 msg_data->data.req.clist = clist; … … 1668 1666 unsigned cand_id; 1669 1667 1670 if (msg_data->is_request) { 1671 pj_ice_sess_checklist *clist = msg_data->data.req.clist; 1672 pj_ice_sess_cand *lcand = clist->checks[msg_data->data.req.ckid].lcand; 1673 1674 cand_id = lcand - ice->lcand; 1675 1676 } else { 1677 cand_id = msg_data->data.res.cand_id; 1678 } 1668 cand_id = msg_data->cand_id; 1679 1669 1680 1670 return (*ice->cb.on_tx_pkt)(ice, sd->comp_id, cand_id, … … 1940 1930 { 1941 1931 stun_data *sd; 1942 unsigned *param_cand_id;1932 //unsigned *param_cand_id; 1943 1933 const pj_stun_msg *msg = rdata->msg; 1944 1934 struct msg_data *msg_data; … … 1962 1952 * whether to send packet using local socket or the relay. 1963 1953 */ 1964 param_cand_id = (unsigned*)token;1954 //param_cand_id = (unsigned*)token; 1965 1955 1966 1956 /* Reject any requests except Binding request */ … … 2073 2063 2074 2064 /* Create a msg_data to be associated with this response */ 2075 msg_data = PJ_POOL_ZALLOC_T( tdata->pool, struct msg_data);2065 msg_data = PJ_POOL_ZALLOC_T(ice->pool, struct msg_data); 2076 2066 msg_data->is_request = PJ_FALSE; 2077 msg_data-> data.res.cand_id = *param_cand_id;2067 msg_data->cand_id = ((struct msg_data*)token)->cand_id; 2078 2068 2079 2069 /* Send the response */ … … 2389 2379 pj_status_t status = PJ_SUCCESS; 2390 2380 pj_ice_sess_comp *comp; 2381 struct msg_data *msg_data; 2391 2382 pj_status_t stun_status; 2392 2383 … … 2401 2392 } 2402 2393 2394 msg_data = PJ_POOL_ZALLOC_T(ice->pool, struct msg_data); 2395 msg_data->is_request = PJ_FALSE; 2396 msg_data->cand_id = cand_id; 2397 2403 2398 stun_status = pj_stun_msg_check((const pj_uint8_t*)pkt, pkt_size, 2404 2399 PJ_STUN_IS_DATAGRAM); 2405 2400 if (stun_status == PJ_SUCCESS) { 2406 2401 status = pj_stun_session_on_rx_pkt(comp->stun_sess, pkt, pkt_size, 2407 PJ_STUN_IS_DATAGRAM, &cand_id,2402 PJ_STUN_IS_DATAGRAM, msg_data, 2408 2403 NULL, src_addr, src_addr_len); 2409 2404 if (status != PJ_SUCCESS) { -
pjproject/branches/projects/ice-turn07/pjnath/src/pjnath/ice_strans.c
r1926 r1932 954 954 } 955 955 956 /* Skip if candidate has no address */ 957 if (!pj_sockaddr_has_addr(&cand->addr)) { 958 PJ_LOG(5,(ice_st->obj_name, 959 "Candidate %d in component %d is not added", 960 j, i)); 961 continue; 962 } 963 956 964 if (cand->type == PJ_ICE_CAND_TYPE_RELAYED) { 957 965 local_addr = &cand->addr; … … 964 972 cand->type, cand->local_pref, 965 973 &cand->foundation, &cand->addr, 966 &comp->local_addr, NULL,974 local_addr, relay_addr, 967 975 sizeof(pj_sockaddr_in), 968 976 (unsigned*)&cand->ice_cand_id); … … 1316 1324 } 1317 1325 1326 if (comp->ice_st->ice == NULL) { 1327 /* The session is gone */ 1328 return; 1329 } 1330 1318 1331 /* Find candidate ID for this packet */ 1319 1332 for (cand_id=0; cand_id<comp->cand_cnt; ++cand_id) { -
pjproject/branches/projects/ice-turn07/pjsip-apps/src/pjsua/pjsua_app.c
r1926 r1932 23 23 #define NO_LIMIT (int)0x7FFFFFFF 24 24 25 #if 125 #if 0 26 26 #define TURN_SERVER "turn.pjsip.org" 27 27 #define TURN_PORT 34780 28 #define TURN_TCP 029 28 #define TURN_REALM "pjsip.org" 30 29 #define TURN_USER "700" 31 30 #define TURN_PASSWD "700" 32 31 #endif 32 33 #if 1 34 /* Eyeball test */ 35 #define TURN_SERVER "216.187.87.78" 36 #define TURN_PORT 3478 37 #define TURN_REALM "test.eyeball.com" 38 #define TURN_USER "sipit6" 39 #define TURN_PASSWD "password" 40 #endif 41 33 42 34 43 … … 240 249 static void default_config(struct app_config *cfg) 241 250 { 242 char tmp[ 80];251 char tmp[120]; 243 252 unsigned i; 244 253 245 254 pjsua_config_default(&cfg->cfg); 246 pj_ansi_sprintf(tmp, "PJSUA v%s/%s ", pj_get_version(), PJ_OS_NAME);255 pj_ansi_sprintf(tmp, "PJSUA v%s/%s (http://pjsip.org)", pj_get_version(), PJ_OS_NAME); 247 256 pj_strdup2_with_null(app_config.pool, &cfg->cfg.user_agent, tmp); 248 257
Note: See TracChangeset
for help on using the changeset viewer.