Changeset 4441 for pjproject/trunk


Ignore:
Timestamp:
Mar 19, 2013 3:51:10 AM (12 years ago)
Author:
nanang
Message:

Re #1644: Added run-time setting 'pjsip_cfg()->follow_early_media_fork' and compile-time setting 'PJSIP_FOLLOW_EARLY_MEDIA_FORK', the default value is PJ_TRUE.

Location:
pjproject/trunk/pjsip
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip/sip_config.h

    r4285 r4441  
    112112        pj_bool_t disable_tcp_switch; 
    113113 
     114        /** 
     115         * Enable call media session to always be updated to the latest 
     116         * received early media SDP when receiving forked early media 
     117         * (multiple 183 responses with different To tag). 
     118         * 
     119         * Default is PJSIP_FOLLOW_EARLY_MEDIA_FORK. 
     120         */ 
     121        pj_bool_t follow_early_media_fork; 
     122 
    114123    } endpt; 
    115124 
     
    293302 
    294303/** 
     304 * Specify whether the call media session should be updated to the latest 
     305 * received early media SDP when receiving forked early media (multiple 183 
     306 * responses with different To tag). 
     307 * 
     308 * This option can also be controlled at run-time by the 
     309 * \a follow_early_media_fork setting in pjsip_cfg_t. 
     310 * 
     311 * Default is PJ_TRUE. 
     312 */ 
     313#ifndef PJSIP_FOLLOW_EARLY_MEDIA_FORK 
     314#   define PJSIP_FOLLOW_EARLY_MEDIA_FORK            PJ_TRUE 
     315#endif 
     316 
     317 
     318/** 
    295319 * Accept call replace in early state when invite is not initiated 
    296320 * by the user agent. RFC 3891 Section 3 disallows this, however, 
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c

    r4425 r4441  
    17361736    if (tsx_inv_data->sdp_done) { 
    17371737        pj_str_t res_tag; 
     1738        int st_code; 
    17381739 
    17391740        res_tag = rdata->msg_info.to->tag; 
    1740  
    1741         /* Allow final response after SDP has been negotiated in early 
    1742          * media, IF this response is a final response with different 
     1741        st_code = rdata->msg_info.msg->line.status.code; 
     1742 
     1743        /* Allow final/early response after SDP has been negotiated in early 
     1744         * media, IF this response is a final/early response with different 
    17431745         * tag. 
    17441746         */ 
    17451747        if (tsx->role == PJSIP_ROLE_UAC && 
    1746             rdata->msg_info.msg->line.status.code/100 == 2 && 
     1748            (st_code/100 == 2 || 
     1749             (st_code==183 && pjsip_cfg()->endpt.follow_early_media_fork)) && 
    17471750            tsx_inv_data->done_early && 
    17481751            pj_stricmp(&tsx_inv_data->done_tag, &res_tag)) 
     
    17501753            const pjmedia_sdp_session *reoffer_sdp = NULL; 
    17511754 
    1752             PJ_LOG(4,(inv->obj_name, "Received forked final response " 
     1755            PJ_LOG(4,(inv->obj_name, "Received forked %s response " 
    17531756                      "after SDP negotiation has been done in early " 
    1754                       "media. Renegotiating SDP..")); 
     1757                      "media. Renegotiating SDP..", 
     1758                      (st_code==183? "early" : "final" ))); 
    17551759 
    17561760            /* Retrieve original SDP offer from INVITE request */ 
     
    17641768            if (status != PJ_SUCCESS) { 
    17651769                PJ_LOG(1,(inv->obj_name, "Error updating local offer for " 
    1766                           "forked 2xx response (err=%d)", status)); 
     1770                          "forked 2xx/183 response (err=%d)", status)); 
    17671771                return status; 
    17681772            } 
  • pjproject/trunk/pjsip/src/pjsip/sip_config.c

    r4285 r4441  
    3030       0, 
    3131       0, 
    32        PJSIP_DONT_SWITCH_TO_TCP 
     32       PJSIP_DONT_SWITCH_TO_TCP, 
     33       PJSIP_FOLLOW_EARLY_MEDIA_FORK 
    3334    }, 
    3435 
Note: See TracChangeset for help on using the changeset viewer.