Changeset 4396


Ignore:
Timestamp:
Feb 27, 2013 12:12:59 PM (12 years ago)
Author:
ming
Message:

Re #1596: Backported to 1.x

Location:
pjproject/branches/1.x
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x

  • pjproject/branches/1.x/pjsip/src/pjsip-ua/sip_inv.c

    r4385 r4396  
    28552855    neg_state = pjmedia_sdp_neg_get_state(inv->neg); 
    28562856 
     2857    /* If UPDATE doesn't contain SDP, just respond with 200/OK. 
     2858     * This is a valid scenario according to session-timer draft. 
     2859     */ 
     2860    if (rdata->msg_info.msg->body == NULL) { 
     2861 
     2862        status = pjsip_dlg_create_response(inv->dlg, rdata,  
     2863                                           200, NULL, &tdata); 
     2864    } 
    28572865    /* Send 491 if we receive UPDATE while we're waiting for an answer */ 
    2858     if (neg_state == PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER) { 
     2866    else if (neg_state == PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER) { 
    28592867        status = pjsip_dlg_create_response(inv->dlg, rdata,  
    28602868                                           PJSIP_SC_REQUEST_PENDING, NULL, 
     
    28652873     */ 
    28662874    else if (neg_state == PJMEDIA_SDP_NEG_STATE_REMOTE_OFFER || 
    2867              neg_state == PJMEDIA_SDP_NEG_STATE_WAIT_NEGO) { 
    2868         status = pjsip_dlg_create_response(inv->dlg, rdata,  
     2875             neg_state == PJMEDIA_SDP_NEG_STATE_WAIT_NEGO) 
     2876    { 
     2877        pjsip_retry_after_hdr *ra_hdr; 
     2878        int val; 
     2879 
     2880        status = pjsip_dlg_create_response(inv->dlg, rdata,  
    28692881                                           PJSIP_SC_INTERNAL_SERVER_ERROR, 
    28702882                                           NULL, &tdata); 
    28712883 
    2872     /* If UPDATE doesn't contain SDP, just respond with 200/OK. 
    2873      * This is a valid scenario according to session-timer draft. 
    2874      */ 
    2875     } else if (rdata->msg_info.msg->body == NULL) { 
    2876  
    2877         status = pjsip_dlg_create_response(inv->dlg, rdata,  
    2878                                            200, NULL, &tdata); 
     2884        val = (pj_rand() % 10); 
     2885        ra_hdr = pjsip_retry_after_hdr_create(tdata->pool, val); 
     2886        pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)ra_hdr); 
    28792887 
    28802888    } else { 
Note: See TracChangeset for help on using the changeset viewer.