Ignore:
Timestamp:
Mar 5, 2006 11:54:02 AM (18 years ago)
Author:
bennylp
Message:

Added complexity and quality argument, and terminate dialog properly on failures

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c

    r255 r284  
    116116    status = pjsip_pres_create_uas( dlg, &pres_cb, rdata, &sub); 
    117117    if (status != PJ_SUCCESS) { 
    118         PJ_TODO(DESTROY_DIALOG); 
     118        pjsip_dlg_terminate(dlg); 
    119119        pjsua_perror(THIS_FILE, "Unable to create server subscription",  
    120120                     status); 
     
    145145                     status); 
    146146        pj_list_erase(uapres); 
     147        pjsip_pres_terminate(sub, PJ_FALSE); 
    147148        return PJ_FALSE; 
    148149    } 
     
    169170                     status); 
    170171        pj_list_erase(uapres); 
     172        pjsip_pres_terminate(sub, PJ_FALSE); 
    171173        return PJ_FALSE; 
    172174    } 
     
    328330        pjsua_perror(THIS_FILE, "Unable to create presence client",  
    329331                     status); 
     332        pjsip_dlg_terminate(dlg); 
    330333        return; 
    331334    } 
     
    336339    status = pjsip_pres_initiate(pjsua.buddies[index].sub, -1, &tdata); 
    337340    if (status != PJ_SUCCESS) { 
     341        pjsip_pres_terminate(pjsua.buddies[index].sub, PJ_FALSE); 
    338342        pjsua.buddies[index].sub = NULL; 
    339343        pjsua_perror(THIS_FILE, "Unable to create initial SUBSCRIBE",  
     
    344348    status = pjsip_pres_send_request(pjsua.buddies[index].sub, tdata); 
    345349    if (status != PJ_SUCCESS) { 
     350        pjsip_pres_terminate(pjsua.buddies[index].sub, PJ_FALSE); 
    346351        pjsua.buddies[index].sub = NULL; 
    347352        pjsua_perror(THIS_FILE, "Unable to send initial SUBSCRIBE",  
     
    349354        return; 
    350355    } 
    351  
    352     PJ_TODO(DESTROY_DIALOG_ON_ERROR); 
    353356} 
    354357 
     
    374377        status = pjsip_pres_send_request( pjsua.buddies[index].sub, tdata ); 
    375378 
    376     if (status == PJ_SUCCESS) { 
    377  
    378         //pjsip_evsub_set_mod_data(pjsua.buddies[index].sub, pjsua.mod.id, 
    379         //                               NULL); 
    380         //pjsua.buddies[index].sub = NULL; 
    381  
    382     } else { 
     379    if (status != PJ_SUCCESS) { 
     380 
     381        pjsip_pres_terminate(pjsua.buddies[index].sub, PJ_FALSE); 
     382        pjsua.buddies[index].sub = NULL; 
    383383        pjsua_perror(THIS_FILE, "Unable to unsubscribe presence",  
    384384                     status); 
Note: See TracChangeset for help on using the changeset viewer.