Changeset 175 for pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
- Timestamp:
- Feb 10, 2006 2:04:05 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r171 r175 131 131 132 132 if (inv->state == PJSIP_INV_STATE_DISCONNECTED) 133 pjsip_dlg_dec_session(inv->dlg );133 pjsip_dlg_dec_session(inv->dlg, &mod_inv.mod); 134 134 } 135 135 … … 142 142 pjsip_tx_data *tdata; 143 143 pj_status_t status; 144 145 PJ_LOG(5,(inv->obj_name, "Received %s, sending ACK", 146 pjsip_rx_data_get_info(rdata))); 144 147 145 148 status = pjsip_dlg_create_request(inv->dlg, &pjsip_ack_method, … … 371 374 inv->options = options; 372 375 376 /* Object name will use the same dialog pointer. */ 377 pj_snprintf(inv->obj_name, PJ_MAX_OBJ_NAME, "inv%p", dlg); 378 373 379 /* Create negotiator if local_sdp is specified. */ 374 380 if (local_sdp) { … … 385 391 386 392 /* Increment dialog session */ 387 pjsip_dlg_inc_session(dlg );393 pjsip_dlg_inc_session(dlg, &mod_inv.mod); 388 394 389 395 /* Done */ 390 396 *p_inv = inv; 397 398 PJ_LOG(5,(inv->obj_name, "UAC invite session created for dialog %s", 399 dlg->obj_name)); 400 391 401 return PJ_SUCCESS; 392 402 } … … 760 770 inv->options = options; 761 771 772 /* Object name will use the same dialog pointer. */ 773 pj_snprintf(inv->obj_name, PJ_MAX_OBJ_NAME, "inv%p", dlg); 774 762 775 /* Parse SDP in message body, if present. */ 763 776 if (msg->body) { … … 795 808 796 809 /* Increment session in the dialog. */ 797 pjsip_dlg_inc_session(dlg );810 pjsip_dlg_inc_session(dlg, &mod_inv.mod); 798 811 799 812 /* Save the invite transaction. */ … … 808 821 /* Done */ 809 822 *p_inv = inv; 823 824 PJ_LOG(5,(inv->obj_name, "UAS invite session created for dialog %s", 825 dlg->obj_name)); 826 810 827 return PJ_SUCCESS; 811 828 } … … 912 929 913 930 status = pjmedia_sdp_neg_negotiate(inv->pool, inv->neg, 0); 931 932 PJ_LOG(5,(inv->obj_name, "SDP negotiation done, status=%d", status)); 914 933 915 934 if (mod_inv.cb.on_media_update) … … 982 1001 /* This is an offer. */ 983 1002 1003 PJ_LOG(5,(inv->obj_name, "Got SDP offer in %s", 1004 pjsip_rx_data_get_info(rdata))); 1005 984 1006 if (inv->neg == NULL) { 985 1007 status=pjmedia_sdp_neg_create_w_remote_offer(inv->pool, NULL, … … 1009 1031 * Process and negotiate remote answer. 1010 1032 */ 1033 1034 PJ_LOG(5,(inv->obj_name, "Got SDP answer in %s", 1035 pjsip_rx_data_get_info(rdata))); 1011 1036 1012 1037 status = pjmedia_sdp_neg_set_remote_answer(inv->pool, inv->neg, sdp); … … 1260 1285 /* Verify arguments. */ 1261 1286 PJ_ASSERT_RETURN(inv && tdata, PJ_EINVAL); 1287 1288 PJ_LOG(5,(inv->obj_name, "Sending %s", 1289 pjsip_tx_data_get_info(tdata))); 1262 1290 1263 1291 if (tdata->msg->type == PJSIP_REQUEST_MSG) { … … 1582 1610 break; 1583 1611 } 1612 1613 } else if (inv->role == PJSIP_ROLE_UAC && 1614 tsx->role == PJSIP_ROLE_UAC && 1615 tsx->method.id == PJSIP_CANCEL_METHOD) 1616 { 1617 /* 1618 * Handle case when outgoing CANCEL is answered with 481 (Call/ 1619 * Transaction Does Not Exist), 408, or when it's timed out. In these 1620 * cases, disconnect session (i.e. dialog usage only). 1621 */ 1622 if (tsx->status_code == PJSIP_SC_CALL_TSX_DOES_NOT_EXIST || 1623 tsx->status_code == PJSIP_SC_REQUEST_TIMEOUT || 1624 tsx->status_code == PJSIP_SC_TSX_TIMEOUT || 1625 PJSIP_SC_TSX_TRANSPORT_ERROR) 1626 { 1627 inv_set_state(inv, PJSIP_INV_STATE_DISCONNECTED, e); 1628 } 1584 1629 } 1585 1630 } … … 1738 1783 inv_respond_incoming_cancel(inv, tsx, e->body.tsx_state.src.rdata); 1739 1784 1785 } else if (inv->role == PJSIP_ROLE_UAC && 1786 tsx->role == PJSIP_ROLE_UAC && 1787 tsx->method.id == PJSIP_CANCEL_METHOD) 1788 { 1789 /* 1790 * Handle case when outgoing CANCEL is answered with 481 (Call/ 1791 * Transaction Does Not Exist), 408, or when it's timed out. In these 1792 * cases, disconnect session (i.e. dialog usage only). 1793 */ 1794 if (tsx->status_code == PJSIP_SC_CALL_TSX_DOES_NOT_EXIST || 1795 tsx->status_code == PJSIP_SC_REQUEST_TIMEOUT || 1796 tsx->status_code == PJSIP_SC_TSX_TIMEOUT || 1797 PJSIP_SC_TSX_TRANSPORT_ERROR) 1798 { 1799 inv_set_state(inv, PJSIP_INV_STATE_DISCONNECTED, e); 1800 } 1740 1801 } 1741 1802 }
Note: See TracChangeset
for help on using the changeset viewer.