- Timestamp:
- May 30, 2007 4:26:40 AM (18 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsip-ua/sip_inv.h
r1287 r1319 224 224 pj_pool_t *pool; /**< Dialog's pool. */ 225 225 pjsip_inv_state state; /**< Invite sess state. */ 226 pj_bool_t cancelling; /**< CANCEL sent? */ 226 pj_bool_t cancelling; /**< CANCEL requested */ 227 pj_bool_t pending_cancel; /**< Wait to send CANCEL*/ 227 228 pjsip_status_code cause; /**< Disconnect cause. */ 228 229 pj_str_t cause_text; /**< Cause text. */ -
pjproject/trunk/pjsip/include/pjsip/sip_transaction.h
r1210 r1319 298 298 299 299 /** 300 * Cease retransmission on the UAC transaction. The UAC transaction is 301 * still considered running, and it will complete when either final 302 * response is received or the transaction times out. 303 * 304 * This operation normally is used for INVITE transaction only, when 305 * the transaction is cancelled before any provisional response has been 306 * received. 307 */ 308 PJ_DECL(pj_status_t) pjsip_tsx_stop_retransmit(pjsip_transaction *tsx); 309 310 311 /** 300 312 * Get the transaction instance in the incoming message. If the message 301 313 * has a corresponding transaction, this function will return non NULL -
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r1287 r1319 1513 1513 if (inv->invite_tsx->status_code < 100) { 1514 1514 1515 pjsip_tsx_terminate(inv->invite_tsx, 487); 1515 pjsip_tsx_stop_retransmit(inv->invite_tsx); 1516 inv->cancelling = PJ_TRUE; 1517 inv->pending_cancel = PJ_TRUE; 1516 1518 *p_tdata = NULL; 1519 PJ_LOG(4, (inv->obj_name, "Stopping retransmission, " 1520 "delaying CANCEL")); 1517 1521 return PJ_SUCCESS; 1518 1522 } … … 1926 1930 1927 1931 case PJSIP_TSX_STATE_PROCEEDING: 1932 if (inv->pending_cancel) { 1933 pjsip_tx_data *cancel; 1934 1935 inv->pending_cancel = PJ_FALSE; 1936 1937 status = pjsip_inv_end_session(inv, 487, NULL, &cancel); 1938 if (status == PJ_SUCCESS && cancel) 1939 status = pjsip_inv_send_msg(inv, cancel); 1940 } 1941 1928 1942 if (dlg->remote.info->tag.slen) { 1929 1943 -
pjproject/trunk/pjsip/src/pjsip/sip_transaction.c
r1250 r1319 1420 1420 struct tsx_lock_data lck; 1421 1421 1422 PJ_ASSERT_RETURN(tsx != NULL, PJ_EINVAL); 1423 1422 1424 PJ_LOG(5,(tsx->obj_name, "Request to terminate transaction")); 1423 1425 1424 PJ_ASSERT_RETURN(tsx != NULL, PJ_EINVAL);1425 1426 PJ_ASSERT_RETURN(code >= 200, PJ_EINVAL); 1426 1427 … … 1431 1432 tsx_set_status_code(tsx, code, NULL); 1432 1433 tsx_set_state( tsx, PJSIP_TSX_STATE_TERMINATED, PJSIP_EVENT_USER, NULL); 1434 unlock_tsx(tsx, &lck); 1435 1436 return PJ_SUCCESS; 1437 } 1438 1439 1440 /* 1441 * Cease retransmission on the UAC transaction. The UAC transaction is 1442 * still considered running, and it will complete when either final 1443 * response is received or the transaction times out. 1444 */ 1445 PJ_DEF(pj_status_t) pjsip_tsx_stop_retransmit(pjsip_transaction *tsx) 1446 { 1447 struct tsx_lock_data lck; 1448 1449 PJ_ASSERT_RETURN(tsx != NULL, PJ_EINVAL); 1450 PJ_ASSERT_RETURN(tsx->role == PJSIP_ROLE_UAC && 1451 tsx->method.id == PJSIP_INVITE_METHOD, 1452 PJ_EINVALIDOP); 1453 1454 PJ_LOG(5,(tsx->obj_name, "Request to stop retransmission")); 1455 1456 lock_tsx(tsx, &lck); 1457 /* Cancel retransmission timer. */ 1458 if (tsx->retransmit_timer.id != 0) { 1459 pjsip_endpt_cancel_timer(tsx->endpt, &tsx->retransmit_timer); 1460 tsx->retransmit_timer.id = 0; 1461 } 1433 1462 unlock_tsx(tsx, &lck); 1434 1463
Note: See TracChangeset
for help on using the changeset viewer.