Ignore:
Timestamp:
Feb 8, 2006 10:44:25 PM (18 years ago)
Author:
bennylp
Message:

Finished invite session UAS implementation

File:
1 edited

Legend:

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

    r145 r160  
    475475    pjsip_dialog *dlg; 
    476476 
    477     /* Optimized path: bail out early if request doesn't have To tag */ 
    478     if (rdata->msg_info.to->tag.slen == 0) 
     477    /* Optimized path: bail out early if request is not CANCEL and it doesn't 
     478     * have To tag  
     479     */ 
     480    if (rdata->msg_info.to->tag.slen == 0 &&  
     481        rdata->msg_info.msg->line.req.method.id != PJSIP_CANCEL_METHOD) 
     482    { 
    479483        return PJ_FALSE; 
     484    } 
    480485 
    481486    /* Lock user agent before looking up the dialog hash table. */ 
     
    625630 
    626631    if (rdata->msg_info.cseq->method.id == PJSIP_INVITE_METHOD) { 
    627         //pj_str_t *to_tag = &rdata->msg_info.to->tag; 
     632         
     633        int st_code = rdata->msg_info.msg->line.status.code; 
     634        pj_str_t *to_tag = &rdata->msg_info.to->tag; 
    628635 
    629636        /* Must hold UA mutex before accessing dialog set. */ 
     
    632639        dlg = dlg_set->dlg_list.next; 
    633640 
    634         /* Forking handling is temporarily disabled. */ 
    635         PJ_TODO(UA_LAYER_HANDLE_FORKING); 
    636  
    637 #if 0 
    638641        while (dlg != (pjsip_dialog*)&dlg_set->dlg_list) { 
    639642 
     
    653656 
    654657        /* If no dialog with matching remote tag is found, this must be 
    655          * a forked response. 
     658         * a forked response. Respond to this ONLY when response is non-100 
     659         * provisional response OR a 2xx response. 
    656660         */ 
    657         if (dlg == (pjsip_dialog*)&dlg_set->dlg_list) { 
     661        if (dlg == (pjsip_dialog*)&dlg_set->dlg_list && 
     662            ((st_code/100==1 && st_code!=100) || st_code/100==2))  
     663        { 
    658664            /* Report to application about forked condition. 
    659665             * Application can either create a dialog or ignore the response. 
     
    678684                return PJ_TRUE; 
    679685            } 
     686 
     687        } else if (dlg == (pjsip_dialog*)&dlg_set->dlg_list) { 
     688 
     689            /* For 100 or non-2xx response which has different To tag, 
     690             * pass the response to the first dialog. 
     691             */ 
     692 
     693            dlg = dlg_set->dlg_list.next; 
     694 
    680695        } 
    681 #endif 
    682696 
    683697        /* Done with the dialog set. */ 
Note: See TracChangeset for help on using the changeset viewer.