- Timestamp:
- Jun 3, 2009 10:19:44 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_transaction.c
r2732 r2739 146 146 #define TIMER_INACTIVE 0 147 147 #define TIMER_ACTIVE 1 148 149 /* Delay for 1xx retransmission (should be 60 seconds). 150 * Specify 0 to disable this feature 151 */ 152 #ifndef PJSIP_TSX_1XX_RETRANS_DELAY 153 # define PJSIP_TSX_1XX_RETRANS_DELAY 60 154 #endif 148 155 149 156 … … 1950 1957 { 1951 1958 pj_time_val timeout; 1952 unsignedmsec_time;1959 pj_uint32_t msec_time; 1953 1960 1954 1961 pj_assert((tsx->transport_flag & TSX_HAS_PENDING_TRANSPORT) == 0); … … 1968 1975 } 1969 1976 } else { 1970 /* Retransmission of INVITE final response also caps-off at T2 */ 1971 pj_assert(tsx->status_code >= 200); 1972 if (msec_time > pjsip_cfg()->tsx.t2) 1973 msec_time = pjsip_cfg()->tsx.t2; 1977 /* For UAS, this can be retransmission of 2xx response for INVITE 1978 * or non-100 1xx response. 1979 */ 1980 if (tsx->status_code < 200) { 1981 /* non-100 1xx retransmission is at 60 seconds */ 1982 msec_time = PJSIP_TSX_1XX_RETRANS_DELAY * 1000; 1983 } else { 1984 /* Retransmission of INVITE final response also caps-off at T2 */ 1985 pj_assert(tsx->status_code >= 200); 1986 if (msec_time > pjsip_cfg()->tsx.t2) 1987 msec_time = pjsip_cfg()->tsx.t2; 1988 } 1974 1989 } 1975 1990 … … 2339 2354 PJSIP_EVENT_TX_MSG, tdata ); 2340 2355 2356 /* Retransmit provisional response every 1 minute if this is 2357 * an INVITE provisional response greater than 100. 2358 */ 2359 if (PJSIP_TSX_1XX_RETRANS_DELAY > 0 && 2360 tsx->method.id==PJSIP_INVITE_METHOD && tsx->status_code>100) 2361 { 2362 2363 /* Stop 1xx retransmission timer, if any */ 2364 if (tsx->retransmit_timer.id) { 2365 pjsip_endpt_cancel_timer(tsx->endpt, 2366 &tsx->retransmit_timer); 2367 tsx->retransmit_timer.id = 0; 2368 } 2369 2370 /* Schedule retransmission */ 2371 tsx->retransmit_count = 0; 2372 if (tsx->transport_flag & TSX_HAS_PENDING_TRANSPORT) { 2373 tsx->transport_flag |= TSX_HAS_PENDING_RESCHED; 2374 } else { 2375 pj_time_val delay = {PJSIP_TSX_1XX_RETRANS_DELAY, 0}; 2376 2377 tsx->retransmit_timer.id = TIMER_ACTIVE; 2378 pjsip_endpt_schedule_timer( tsx->endpt, 2379 &tsx->retransmit_timer, 2380 &delay); 2381 } 2382 } 2383 2341 2384 } else if (PJSIP_IS_STATUS_IN_CLASS(tsx->status_code, 200)) { 2385 2386 /* Stop 1xx retransmission timer, if any */ 2387 if (tsx->retransmit_timer.id) { 2388 pjsip_endpt_cancel_timer(tsx->endpt, &tsx->retransmit_timer); 2389 tsx->retransmit_timer.id = 0; 2390 } 2342 2391 2343 2392 if (tsx->method.id == PJSIP_INVITE_METHOD && tsx->handle_200resp==0) { … … 2410 2459 } else if (tsx->status_code >= 300) { 2411 2460 2461 /* Stop 1xx retransmission timer, if any */ 2462 if (tsx->retransmit_timer.id) { 2463 pjsip_endpt_cancel_timer(tsx->endpt, &tsx->retransmit_timer); 2464 tsx->retransmit_timer.id = 0; 2465 } 2466 2412 2467 /* 3xx-6xx class message causes transaction to move to 2413 2468 * "Completed" state.
Note: See TracChangeset
for help on using the changeset viewer.