Ignore:
Timestamp:
Feb 7, 2006 12:34:11 PM (18 years ago)
Author:
bennylp
Message:

Initial implementation of invite session abstraction, and updated pjsua for the new framework

File:
1 edited

Legend:

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

    r127 r139  
    169169    dlg = tsx->mod_data[mod_ua.mod.id]; 
    170170     
    171     /* Must have the dialog instance! */ 
    172     PJ_ASSERT_ON_FAIL(dlg != NULL, return); 
     171    /* If dialog instance has gone, it could mean that the dialog 
     172     * may has been destroyed. 
     173     */ 
     174    if (dlg == NULL) 
     175        return; 
    173176 
    174177    /* Hand over the event to the dialog. */ 
     
    205208{ 
    206209    return &mod_ua.mod; 
     210} 
     211 
     212 
     213/* 
     214 * Get the endpoint where this UA is currently registered. 
     215 */ 
     216PJ_DEF(pjsip_endpoint*) pjsip_ua_get_endpt(pjsip_user_agent *ua) 
     217{ 
     218    PJ_UNUSED_ARG(ua); 
     219    pj_assert(ua == &mod_ua.mod); 
     220    return mod_ua.endpt; 
    207221} 
    208222 
     
    461475    pjsip_dialog *dlg; 
    462476 
     477    /* Optimized path: bail out early if request doesn't have To tag */ 
     478    if (rdata->msg_info.to->tag.slen == 0) 
     479        return PJ_FALSE; 
     480 
    463481    /* Lock user agent before looking up the dialog hash table. */ 
    464482    pj_mutex_lock(mod_ua.mutex); 
     
    467485    dlg_set = find_dlg_set_for_msg(rdata); 
    468486 
    469     /* Bail out if dialog is not found. */ 
     487    /* If dialog is not found, respond with 481 (Call/Transaction 
     488     * Does Not Exist). 
     489     */ 
    470490    if (dlg_set == NULL) { 
    471         /* Not ours. */ 
     491        /* Unable to find dialog. */ 
    472492        pj_mutex_unlock(mod_ua.mutex); 
    473         return PJ_FALSE; 
     493 
     494        /* Respond with 481 . */ 
     495        pjsip_endpt_respond_stateless( mod_ua.endpt, rdata, 481, NULL, NULL, 
     496                                       NULL ); 
     497        return PJ_TRUE; 
    474498    } 
    475499 
     
    531555    /* Check if transaction is present. */ 
    532556    tsx = pjsip_rdata_get_tsx(rdata); 
    533     if (!tsx) { 
     557    if (tsx) { 
    534558        /* Check if dialog is present in the transaction. */ 
    535559        dlg = pjsip_tsx_get_dlg(tsx); 
Note: See TracChangeset for help on using the changeset viewer.