Changeset 2650


Ignore:
Timestamp:
Apr 27, 2009 12:50:16 PM (15 years ago)
Author:
bennylp
Message:

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

  • UAC now handles the BYE, and treat it as out-of-order disconnect request, meaning that it will disconnect the call
  • it will also activate timer to terminate the INVITE transaction, in case final response never arrives
  • added SIPp UAS scenario to test this
  • also added forked 200/OK response SIPp scenario,
  • and fixed the prack_fork.xml SIPp scenario
Location:
pjproject/trunk
Files:
2 added
3 edited

Legend:

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

    r2568 r2650  
    37973797            if (result.nb_result != NO_NB) { 
    37983798 
    3799                 if (result.nb_result == -1 || result.nb_result == 0) { 
     3799                if (result.nb_result == -1) { 
    38003800                    puts("Sorry you can't do that!"); 
    38013801                    continue; 
     3802                } else if (result.nb_result == 0) { 
     3803                    uri = NULL; 
     3804                    if (current_call == PJSUA_INVALID_ID) { 
     3805                        puts("No current call"); 
     3806                        continue; 
     3807                    } 
    38023808                } else { 
    38033809                    pjsua_buddy_info binfo; 
     
    38123818            } 
    38133819             
    3814             tmp = pj_str(uri); 
    3815  
    3816             send_request(text, &tmp); 
     3820            if (uri) { 
     3821                tmp = pj_str(uri); 
     3822                send_request(text, &tmp); 
     3823            } else { 
     3824                /* If you send call control request using this method 
     3825                 * (such requests includes BYE, CANCEL, etc.), it will 
     3826                 * not go well with the call state, so don't do it 
     3827                 * unless it's for testing. 
     3828                 */ 
     3829                pj_str_t method = pj_str(text); 
     3830                pjsua_call_send_request(current_call, &method, NULL); 
     3831            } 
    38173832            break; 
    38183833 
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c

    r2647 r2650  
    33623362        /* Generic handling for UAC tsx completion */ 
    33633363        handle_uac_tsx_response(inv, e); 
     3364 
     3365    } else if (tsx->role == PJSIP_ROLE_UAS && 
     3366               tsx->method.id == PJSIP_BYE_METHOD && 
     3367               tsx->status_code < 200 && 
     3368               e->body.tsx_state.type == PJSIP_EVENT_RX_MSG) 
     3369    { 
     3370        /* Received BYE before the 2xx/OK response to INVITE. 
     3371         * Assume that the 2xx/OK response is lost and the BYE 
     3372         * arrives earlier. 
     3373         */ 
     3374        inv_respond_incoming_bye(inv, tsx, e->body.tsx_state.src.rdata, e); 
     3375 
     3376        /* Set timer just in case we will never get the final response 
     3377         * for INVITE. 
     3378         */ 
     3379        pjsip_tsx_set_timeout(inv->invite_tsx, 64*pjsip_cfg()->tsx.t1); 
    33643380    } 
    33653381} 
  • pjproject/trunk/tests/pjsua/scripts-sipp/prack_fork.xml

    r2576 r2650  
    9494    <![CDATA[ 
    9595      SIP/2.0 200 OK 
    96       Via: SIP/2.0/UDP [remote_ip]:[remote_port];rport=[remote_port];[$3] 
     96      Via: SIP/2.0/UDP 127.0.0.1:5080;received=127.0.0.1;rport=5080;[$3] 
    9797      [last_From:] 
    9898      [last_To:];tag=2 
Note: See TracChangeset for help on using the changeset viewer.