diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h index f33132c44b..0876fbdd55 100644 --- a/pjsip/include/pjsua-lib/pjsua.h +++ b/pjsip/include/pjsua-lib/pjsua.h @@ -426,6 +426,16 @@ typedef struct pj_stun_resolve_result pj_stun_resolve_result; # define PJSUA_TRICKLE_ICE_NEW_CAND_CHECK_INTERVAL 100 #endif +/** + * Specify if PJSUA should check for merged requests as per RFC 3261 section + * 8.2.2.2. If a merged request is detected, PJSUA will automatically reply + * with a 482 - Loop Detected. + * + * Default: 1 (enabled) + */ +#ifndef PJSUA_DETECT_MERGED_REQUESTS +# define PJSUA_DETECT_MERGED_REQUESTS 1 +#endif /** * This enumeration represents pjsua state. diff --git a/pjsip/src/pjsua-lib/pjsua_core.c b/pjsip/src/pjsua-lib/pjsua_core.c index 8324019d9e..943368021d 100644 --- a/pjsip/src/pjsua-lib/pjsua_core.c +++ b/pjsip/src/pjsua-lib/pjsua_core.c @@ -663,6 +663,7 @@ static pj_bool_t mod_pjsua_on_rx_request(pjsip_rx_data *rdata) { pj_bool_t processed = PJ_FALSE; +#if PJSUA_DETECT_MERGED_REQUESTS if (pjsip_tsx_detect_merged_requests(rdata)) { PJ_LOG(4, (THIS_FILE, "Merged request detected")); @@ -673,6 +674,7 @@ static pj_bool_t mod_pjsua_on_rx_request(pjsip_rx_data *rdata) return PJ_TRUE; } +#endif PJSUA_LOCK();