Changeset 3753
- Timestamp:
- Sep 18, 2011 2:59:56 PM (13 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/src/pjnath/ice_session.c
r3553 r3753 1749 1749 "Sending connectivity check for check %s", 1750 1750 dump_check(ice->tmp.txt, sizeof(ice->tmp.txt), clist, check))); 1751 pj_log_push_indent(); 1751 1752 1752 1753 /* Create request */ … … 1756 1757 if (status != PJ_SUCCESS) { 1757 1758 pjnath_perror(ice->obj_name, "Error creating STUN request", status); 1759 pj_log_pop_indent(); 1758 1760 return status; 1759 1761 } … … 1812 1814 check->tdata = NULL; 1813 1815 pjnath_perror(ice->obj_name, "Error sending STUN request", status); 1816 pj_log_pop_indent(); 1814 1817 return status; 1815 1818 } … … 1817 1820 check_set_state(ice, check, PJ_ICE_SESS_CHECK_STATE_IN_PROGRESS, 1818 1821 PJ_SUCCESS); 1822 pj_log_pop_indent(); 1819 1823 return PJ_SUCCESS; 1820 1824 } … … 1846 1850 1847 1851 LOG5((ice->obj_name, "Starting checklist periodic check")); 1852 pj_log_push_indent(); 1848 1853 1849 1854 /* Send STUN Binding request for check with highest priority on … … 1857 1862 if (status != PJ_SUCCESS) { 1858 1863 pj_mutex_unlock(ice->mutex); 1864 pj_log_pop_indent(); 1859 1865 return status; 1860 1866 } … … 1876 1882 if (status != PJ_SUCCESS) { 1877 1883 pj_mutex_unlock(ice->mutex); 1884 pj_log_pop_indent(); 1878 1885 return status; 1879 1886 } … … 1897 1904 1898 1905 pj_mutex_unlock(ice->mutex); 1906 pj_log_pop_indent(); 1899 1907 return PJ_SUCCESS; 1900 1908 } … … 1909 1917 1910 1918 LOG4((ice->obj_name, "Starting nominated check..")); 1919 pj_log_push_indent(); 1911 1920 1912 1921 pj_assert(ice->is_nominating == PJ_FALSE); … … 1959 1968 1960 1969 ice->is_nominating = PJ_TRUE; 1970 pj_log_pop_indent(); 1961 1971 } 1962 1972 … … 2006 2016 2007 2017 LOG4((ice->obj_name, "Starting ICE check..")); 2018 pj_log_push_indent(); 2008 2019 2009 2020 /* If we are using aggressive nomination, set the is_nominating state */ … … 2033 2044 pj_assert(!"Unable to find checklist for component 1"); 2034 2045 pj_mutex_unlock(ice->mutex); 2046 pj_log_pop_indent(); 2035 2047 return PJNATH_EICEINCOMPID; 2036 2048 } … … 2073 2085 "Performing delayed triggerred check for component %d", 2074 2086 rcheck->comp_id)); 2087 pj_log_push_indent(); 2075 2088 handle_incoming_check(ice, rcheck); 2076 2089 rcheck = rcheck->next; 2090 pj_log_pop_indent(); 2077 2091 } 2078 2092 pj_list_init(&ice->early_check); … … 2092 2106 2093 2107 pj_mutex_unlock(ice->mutex); 2108 pj_log_pop_indent(); 2094 2109 return status; 2095 2110 } … … 2194 2209 /* Resend request */ 2195 2210 LOG4((ice->obj_name, "Resending check because of role conflict")); 2211 pj_log_push_indent(); 2196 2212 check_set_state(ice, check, PJ_ICE_SESS_CHECK_STATE_WAITING, 0); 2197 2213 perform_check(ice, clist, msg_data->data.req.ckid, 2198 2214 check->nominated || ice->is_nominating); 2215 pj_log_pop_indent(); 2199 2216 pj_mutex_unlock(ice->mutex); 2200 2217 return; … … 2208 2225 (check->nominated ? " (nominated)" : " (not nominated)"), 2209 2226 errmsg)); 2210 2227 pj_log_push_indent(); 2211 2228 check_set_state(ice, check, PJ_ICE_SESS_CHECK_STATE_FAILED, status); 2212 2229 on_check_complete(ice, check); 2230 pj_log_pop_indent(); 2213 2231 pj_mutex_unlock(ice->mutex); 2214 2232 return; … … 2231 2249 &ice->clist, check), 2232 2250 (check->nominated ? " (nominated)" : " (not nominated)"))); 2251 pj_log_push_indent(); 2233 2252 check_set_state(ice, check, PJ_ICE_SESS_CHECK_STATE_FAILED, status); 2234 2253 on_check_complete(ice, check); 2254 pj_log_pop_indent(); 2235 2255 pj_mutex_unlock(ice->mutex); 2236 2256 return; … … 2703 2723 2704 2724 LOG5((ice->obj_name, "Performing triggered check for check %d",i)); 2725 pj_log_push_indent(); 2705 2726 perform_check(ice, &ice->clist, i, nominate); 2727 pj_log_pop_indent(); 2706 2728 2707 2729 } else if (c->state == PJ_ICE_SESS_CHECK_STATE_IN_PROGRESS) { … … 2710 2732 LOG5((ice->obj_name, "Triggered check for check %d not performed " 2711 2733 "because it's in progress. Retransmitting", i)); 2734 pj_log_push_indent(); 2712 2735 pj_stun_session_retransmit_req(comp->stun_sess, c->tdata); 2736 pj_log_pop_indent(); 2713 2737 2714 2738 } else if (c->state == PJ_ICE_SESS_CHECK_STATE_SUCCEEDED) { … … 2744 2768 LOG5((ice->obj_name, "Triggered check for check %d not performed " 2745 2769 "because it's completed", i)); 2746 2770 pj_log_push_indent(); 2747 2771 complete = on_check_complete(ice, c); 2772 pj_log_pop_indent(); 2748 2773 if (complete) { 2749 2774 return; … … 2774 2799 LOG4((ice->obj_name, "New triggered check added: %d", 2775 2800 ice->clist.count)); 2801 pj_log_push_indent(); 2776 2802 perform_check(ice, &ice->clist, ice->clist.count++, nominate); 2803 pj_log_pop_indent(); 2777 2804 2778 2805 } else { … … 2803 2830 sd = (struct stun_data*) pj_stun_session_get_user_data(sess); 2804 2831 2832 pj_log_push_indent(); 2833 2805 2834 if (msg->hdr.type == PJ_STUN_BINDING_INDICATION) { 2806 2835 LOG5((sd->ice->obj_name, "Received Binding Indication keep-alive " … … 2811 2840 sd->comp_id)); 2812 2841 } 2842 2843 pj_log_pop_indent(); 2813 2844 2814 2845 return PJ_SUCCESS; -
pjproject/trunk/pjnath/src/pjnath/ice_strans.c
r3553 r3753 406 406 comp_id)); 407 407 408 pj_log_push_indent(); 409 408 410 /* Start Binding resolution */ 409 411 status = pj_stun_sock_start(comp->stun_sock, … … 413 415 if (status != PJ_SUCCESS) { 414 416 ///sess_dec_ref(ice_st); 417 pj_log_pop_indent(); 415 418 return status; 416 419 } … … 420 423 if (status != PJ_SUCCESS) { 421 424 ///sess_dec_ref(ice_st); 425 pj_log_pop_indent(); 422 426 return status; 423 427 } … … 438 442 comp->default_cand = cand - comp->cand_list; 439 443 444 pj_log_pop_indent(); 440 445 } 441 446 … … 537 542 "Creating ICE stream transport with %d component(s)", 538 543 comp_cnt)); 544 pj_log_push_indent(); 539 545 540 546 pj_ice_strans_cfg_copy(pool, &ice_st->cfg, cfg); … … 551 557 if (status != PJ_SUCCESS) { 552 558 destroy_ice_st(ice_st); 559 pj_log_pop_indent(); 553 560 return status; 554 561 } … … 571 578 pj_lock_release(ice_st->init_lock); 572 579 destroy_ice_st(ice_st); 580 pj_log_pop_indent(); 573 581 return status; 574 582 } … … 584 592 585 593 *p_ice_st = ice_st; 594 pj_log_pop_indent(); 595 586 596 return PJ_SUCCESS; 587 597 } … … 591 601 { 592 602 unsigned i; 603 604 PJ_LOG(5,(ice_st->obj_name, "ICE stream transport destroying..")); 605 pj_log_push_indent(); 593 606 594 607 /* Destroy ICE if we have ICE */ … … 630 643 } 631 644 645 PJ_LOG(4,(ice_st->obj_name, "ICE stream transport destroyed")); 646 632 647 /* Done */ 633 648 pj_pool_release(ice_st->pool); 649 pj_log_pop_indent(); 634 650 } 635 651 … … 665 681 pj_strerror(status, errmsg, sizeof(errmsg)); 666 682 PJ_LOG(4,(ice_st->obj_name, "%s: %s", title, errmsg)); 667 668 if (op==PJ_ICE_STRANS_OP_INIT && ice_st->cb_called) 683 pj_log_push_indent(); 684 685 if (op==PJ_ICE_STRANS_OP_INIT && ice_st->cb_called) { 686 pj_log_pop_indent(); 669 687 return; 688 } 670 689 671 690 ice_st->cb_called = PJ_TRUE; … … 673 692 if (ice_st->cb.on_ice_complete) 674 693 (*ice_st->cb.on_ice_complete)(ice_st, op, status); 694 695 pj_log_pop_indent(); 675 696 } 676 697 … … 710 731 PJ_DEF(pj_status_t) pj_ice_strans_destroy(pj_ice_strans *ice_st) 711 732 { 712 char obj_name[PJ_MAX_OBJ_NAME];713 714 733 PJ_ASSERT_RETURN(ice_st, PJ_EINVAL); 715 734 … … 721 740 } 722 741 723 pj_memcpy(obj_name, ice_st->obj_name, PJ_MAX_OBJ_NAME);724 742 destroy_ice_st(ice_st); 725 726 PJ_LOG(4,(obj_name, "ICE stream transport destroyed"));727 743 return PJ_SUCCESS; 728 744 } … … 1295 1311 PJ_ICE_STRANS_STATE_FAILED; 1296 1312 1313 pj_log_push_indent(); 1297 1314 (*ice_st->cb.on_ice_complete)(ice_st, PJ_ICE_STRANS_OP_NEGOTIATION, 1298 1315 status); 1299 1316 pj_log_pop_indent(); 1300 1317 1301 1318 } … … 1616 1633 PJ_LOG(5,(comp->ice_st->obj_name, "TURN client state changed %s --> %s", 1617 1634 pj_turn_state_name(old_state), pj_turn_state_name(new_state))); 1635 pj_log_push_indent(); 1618 1636 1619 1637 sess_add_ref(comp->ice_st); … … 1691 1709 1692 1710 sess_dec_ref(comp->ice_st); 1693 } 1694 1711 1712 pj_log_pop_indent(); 1713 } 1714 -
pjproject/trunk/pjnath/src/pjnath/stun_session.c
r3553 r3753 865 865 PJ_ASSERT_RETURN(sess && addr_len && server && tdata, PJ_EINVAL); 866 866 867 pj_log_push_indent(); 868 867 869 /* Allocate packet */ 868 870 tdata->max_len = PJ_STUN_MAX_PKT_LEN; … … 972 974 on_return: 973 975 pj_lock_release(sess->lock); 976 977 pj_log_pop_indent(); 974 978 975 979 /* Check if application has called destroy() in the callback */ … … 1354 1358 PJ_ASSERT_RETURN(sess && packet && pkt_size, PJ_EINVAL); 1355 1359 1360 pj_log_push_indent(); 1361 1356 1362 /* Lock the session and prevent user from destroying us in the callback */ 1357 1363 pj_atomic_inc(sess->busy); … … 1411 1417 pj_lock_release(sess->lock); 1412 1418 1419 pj_log_pop_indent(); 1420 1413 1421 /* If we've received destroy request while we're on the callback, 1414 1422 * destroy the session now. -
pjproject/trunk/pjnath/src/pjnath/stun_transaction.c
r3553 r3753 226 226 PJ_LOG(5,(tsx->obj_name, "STUN sending message (transmit count=%d)", 227 227 tsx->transmit_count)); 228 pj_log_push_indent(); 228 229 229 230 /* Send message */ … … 239 240 } 240 241 stun_perror(tsx, "STUN error sending message", status); 241 return status; 242 } 243 242 } 243 244 pj_log_pop_indent(); 244 245 return status; 245 246 } … … 322 323 tsx->retransmit_timer.id = 0; 323 324 PJ_LOG(4,(tsx->obj_name, "STUN timeout waiting for response")); 325 pj_log_push_indent(); 324 326 if (!tsx->complete) { 325 327 tsx->complete = PJ_TRUE; … … 329 331 } 330 332 /* We might have been destroyed, don't try to access the object */ 333 pj_log_pop_indent(); 331 334 return; 332 335 } -
pjproject/trunk/pjsip/src/pjsip-simple/evsub.c
r3553 r3753 579 579 (int)sub->state_str.slen, 580 580 sub->state_str.ptr)); 581 pj_log_push_indent(); 581 582 582 583 /* don't call the callback with NULL event, it may crash the app! */ … … 596 597 } 597 598 } 599 600 pj_log_pop_indent(); 598 601 } 599 602 … … 628 631 629 632 PJ_LOG(5,(sub->obj_name, "Refreshing subscription.")); 633 pj_log_push_indent(); 630 634 status = pjsip_evsub_initiate(sub, NULL, 631 635 sub->expires->ivalue, … … 633 637 if (status == PJ_SUCCESS) 634 638 pjsip_evsub_send_request(sub, tdata); 639 640 pj_log_pop_indent(); 635 641 } 636 642 break; … … 646 652 PJ_LOG(5,(sub->obj_name, "Timeout waiting for refresh. " 647 653 "Sending NOTIFY to terminate.")); 654 pj_log_push_indent(); 648 655 status = pjsip_evsub_notify( sub, PJSIP_EVSUB_STATE_TERMINATED, 649 656 NULL, &STR_TIMEOUT, &tdata); 650 657 if (status == PJ_SUCCESS) 651 658 pjsip_evsub_send_request(sub, tdata); 659 660 pj_log_pop_indent(); 652 661 } 653 662 break; … … 659 668 PJ_LOG(5,(sub->obj_name, "Timeout waiting for final NOTIFY. " 660 669 "Terminating..")); 670 pj_log_push_indent(); 661 671 set_state(sub, PJSIP_EVSUB_STATE_TERMINATED, NULL, NULL, 662 672 &timeout); 673 pj_log_pop_indent(); 663 674 } 664 675 break; … … 673 684 "send non-2xx response for previous NOTIFY). " 674 685 "Unsubscribing..")); 686 pj_log_push_indent(); 675 687 status = pjsip_evsub_initiate( sub, NULL, 0, &tdata); 676 688 if (status == PJ_SUCCESS) 677 689 pjsip_evsub_send_request(sub, tdata); 690 691 pj_log_pop_indent(); 678 692 } 679 693 break; -
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r3553 r3753 1917 1917 PJ_ASSERT_RETURN(inv->invite_tsx, PJ_EBUG); 1918 1918 1919 pj_log_push_indent(); 1920 1919 1921 pjsip_dlg_inc_lock(inv->dlg); 1920 1922 … … 1964 1966 on_return: 1965 1967 pjsip_dlg_dec_lock(inv->dlg); 1968 pj_log_pop_indent(); 1966 1969 return status; 1967 1970 } … … 1990 1993 PJ_ASSERT_RETURN(inv->last_answer, PJ_EINVALIDOP); 1991 1994 1995 pj_log_push_indent(); 1996 1992 1997 pjsip_dlg_inc_lock(inv->dlg); 1993 1998 … … 2017 2022 on_return: 2018 2023 pjsip_dlg_dec_lock(inv->dlg); 2024 pj_log_pop_indent(); 2019 2025 return status; 2020 2026 } … … 2052 2058 /* Verify arguments. */ 2053 2059 PJ_ASSERT_RETURN(inv && p_tdata, PJ_EINVAL); 2060 2061 pj_log_push_indent(); 2054 2062 2055 2063 /* Set cause code. */ … … 2082 2090 PJ_LOG(4, (inv->obj_name, "Delaying CANCEL since no " 2083 2091 "provisional response is received yet")); 2092 pj_log_pop_indent(); 2084 2093 return PJ_SUCCESS; 2085 2094 } … … 2093 2102 inv->invite_tsx->last_tx, 2094 2103 &tdata); 2095 if (status != PJ_SUCCESS) 2104 if (status != PJ_SUCCESS) { 2105 pj_log_pop_indent(); 2096 2106 return status; 2107 } 2097 2108 2098 2109 /* Set timeout for the INVITE transaction, in case UAS is not … … 2126 2137 case PJSIP_INV_STATE_DISCONNECTED: 2127 2138 /* No need to do anything. */ 2139 pj_log_pop_indent(); 2128 2140 return PJSIP_ESESSIONTERMINATED; 2129 2141 2130 2142 default: 2131 2143 pj_assert("!Invalid operation!"); 2144 pj_log_pop_indent(); 2132 2145 return PJ_EINVALIDOP; 2133 2146 } 2134 2147 2135 if (status != PJ_SUCCESS) 2148 if (status != PJ_SUCCESS) { 2149 pj_log_pop_indent(); 2136 2150 return status; 2151 } 2137 2152 2138 2153 … … 2142 2157 *p_tdata = tdata; 2143 2158 2159 pj_log_pop_indent(); 2144 2160 return PJ_SUCCESS; 2145 2161 } … … 2364 2380 return PJ_EINVALIDOP; 2365 2381 2382 pj_log_push_indent(); 2366 2383 2367 2384 pjsip_dlg_inc_lock(inv->dlg); … … 2434 2451 on_return: 2435 2452 pjsip_dlg_dec_lock(inv->dlg); 2453 pj_log_pop_indent(); 2436 2454 return status; 2437 2455 } … … 2460 2478 PJ_ASSERT_RETURN(inv->state < PJSIP_INV_STATE_DISCONNECTED, 2461 2479 PJ_EINVALIDOP); 2480 2481 pj_log_push_indent(); 2462 2482 2463 2483 /* Lock dialog. */ … … 2523 2543 *p_tdata = tdata; 2524 2544 2545 pj_log_pop_indent(); 2525 2546 return PJ_SUCCESS; 2526 2547 … … 2532 2553 pjsip_dlg_dec_lock(inv->dlg); 2533 2554 2555 pj_log_pop_indent(); 2534 2556 return status; 2535 2557 } … … 2594 2616 PJ_ASSERT_RETURN(inv && tdata, PJ_EINVAL); 2595 2617 2618 pj_log_push_indent(); 2619 2596 2620 PJ_LOG(5,(inv->obj_name, "Sending %s", 2597 2621 pjsip_tx_data_get_info(tdata))); … … 2608 2632 pjsip_tx_data_dec_ref(tdata); 2609 2633 pjsip_dlg_dec_lock(inv->dlg); 2610 return PJ_EINVALIDOP; 2634 status = PJ_EINVALIDOP; 2635 goto on_error; 2611 2636 } 2612 2637 … … 2619 2644 status = pjsip_dlg_send_request(inv->dlg, tdata, mod_inv.mod.id, 2620 2645 tsx_inv_data); 2621 if (status != PJ_SUCCESS) 2622 return status; 2646 if (status != PJ_SUCCESS) { 2647 goto on_error; 2648 } 2623 2649 2624 2650 } else { … … 2639 2665 } 2640 2666 2641 if (status != PJ_SUCCESS) 2642 return status; 2643 } 2644 2645 /* Done (?) */ 2667 if (status != PJ_SUCCESS) { 2668 goto on_error; 2669 } 2670 } 2671 2672 /* Done */ 2673 pj_log_pop_indent(); 2646 2674 return PJ_SUCCESS; 2675 2676 on_error: 2677 pj_log_pop_indent(); 2678 return status; 2647 2679 } 2648 2680 -
pjproject/trunk/pjsip/src/pjsip/sip_dialog.c
r3553 r3753 803 803 PJ_ASSERT_RETURN(dlg && mod, PJ_EINVAL); 804 804 805 pj_log_push_indent(); 806 805 807 pjsip_dlg_inc_lock(dlg); 806 808 ++dlg->sess_count; … … 810 812 dlg->sess_count, (int)mod->name.slen, mod->name.ptr)); 811 813 814 pj_log_pop_indent(); 812 815 return PJ_SUCCESS; 813 816 } … … 890 893 PJ_ASSERT_RETURN(dlg, PJ_EINVAL); 891 894 895 pj_log_push_indent(); 896 892 897 PJ_LOG(5,(dlg->obj_name, "Session count dec to %d by %.*s", 893 898 dlg->sess_count-1, (int)mod->name.slen, mod->name.ptr)); … … 897 902 pjsip_dlg_dec_lock(dlg); 898 903 904 pj_log_pop_indent(); 899 905 return PJ_SUCCESS; 900 906 } … … 1151 1157 PJSIP_ENOTREQUESTMSG); 1152 1158 1159 pj_log_push_indent(); 1153 1160 PJ_LOG(5,(dlg->obj_name, "Sending %s", 1154 1161 pjsip_tx_data_get_info(tdata))); … … 1222 1229 /* Unlock dialog, may destroy dialog. */ 1223 1230 pjsip_dlg_dec_lock(dlg); 1224 1231 pj_log_pop_indent(); 1225 1232 return PJ_SUCCESS; 1226 1233 … … 1231 1238 /* Whatever happen delete the message. */ 1232 1239 pjsip_tx_data_dec_ref( tdata ); 1233 1240 pj_log_pop_indent(); 1234 1241 return status; 1235 1242 } … … 1409 1416 PJ_ASSERT_RETURN(tsx->mod_data[dlg->ua->id] == dlg, PJ_EINVALIDOP); 1410 1417 1418 pj_log_push_indent(); 1419 1411 1420 PJ_LOG(5,(dlg->obj_name, "Sending %s", 1412 1421 pjsip_tx_data_get_info(tdata))); … … 1453 1462 1454 1463 pjsip_dlg_dec_lock(dlg); 1464 pj_log_pop_indent(); 1455 1465 1456 1466 return status; … … 1520 1530 PJ_LOG(5,(dlg->obj_name, "Received %s", 1521 1531 pjsip_rx_data_get_info(rdata))); 1532 pj_log_push_indent(); 1522 1533 1523 1534 /* Lock dialog and increment session. */ … … 1541 1552 pjsip_endpt_respond_stateless(dlg->endpt, 1542 1553 rdata, 500, &warn_text, NULL, NULL); 1554 pj_log_pop_indent(); 1543 1555 return; 1544 1556 } … … 1644 1656 /* Unlock dialog and dec session, may destroy dialog. */ 1645 1657 pjsip_dlg_dec_lock(dlg); 1658 pj_log_pop_indent(); 1646 1659 } 1647 1660 … … 1740 1753 PJ_LOG(5,(dlg->obj_name, "Received %s", 1741 1754 pjsip_rx_data_get_info(rdata))); 1755 pj_log_push_indent(); 1742 1756 1743 1757 /* Lock the dialog and inc session. */ … … 1932 1946 /* Unlock dialog and dec session, may destroy dialog. */ 1933 1947 pjsip_dlg_dec_lock(dlg); 1948 1949 pj_log_pop_indent(); 1934 1950 } 1935 1951 … … 1945 1961 PJ_LOG(5,(dlg->obj_name, "Transaction %s state changed to %s", 1946 1962 tsx->obj_name, pjsip_tsx_state_str(tsx->state))); 1963 pj_log_push_indent(); 1947 1964 1948 1965 /* Lock the dialog and increment session. */ … … 1973 1990 /* Unlock dialog and dec session, may destroy dialog. */ 1974 1991 pjsip_dlg_dec_lock(dlg); 1992 pj_log_pop_indent(); 1975 1993 } 1976 1994 -
pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c
r3553 r3753 826 826 PJ_LOG(5, (THIS_FILE, "Processing incoming message: %s", 827 827 pjsip_rx_data_get_info(rdata))); 828 pj_log_push_indent(); 828 829 829 830 #if defined(PJSIP_CHECK_VIA_SENT_BY) && PJSIP_CHECK_VIA_SENT_BY != 0 … … 881 882 rdata->pkt_info.src_name, 882 883 rdata->pkt_info.src_port)); 884 pj_log_pop_indent(); 883 885 return; 884 886 } … … 941 943 */ 942 944 pj_bzero(&rdata->endpt_info, sizeof(rdata->endpt_info)); 945 946 pj_log_pop_indent(); 943 947 } 944 948 -
pjproject/trunk/pjsip/src/pjsip/sip_transaction.c
r3553 r3753 1087 1087 PJ_LOG(5,(tsx->obj_name, "%s timer event", 1088 1088 (entry==&tsx->retransmit_timer ? "Retransmit":"Timeout"))); 1089 pj_log_push_indent(); 1089 1090 1090 1091 … … 1095 1096 (*tsx->state_handler)(tsx, &event); 1096 1097 unlock_tsx(tsx, &lck); 1098 1099 pj_log_pop_indent(); 1097 1100 } 1098 1101 … … 1114 1117 state_str[tsx->state], state_str[state], 1115 1118 pjsip_event_str(event_src_type))); 1119 pj_log_push_indent(); 1116 1120 1117 1121 /* Change state. */ … … 1192 1196 tsx_destroy(tsx); 1193 1197 } 1198 1199 pj_log_pop_indent(); 1194 1200 } 1195 1201 … … 1325 1331 unlock_tsx(tsx, &lck); 1326 1332 1333 pj_log_push_indent(); 1327 1334 PJ_LOG(5,(tsx->obj_name, "Transaction created for %s", 1328 1335 pjsip_tx_data_get_info(tdata))); 1336 pj_log_pop_indent(); 1329 1337 1330 1338 *p_tsx = tsx; … … 1467 1475 unlock_tsx(tsx, &lck); 1468 1476 1469 1477 pj_log_push_indent(); 1470 1478 PJ_LOG(5,(tsx->obj_name, "Transaction created for %s", 1471 1479 pjsip_rx_data_get_info(rdata))); 1480 pj_log_pop_indent(); 1472 1481 1473 1482 … … 1537 1546 return PJ_SUCCESS; 1538 1547 1548 pj_log_push_indent(); 1549 1539 1550 lock_tsx(tsx, &lck); 1540 1551 tsx_set_status_code(tsx, code, NULL); … … 1542 1553 unlock_tsx(tsx, &lck); 1543 1554 1555 pj_log_pop_indent(); 1556 1544 1557 return PJ_SUCCESS; 1545 1558 } … … 1561 1574 1562 1575 PJ_LOG(5,(tsx->obj_name, "Request to stop retransmission")); 1576 1577 pj_log_push_indent(); 1563 1578 1564 1579 lock_tsx(tsx, &lck); … … 1569 1584 } 1570 1585 unlock_tsx(tsx, &lck); 1586 1587 pj_log_pop_indent(); 1571 1588 1572 1589 return PJ_SUCCESS; … … 1641 1658 pjsip_tx_data_get_info(tdata), 1642 1659 state_str[tsx->state])); 1660 pj_log_push_indent(); 1643 1661 1644 1662 PJSIP_EVENT_INIT_TX_MSG(event, tdata); … … 1662 1680 } 1663 1681 1682 pj_log_pop_indent(); 1683 1664 1684 return status; 1665 1685 } … … 1679 1699 PJ_LOG(5,(tsx->obj_name, "Incoming %s in state %s", 1680 1700 pjsip_rx_data_get_info(rdata), state_str[tsx->state])); 1701 pj_log_push_indent(); 1681 1702 1682 1703 /* Put the transaction in the rdata's mod_data. */ … … 1690 1711 status = (*tsx->state_handler)(tsx, &event); 1691 1712 unlock_tsx(tsx, &lck); 1713 1714 pj_log_pop_indent(); 1692 1715 } 1693 1716 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r3683 r3753 375 375 pjsua_acc *acc; 376 376 unsigned i, id; 377 pj_status_t status; 378 377 pj_status_t status = PJ_SUCCESS; 378 379 PJ_ASSERT_RETURN(cfg, PJ_EINVAL); 379 380 PJ_ASSERT_RETURN(pjsua_var.acc_cnt < PJ_ARRAY_SIZE(pjsua_var.acc), 380 381 PJ_ETOOMANY); … … 385 386 /* Verify media count */ 386 387 #if !defined(PJMEDIA_HAS_VIDEO) || (PJMEDIA_HAS_VIDEO == 0) 388 /* Enable PJMEDIA_HAS_VIDEO in your config_site.h! */ 387 389 PJ_ASSERT_RETURN(cfg->max_video_cnt == 0, PJ_EINVAL); 388 390 #endif 389 391 PJ_ASSERT_RETURN(cfg->max_audio_cnt + cfg->max_video_cnt <= 390 392 PJSUA_MAX_CALL_MEDIA, PJ_ETOOMANY); 393 394 PJ_LOG(4,(THIS_FILE, "Adding account: id=%.*s", 395 (int)cfg->id.slen, cfg->id.ptr)); 396 pj_log_push_indent(); 391 397 392 398 PJSUA_LOCK(); … … 434 440 for (i=0; i<acc->cfg.proxy_cnt; ++i) { 435 441 status = normalize_route_uri(acc->pool, &acc->cfg.proxy[i]); 436 if (status != PJ_SUCCESS) 442 if (status != PJ_SUCCESS) { 443 PJSUA_UNLOCK(); 444 pj_log_pop_indent(); 437 445 return status; 446 } 438 447 } 439 448 … … 444 453 acc->pool = NULL; 445 454 PJSUA_UNLOCK(); 455 pj_log_pop_indent(); 446 456 return status; 447 457 } … … 469 479 } 470 480 481 pj_log_pop_indent(); 471 482 return PJ_SUCCESS; 472 483 } … … 575 586 PJ_ASSERT_RETURN(pjsua_var.acc[acc_id].valid, PJ_EINVALIDOP); 576 587 588 PJ_LOG(4,(THIS_FILE, "Deleting account %d..", acc_id)); 589 pj_log_push_indent(); 590 577 591 PJSUA_LOCK(); 578 592 … … 625 639 PJ_LOG(4,(THIS_FILE, "Account id %d deleted", acc_id)); 626 640 641 pj_log_pop_indent(); 627 642 return PJ_SUCCESS; 628 643 } … … 656 671 PJSUA_MAX_CALL_MEDIA, PJ_ETOOMANY); 657 672 673 PJ_LOG(4,(THIS_FILE, "Modifying accunt %d", acc_id)); 674 pj_log_push_indent(); 658 675 659 676 PJSUA_LOCK(); … … 1041 1058 on_return: 1042 1059 PJSUA_UNLOCK(); 1060 pj_log_pop_indent(); 1043 1061 return status; 1044 1062 } … … 1056 1074 PJ_ASSERT_RETURN(pjsua_var.acc[acc_id].valid, PJ_EINVALIDOP); 1057 1075 1076 PJ_LOG(4,(THIS_FILE, "Acc %d: setting online status to %d..", 1077 acc_id, is_online)); 1078 pj_log_push_indent(); 1079 1058 1080 pjsua_var.acc[acc_id].online_status = is_online; 1059 1081 pj_bzero(&pjsua_var.acc[acc_id].rpid, sizeof(pjrpid_element)); 1060 1082 pjsua_pres_update_acc(acc_id, PJ_FALSE); 1083 1084 pj_log_pop_indent(); 1061 1085 return PJ_SUCCESS; 1062 1086 } … … 1074 1098 PJ_ASSERT_RETURN(pjsua_var.acc[acc_id].valid, PJ_EINVALIDOP); 1075 1099 1100 PJ_LOG(4,(THIS_FILE, "Acc %d: setting online status to %d..", 1101 acc_id, is_online)); 1102 pj_log_push_indent(); 1103 1076 1104 PJSUA_LOCK(); 1077 1105 pjsua_var.acc[acc_id].online_status = is_online; … … 1080 1108 1081 1109 pjsua_pres_update_acc(acc_id, PJ_TRUE); 1110 pj_log_pop_indent(); 1111 1082 1112 return PJ_SUCCESS; 1083 1113 } … … 1665 1695 return; 1666 1696 1697 pj_log_push_indent(); 1667 1698 PJSUA_LOCK(); 1668 1699 … … 1716 1747 if (acc_check_nat_addr(acc, param)) { 1717 1748 PJSUA_UNLOCK(); 1749 pj_log_pop_indent(); 1718 1750 return; 1719 1751 } … … 1778 1810 1779 1811 PJSUA_UNLOCK(); 1812 pj_log_pop_indent(); 1780 1813 } 1781 1814 … … 1965 1998 PJ_ASSERT_RETURN(pjsua_var.acc[acc_id].valid, PJ_EINVALIDOP); 1966 1999 2000 PJ_LOG(4,(THIS_FILE, "Acc %d: setting %sregistration..", 2001 acc_id, (renew? "" : "un"))); 2002 pj_log_push_indent(); 2003 1967 2004 PJSUA_LOCK(); 1968 2005 … … 2040 2077 status); 2041 2078 } else { 2042 PJ_LOG( 3,(THIS_FILE, "%s sent",2079 PJ_LOG(4,(THIS_FILE, "Acc %d: %s sent", acc_id, 2043 2080 (renew? "Registration" : "Unregistration"))); 2044 2081 } … … 2046 2083 on_return: 2047 2084 PJSUA_UNLOCK(); 2085 pj_log_pop_indent(); 2048 2086 return status; 2049 2087 } … … 2791 2829 return; 2792 2830 2831 PJ_LOG(4,(THIS_FILE, "Disconnected notification for transport %s", 2832 tp->obj_name)); 2833 pj_log_push_indent(); 2834 2793 2835 /* Shutdown this transport, to make sure that the transport manager 2794 2836 * will create a new transport for reconnection. … … 2818 2860 2819 2861 PJSUA_UNLOCK(); 2820 } 2862 pj_log_pop_indent(); 2863 } -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r3694 r3753 343 343 pjsua_call_id *p_call_id) 344 344 { 345 pj_pool_t *tmp_pool ;345 pj_pool_t *tmp_pool = NULL; 346 346 pjsip_dialog *dlg = NULL; 347 347 pjmedia_sdp_session *offer; … … 362 362 PJ_ASSERT_RETURN(dest_uri, PJ_EINVAL); 363 363 364 PJ_LOG(4,(THIS_FILE, "Making call with acc #%d to %.*s", acc_id, 365 (int)dest_uri->slen, dest_uri->ptr)); 366 367 pj_log_push_indent(); 368 364 369 PJSUA_LOCK(); 365 370 … … 375 380 376 381 status = pjsua_set_snd_dev(pjsua_var.cap_dev, pjsua_var.play_dev); 377 if (status != PJ_SUCCESS) { 378 PJSUA_UNLOCK(); 379 return status; 380 } 382 if (status != PJ_SUCCESS) 383 goto on_error; 381 384 } 382 385 … … 385 388 pjsua_perror(THIS_FILE, "Unable to make call because account " 386 389 "is not valid", PJ_EINVALIDOP); 387 PJSUA_UNLOCK();388 return PJ_EINVALIDOP;390 status = PJ_EINVALIDOP; 391 goto on_error; 389 392 } 390 393 … … 394 397 if (call_id == PJSUA_INVALID_ID) { 395 398 pjsua_perror(THIS_FILE, "Error making call", PJ_ETOOMANY); 396 PJSUA_UNLOCK();397 return PJ_ETOOMANY;399 status = PJ_ETOOMANY; 400 goto on_error; 398 401 } 399 402 … … 422 425 pjsua_perror(THIS_FILE, "Unable to make call", 423 426 PJSIP_EINVALIDREQURI); 424 pj_pool_release(tmp_pool); 425 PJSUA_UNLOCK(); 426 return PJSIP_EINVALIDREQURI; 427 } 428 } 429 430 PJ_LOG(4,(THIS_FILE, "Making call with acc #%d to %.*s", acc_id, 431 (int)dest_uri->slen, dest_uri->ptr)); 427 status = PJSIP_EINVALIDREQURI; 428 goto on_error; 429 } 430 } 432 431 433 432 /* Mark call start time. */ … … 448 447 pjsua_perror(THIS_FILE, "Unable to generate Contact header", 449 448 status); 450 pj_pool_release(tmp_pool); 451 PJSUA_UNLOCK(); 452 return status; 449 goto on_error; 453 450 } 454 451 } … … 460 457 if (status != PJ_SUCCESS) { 461 458 pjsua_perror(THIS_FILE, "Dialog creation failed", status); 462 pj_pool_release(tmp_pool); 463 PJSUA_UNLOCK(); 464 return status; 459 goto on_error; 465 460 } 466 461 … … 588 583 PJSUA_UNLOCK(); 589 584 585 pj_log_pop_indent(); 586 590 587 return PJ_SUCCESS; 591 588 … … 606 603 } 607 604 608 pj_pool_release(tmp_pool); 605 if (tmp_pool) 606 pj_pool_release(tmp_pool); 609 607 PJSUA_UNLOCK(); 608 609 pj_log_pop_indent(); 610 610 return status; 611 611 } … … 669 669 } 670 670 671 PJ_LOG(4,(THIS_FILE, "Incoming %s", rdata->msg_info.info)); 672 pj_log_push_indent(); 673 671 674 PJSUA_LOCK(); 672 675 … … 680 683 PJ_LOG(2,(THIS_FILE, 681 684 "Unable to accept incoming call (too many calls)")); 682 PJSUA_UNLOCK(); 683 return PJ_TRUE; 685 goto on_return; 684 686 } 685 687 … … 715 717 } 716 718 717 PJSUA_UNLOCK(); 718 return PJ_TRUE; 719 goto on_return; 719 720 } 720 721 … … 746 747 pjsip_endpt_respond(pjsua_var.endpt, NULL, rdata, 747 748 st_code, &st_text, NULL, NULL, NULL); 748 PJSUA_UNLOCK(); 749 return PJ_TRUE; 749 goto on_return; 750 750 } 751 751 } … … 794 794 pjsip_endpt_respond(pjsua_var.endpt, NULL, rdata, 400, 795 795 &reason, &hdr_list, NULL, NULL); 796 PJSUA_UNLOCK(); 797 return PJ_TRUE; 796 goto on_return; 798 797 } 799 798 … … 805 804 pjsip_endpt_respond(pjsua_var.endpt, NULL, rdata, 400, &reason, 806 805 NULL, NULL, NULL); 807 PJSUA_UNLOCK(); 808 return PJ_TRUE; 806 goto on_return; 809 807 } 810 808 … … 823 821 pjsip_endpt_respond(pjsua_var.endpt, NULL, rdata, 824 822 sip_err_code, NULL, NULL, NULL, NULL); 825 PJSUA_UNLOCK(); 826 return PJ_TRUE; 823 goto on_return; 827 824 } 828 825 … … 834 831 pjsip_endpt_respond(pjsua_var.endpt, NULL, rdata, 835 832 sip_err_code, NULL, NULL, NULL, NULL); 836 PJSUA_UNLOCK(); 837 return PJ_TRUE; 833 goto on_return; 838 834 } 839 835 … … 872 868 873 869 pjsua_media_channel_deinit(call->index); 874 PJSUA_UNLOCK(); 875 return PJ_TRUE; 870 goto on_return; 876 871 } 877 872 … … 889 884 NULL, NULL); 890 885 pjsua_media_channel_deinit(call->index); 891 PJSUA_UNLOCK(); 892 return PJ_TRUE; 886 goto on_return; 893 887 } 894 888 } … … 901 895 NULL, NULL); 902 896 pjsua_media_channel_deinit(call->index); 903 PJSUA_UNLOCK(); 904 return PJ_TRUE; 897 goto on_return; 905 898 } 906 899 … … 943 936 */ 944 937 pjsua_media_channel_deinit(call->index); 945 PJSUA_UNLOCK(); 946 return PJ_TRUE; 938 goto on_return; 947 939 } 948 940 … … 959 951 pjsua_media_channel_deinit(call->index); 960 952 961 PJSUA_UNLOCK(); 962 return PJ_TRUE; 953 goto on_return; 963 954 } 964 955 … … 1007 998 } 1008 999 pjsua_media_channel_deinit(call->index); 1009 PJSUA_UNLOCK(); 1010 return PJ_TRUE; 1000 goto on_return; 1011 1001 1012 1002 } else { … … 1014 1004 if (status != PJ_SUCCESS) { 1015 1005 pjsua_perror(THIS_FILE, "Unable to send 100 response", status); 1016 PJSUA_UNLOCK(); 1017 return PJ_TRUE; 1006 goto on_return; 1018 1007 } 1019 1008 } … … 1088 1077 1089 1078 /* This INVITE request has been handled. */ 1079 on_return: 1080 pj_log_pop_indent(); 1090 1081 PJSUA_UNLOCK(); 1091 1082 return PJ_TRUE; … … 1578 1569 { 1579 1570 pjsua_call *call; 1580 pjsip_dialog *dlg ;1571 pjsip_dialog *dlg = NULL; 1581 1572 pjsip_tx_data *tdata; 1582 1573 pj_status_t status; … … 1585 1576 PJ_EINVAL); 1586 1577 1578 PJ_LOG(4,(THIS_FILE, "Answering call %d: code=%d", call_id, code)); 1579 pj_log_push_indent(); 1580 1587 1581 status = acquire_call("pjsua_call_answer()", call_id, &call, &dlg); 1588 1582 if (status != PJ_SUCCESS) 1589 return status;1583 goto on_return; 1590 1584 1591 1585 if (call->res_time.sec == 0) … … 1600 1594 pjsua_perror(THIS_FILE, "Error creating response", 1601 1595 status); 1602 pjsip_dlg_dec_lock(dlg); 1603 return status; 1596 goto on_return; 1604 1597 } 1605 1598 … … 1607 1600 * 200/OK and the media failed to start. 1608 1601 */ 1609 if (call->inv == NULL) { 1610 pjsip_dlg_dec_lock(dlg); 1611 return PJSIP_ESESSIONTERMINATED; 1612 } 1602 if (call->inv == NULL) 1603 goto on_return; 1613 1604 1614 1605 /* Add additional headers etc */ … … 1621 1612 status); 1622 1613 1623 pjsip_dlg_dec_lock(dlg); 1624 1614 on_return: 1615 if (dlg) pjsip_dlg_dec_lock(dlg); 1616 pj_log_pop_indent(); 1625 1617 return status; 1626 1618 } … … 1637 1629 { 1638 1630 pjsua_call *call; 1639 pjsip_dialog *dlg ;1631 pjsip_dialog *dlg = NULL; 1640 1632 pj_status_t status; 1641 1633 pjsip_tx_data *tdata; … … 1650 1642 PJ_EINVAL); 1651 1643 1644 PJ_LOG(4,(THIS_FILE, "Call %d hanging up: code=%d..", call_id, code)); 1645 pj_log_push_indent(); 1646 1652 1647 status = acquire_call("pjsua_call_hangup()", call_id, &call, &dlg); 1653 1648 if (status != PJ_SUCCESS) 1654 return status;1649 goto on_return; 1655 1650 1656 1651 if (code==0) { … … 1668 1663 "Failed to create end session message", 1669 1664 status); 1670 pjsip_dlg_dec_lock(dlg); 1671 return status; 1665 goto on_return; 1672 1666 } 1673 1667 … … 1676 1670 * with any provisional responses. 1677 1671 */ 1678 if (tdata == NULL) { 1679 pjsip_dlg_dec_lock(dlg); 1680 return PJ_SUCCESS; 1681 } 1672 if (tdata == NULL) 1673 goto on_return; 1682 1674 1683 1675 /* Add additional headers etc */ … … 1690 1682 "Failed to send end session message", 1691 1683 status); 1692 pjsip_dlg_dec_lock(dlg); 1693 return status; 1684 goto on_return; 1694 1685 } 1695 1686 … … 1701 1692 } 1702 1693 1703 pjsip_dlg_dec_lock(dlg); 1704 1705 return PJ_SUCCESS; 1694 on_return: 1695 if (dlg) pjsip_dlg_dec_lock(dlg); 1696 pj_log_pop_indent(); 1697 return status; 1706 1698 } 1707 1699 … … 1741 1733 pjmedia_sdp_session *sdp; 1742 1734 pjsua_call *call; 1743 pjsip_dialog *dlg ;1735 pjsip_dialog *dlg = NULL; 1744 1736 pjsip_tx_data *tdata; 1745 1737 pj_status_t status; … … 1748 1740 PJ_EINVAL); 1749 1741 1742 PJ_LOG(4,(THIS_FILE, "Putting call %d on hold", call_id)); 1743 pj_log_push_indent(); 1744 1750 1745 status = acquire_call("pjsua_call_set_hold()", call_id, &call, &dlg); 1751 1746 if (status != PJ_SUCCESS) 1752 return status; 1753 1747 goto on_return; 1754 1748 1755 1749 if (call->inv->state != PJSIP_INV_STATE_CONFIRMED) { 1756 1750 PJ_LOG(3,(THIS_FILE, "Can not hold call that is not confirmed")); 1757 pjsip_dlg_dec_lock(dlg);1758 return PJSIP_ESESSIONSTATE;1751 status = PJSIP_ESESSIONSTATE; 1752 goto on_return; 1759 1753 } 1760 1754 1761 1755 status = create_sdp_of_call_hold(call, &sdp); 1762 if (status != PJ_SUCCESS) { 1763 pjsip_dlg_dec_lock(dlg); 1764 return status; 1765 } 1756 if (status != PJ_SUCCESS) 1757 goto on_return; 1766 1758 1767 1759 /* Create re-INVITE with new offer */ … … 1769 1761 if (status != PJ_SUCCESS) { 1770 1762 pjsua_perror(THIS_FILE, "Unable to create re-INVITE", status); 1771 pjsip_dlg_dec_lock(dlg); 1772 return status; 1763 goto on_return; 1773 1764 } 1774 1765 … … 1780 1771 if (status != PJ_SUCCESS) { 1781 1772 pjsua_perror(THIS_FILE, "Unable to send re-INVITE", status); 1782 pjsip_dlg_dec_lock(dlg); 1783 return status; 1773 goto on_return; 1784 1774 } 1785 1775 … … 1787 1777 call->local_hold = PJ_TRUE; 1788 1778 1789 pjsip_dlg_dec_lock(dlg); 1790 1791 return PJ_SUCCESS; 1779 on_return: 1780 if (dlg) pjsip_dlg_dec_lock(dlg); 1781 pj_log_pop_indent(); 1782 return status; 1792 1783 } 1793 1784 … … 1804 1795 pjsip_tx_data *tdata; 1805 1796 pjsua_call *call; 1806 pjsip_dialog *dlg ;1797 pjsip_dialog *dlg = NULL; 1807 1798 pj_status_t status; 1808 1799 … … 1811 1802 PJ_EINVAL); 1812 1803 1804 PJ_LOG(4,(THIS_FILE, "Sending re-INVITE on call %d", call_id)); 1805 pj_log_push_indent(); 1806 1813 1807 status = acquire_call("pjsua_call_reinvite()", call_id, &call, &dlg); 1814 1808 if (status != PJ_SUCCESS) 1815 return status;1809 goto on_return; 1816 1810 1817 1811 if (call->inv->state != PJSIP_INV_STATE_CONFIRMED) { 1818 1812 PJ_LOG(3,(THIS_FILE, "Can not re-INVITE call that is not confirmed")); 1819 pjsip_dlg_dec_lock(dlg);1820 return PJSIP_ESESSIONSTATE;1813 status = PJSIP_ESESSIONSTATE; 1814 goto on_return; 1821 1815 } 1822 1816 … … 1833 1827 pjsua_perror(THIS_FILE, "Unable to get SDP from media endpoint", 1834 1828 status); 1835 pjsip_dlg_dec_lock(dlg); 1836 return status; 1829 goto on_return; 1837 1830 } 1838 1831 … … 1847 1840 if (status != PJ_SUCCESS) { 1848 1841 pjsua_perror(THIS_FILE, "Unable to create re-INVITE", status); 1849 pjsip_dlg_dec_lock(dlg); 1850 return status; 1842 goto on_return; 1851 1843 } 1852 1844 … … 1858 1850 if (status != PJ_SUCCESS) { 1859 1851 pjsua_perror(THIS_FILE, "Unable to send re-INVITE", status); 1860 pjsip_dlg_dec_lock(dlg);1861 return status; 1862 } 1863 1852 goto on_return; 1853 } 1854 1855 on_return: 1864 1856 pjsip_dlg_dec_lock(dlg); 1865 1866 return PJ_SUCCESS;1857 pj_log_pop_indent(); 1858 return status; 1867 1859 } 1868 1860 … … 1879 1871 pjsip_tx_data *tdata; 1880 1872 pjsua_call *call; 1881 pjsip_dialog *dlg ;1873 pjsip_dialog *dlg = NULL; 1882 1874 pj_status_t status; 1883 1875 … … 1887 1879 PJ_EINVAL); 1888 1880 1881 PJ_LOG(4,(THIS_FILE, "Sending UPDATE on call %d", call_id)); 1882 pj_log_push_indent(); 1883 1889 1884 status = acquire_call("pjsua_call_update()", call_id, &call, &dlg); 1890 1885 if (status != PJ_SUCCESS) 1891 return status;1886 goto on_return; 1892 1887 1893 1888 /* Create SDP */ … … 1898 1893 pjsua_perror(THIS_FILE, "Unable to get SDP from media endpoint", 1899 1894 status); 1900 pjsip_dlg_dec_lock(dlg); 1901 return status; 1895 goto on_return; 1902 1896 } 1903 1897 … … 1912 1906 if (status != PJ_SUCCESS) { 1913 1907 pjsua_perror(THIS_FILE, "Unable to create UPDATE request", status); 1914 pjsip_dlg_dec_lock(dlg); 1915 return status; 1908 goto on_return; 1916 1909 } 1917 1910 … … 1923 1916 if (status != PJ_SUCCESS) { 1924 1917 pjsua_perror(THIS_FILE, "Unable to send UPDATE request", status); 1925 pjsip_dlg_dec_lock(dlg); 1926 return status; 1918 goto on_return; 1927 1919 } 1928 1920 1929 1921 call->local_hold = PJ_FALSE; 1930 1922 1931 pjsip_dlg_dec_lock(dlg); 1932 1933 return PJ_SUCCESS; 1923 on_return: 1924 if (dlg) pjsip_dlg_dec_lock(dlg); 1925 pj_log_pop_indent(); 1926 return status; 1934 1927 } 1935 1928 … … 1945 1938 pjsip_tx_data *tdata; 1946 1939 pjsua_call *call; 1947 pjsip_dialog *dlg ;1940 pjsip_dialog *dlg = NULL; 1948 1941 pjsip_generic_string_hdr *gs_hdr; 1949 1942 const pj_str_t str_ref_by = { "Referred-By", 11 }; … … 1952 1945 1953 1946 1954 PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls ,1955 1947 PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls && 1948 dest, PJ_EINVAL); 1956 1949 1950 PJ_LOG(4,(THIS_FILE, "Transfering call %d to %.*s", call_id, 1951 (int)dest->slen, dest->ptr)); 1952 pj_log_push_indent(); 1953 1957 1954 status = acquire_call("pjsua_call_xfer()", call_id, &call, &dlg); 1958 1955 if (status != PJ_SUCCESS) 1959 return status; 1960 1956 goto on_return; 1961 1957 1962 1958 /* Create xfer client subscription. */ … … 1967 1963 if (status != PJ_SUCCESS) { 1968 1964 pjsua_perror(THIS_FILE, "Unable to create xfer", status); 1969 pjsip_dlg_dec_lock(dlg); 1970 return status; 1965 goto on_return; 1971 1966 } 1972 1967 … … 1980 1975 if (status != PJ_SUCCESS) { 1981 1976 pjsua_perror(THIS_FILE, "Unable to create REFER request", status); 1982 pjsip_dlg_dec_lock(dlg); 1983 return status; 1977 goto on_return; 1984 1978 } 1985 1979 … … 1997 1991 if (status != PJ_SUCCESS) { 1998 1992 pjsua_perror(THIS_FILE, "Unable to send REFER request", status); 1999 pjsip_dlg_dec_lock(dlg); 2000 return status; 1993 goto on_return; 2001 1994 } 2002 1995 … … 2005 1998 * may want to hold the INVITE, or terminate the invite, or whatever. 2006 1999 */ 2007 2008 pjsip_dlg_dec_lock(dlg);2009 2010 return PJ_SUCCESS;2000 on_return: 2001 if (dlg) pjsip_dlg_dec_lock(dlg); 2002 pj_log_pop_indent(); 2003 return status; 2011 2004 2012 2005 } … … 2036 2029 PJ_EINVAL); 2037 2030 2031 PJ_LOG(4,(THIS_FILE, "Transfering call %d replacing with call %d", 2032 call_id, dest_call_id)); 2033 pj_log_push_indent(); 2034 2038 2035 status = acquire_call("pjsua_call_xfer_replaces()", dest_call_id, 2039 2036 &dest_call, &dest_dlg); 2040 if (status != PJ_SUCCESS) 2037 if (status != PJ_SUCCESS) { 2038 pj_log_pop_indent(); 2041 2039 return status; 2040 } 2042 2041 2043 2042 /* … … 2046 2045 2047 2046 /* Make sure we have sufficient buffer's length */ 2048 PJ_ASSERT_ RETURN(dest_dlg->remote.info_str.slen +2047 PJ_ASSERT_ON_FAIL(dest_dlg->remote.info_str.slen + 2049 2048 dest_dlg->call_id->id.slen + 2050 2049 dest_dlg->remote.info->tag.slen + 2051 2050 dest_dlg->local.info->tag.slen + 32 2052 < (long)sizeof(str_dest_buf), PJSIP_EURITOOLONG); 2051 < (long)sizeof(str_dest_buf), 2052 { status=PJSIP_EURITOOLONG; goto on_error; }); 2053 2053 2054 2054 /* Print URI */ … … 2059 2059 len = pjsip_uri_print(PJSIP_URI_IN_REQ_URI, uri, 2060 2060 str_dest_buf+1, sizeof(str_dest_buf)-1); 2061 if (len < 0) 2062 return PJSIP_EURITOOLONG; 2061 if (len < 0) { 2062 status = PJSIP_EURITOOLONG; 2063 goto on_error; 2064 } 2063 2065 2064 2066 str_dest.slen += len; … … 2081 2083 dest_dlg->local.info->tag.ptr); 2082 2084 2083 PJ_ASSERT_ RETURN(len > 0 && len <= (int)sizeof(str_dest_buf)-str_dest.slen,2084 PJSIP_EURITOOLONG);2085 PJ_ASSERT_ON_FAIL(len > 0 && len <= (int)sizeof(str_dest_buf)-str_dest.slen, 2086 { status=PJSIP_EURITOOLONG; goto on_error; }); 2085 2087 2086 2088 str_dest.ptr = str_dest_buf; … … 2089 2091 pjsip_dlg_dec_lock(dest_dlg); 2090 2092 2091 return pjsua_call_xfer(call_id, &str_dest, msg_data); 2093 status = pjsua_call_xfer(call_id, &str_dest, msg_data); 2094 2095 pj_log_pop_indent(); 2096 return status; 2097 2098 on_error: 2099 if (dest_dlg) pjsip_dlg_dec_lock(dest_dlg); 2100 pj_log_pop_indent(); 2101 return status; 2092 2102 } 2093 2103 … … 2100 2110 { 2101 2111 pjsua_call *call; 2102 pjsip_dialog *dlg ;2112 pjsip_dialog *dlg = NULL; 2103 2113 pj_status_t status; 2104 2114 … … 2106 2116 PJ_EINVAL); 2107 2117 2118 PJ_LOG(4,(THIS_FILE, "Call %d dialing DTMF %.*s", 2119 call_id, (int)digits->slen, digits->ptr)); 2120 pj_log_push_indent(); 2121 2108 2122 status = acquire_call("pjsua_call_dial_dtmf()", call_id, &call, &dlg); 2109 2123 if (status != PJ_SUCCESS) 2110 return status;2124 goto on_return; 2111 2125 2112 2126 if (!pjsua_call_has_media(call_id)) { 2113 2127 PJ_LOG(3,(THIS_FILE, "Media is not established yet!")); 2114 pjsip_dlg_dec_lock(dlg);2115 return PJ_EINVALIDOP;2128 status = PJ_EINVALIDOP; 2129 goto on_return; 2116 2130 } 2117 2131 … … 2119 2133 call->media[call->audio_idx].strm.a.stream, digits); 2120 2134 2121 pjsip_dlg_dec_lock(dlg); 2122 2135 on_return: 2136 if (dlg) pjsip_dlg_dec_lock(dlg); 2137 pj_log_pop_indent(); 2123 2138 return status; 2124 2139 } … … 2135 2150 { 2136 2151 pjsua_call *call; 2137 pjsip_dialog *dlg ;2152 pjsip_dialog *dlg = NULL; 2138 2153 const pj_str_t mime_text_plain = pj_str("text/plain"); 2139 2154 pjsip_media_type ctype; … … 2142 2157 pj_status_t status; 2143 2158 2144 2145 2159 PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls, 2146 2160 PJ_EINVAL); 2147 2161 2162 PJ_LOG(4,(THIS_FILE, "Call %d sending %d bytes MESSAGE..", 2163 call_id, (int)content->slen)); 2164 pj_log_push_indent(); 2165 2148 2166 status = acquire_call("pjsua_call_send_im()", call_id, &call, &dlg); 2149 2167 if (status != PJ_SUCCESS) 2150 return status;2168 goto on_return; 2151 2169 2152 2170 /* Set default media type if none is specified */ … … 2200 2218 2201 2219 on_return: 2202 pjsip_dlg_dec_lock(dlg); 2220 if (dlg) pjsip_dlg_dec_lock(dlg); 2221 pj_log_pop_indent(); 2203 2222 return status; 2204 2223 } … … 2213 2232 { 2214 2233 pjsua_call *call; 2215 pjsip_dialog *dlg ;2234 pjsip_dialog *dlg = NULL; 2216 2235 pjsip_tx_data *tdata; 2217 2236 pj_status_t status; … … 2220 2239 PJ_EINVAL); 2221 2240 2241 PJ_LOG(4,(THIS_FILE, "Call %d sending typing indication..", 2242 call_id)); 2243 pj_log_push_indent(); 2244 2222 2245 status = acquire_call("pjsua_call_send_typing_ind", call_id, &call, &dlg); 2223 2246 if (status != PJ_SUCCESS) 2224 return status;2247 goto on_return; 2225 2248 2226 2249 /* Create request message. */ … … 2247 2270 2248 2271 on_return: 2249 pjsip_dlg_dec_lock(dlg); 2272 if (dlg) pjsip_dlg_dec_lock(dlg); 2273 pj_log_pop_indent(); 2250 2274 return status; 2251 2275 } … … 2260 2284 { 2261 2285 pjsua_call *call; 2262 pjsip_dialog *dlg ;2286 pjsip_dialog *dlg = NULL; 2263 2287 pjsip_method method; 2264 2288 pjsip_tx_data *tdata; … … 2268 2292 PJ_EINVAL); 2269 2293 2294 PJ_LOG(4,(THIS_FILE, "Call %d sending %.*s request..", 2295 call_id, (int)method_str->slen, method_str->ptr)); 2296 pj_log_push_indent(); 2297 2270 2298 status = acquire_call("pjsua_call_send_request", call_id, &call, &dlg); 2271 2299 if (status != PJ_SUCCESS) 2272 return status;2300 goto on_return; 2273 2301 2274 2302 /* Init method */ … … 2293 2321 2294 2322 on_return: 2295 pjsip_dlg_dec_lock(dlg); 2323 if (dlg) pjsip_dlg_dec_lock(dlg); 2324 pj_log_pop_indent(); 2296 2325 return status; 2297 2326 } … … 2304 2333 { 2305 2334 unsigned i; 2335 2336 PJ_LOG(4,(THIS_FILE, "Hangup all calls..")); 2337 pj_log_push_indent(); 2306 2338 2307 2339 PJSUA_LOCK(); … … 2313 2345 2314 2346 PJSUA_UNLOCK(); 2347 pj_log_pop_indent(); 2315 2348 } 2316 2349 … … 2609 2642 return PJ_SUCCESS; 2610 2643 2611 PJ_LOG( 3, (THIS_FILE, "Got answer with multiple codecs, scheduling "2644 PJ_LOG(4, (THIS_FILE, "Got answer with multiple codecs, scheduling " 2612 2645 "updating media session to use only one codec..")); 2613 2646 … … 2635 2668 pjsua_call *call; 2636 2669 2670 pj_log_push_indent(); 2637 2671 PJSUA_LOCK(); 2638 2672 … … 2641 2675 if (!call) { 2642 2676 PJSUA_UNLOCK(); 2677 pj_log_pop_indent(); 2643 2678 return; 2644 2679 } … … 2797 2832 2798 2833 PJSUA_UNLOCK(); 2834 pj_log_pop_indent(); 2799 2835 } 2800 2836 … … 2905 2941 //const pj_str_t st_update = {"UPDATE", 6}; 2906 2942 2943 pj_log_push_indent(); 2907 2944 PJSUA_LOCK(); 2908 2945 … … 2930 2967 } 2931 2968 2932 PJSUA_UNLOCK(); 2933 return; 2969 goto on_return; 2934 2970 } 2935 2971 … … 2942 2978 status); 2943 2979 //call_disconnect(inv, PJSIP_SC_UNSUPPORTED_MEDIA_TYPE); 2944 PJSUA_UNLOCK(); 2945 return; 2980 goto on_return; 2946 2981 } 2947 2982 … … 2952 2987 status); 2953 2988 //call_disconnect(inv, PJSIP_SC_UNSUPPORTED_MEDIA_TYPE); 2954 PJSUA_UNLOCK(); 2955 return; 2989 goto on_return; 2956 2990 } 2957 2991 … … 2971 3005 */ 2972 3006 /*pjsua_media_channel_deinit(call->index);*/ 2973 PJSUA_UNLOCK(); 2974 return; 3007 goto on_return; 2975 3008 } 2976 3009 … … 2985 3018 pjsua_var.ua_cfg.cb.on_call_media_state(call->index); 2986 3019 2987 3020 on_return: 2988 3021 PJSUA_UNLOCK(); 3022 pj_log_pop_indent(); 2989 3023 } 2990 3024 … … 3105 3139 PJ_LOG(4,(THIS_FILE, "Call %d: received updated media offer", 3106 3140 call->index)); 3141 pj_log_push_indent(); 3107 3142 3108 3143 status = pjsua_media_channel_create_sdp(call->index, … … 3111 3146 if (status != PJ_SUCCESS) { 3112 3147 pjsua_perror(THIS_FILE, "Unable to create local SDP", status); 3113 PJSUA_UNLOCK(); 3114 return; 3148 goto on_return; 3115 3149 } 3116 3150 … … 3155 3189 if (status != PJ_SUCCESS) { 3156 3190 pjsua_perror(THIS_FILE, "Unable to set answer", status); 3157 PJSUA_UNLOCK();3158 return; 3159 } 3160 3191 goto on_return; 3192 } 3193 3194 on_return: 3161 3195 PJSUA_UNLOCK(); 3196 pj_log_pop_indent(); 3162 3197 } 3163 3198 … … 3172 3207 pj_status_t status; 3173 3208 3209 pj_log_push_indent(); 3174 3210 PJSUA_LOCK(); 3175 3211 … … 3193 3229 if (status != PJ_SUCCESS) { 3194 3230 pjsua_perror(THIS_FILE, "Unable to create local SDP", status); 3195 PJSUA_UNLOCK();3196 return; 3197 } 3198 3231 goto on_return; 3232 } 3233 3234 on_return: 3199 3235 PJSUA_UNLOCK(); 3236 pj_log_pop_indent(); 3200 3237 } 3201 3238 … … 3209 3246 3210 3247 PJ_UNUSED_ARG(event); 3248 3249 pj_log_push_indent(); 3211 3250 3212 3251 /* … … 3297 3336 if (!call || !event || !pjsua_var.ua_cfg.cb.on_call_transfer_status) { 3298 3337 /* Application is not interested with call progress status */ 3299 return;3338 goto on_return; 3300 3339 } 3301 3340 … … 3314 3353 PJ_LOG(2,(THIS_FILE, 3315 3354 "Warning: received NOTIFY without message body")); 3316 return;3355 goto on_return; 3317 3356 } 3318 3357 … … 3324 3363 "Warning: received NOTIFY with non message/sipfrag " 3325 3364 "content")); 3326 return;3365 goto on_return; 3327 3366 } 3328 3367 … … 3334 3373 "Warning: received NOTIFY with invalid " 3335 3374 "message/sipfrag content")); 3336 return;3375 goto on_return; 3337 3376 } 3338 3377 … … 3366 3405 } 3367 3406 } 3407 3408 on_return: 3409 pj_log_pop_indent(); 3368 3410 } 3369 3411 … … 3375 3417 static void xfer_server_on_evsub_state( pjsip_evsub *sub, pjsip_event *event) 3376 3418 { 3377 3378 3419 PJ_UNUSED_ARG(event); 3420 3421 pj_log_push_indent(); 3379 3422 3380 3423 /* … … 3387 3430 call = (pjsua_call*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id); 3388 3431 if (!call) 3389 return;3432 goto on_return; 3390 3433 3391 3434 pjsip_evsub_set_mod_data(sub, pjsua_var.mod.id, NULL); … … 3394 3437 PJ_LOG(4,(THIS_FILE, "Xfer server subscription terminated")); 3395 3438 } 3439 3440 on_return: 3441 pj_log_pop_indent(); 3396 3442 } 3397 3443 … … 3420 3466 pjsip_evsub *sub; 3421 3467 3468 pj_log_push_indent(); 3469 3422 3470 existing_call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id]; 3423 3471 … … 3432 3480 PJ_LOG(4,(THIS_FILE, "Received REFER without Refer-To header!")); 3433 3481 pjsip_dlg_respond( inv->dlg, rdata, 400, NULL, NULL, NULL); 3434 return;3482 goto on_return; 3435 3483 } 3436 3484 … … 3463 3511 /* Application rejects call transfer request */ 3464 3512 pjsip_dlg_respond( inv->dlg, rdata, code, NULL, NULL, NULL); 3465 return;3513 goto on_return; 3466 3514 } 3467 3515 … … 3485 3533 pjsua_perror(THIS_FILE, "Unable to create 2xx response to REFER", 3486 3534 status); 3487 return;3535 goto on_return; 3488 3536 } 3489 3537 … … 3501 3549 pjsua_perror(THIS_FILE, "Unable to create 2xx response to REFER", 3502 3550 status); 3503 return;3551 goto on_return; 3504 3552 } 3505 3553 … … 3523 3571 pjsua_perror(THIS_FILE, "Unable to create xfer uas", status); 3524 3572 pjsip_dlg_respond( inv->dlg, rdata, 500, NULL, NULL, NULL); 3525 return;3573 goto on_return; 3526 3574 } 3527 3575 … … 3550 3598 pjsua_perror(THIS_FILE, "Unable to create NOTIFY to REFER", 3551 3599 status); 3552 return;3600 goto on_return; 3553 3601 } 3554 3602 … … 3557 3605 if (status != PJ_SUCCESS) { 3558 3606 pjsua_perror(THIS_FILE, "Unable to send NOTIFY to REFER", status); 3559 return;3607 goto on_return; 3560 3608 } 3561 3609 } … … 3595 3643 pjsua_perror(THIS_FILE, "Unable to create NOTIFY to REFER", 3596 3644 status); 3597 return;3645 goto on_return; 3598 3646 } 3599 3647 status = pjsip_xfer_send_request(sub, tdata); … … 3601 3649 pjsua_perror(THIS_FILE, "Unable to send NOTIFY to REFER", 3602 3650 status); 3603 return;3651 goto on_return; 3604 3652 } 3605 3653 } 3606 return;3654 goto on_return; 3607 3655 } 3608 3656 … … 3618 3666 &pjsua_var.calls[new_call]); 3619 3667 } 3668 3669 on_return: 3670 pj_log_pop_indent(); 3620 3671 } 3621 3672 … … 3634 3685 pjsua_call *call; 3635 3686 3687 pj_log_push_indent(); 3636 3688 PJSUA_LOCK(); 3637 3689 3638 3690 call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id]; 3639 3691 3640 if (call == NULL) { 3641 PJSUA_UNLOCK(); 3642 return; 3643 } 3692 if (call == NULL) 3693 goto on_return; 3644 3694 3645 3695 if (call->inv == NULL) { … … 3649 3699 * receive another REFER for this call. 3650 3700 */ 3651 PJSUA_UNLOCK(); 3652 return; 3701 goto on_return; 3653 3702 } 3654 3703 … … 3695 3744 pjsip_dlg_respond( inv->dlg, rdata, PJSIP_SC_NOT_ACCEPTABLE_HERE, 3696 3745 NULL, &hdr_list, NULL ); 3697 PJSUA_UNLOCK(); 3698 return; 3746 goto on_return; 3699 3747 } 3700 3748 … … 3731 3779 } 3732 3780 3733 3781 on_return: 3734 3782 PJSUA_UNLOCK(); 3783 pj_log_pop_indent(); 3735 3784 } 3736 3785 … … 3744 3793 pjsip_redirect_op op; 3745 3794 3795 pj_log_push_indent(); 3746 3796 PJSUA_LOCK(); 3747 3797 … … 3758 3808 3759 3809 PJSUA_UNLOCK(); 3810 pj_log_pop_indent(); 3760 3811 3761 3812 return op; -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r3666 r3753 84 84 cfg->decor = PJ_LOG_HAS_SENDER | PJ_LOG_HAS_TIME | 85 85 PJ_LOG_HAS_MICRO_SEC | PJ_LOG_HAS_NEWLINE | 86 PJ_LOG_HAS_SPACE; 86 PJ_LOG_HAS_SPACE | PJ_LOG_HAS_THREAD_SWC | 87 PJ_LOG_HAS_INDENT; 87 88 #if defined(PJ_WIN32) && PJ_WIN32 != 0 88 89 cfg->decor |= PJ_LOG_HAS_COLOR; … … 629 630 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 630 631 632 pj_log_push_indent(); 633 631 634 /* Init random seed */ 632 635 init_random_seed(); … … 660 663 &pjsua_var.mutex); 661 664 if (status != PJ_SUCCESS) { 665 pj_log_pop_indent(); 662 666 pjsua_perror(THIS_FILE, "Unable to create mutex", status); 663 667 return status; … … 673 677 674 678 pjsua_set_state(PJSUA_STATE_CREATED); 675 679 pj_log_pop_indent(); 676 680 return PJ_SUCCESS; 677 681 } … … 694 698 pj_status_t status; 695 699 700 pj_log_push_indent(); 696 701 697 702 /* Create default configurations when the config is not supplied */ … … 711 716 status = pjsua_reconfigure_logging(log_cfg); 712 717 if (status != PJ_SUCCESS) 713 return status;718 goto on_error; 714 719 } 715 720 … … 735 740 if (status != PJ_SUCCESS) { 736 741 pjsua_perror(THIS_FILE, "Error creating resolver", status); 737 return status;742 goto on_error; 738 743 } 739 744 … … 744 749 if (status != PJ_SUCCESS) { 745 750 pjsua_perror(THIS_FILE, "Error setting nameserver", status); 746 return status;751 goto on_error; 747 752 } 748 753 … … 751 756 if (status != PJ_SUCCESS) { 752 757 pjsua_perror(THIS_FILE, "Error setting DNS resolver", status); 753 return status;758 goto on_error; 754 759 } 755 760 … … 833 838 pjsua_perror(THIS_FILE, "Invalid outbound proxy URI", 834 839 PJSIP_EINVALIDURI); 835 return PJSIP_EINVALIDURI; 840 status = PJSIP_EINVALIDURI; 841 goto on_error; 836 842 } 837 843 … … 841 847 !PJSIP_URI_SCHEME_IS_SIP(r->name_addr.uri)) 842 848 { 843 return PJSIP_EINVALIDSCHEME; 849 status = PJSIP_EINVALIDSCHEME; 850 goto on_error; 844 851 } 845 852 sip_url = (pjsip_sip_uri*)r->name_addr.uri; … … 872 879 if (status != PJ_SUCCESS && status != PJ_EPENDING) { 873 880 pjsua_perror(THIS_FILE, "Error resolving STUN server", status); 874 return status;881 goto on_error; 875 882 } 876 883 … … 942 949 943 950 pjsua_set_state(PJSUA_STATE_INIT); 944 951 pj_log_pop_indent(); 945 952 return PJ_SUCCESS; 946 953 947 954 on_error: 948 955 pjsua_destroy(); 956 pj_log_pop_indent(); 949 957 return status; 950 958 } … … 1323 1331 PJ_LOG(4,(THIS_FILE, "Shutting down...")); 1324 1332 1333 pj_log_push_indent(); 1334 1325 1335 /* Terminate all calls. */ 1326 1336 pjsua_call_hangup_all(); … … 1478 1488 } 1479 1489 1490 pj_log_pop_indent(); 1491 1480 1492 /* Shutdown PJLIB */ 1481 1493 pj_shutdown(); … … 1524 1536 1525 1537 pjsua_set_state(PJSUA_STATE_STARTING); 1538 pj_log_push_indent(); 1526 1539 1527 1540 status = pjsua_call_subsys_start(); 1528 1541 if (status != PJ_SUCCESS) 1529 return status;1542 goto on_return; 1530 1543 1531 1544 status = pjsua_media_subsys_start(); 1532 1545 if (status != PJ_SUCCESS) 1533 return status;1546 goto on_return; 1534 1547 1535 1548 status = pjsua_pres_start(); 1536 1549 if (status != PJ_SUCCESS) 1537 return status;1550 goto on_return; 1538 1551 1539 1552 pjsua_set_state(PJSUA_STATE_RUNNING); 1540 1553 1541 return PJ_SUCCESS; 1554 on_return: 1555 pj_log_pop_indent(); 1556 return status; 1542 1557 } 1543 1558 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r3714 r3753 73 73 PJ_UNUSED_ARG(codec_id); 74 74 75 pj_log_push_indent(); 76 75 77 /* Specify which audio device settings are save-able */ 76 78 pjsua_var.aud_svmask = 0xFFFFFFFF; … … 111 113 "Media stack initialization has returned error", 112 114 status); 113 return status;115 goto on_error; 114 116 } 115 117 … … 138 140 pjsua_perror(THIS_FILE, "Error querying audio device info", 139 141 status); 140 return status;142 goto on_error; 141 143 } 142 144 … … 175 177 if (status != PJ_SUCCESS) { 176 178 PJ_PERROR(1,(THIS_FILE, status, "Error registering codecs")); 177 return status;179 goto on_error; 178 180 } 179 181 … … 229 231 pjsua_perror(THIS_FILE, "Error creating conference bridge", 230 232 status); 231 return status;233 goto on_error; 232 234 } 233 235 … … 251 253 pjsua_perror(THIS_FILE, "Error initializing SRTP library", 252 254 status); 253 return status;255 goto on_error; 254 256 } 255 257 #endif … … 259 261 status = pjsua_vid_subsys_init(); 260 262 if (status != PJ_SUCCESS) 261 return status;263 goto on_error; 262 264 #endif 263 265 266 pj_log_pop_indent(); 264 267 return PJ_SUCCESS; 268 269 on_error: 270 pj_log_pop_indent(); 271 return status; 265 272 } 266 273 … … 345 352 pj_status_t status; 346 353 354 pj_log_push_indent(); 355 347 356 #if DISABLED_FOR_TICKET_1185 348 357 /* Create media for calls, if none is specified */ … … 355 364 356 365 status = pjsua_media_transports_create(&transport_cfg); 357 if (status != PJ_SUCCESS) 366 if (status != PJ_SUCCESS) { 367 pj_log_pop_indent(); 358 368 return status; 369 } 359 370 } 360 371 #endif … … 366 377 #if PJMEDIA_HAS_VIDEO 367 378 status = pjsua_vid_subsys_start(); 368 if (status != PJ_SUCCESS) 379 if (status != PJ_SUCCESS) { 380 pj_log_pop_indent(); 369 381 return status; 382 } 370 383 #endif 371 384 … … 376 389 } 377 390 391 pj_log_pop_indent(); 378 392 return PJ_SUCCESS; 379 393 } … … 388 402 389 403 PJ_LOG(4,(THIS_FILE, "Shutting down media..")); 404 pj_log_push_indent(); 390 405 391 406 close_snd_dev(); … … 451 466 /* Reset RTP port */ 452 467 next_rtp_port = 0; 468 469 pj_log_pop_indent(); 453 470 454 471 return PJ_SUCCESS; … … 1364 1381 return PJ_EBUSY; 1365 1382 1383 PJ_LOG(4,(THIS_FILE, "Call %d: initializing media..", call_id)); 1384 pj_log_push_indent(); 1385 1366 1386 #if DISABLED_FOR_TICKET_1185 1367 1387 /* Return error if media transport has not been created yet … … 1370 1390 for (i=0; i<call->med_cnt; ++i) { 1371 1391 if (call->media[i].tp == NULL) { 1372 return PJ_EBUSY; 1392 status = PJ_EBUSY; 1393 goto on_error; 1373 1394 } 1374 1395 } … … 1386 1407 if (sip_err_code) *sip_err_code = PJSIP_SC_NOT_ACCEPTABLE_HERE; 1387 1408 pjsua_media_channel_deinit(call_id); 1388 return PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_NOT_ACCEPTABLE_HERE); 1409 status = PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_NOT_ACCEPTABLE_HERE); 1410 goto on_error; 1389 1411 } 1390 1412 … … 1426 1448 if (sip_err_code) *sip_err_code = PJSIP_SC_NOT_ACCEPTABLE_HERE; 1427 1449 pjsua_media_channel_deinit(call_id); 1428 return PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_NOT_ACCEPTABLE_HERE); 1450 status = PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_NOT_ACCEPTABLE_HERE); 1451 goto on_error; 1429 1452 } 1430 1453 … … 1463 1486 if (status != PJ_SUCCESS) { 1464 1487 pjsua_media_channel_deinit(call_id); 1465 return status;1488 goto on_error; 1466 1489 } 1467 1490 } else { … … 1501 1524 if (sip_err_code) *sip_err_code = PJSIP_SC_NOT_ACCEPTABLE; 1502 1525 pjsua_media_channel_deinit(call_id); 1503 return status;1526 goto on_error; 1504 1527 } 1505 1528 … … 1508 1531 } 1509 1532 1533 pj_log_pop_indent(); 1510 1534 return PJ_SUCCESS; 1535 1536 on_error: 1537 pj_log_pop_indent(); 1538 return status; 1511 1539 } 1512 1540 … … 1791 1819 unsigned mi; 1792 1820 1821 pj_log_push_indent(); 1822 1793 1823 for (mi=0; mi<call->med_cnt; ++mi) { 1794 1824 pjsua_call_media *call_med = &call->media[mi]; … … 1839 1869 call_med->state = PJSUA_CALL_MEDIA_NONE; 1840 1870 } 1871 1872 pj_log_pop_indent(); 1841 1873 } 1842 1874 … … 1845 1877 pjsua_call *call = &pjsua_var.calls[call_id]; 1846 1878 unsigned mi; 1879 1880 PJ_LOG(4,(THIS_FILE, "Call %d: deinitializing media..", call_id)); 1881 pj_log_push_indent(); 1847 1882 1848 1883 stop_media_session(call_id); … … 1869 1904 1870 1905 check_snd_dev_idle(); 1906 pj_log_pop_indent(); 1871 1907 1872 1908 return PJ_SUCCESS; … … 1881 1917 { 1882 1918 PJ_UNUSED_ARG(strm); 1919 1920 pj_log_push_indent(); 1883 1921 1884 1922 /* For discussions about call mutex protection related to this … … 1892 1930 pjsua_var.ua_cfg.cb.on_dtmf_digit(call_id, digit); 1893 1931 } 1932 1933 pj_log_pop_indent(); 1894 1934 } 1895 1935 … … 1905 1945 unsigned strm_idx = call_med->idx; 1906 1946 pj_status_t status; 1947 1948 PJ_LOG(4,(THIS_FILE,"Audio channel update..")); 1949 pj_log_push_indent(); 1907 1950 1908 1951 status = pjmedia_stream_info_from_sdp(si, tmp_pool, pjsua_var.med_endpt, 1909 1952 local_sdp, remote_sdp, strm_idx); 1910 1953 if (status != PJ_SUCCESS) 1911 return status;1954 goto on_return; 1912 1955 1913 1956 /* Check if no media is active */ … … 1927 1970 remote_sdp, strm_idx); 1928 1971 if (status != PJ_SUCCESS) 1929 return status;1972 goto on_return; 1930 1973 1931 1974 call_med->tp_st = PJSUA_MED_TP_RUNNING; … … 1992 2035 &call_med->strm.a.stream); 1993 2036 if (status != PJ_SUCCESS) { 1994 return status;2037 goto on_return; 1995 2038 } 1996 2039 … … 1998 2041 status = pjmedia_stream_start(call_med->strm.a.stream); 1999 2042 if (status != PJ_SUCCESS) { 2000 return status;2043 goto on_return; 2001 2044 } 2002 2045 … … 2046 2089 &call_med->strm.a.conf_slot); 2047 2090 if (status != PJ_SUCCESS) { 2048 return status;2091 goto on_return; 2049 2092 } 2050 2093 } … … 2093 2136 if (len > 0) 2094 2137 info_len += len; 2095 PJ_LOG(4,(THIS_FILE,"Media updates%s", info)); 2096 } 2097 2098 return PJ_SUCCESS; 2138 PJ_LOG(4,(THIS_FILE,"Audio updated%s", info)); 2139 } 2140 2141 on_return: 2142 pj_log_pop_indent(); 2143 return status; 2099 2144 } 2100 2145 … … 2120 2165 if (pjsua_get_state() != PJSUA_STATE_RUNNING) 2121 2166 return PJ_EBUSY; 2167 2168 PJ_LOG(4,(THIS_FILE, "Call %d: updating media..", call_id)); 2169 pj_log_push_indent(); 2122 2170 2123 2171 /* Destroy existing media session, if any. */ … … 2183 2231 PJ_LOG(1,(THIS_FILE, "Error updating media for call %d: " 2184 2232 "invalid media index %d in SDP", call_id, mi)); 2185 return PJMEDIA_SDP_EINSDP; 2233 status = PJMEDIA_SDP_EINSDP; 2234 goto on_error; 2186 2235 #endif 2187 2236 } … … 2236 2285 status = pjmedia_sdp_neg_set_remote_offer(tmp_pool, neg, remote_sdp); 2237 2286 if (status != PJ_SUCCESS) 2238 return status;2287 goto on_error; 2239 2288 2240 2289 status = pjmedia_sdp_neg_set_local_answer(tmp_pool, neg, local_sdp); 2241 2290 if (status != PJ_SUCCESS) 2242 return status;2291 goto on_error; 2243 2292 2244 2293 status = pjmedia_sdp_neg_negotiate(tmp_pool, neg, 0); 2245 2294 if (status != PJ_SUCCESS) 2246 return status; 2247 } 2248 2295 goto on_error; 2296 } 2297 2298 pj_log_pop_indent(); 2249 2299 return (got_media? PJ_SUCCESS : PJMEDIA_SDPNEG_ENOMEDIA); 2300 2301 on_error: 2302 pj_log_pop_indent(); 2303 return status; 2250 2304 } 2251 2305 … … 2358 2412 pjsua_conf_port_id sink) 2359 2413 { 2414 pj_status_t status = PJ_SUCCESS; 2415 2416 PJ_LOG(4,(THIS_FILE, "%s connect: %d --> %d", 2417 (pjsua_var.is_mswitch ? "Switch" : "Conf"), 2418 source, sink)); 2419 pj_log_push_indent(); 2420 2360 2421 /* If sound device idle timer is active, cancel it first. */ 2361 2422 PJSUA_LOCK(); … … 2378 2439 unsigned peer_id; 2379 2440 pj_bool_t need_reopen = PJ_FALSE; 2380 pj_status_t status;2381 2441 2382 2442 peer_id = (source!=0)? source : sink; … … 2420 2480 pjsua_perror(THIS_FILE, "Error opening sound device", 2421 2481 status); 2422 return status;2482 goto on_return; 2423 2483 } 2424 2484 … … 2434 2494 pjsua_perror(THIS_FILE, "Error opening sound device", 2435 2495 status); 2436 return status;2496 goto on_return; 2437 2497 } 2438 2498 } else { … … 2443 2503 pjsua_perror(THIS_FILE, "Error opening sound device", 2444 2504 status); 2445 return status;2505 goto on_return; 2446 2506 } 2447 2507 } … … 2468 2528 if (status != PJ_SUCCESS) { 2469 2529 pjsua_perror(THIS_FILE, "Error opening sound device", status); 2470 return status;2530 goto on_return; 2471 2531 } 2472 2532 } else if (pjsua_var.no_snd && !pjsua_var.snd_is_on) { … … 2479 2539 } 2480 2540 2481 return pjmedia_conf_connect_port(pjsua_var.mconf, source, sink, 0); 2541 status = pjmedia_conf_connect_port(pjsua_var.mconf, source, sink, 0); 2542 2543 on_return: 2544 pj_log_pop_indent(); 2545 return status; 2482 2546 } 2483 2547 … … 2491 2555 pj_status_t status; 2492 2556 2557 PJ_LOG(4,(THIS_FILE, "%s disconnect: %d -x- %d", 2558 (pjsua_var.is_mswitch ? "Switch" : "Conf"), 2559 source, sink)); 2560 pj_log_push_indent(); 2561 2493 2562 status = pjmedia_conf_disconnect_port(pjsua_var.mconf, source, sink); 2494 2563 check_snd_dev_idle(); 2495 2564 2565 pj_log_pop_indent(); 2496 2566 return status; 2497 2567 } … … 2559 2629 unsigned slot, file_id; 2560 2630 char path[PJ_MAXPATH]; 2561 pj_pool_t *pool ;2631 pj_pool_t *pool = NULL; 2562 2632 pjmedia_port *port; 2563 pj_status_t status ;2633 pj_status_t status = PJ_SUCCESS; 2564 2634 2565 2635 if (pjsua_var.player_cnt >= PJ_ARRAY_SIZE(pjsua_var.player)) 2566 2636 return PJ_ETOOMANY; 2637 2638 PJ_LOG(4,(THIS_FILE, "Creating file player: %.*s..", 2639 (int)filename->slen, filename->ptr)); 2640 pj_log_push_indent(); 2567 2641 2568 2642 PJSUA_LOCK(); … … 2575 2649 if (file_id == PJ_ARRAY_SIZE(pjsua_var.player)) { 2576 2650 /* This is unexpected */ 2577 PJSUA_UNLOCK();2578 2651 pj_assert(0); 2579 return PJ_EBUG; 2652 status = PJ_EBUG; 2653 goto on_error; 2580 2654 } 2581 2655 … … 2585 2659 pool = pjsua_pool_create(get_basename(path, filename->slen), 1000, 1000); 2586 2660 if (!pool) { 2587 PJSUA_UNLOCK();2588 return PJ_ENOMEM;2661 status = PJ_ENOMEM; 2662 goto on_error; 2589 2663 } 2590 2664 … … 2596 2670 options, 0, &port); 2597 2671 if (status != PJ_SUCCESS) { 2598 PJSUA_UNLOCK();2599 2672 pjsua_perror(THIS_FILE, "Unable to open file for playback", status); 2600 pj_pool_release(pool); 2601 return status; 2673 goto on_error; 2602 2674 } 2603 2675 … … 2606 2678 if (status != PJ_SUCCESS) { 2607 2679 pjmedia_port_destroy(port); 2608 PJSUA_UNLOCK();2609 2680 pjsua_perror(THIS_FILE, "Unable to add file to conference bridge", 2610 2681 status); 2611 pj_pool_release(pool); 2612 return status; 2682 goto on_error; 2613 2683 } 2614 2684 … … 2623 2693 2624 2694 PJSUA_UNLOCK(); 2695 2696 PJ_LOG(4,(THIS_FILE, "Player created, id=%d, slot=%d", file_id, slot)); 2697 2698 pj_log_pop_indent(); 2625 2699 return PJ_SUCCESS; 2700 2701 on_error: 2702 PJSUA_UNLOCK(); 2703 if (pool) pj_pool_release(pool); 2704 pj_log_pop_indent(); 2705 return status; 2626 2706 } 2627 2707 … … 2638 2718 { 2639 2719 unsigned slot, file_id, ptime; 2640 pj_pool_t *pool ;2720 pj_pool_t *pool = NULL; 2641 2721 pjmedia_port *port; 2642 pj_status_t status ;2722 pj_status_t status = PJ_SUCCESS; 2643 2723 2644 2724 if (pjsua_var.player_cnt >= PJ_ARRAY_SIZE(pjsua_var.player)) 2645 2725 return PJ_ETOOMANY; 2726 2727 PJ_LOG(4,(THIS_FILE, "Creating playlist with %d file(s)..", file_count)); 2728 pj_log_push_indent(); 2646 2729 2647 2730 PJSUA_LOCK(); … … 2654 2737 if (file_id == PJ_ARRAY_SIZE(pjsua_var.player)) { 2655 2738 /* This is unexpected */ 2656 PJSUA_UNLOCK();2657 2739 pj_assert(0); 2658 return PJ_EBUG; 2740 status = PJ_EBUG; 2741 goto on_error; 2659 2742 } 2660 2743 … … 2665 2748 pool = pjsua_pool_create("playlist", 1000, 1000); 2666 2749 if (!pool) { 2667 PJSUA_UNLOCK();2668 return PJ_ENOMEM;2750 status = PJ_ENOMEM; 2751 goto on_error; 2669 2752 } 2670 2753 … … 2673 2756 ptime, options, 0, &port); 2674 2757 if (status != PJ_SUCCESS) { 2675 PJSUA_UNLOCK();2676 2758 pjsua_perror(THIS_FILE, "Unable to create playlist", status); 2677 pj_pool_release(pool); 2678 return status; 2759 goto on_error; 2679 2760 } 2680 2761 … … 2683 2764 if (status != PJ_SUCCESS) { 2684 2765 pjmedia_port_destroy(port); 2685 PJSUA_UNLOCK();2686 2766 pjsua_perror(THIS_FILE, "Unable to add port", status); 2687 pj_pool_release(pool); 2688 return status; 2767 goto on_error; 2689 2768 } 2690 2769 … … 2699 2778 2700 2779 PJSUA_UNLOCK(); 2780 2781 PJ_LOG(4,(THIS_FILE, "Playlist created, id=%d, slot=%d", file_id, slot)); 2782 2783 pj_log_pop_indent(); 2784 2701 2785 return PJ_SUCCESS; 2702 2786 2787 on_error: 2788 PJSUA_UNLOCK(); 2789 if (pool) pj_pool_release(pool); 2790 pj_log_pop_indent(); 2791 2792 return status; 2703 2793 } 2704 2794 … … 2752 2842 PJ_ASSERT_RETURN(id>=0&&id<(int)PJ_ARRAY_SIZE(pjsua_var.player), PJ_EINVAL); 2753 2843 PJ_ASSERT_RETURN(pjsua_var.player[id].port != NULL, PJ_EINVAL); 2844 2845 PJ_LOG(4,(THIS_FILE, "Destroying player %d..", id)); 2846 pj_log_push_indent(); 2754 2847 2755 2848 PJSUA_LOCK(); … … 2766 2859 2767 2860 PJSUA_UNLOCK(); 2861 pj_log_pop_indent(); 2768 2862 2769 2863 return PJ_SUCCESS; … … 2796 2890 pj_str_t ext; 2797 2891 int file_format; 2798 pj_pool_t *pool ;2892 pj_pool_t *pool = NULL; 2799 2893 pjmedia_port *port; 2800 pj_status_t status ;2894 pj_status_t status = PJ_SUCCESS; 2801 2895 2802 2896 /* Filename must present */ … … 2809 2903 PJ_ASSERT_RETURN(enc_type == 0, PJ_EINVAL); 2810 2904 2811 if (pjsua_var.rec_cnt >= PJ_ARRAY_SIZE(pjsua_var.recorder)) 2905 PJ_LOG(4,(THIS_FILE, "Creating recorder %.*s..", 2906 (int)filename->slen, filename->ptr)); 2907 pj_log_push_indent(); 2908 2909 if (pjsua_var.rec_cnt >= PJ_ARRAY_SIZE(pjsua_var.recorder)) { 2910 pj_log_pop_indent(); 2812 2911 return PJ_ETOOMANY; 2912 } 2813 2913 2814 2914 /* Determine the file format */ … … 2824 2924 "determine file format for %.*s", 2825 2925 (int)filename->slen, filename->ptr)); 2926 pj_log_pop_indent(); 2826 2927 return PJ_ENOTSUP; 2827 2928 } … … 2836 2937 if (file_id == PJ_ARRAY_SIZE(pjsua_var.recorder)) { 2837 2938 /* This is unexpected */ 2838 PJSUA_UNLOCK();2839 2939 pj_assert(0); 2840 return PJ_EBUG; 2940 status = PJ_EBUG; 2941 goto on_return; 2841 2942 } 2842 2943 … … 2846 2947 pool = pjsua_pool_create(get_basename(path, filename->slen), 1000, 1000); 2847 2948 if (!pool) { 2848 PJSUA_UNLOCK();2849 return PJ_ENOMEM;2949 status = PJ_ENOMEM; 2950 goto on_return; 2850 2951 } 2851 2952 … … 2864 2965 2865 2966 if (status != PJ_SUCCESS) { 2866 PJSUA_UNLOCK();2867 2967 pjsua_perror(THIS_FILE, "Unable to open file for recording", status); 2868 pj_pool_release(pool); 2869 return status; 2968 goto on_return; 2870 2969 } 2871 2970 … … 2874 2973 if (status != PJ_SUCCESS) { 2875 2974 pjmedia_port_destroy(port); 2876 PJSUA_UNLOCK(); 2877 pj_pool_release(pool); 2878 return status; 2975 goto on_return; 2879 2976 } 2880 2977 … … 2888 2985 2889 2986 PJSUA_UNLOCK(); 2987 2988 PJ_LOG(4,(THIS_FILE, "Recorder created, id=%d, slot=%d", file_id, slot)); 2989 2990 pj_log_pop_indent(); 2890 2991 return PJ_SUCCESS; 2992 2993 on_return: 2994 PJSUA_UNLOCK(); 2995 if (pool) pj_pool_release(pool); 2996 pj_log_pop_indent(); 2997 return status; 2891 2998 } 2892 2999 … … 2927 3034 PJ_EINVAL); 2928 3035 PJ_ASSERT_RETURN(pjsua_var.recorder[id].port != NULL, PJ_EINVAL); 3036 3037 PJ_LOG(4,(THIS_FILE, "Destroying recorder %d..", id)); 3038 pj_log_push_indent(); 2929 3039 2930 3040 PJSUA_LOCK(); … … 2941 3051 2942 3052 PJSUA_UNLOCK(); 3053 pj_log_pop_indent(); 2943 3054 2944 3055 return PJ_SUCCESS; … … 3148 3259 param->base.samples_per_frame / param->base.channel_count * 3149 3260 1000 / param->base.clock_rate)); 3261 pj_log_push_indent(); 3150 3262 3151 3263 status = pjmedia_snd_port_create2( pjsua_var.snd_pool, 3152 3264 param, &pjsua_var.snd_port); 3153 3265 if (status != PJ_SUCCESS) 3154 return status;3266 goto on_error; 3155 3267 3156 3268 /* Get the port0 of the conference bridge. */ … … 3189 3301 errmsg)); 3190 3302 close_snd_dev(); 3191 return status;3303 goto on_error; 3192 3304 } 3193 3305 … … 3218 3330 pjmedia_snd_port_destroy(pjsua_var.snd_port); 3219 3331 pjsua_var.snd_port = NULL; 3220 return status;3332 goto on_error; 3221 3333 } 3222 3334 … … 3256 3368 /* Any error is not major, let it through */ 3257 3369 status = PJ_SUCCESS; 3258 } ;3370 } 3259 3371 3260 3372 /* If this is the first time the audio device is open, retrieve some … … 3267 3379 } 3268 3380 3381 pj_log_pop_indent(); 3269 3382 return PJ_SUCCESS; 3383 3384 on_error: 3385 pj_log_pop_indent(); 3386 return status; 3270 3387 } 3271 3388 … … 3274 3391 static void close_snd_dev(void) 3275 3392 { 3393 pj_log_push_indent(); 3394 3276 3395 /* Notify app */ 3277 3396 if (pjsua_var.snd_is_on && pjsua_var.ua_cfg.cb.on_snd_dev_operation) { … … 3313 3432 pjsua_var.snd_pool = NULL; 3314 3433 pjsua_var.snd_is_on = PJ_FALSE; 3434 3435 pj_log_pop_indent(); 3315 3436 } 3316 3437 … … 3328 3449 pj_status_t status = -1; 3329 3450 3451 PJ_LOG(4,(THIS_FILE, "Set sound device: capture=%d, playback=%d", 3452 capture_dev, playback_dev)); 3453 pj_log_push_indent(); 3454 3330 3455 /* Null-sound */ 3331 3456 if (capture_dev==NULL_SND_DEV_ID && playback_dev==NULL_SND_DEV_ID) { 3332 return pjsua_set_null_snd_dev(); 3457 status = pjsua_set_null_snd_dev(); 3458 pj_log_pop_indent(); 3459 return status; 3333 3460 } 3334 3461 … … 3361 3488 samples_per_frame, 16); 3362 3489 if (status != PJ_SUCCESS) 3363 return status;3490 goto on_error; 3364 3491 3365 3492 /* Open! */ … … 3372 3499 if (status != PJ_SUCCESS) { 3373 3500 pjsua_perror(THIS_FILE, "Unable to open sound device", status); 3374 return status;3501 goto on_error; 3375 3502 } 3376 3503 … … 3378 3505 pjsua_var.snd_is_on = PJ_TRUE; 3379 3506 3507 pj_log_pop_indent(); 3380 3508 return PJ_SUCCESS; 3509 3510 on_error: 3511 pj_log_pop_indent(); 3512 return status; 3381 3513 } 3382 3514 … … 3408 3540 pjmedia_port *conf_port; 3409 3541 pj_status_t status; 3542 3543 PJ_LOG(4,(THIS_FILE, "Setting null sound device..")); 3544 pj_log_push_indent(); 3545 3410 3546 3411 3547 /* Close existing sound device */ … … 3435 3571 pjsua_perror(THIS_FILE, "Unable to create null sound device", 3436 3572 status); 3573 pj_log_pop_indent(); 3437 3574 return status; 3438 3575 } … … 3448 3585 pjsua_var.snd_is_on = PJ_TRUE; 3449 3586 3587 pj_log_pop_indent(); 3450 3588 return PJ_SUCCESS; 3451 3589 } -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
r3553 r3753 390 390 PJ_ETOOMANY); 391 391 392 PJ_LOG(4,(THIS_FILE, "Adding buddy: %.*s", 393 (int)cfg->uri.slen, cfg->uri.ptr)); 394 pj_log_push_indent(); 395 392 396 PJSUA_LOCK(); 393 397 … … 403 407 /* This shouldn't happen */ 404 408 pj_assert(!"index < PJ_ARRAY_SIZE(pjsua_var.buddy)"); 409 pj_log_pop_indent(); 405 410 return PJ_ETOOMANY; 406 411 } … … 432 437 buddy->pool = NULL; 433 438 PJSUA_UNLOCK(); 439 pj_log_pop_indent(); 434 440 return PJSIP_EINVALIDURI; 435 441 } … … 440 446 buddy->pool = NULL; 441 447 PJSUA_UNLOCK(); 448 pj_log_pop_indent(); 442 449 return PJSIP_EINVALIDSCHEME; 443 450 } … … 470 477 PJSUA_UNLOCK(); 471 478 479 PJ_LOG(4,(THIS_FILE, "Buddy %d added.", index)); 480 472 481 pjsua_buddy_subscribe_pres(index, cfg->subscribe); 473 482 483 pj_log_pop_indent(); 474 484 return PJ_SUCCESS; 475 485 } … … 495 505 if (status != PJ_SUCCESS) 496 506 return status; 507 508 PJ_LOG(4,(THIS_FILE, "Buddy %d: deleting..", buddy_id)); 509 pj_log_push_indent(); 497 510 498 511 /* Unsubscribe presence */ … … 519 532 520 533 unlock_buddy(&lck); 534 pj_log_pop_indent(); 521 535 return PJ_SUCCESS; 522 536 } … … 538 552 return status; 539 553 554 PJ_LOG(4,(THIS_FILE, "Buddy %d: unsubscribing presence..", buddy_id)); 555 pj_log_push_indent(); 556 540 557 lck.buddy->monitor = subscribe; 541 558 … … 543 560 544 561 unlock_buddy(&lck); 562 pj_log_pop_indent(); 545 563 return PJ_SUCCESS; 546 564 } … … 560 578 if (status != PJ_SUCCESS) 561 579 return status; 580 581 PJ_LOG(4,(THIS_FILE, "Buddy %d: updating presence..", buddy_id)); 582 pj_log_push_indent(); 562 583 563 584 /* Is this an unsubscribe request? */ … … 565 586 unsubscribe_buddy_presence(buddy_id); 566 587 unlock_buddy(&lck); 588 pj_log_pop_indent(); 567 589 return PJ_SUCCESS; 568 590 } … … 571 593 if (lck.buddy->sub) { 572 594 unlock_buddy(&lck); 595 pj_log_pop_indent(); 573 596 return PJ_SUCCESS; 574 597 } … … 578 601 579 602 unlock_buddy(&lck); 580 603 pj_log_pop_indent(); 581 604 return PJ_SUCCESS; 582 605 } … … 746 769 PJ_LOG(4,(THIS_FILE, "Server subscription to %s is %s", 747 770 uapres->remote, pjsip_evsub_get_state_name(sub))); 771 pj_log_push_indent(); 748 772 749 773 state = pjsip_evsub_get_state(sub); … … 762 786 pj_list_erase(uapres); 763 787 } 788 pj_log_pop_indent(); 764 789 } 765 790 … … 807 832 PJ_LOG(4,(THIS_FILE, "Creating server subscription, using account %d", 808 833 acc_id)); 834 pj_log_push_indent(); 809 835 810 836 /* Create suitable Contact header */ … … 820 846 pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, 400, NULL, 821 847 NULL, NULL); 848 pj_log_pop_indent(); 822 849 return PJ_TRUE; 823 850 } … … 834 861 pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, 400, NULL, 835 862 NULL, NULL); 863 pj_log_pop_indent(); 836 864 return PJ_TRUE; 837 865 } … … 865 893 866 894 PJSUA_UNLOCK(); 895 pj_log_pop_indent(); 867 896 return PJ_TRUE; 868 897 } … … 935 964 pjsip_pres_terminate(sub, PJ_FALSE); 936 965 PJSUA_UNLOCK(); 966 pj_log_pop_indent(); 937 967 return PJ_FALSE; 938 968 } … … 953 983 pjsip_pres_terminate(sub, PJ_FALSE); 954 984 PJSUA_UNLOCK(); 985 pj_log_pop_indent(); 955 986 return PJ_TRUE; 956 987 } … … 964 995 pjsip_pres_terminate(sub, PJ_FALSE); 965 996 PJSUA_UNLOCK(); 997 pj_log_pop_indent(); 966 998 return PJ_FALSE; 967 999 } … … 976 1008 977 1009 PJSUA_UNLOCK(); 978 1010 pj_log_pop_indent(); 979 1011 return PJ_TRUE; 980 1012 } … … 1007 1039 PJ_ASSERT_RETURN(pjsua_var.acc[acc_id].valid, PJ_EINVALIDOP); 1008 1040 1041 PJ_LOG(4,(THIS_FILE, "Acc %d: sending NOTIFY for srv_pres=0x%p..", 1042 acc_id, (int)(long)srv_pres)); 1043 pj_log_push_indent(); 1044 1009 1045 PJSUA_LOCK(); 1010 1046 … … 1015 1051 /* Subscription has been terminated */ 1016 1052 PJSUA_UNLOCK(); 1053 pj_log_pop_indent(); 1017 1054 return PJ_EINVALIDOP; 1018 1055 } … … 1056 1093 pjsip_pres_terminate(srv_pres->sub, PJ_FALSE); 1057 1094 PJSUA_UNLOCK(); 1095 pj_log_pop_indent(); 1058 1096 return status; 1059 1097 } … … 1072 1110 1073 1111 PJSUA_UNLOCK(); 1074 1112 pj_log_pop_indent(); 1075 1113 return PJ_SUCCESS; 1076 1114 } … … 1132 1170 pj_status_t status; 1133 1171 1172 PJ_LOG(5,(THIS_FILE, "Acc %d: sending %sPUBLISH..", 1173 acc_id, (active ? "" : "un-"))); 1174 pj_log_push_indent(); 1134 1175 1135 1176 /* Create PUBLISH request */ … … 1200 1241 1201 1242 acc->publish_state = acc->online_status; 1243 pj_log_pop_indent(); 1202 1244 return PJ_SUCCESS; 1203 1245 … … 1207 1249 acc->publish_sess = NULL; 1208 1250 } 1251 pj_log_pop_indent(); 1209 1252 return status; 1210 1253 } … … 1455 1498 pjsua_var.buddy[buddy->index].uri.ptr, 1456 1499 pjsip_evsub_get_state_name(sub))); 1500 pj_log_push_indent(); 1457 1501 1458 1502 if (pjsip_evsub_get_state(sub) == PJSIP_EVSUB_STATE_TERMINATED) { … … 1574 1618 pjsip_evsub_set_mod_data(sub, pjsua_var.mod.id, NULL); 1575 1619 } 1620 1621 pj_log_pop_indent(); 1576 1622 } 1577 1623 } … … 1685 1731 acc = &pjsua_var.acc[acc_id]; 1686 1732 1687 PJ_LOG(4,(THIS_FILE, "Using account %d for buddy %d subscription", 1688 acc_id, buddy_id)); 1733 PJ_LOG(4,(THIS_FILE, "Buddy %d: subscribing presence,using account %d..", 1734 buddy_id, acc_id)); 1735 pj_log_push_indent(); 1689 1736 1690 1737 /* Generate suitable Contact header unless one is already set in … … 1702 1749 status); 1703 1750 pj_pool_release(tmp_pool); 1751 pj_log_pop_indent(); 1704 1752 return; 1705 1753 } … … 1716 1764 status); 1717 1765 if (tmp_pool) pj_pool_release(tmp_pool); 1766 pj_log_pop_indent(); 1718 1767 return; 1719 1768 } … … 1735 1784 if (buddy->dlg) pjsip_dlg_dec_lock(buddy->dlg); 1736 1785 if (tmp_pool) pj_pool_release(tmp_pool); 1786 pj_log_pop_indent(); 1737 1787 return; 1738 1788 } … … 1774 1824 status); 1775 1825 if (tmp_pool) pj_pool_release(tmp_pool); 1826 pj_log_pop_indent(); 1776 1827 return; 1777 1828 } … … 1789 1840 status); 1790 1841 if (tmp_pool) pj_pool_release(tmp_pool); 1842 pj_log_pop_indent(); 1791 1843 return; 1792 1844 } … … 1794 1846 pjsip_dlg_dec_lock(buddy->dlg); 1795 1847 if (tmp_pool) pj_pool_release(tmp_pool); 1848 pj_log_pop_indent(); 1796 1849 } 1797 1850 … … 1813 1866 return; 1814 1867 } 1868 1869 PJ_LOG(5,(THIS_FILE, "Buddy %d: unsubscribing..", buddy_id)); 1870 pj_log_push_indent(); 1815 1871 1816 1872 status = pjsip_pres_initiate( buddy->sub, 0, &tdata); … … 1826 1882 status); 1827 1883 } 1884 1885 pj_log_pop_indent(); 1828 1886 } 1829 1887 … … 1915 1973 mwi_info.rdata = rdata; 1916 1974 1975 PJ_LOG(4,(THIS_FILE, "MWI got NOTIFY..")); 1976 pj_log_push_indent(); 1977 1917 1978 /* Call callback */ 1918 1979 if (pjsua_var.ua_cfg.cb.on_mwi_info) { 1919 1980 (*pjsua_var.ua_cfg.cb.on_mwi_info)(acc->index, &mwi_info); 1920 1981 } 1982 1983 pj_log_pop_indent(); 1921 1984 } 1922 1985 … … 1973 2036 1974 2037 } 2038 2039 PJ_LOG(4,(THIS_FILE, "Starting MWI subscription..")); 2040 pj_log_push_indent(); 1975 2041 1976 2042 /* Generate suitable Contact header unless one is already set in … … 1987 2053 status); 1988 2054 pj_pool_release(tmp_pool); 2055 pj_log_pop_indent(); 1989 2056 return; 1990 2057 } … … 2000 2067 pjsua_perror(THIS_FILE, "Unable to create dialog", status); 2001 2068 if (tmp_pool) pj_pool_release(tmp_pool); 2069 pj_log_pop_indent(); 2002 2070 return; 2003 2071 } … … 2015 2083 if (tmp_pool) pj_pool_release(tmp_pool); 2016 2084 if (acc->mwi_dlg) pjsip_dlg_dec_lock(acc->mwi_dlg); 2085 pj_log_pop_indent(); 2017 2086 return; 2018 2087 } … … 2055 2124 status); 2056 2125 if (tmp_pool) pj_pool_release(tmp_pool); 2126 pj_log_pop_indent(); 2057 2127 return; 2058 2128 } … … 2071 2141 status); 2072 2142 if (tmp_pool) pj_pool_release(tmp_pool); 2143 pj_log_pop_indent(); 2073 2144 return; 2074 2145 } … … 2077 2148 if (tmp_pool) pj_pool_release(tmp_pool); 2078 2149 2150 pj_log_pop_indent(); 2079 2151 } 2080 2152 … … 2106 2178 } 2107 2179 2180 PJ_LOG(4,(THIS_FILE, "Got unsolicited NOTIFY from %s:%d..", 2181 rdata->pkt_info.src_name, rdata->pkt_info.src_port)); 2182 pj_log_push_indent(); 2183 2108 2184 /* Got unsolicited MWI request, respond with 200/OK first */ 2109 2185 pjsip_endpt_respond(pjsua_get_pjsip_endpt(), NULL, rdata, 200, NULL, … … 2124 2200 } 2125 2201 2126 2202 pj_log_pop_indent(); 2127 2203 return PJ_TRUE; 2128 2204 } … … 2254 2330 2255 2331 PJ_LOG(4,(THIS_FILE, "Shutting down presence..")); 2332 pj_log_push_indent(); 2256 2333 2257 2334 if (pjsua_var.pres_timer.id != 0) { … … 2276 2353 pjsua_pres_update_acc(i, PJ_FALSE); 2277 2354 } 2278 } 2355 2356 pj_log_pop_indent(); 2357 } -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c
r3737 r3753 37 37 pj_status_t status; 38 38 39 PJ_LOG(4,(THIS_FILE, "Initializing video subsystem..")); 40 pj_log_push_indent(); 41 39 42 status = pjmedia_video_format_mgr_create(pjsua_var.pool, 64, 0, NULL); 40 43 if (status != PJ_SUCCESS) { 41 44 PJ_PERROR(1,(THIS_FILE, status, 42 45 "Error creating PJMEDIA video format manager")); 43 return status;46 goto on_error; 44 47 } 45 48 … … 48 51 PJ_PERROR(1,(THIS_FILE, status, 49 52 "Error creating PJMEDIA converter manager")); 50 return status;53 goto on_error; 51 54 } 52 55 … … 55 58 PJ_PERROR(1,(THIS_FILE, status, 56 59 "Error creating PJMEDIA video codec manager")); 57 return status;60 goto on_error; 58 61 } 59 62 … … 62 65 PJ_PERROR(1,(THIS_FILE, status, 63 66 "Error creating PJMEDIA video subsystem")); 64 return status;67 goto on_error; 65 68 } 66 69 … … 70 73 PJ_PERROR(1,(THIS_FILE, status, 71 74 "Error initializing ffmpeg library")); 72 return status;75 goto on_error; 73 76 } 74 77 #endif … … 77 80 if (pjsua_var.win[i].pool == NULL) { 78 81 pjsua_var.win[i].pool = pjsua_pool_create("win%p", 512, 512); 79 if (pjsua_var.win[i].pool == NULL) 80 return PJ_ENOMEM; 82 if (pjsua_var.win[i].pool == NULL) { 83 status = PJ_ENOMEM; 84 goto on_error; 85 } 81 86 } 82 87 } 83 88 89 pj_log_pop_indent(); 84 90 return PJ_SUCCESS; 91 92 on_error: 93 pj_log_pop_indent(); 94 return status; 85 95 } 86 96 … … 93 103 { 94 104 unsigned i; 105 106 PJ_LOG(4,(THIS_FILE, "Destroying video subsystem..")); 107 pj_log_push_indent(); 95 108 96 109 for (i=0; i<PJSUA_MAX_VID_WINS; ++i) { … … 108 121 #endif 109 122 123 pj_log_pop_indent(); 110 124 return PJ_SUCCESS; 111 125 } … … 343 357 pj_status_t status; 344 358 unsigned i; 359 360 PJ_LOG(4,(THIS_FILE, "Creating window, type=%d, cap_dev=%d, rend_dev=%d", 361 type, cap_id, rend_id)); 362 pj_log_push_indent(); 345 363 346 364 /* If type is preview, check if it exists already */ … … 361 379 /* Done */ 362 380 *id = wid; 381 PJ_LOG(4,(THIS_FILE, "Window already exist: %d", wid)); 382 pj_log_pop_indent(); 363 383 return PJ_SUCCESS; 364 384 } … … 374 394 } 375 395 } 376 if (i == PJSUA_MAX_VID_WINS) 396 if (i == PJSUA_MAX_VID_WINS) { 397 pj_log_pop_indent(); 377 398 return PJ_ETOOMANY; 399 } 378 400 379 401 /* Initialize window */ … … 449 471 *id = wid; 450 472 473 PJ_LOG(4,(THIS_FILE, "Window %d created", wid)); 474 pj_log_pop_indent(); 451 475 return PJ_SUCCESS; 452 476 453 477 on_error: 454 478 free_vid_win(wid); 479 pj_log_pop_indent(); 455 480 return status; 456 481 } … … 461 486 pjsua_vid_win *w = &pjsua_var.win[wid]; 462 487 488 PJ_LOG(4,(THIS_FILE, "Window %d: destroying..", wid)); 489 pj_log_push_indent(); 490 463 491 if (w->vp_cap) { 464 492 pjmedia_vid_port_stop(w->vp_cap); … … 474 502 } 475 503 pjsua_vid_win_reset(wid); 504 505 pj_log_pop_indent(); 476 506 } 477 507 … … 514 544 pj_status_t status; 515 545 546 PJ_LOG(4,(THIS_FILE, "Video channel update..")); 547 pj_log_push_indent(); 548 516 549 status = pjmedia_vid_stream_info_from_sdp(si, tmp_pool, pjsua_var.med_endpt, 517 550 local_sdp, remote_sdp, strm_idx); 518 551 if (status != PJ_SUCCESS) 519 return status;552 goto on_error; 520 553 521 554 /* Check if no media is active */ … … 535 568 remote_sdp, strm_idx); 536 569 if (status != PJ_SUCCESS) 537 return status;570 goto on_error; 538 571 539 572 call_med->tp_st = PJSUA_MED_TP_RUNNING; … … 592 625 &dev_info); 593 626 if (status != PJ_SUCCESS) 594 return status;627 goto on_error; 595 628 596 629 /* Find matched format ID */ … … 617 650 &call_med->strm.v.stream); 618 651 if (status != PJ_SUCCESS) 619 return status;652 goto on_error; 620 653 621 654 /* Start stream */ 622 655 status = pjmedia_vid_stream_start(call_med->strm.v.stream); 623 656 if (status != PJ_SUCCESS) 624 return status;657 goto on_error; 625 658 626 659 /* Setup decoding direction */ … … 630 663 pjsua_vid_win *w; 631 664 665 PJ_LOG(4,(THIS_FILE, "Setting up RX..")); 666 pj_log_push_indent(); 667 632 668 status = pjmedia_vid_stream_get_port(call_med->strm.v.stream, 633 669 PJMEDIA_DIR_DECODING, 634 670 &media_port); 635 if (status != PJ_SUCCESS) 636 return status; 671 if (status != PJ_SUCCESS) { 672 pj_log_pop_indent(); 673 goto on_error; 674 } 637 675 638 676 /* Create stream video window */ … … 644 682 acc->cfg.vid_in_auto_show, 645 683 &wid); 646 if (status != PJ_SUCCESS) 647 return status; 684 if (status != PJ_SUCCESS) { 685 pj_log_pop_indent(); 686 goto on_error; 687 } 648 688 649 689 w = &pjsua_var.win[wid]; … … 659 699 status = pjmedia_vid_port_connect(w->vp_rend, media_port, 660 700 PJ_FALSE); 661 if (status != PJ_SUCCESS) 662 return status; 701 if (status != PJ_SUCCESS) { 702 pj_log_pop_indent(); 703 goto on_error; 704 } 663 705 664 706 /* Start renderer */ 665 707 status = pjmedia_vid_port_start(w->vp_rend); 666 if (status != PJ_SUCCESS) 667 return status; 708 if (status != PJ_SUCCESS) { 709 pj_log_pop_indent(); 710 goto on_error; 711 } 668 712 669 713 /* Done */ 670 714 inc_vid_win(wid); 671 715 call_med->strm.v.rdr_win_id = wid; 716 pj_log_pop_indent(); 672 717 } 673 718 … … 678 723 pjsua_vid_win_id wid; 679 724 725 PJ_LOG(4,(THIS_FILE, "Setting up TX..")); 726 pj_log_push_indent(); 727 680 728 status = pjmedia_vid_stream_get_port(call_med->strm.v.stream, 681 729 PJMEDIA_DIR_ENCODING, 682 730 &media_port); 683 if (status != PJ_SUCCESS) 684 return status; 731 if (status != PJ_SUCCESS) { 732 pj_log_pop_indent(); 733 goto on_error; 734 } 685 735 686 736 /* Create preview video window */ … … 693 743 PJ_FALSE, 694 744 &wid); 695 if (status != PJ_SUCCESS) 696 return status; 745 if (status != PJ_SUCCESS) { 746 pj_log_pop_indent(); 747 goto on_error; 748 } 697 749 698 750 w = &pjsua_var.win[wid]; … … 705 757 /* Connect stream to capturer (via video window tee) */ 706 758 status = pjmedia_vid_tee_add_dst_port2(w->tee, 0, media_port); 707 if (status != PJ_SUCCESS) 708 return status; 759 if (status != PJ_SUCCESS) { 760 pj_log_pop_indent(); 761 goto on_error; 762 } 709 763 710 764 /* Start renderer */ 711 765 status = pjmedia_vid_port_start(w->vp_rend); 712 if (status != PJ_SUCCESS) 713 return status; 766 if (status != PJ_SUCCESS) { 767 pj_log_pop_indent(); 768 goto on_error; 769 } 714 770 715 771 /* Start capturer */ 716 772 status = pjmedia_vid_port_start(w->vp_cap); 717 if (status != PJ_SUCCESS) 718 return status; 773 if (status != PJ_SUCCESS) { 774 pj_log_pop_indent(); 775 goto on_error; 776 } 719 777 720 778 /* Done */ 721 779 inc_vid_win(wid); 722 780 call_med->strm.v.cap_win_id = wid; 781 pj_log_pop_indent(); 723 782 } 724 783 … … 766 825 if (len > 0) 767 826 info_len += len; 768 PJ_LOG(4,(THIS_FILE," Media updates%s", info));827 PJ_LOG(4,(THIS_FILE,"Video updated%s", info)); 769 828 } 770 829 … … 773 832 PJMEDIA_DIR_ENCODING); 774 833 if (status != PJ_SUCCESS) 775 return status; 776 } 777 834 goto on_error; 835 } 836 837 pj_log_pop_indent(); 778 838 return PJ_SUCCESS; 839 840 on_error: 841 pj_log_pop_indent(); 842 return status; 779 843 } 780 844 … … 790 854 if (!strm) 791 855 return; 856 857 PJ_LOG(4,(THIS_FILE, "Stopping video stream..")); 858 pj_log_push_indent(); 792 859 793 860 /* Unsubscribe events */ … … 832 899 pjmedia_vid_stream_destroy(strm); 833 900 call_med->strm.v.stream = NULL; 901 902 pj_log_pop_indent(); 834 903 } 835 904 … … 847 916 pj_status_t status; 848 917 849 PJSUA_LOCK();850 851 918 if (!prm) { 852 919 pjsua_vid_preview_param_default(&default_param); 853 920 prm = &default_param; 854 921 } 922 923 PJ_LOG(4,(THIS_FILE, "Starting preview for cap_dev=%d, show=%d", 924 id, prm->show)); 925 pj_log_push_indent(); 926 927 PJSUA_LOCK(); 855 928 856 929 rend_id = prm->rend_id; … … 860 933 if (status != PJ_SUCCESS) { 861 934 PJSUA_UNLOCK(); 935 pj_log_pop_indent(); 862 936 return status; 863 937 } … … 869 943 if (status != PJ_SUCCESS) { 870 944 PJSUA_UNLOCK(); 945 pj_log_pop_indent(); 871 946 return status; 872 947 } … … 876 951 if (status != PJ_SUCCESS) { 877 952 PJSUA_UNLOCK(); 953 pj_log_pop_indent(); 878 954 return status; 879 955 } … … 882 958 883 959 PJSUA_UNLOCK(); 960 pj_log_pop_indent(); 884 961 return PJ_SUCCESS; 885 962 } … … 891 968 { 892 969 pjsua_vid_win_id wid = PJSUA_INVALID_ID; 970 971 PJ_LOG(4,(THIS_FILE, "Stopping preview for cap_dev=%d", id)); 972 pj_log_push_indent(); 893 973 894 974 PJSUA_LOCK(); … … 896 976 if (wid == PJSUA_INVALID_ID) { 897 977 PJSUA_UNLOCK(); 978 pj_log_pop_indent(); 898 979 return PJ_ENOTFOUND; 899 980 } … … 902 983 903 984 PJSUA_UNLOCK(); 985 pj_log_pop_indent(); 904 986 905 987 return PJ_SUCCESS; … … 1580 1662 PJ_EINVAL); 1581 1663 PJ_ASSERT_RETURN(op != PJSUA_CALL_VID_STRM_NO_OP, PJ_EINVAL); 1664 1665 PJ_LOG(4,(THIS_FILE, "Call %d: set video stream, op=%d", 1666 call_id, op)); 1667 pj_log_push_indent(); 1582 1668 1583 1669 PJSUA_LOCK(); … … 1636 1722 1637 1723 PJSUA_UNLOCK(); 1724 pj_log_pop_indent(); 1638 1725 1639 1726 return status;
Note: See TracChangeset
for help on using the changeset viewer.