Ignore:
Timestamp:
Feb 10, 2006 2:04:05 PM (18 years ago)
Author:
bennylp
Message:

Added more logging, and fixed bug when ACK is responded!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_dialog.c

    r169 r175  
    201201    *p_dlg = dlg; 
    202202 
     203 
     204    PJ_LOG(5,(dlg->obj_name, "UAC dialog created")); 
     205 
    203206    return PJ_SUCCESS; 
    204207 
     
    381384    /* Done. */ 
    382385    *p_dlg = dlg; 
     386    PJ_LOG(5,(dlg->obj_name, "UAS dialog created")); 
    383387    return PJ_SUCCESS; 
    384388 
     
    496500    *new_dlg = dlg; 
    497501 
     502    PJ_LOG(5,(dlg->obj_name, "Forked dialog created")); 
    498503    return PJ_SUCCESS; 
    499504 
     
    577582 * Increment session counter. 
    578583 */ 
    579 PJ_DEF(pj_status_t) pjsip_dlg_inc_session( pjsip_dialog *dlg ) 
    580 { 
    581     PJ_ASSERT_RETURN(dlg, PJ_EINVAL); 
     584PJ_DEF(pj_status_t) pjsip_dlg_inc_session( pjsip_dialog *dlg, 
     585                                           pjsip_module *mod ) 
     586{ 
     587    PJ_ASSERT_RETURN(dlg && mod, PJ_EINVAL); 
    582588 
    583589    pj_mutex_lock(dlg->mutex); 
     
    585591    pj_mutex_unlock(dlg->mutex); 
    586592 
     593    PJ_LOG(5,(dlg->obj_name, "Session count inc to %d by %.*s", 
     594              dlg->sess_count, (int)mod->name.slen, mod->name.ptr)); 
     595 
    587596    return PJ_SUCCESS; 
    588597} 
     
    591600 * Decrement session counter. 
    592601 */ 
    593 PJ_DEF(pj_status_t) pjsip_dlg_dec_session( pjsip_dialog *dlg ) 
     602PJ_DEF(pj_status_t) pjsip_dlg_dec_session( pjsip_dialog *dlg, 
     603                                           pjsip_module *mod) 
    594604{ 
    595605    pj_status_t status; 
    596606 
    597607    PJ_ASSERT_RETURN(dlg, PJ_EINVAL); 
     608 
     609    PJ_LOG(5,(dlg->obj_name, "Session count dec to %d by %.*s", 
     610              dlg->sess_count-1, (int)mod->name.slen, mod->name.ptr)); 
    598611 
    599612    pj_mutex_lock(dlg->mutex); 
     
    626639                     PJ_EINVAL); 
    627640    PJ_ASSERT_RETURN(dlg->usage_cnt < PJSIP_MAX_MODULE, PJ_EBUG); 
     641 
     642    PJ_LOG(5,(dlg->obj_name, "Module %.*s added as dialog usage", 
     643              (int)mod->name.slen, mod->name.ptr)); 
    628644 
    629645    pj_mutex_lock(dlg->mutex); 
     
    795811                     PJSIP_ENOTREQUESTMSG); 
    796812 
     813    PJ_LOG(5,(dlg->obj_name, "Sending %s", 
     814              pjsip_tx_data_get_info(tdata))); 
     815 
    797816    /* Update CSeq */ 
    798817    pj_mutex_lock(dlg->mutex); 
     
    10241043    PJ_ASSERT_RETURN(tsx->mod_data[dlg->ua->id] == dlg, PJ_EINVALIDOP); 
    10251044 
     1045    PJ_LOG(5,(dlg->obj_name, "Sending %s", 
     1046              pjsip_tx_data_get_info(tdata))); 
     1047 
    10261048    /* Check that transaction method and cseq match the response.  
    10271049     * This operation is sloooww (search CSeq header twice), that's why 
     
    10781100    pjsip_transaction *tsx = NULL; 
    10791101    unsigned i; 
     1102 
     1103    PJ_LOG(5,(dlg->obj_name, "Received %s", 
     1104              pjsip_rx_data_get_info(rdata))); 
    10801105 
    10811106    /* Lock the dialog. */ 
     
    11441169    int res_code; 
    11451170 
     1171    PJ_LOG(5,(dlg->obj_name, "Received %s", 
     1172              pjsip_rx_data_get_info(rdata))); 
     1173 
    11461174    /* Lock the dialog. */ 
    11471175    pj_mutex_lock(dlg->mutex); 
     
    12501278    unsigned i; 
    12511279 
     1280    PJ_LOG(5,(dlg->obj_name, "Transaction %s state changed to %s", 
     1281              tsx->obj_name, pjsip_tsx_state_str(tsx->state))); 
     1282 
    12521283    /* Lock the dialog. */ 
    12531284    pj_mutex_lock(dlg->mutex); 
Note: See TracChangeset for help on using the changeset viewer.