Changeset 3481


Ignore:
Timestamp:
Mar 23, 2011 11:46:17 AM (10 years ago)
Author:
bennylp
Message:

Fix #1222: Assertion if BYE is received while callee is still in early state

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c

    r3385 r3481  
    36933693        inv_respond_incoming_bye(inv, tsx, e->body.tsx_state.src.rdata, e); 
    36943694 
    3695         /* Set timer just in case we will never get the final response 
    3696          * for INVITE. 
    3697          */ 
    3698         pjsip_tsx_set_timeout(inv->invite_tsx, 64*pjsip_cfg()->tsx.t1); 
     3695        if (inv->invite_tsx->role == PJSIP_ROLE_UAC) { 
     3696            /* Set timer just in case we will never get the final response 
     3697             * for INVITE. 
     3698             */ 
     3699            pjsip_tsx_set_timeout(inv->invite_tsx, 64*pjsip_cfg()->tsx.t1); 
     3700        } else if (inv->invite_tsx->status_code < 200) { 
     3701            pjsip_tx_data *tdata; 
     3702            pjsip_msg *msg; 
     3703 
     3704            /* For UAS, send a final response. */ 
     3705            tdata = inv->invite_tsx->last_tx; 
     3706            PJ_ASSERT_ON_FAIL(tdata != NULL, return); 
     3707 
     3708            msg = tdata->msg; 
     3709            msg->line.status.code = PJSIP_SC_REQUEST_TERMINATED; 
     3710            msg->line.status.reason = 
     3711                    *pjsip_get_status_text(PJSIP_SC_REQUEST_TERMINATED); 
     3712            msg->body = NULL; 
     3713 
     3714            pjsip_tx_data_invalidate_msg(tdata); 
     3715            pjsip_tx_data_add_ref(tdata); 
     3716 
     3717            pjsip_dlg_send_response(inv->dlg, inv->invite_tsx, tdata); 
     3718        } 
    36993719    } 
    37003720} 
Note: See TracChangeset for help on using the changeset viewer.