Changeset 2800


Ignore:
Timestamp:
Jun 25, 2009 11:17:17 AM (15 years ago)
Author:
bennylp
Message:

Ticket #799: UAC disconnect call when receiving BYE in early state (thanks Gang Liu for the suggestion)

  • backported changes from #798
Location:
pjproject/branches/1.0
Files:
2 edited
2 copied

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.0/pjsip-apps/src/pjsua/pjsua_app.c

    r2544 r2800  
    37603760            if (result.nb_result != NO_NB) { 
    37613761 
    3762                 if (result.nb_result == -1 || result.nb_result == 0) { 
     3762                if (result.nb_result == -1) { 
    37633763                    puts("Sorry you can't do that!"); 
    37643764                    continue; 
     3765                } else if (result.nb_result == 0) { 
     3766                    uri = NULL; 
     3767                    if (current_call == PJSUA_INVALID_ID) { 
     3768                        puts("No current call"); 
     3769                        continue; 
     3770                    } 
    37653771                } else { 
    37663772                    pjsua_buddy_info binfo; 
     
    37733779            } 
    37743780             
    3775             tmp = pj_str(uri); 
    3776  
    3777             send_request(text, &tmp); 
     3781            if (uri) { 
     3782                tmp = pj_str(uri); 
     3783                send_request(text, &tmp); 
     3784            } else { 
     3785                /* If you send call control request using this method 
     3786                 * (such requests includes BYE, CANCEL, etc.), it will 
     3787                 * not go well with the call state, so don't do it 
     3788                 * unless it's for testing. 
     3789                 */ 
     3790                pj_str_t method = pj_str(text); 
     3791                pjsua_call_send_request(current_call, &method, NULL); 
     3792            } 
    37783793            break; 
    37793794 
  • pjproject/branches/1.0/pjsip/src/pjsip-ua/sip_inv.c

    r2799 r2800  
    33603360        /* Generic handling for UAC tsx completion */ 
    33613361        handle_uac_tsx_response(inv, e); 
     3362 
     3363    } else if (tsx->role == PJSIP_ROLE_UAS && 
     3364               tsx->method.id == PJSIP_BYE_METHOD && 
     3365               tsx->status_code < 200 && 
     3366               e->body.tsx_state.type == PJSIP_EVENT_RX_MSG) 
     3367    { 
     3368        /* Received BYE before the 2xx/OK response to INVITE. 
     3369         * Assume that the 2xx/OK response is lost and the BYE 
     3370         * arrives earlier. 
     3371         */ 
     3372        inv_respond_incoming_bye(inv, tsx, e->body.tsx_state.src.rdata, e); 
     3373 
     3374        /* Set timer just in case we will never get the final response 
     3375         * for INVITE. 
     3376         */ 
     3377        pjsip_tsx_set_timeout(inv->invite_tsx, 64*pjsip_cfg()->tsx.t1); 
    33623378    } 
    33633379} 
Note: See TracChangeset for help on using the changeset viewer.