Changeset 5812
- Timestamp:
- Jun 25, 2018 2:58:18 AM (6 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsip-ua/sip_inv.h
r5641 r5812 443 443 forked media? */ 444 444 pj_atomic_t *ref_cnt; /**< Reference counter. */ 445 pj_bool_t updated_sdp_answer; /**< SDP answer just been 446 updated? */ 445 447 }; 446 448 -
pjproject/trunk/pjsip/include/pjsip/sip_config.h
r5716 r5812 171 171 pj_bool_t use_compact_form; 172 172 173 /** 174 * Accept multiple SDP answers on non-reliable 18X responses and the 2XX 175 * response when they are all received from the same source (same To tag). 176 * 177 * See also: 178 * https://tools.ietf.org/html/rfc6337#section-3.1.1 179 * 180 * Default is PJSIP_ACCEPT_MULTIPLE_SDP_ANSWERS. 181 */ 182 pj_bool_t accept_multiple_sdp_answers; 183 173 184 } endpt; 174 185 … … 417 428 418 429 /** 430 * Accept multiple SDP answers on non-reliable 18X responses and the 2XX 431 * response when they are all received from the same source (same To tag). 432 * 433 * This option can also be controlled at run-time by the 434 * \a accept_multiple_sdp_answers setting in pjsip_cfg_t. 435 * 436 * Default is PJ_FALSE. 437 */ 438 #ifndef PJSIP_ACCEPT_MULTIPLE_SDP_ANSWERS 439 # define PJSIP_ACCEPT_MULTIPLE_SDP_ANSWERS PJ_TRUE 440 #endif 441 442 443 /** 419 444 * Specify whether "alias" param should be added to the Via header 420 445 * in any outgoing request with connection oriented transport. -
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r5714 r5812 163 163 pj_str_t done_tag; /* To tag in RX response with answer */ 164 164 pj_bool_t done_early;/* Negotiation was done for early med? */ 165 pj_bool_t done_early_rel;/* Early med was realiable? */ 165 166 pj_bool_t has_sdp; /* Message with SDP? */ 166 167 }; … … 2001 2002 /* Initialize info that we are following forked media */ 2002 2003 inv->following_fork = PJ_FALSE; 2004 inv->updated_sdp_answer = PJ_FALSE; 2003 2005 2004 2006 /* MUST NOT do multiple SDP offer/answer in a single transaction, 2005 * EXCEPT if: 2006 * - this is an initial UAC INVITE transaction (i.e. not re-INVITE), and 2007 * - the previous negotiation was done on an early media (18x) and 2008 * this response is a final/2xx response, and 2009 * - the 2xx response has different To tag than the 18x response 2010 * (i.e. the request has forked). 2007 * EXCEPT previous nego was in 18x (early media) and any of the following 2008 * condition is met: 2009 * - Non-forking scenario: 2010 * - 'accept_multiple_sdp_answers' is set, and 2011 * - previous early response was not reliable (rfc6337 section 3.1.1). 2012 * - Forking scenario: 2013 * - This response has different To tag than the previous response, and 2014 * - This response is 18x/2xx (early or final). If this is 18x, 2015 * only do multiple SDP nego if 'follow_early_media_fork' is set. 2011 2016 * 2012 * The exception above is to add a rudimentary support for early media 2013 * forking (sample case: custom ringback). See this ticket for more 2014 * info: http://trac.pjsip.org/repos/ticket/657 2017 * See also tickets #657, #1644, #1764, and #2123 for more info. 2015 2018 */ 2016 2019 if (tsx_inv_data->sdp_done) { … … 2021 2024 st_code = rdata->msg_info.msg->line.status.code; 2022 2025 2023 /* Allow final/early response after SDP has been negotiated in early 2024 * media, IF this response is a final/early response with different 2025 * tag. 2026 * See ticket #1644 and #1764 for forked early media case. 2027 */ 2028 if (tsx->role == PJSIP_ROLE_UAC && 2029 (st_code/100 == 2 || 2030 (st_code/10 == 18 /* st_code == 18x */ 2031 && pjsip_cfg()->endpt.follow_early_media_fork)) && 2032 tsx_inv_data->done_early && 2033 pj_stricmp(&tsx_inv_data->done_tag, &res_tag)) 2026 if (tsx->role == PJSIP_ROLE_UAC && tsx_inv_data->done_early && 2027 ( 2028 /* Non-forking scenario */ 2029 ( 2030 !tsx_inv_data->done_early_rel && 2031 (st_code/100 == 2 || st_code/10 == 18) && 2032 pjsip_cfg()->endpt.accept_multiple_sdp_answers && 2033 !pj_stricmp(&tsx_inv_data->done_tag, &res_tag) 2034 ) 2035 || 2036 /* Forking scenario */ 2037 ( 2038 (st_code/100 == 2 || 2039 (st_code/10 == 18 && 2040 pjsip_cfg()->endpt.follow_early_media_fork)) && 2041 pj_stricmp(&tsx_inv_data->done_tag, &res_tag) 2042 ) 2043 ) 2044 ) 2034 2045 { 2035 2046 const pjmedia_sdp_session *reoffer_sdp = NULL; 2036 2047 2037 PJ_LOG(4,(inv->obj_name, "Received forked%s response "2048 PJ_LOG(4,(inv->obj_name, "Received %s response " 2038 2049 "after SDP negotiation has been done in early " 2039 2050 "media. Renegotiating SDP..", … … 2055 2066 } 2056 2067 2057 inv->following_fork = PJ_TRUE; 2068 inv->following_fork = !!pj_stricmp(&tsx_inv_data->done_tag, 2069 &res_tag); 2070 inv->updated_sdp_answer = PJ_TRUE; 2058 2071 2059 2072 } else { … … 2164 2177 status_code = rdata->msg_info.msg->line.status.code; 2165 2178 tsx_inv_data->done_early = (status_code/100==1); 2179 tsx_inv_data->done_early_rel = tsx_inv_data->done_early && 2180 pjsip_100rel_is_reliable(rdata); 2166 2181 pj_strdup(tsx->pool, &tsx_inv_data->done_tag, 2167 2182 &rdata->msg_info.to->tag); -
pjproject/trunk/pjsip/src/pjsip/sip_config.c
r5701 r5812 36 36 PJSIP_RESOLVE_HOSTNAME_TO_GET_INTERFACE, 37 37 0, 38 PJSIP_ENCODE_SHORT_HNAME 38 PJSIP_ENCODE_SHORT_HNAME, 39 PJSIP_ACCEPT_MULTIPLE_SDP_ANSWERS 39 40 }, 40 41
Note: See TracChangeset
for help on using the changeset viewer.