Changeset 2380
- Timestamp:
- Dec 17, 2008 2:28:18 PM (16 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r2373 r2380 2188 2188 ring_start(call_id); 2189 2189 2190 if (current_call==PJSUA_INVALID_ID) 2191 current_call = call_id; 2192 2190 2193 if (app_config.auto_answer > 0) { 2191 2194 pjsua_call_answer(call_id, app_config.auto_answer, NULL, NULL); -
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r2371 r2380 2815 2815 inv_set_state(inv, PJSIP_INV_STATE_EARLY, e); 2816 2816 break; 2817 case PJSIP_TSX_STATE_TERMINATED: 2818 /* there is a failure in sending response. */ 2819 inv_set_cause(inv, tsx->status_code, &tsx->status_text); 2820 inv_set_state(inv, PJSIP_INV_STATE_DISCONNECTED, e); 2821 break; 2817 2822 default: 2818 2823 inv_on_state_incoming(inv, e); -
pjproject/trunk/pjsip/src/pjsip/sip_dialog.c
r2370 r2380 541 541 if (tsx) { 542 542 pjsip_tsx_terminate(tsx, 500); 543 pj_assert(dlg->tsx_count>0); 543 544 --dlg->tsx_count; 544 545 } … … 1412 1413 /* Ask transaction to send the response */ 1413 1414 status = pjsip_tsx_send_msg(tsx, tdata); 1415 1416 /* This function must decrement transmit data request counter 1417 * regardless of the operation status. The transaction only 1418 * decrements the counter if the operation is successful. 1419 */ 1420 if (status != PJ_SUCCESS) { 1421 pjsip_tx_data_dec_ref(tdata); 1422 } 1414 1423 1415 1424 pjsip_dlg_dec_lock(dlg); … … 1899 1908 1900 1909 1901 if (tsx->state == PJSIP_TSX_STATE_TERMINATED) { 1910 /* It is possible that the transaction is terminated and this function 1911 * is called while we're calling on_tsx_state(). So only decrement 1912 * the tsx_count if we're still attached to the transaction. 1913 */ 1914 if (tsx->state == PJSIP_TSX_STATE_TERMINATED && 1915 tsx->mod_data[dlg->ua->id] == dlg) 1916 { 1917 pj_assert(dlg->tsx_count>0); 1902 1918 --dlg->tsx_count; 1903 1919 tsx->mod_data[dlg->ua->id] = NULL; -
pjproject/trunk/pjsip/src/pjsip/sip_transport.c
r2180 r2380 569 569 /* Allocate buffer if necessary. */ 570 570 if (tdata->buf.start == NULL) { 571 tdata->buf.start = (char*) 572 pj_pool_alloc( tdata->pool, PJSIP_MAX_PKT_LEN); 571 PJ_USE_EXCEPTION; 572 573 PJ_TRY { 574 tdata->buf.start = (char*) 575 pj_pool_alloc(tdata->pool, PJSIP_MAX_PKT_LEN); 576 } 577 PJ_CATCH_ANY { 578 return PJ_ENOMEM; 579 } 580 PJ_END 581 573 582 tdata->buf.cur = tdata->buf.start; 574 583 tdata->buf.end = tdata->buf.start + PJSIP_MAX_PKT_LEN; -
pjproject/trunk/pjsip/src/pjsip/sip_util.c
r2372 r2380 1674 1674 /* Send! */ 1675 1675 status = pjsip_endpt_send_response( endpt, &res_addr, tdata, NULL, NULL ); 1676 1677 return status; 1676 if (status != PJ_SUCCESS) { 1677 pjsip_tx_data_dec_ref(tdata); 1678 return status; 1679 } 1680 1681 return PJ_SUCCESS; 1678 1682 } 1679 1683 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r2371 r2380 910 910 } 911 911 912 /* Create and attach pjsua_var data to the dialog: */913 call->inv = inv;914 915 dlg->mod_data[pjsua_var.mod.id] = call;916 inv->mod_data[pjsua_var.mod.id] = call;917 918 912 /* If account is locked to specific transport, then lock dialog 919 913 * to this transport too. … … 926 920 } 927 921 928 /* Must answer with some response to initial INVITE. 922 /* Must answer with some response to initial INVITE. We'll do this before 923 * attaching the call to the invite session/dialog, so that the application 924 * will not get notification about this event (on another scenario, it is 925 * also possible that inv_send_msg() fails and causes the invite session to 926 * be disconnected. If we have the call attached at this time, this will 927 * cause the disconnection callback to be called before on_incoming_call() 928 * callback is called, which is not right). 929 929 */ 930 930 status = pjsip_inv_initial_answer(inv, rdata, … … 944 944 if (status != PJ_SUCCESS) { 945 945 pjsua_perror(THIS_FILE, "Unable to send 100 response", status); 946 } 947 } 946 PJSUA_UNLOCK(); 947 return PJ_TRUE; 948 } 949 } 950 951 /* Create and attach pjsua_var data to the dialog: */ 952 call->inv = inv; 953 954 dlg->mod_data[pjsua_var.mod.id] = call; 955 inv->mod_data[pjsua_var.mod.id] = call; 948 956 949 957 ++pjsua_var.call_cnt; … … 3726 3734 pjsip_event *e) 3727 3735 { 3728 pjsua_call *call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id];3736 pjsua_call *call; 3729 3737 3730 3738 PJSUA_LOCK(); 3739 3740 call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id]; 3741 3742 if (call == NULL) { 3743 PJSUA_UNLOCK(); 3744 return; 3745 } 3731 3746 3732 3747 /* Notify application callback first */
Note: See TracChangeset
for help on using the changeset viewer.