Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add PJSUA_DETECT_MERGED_REQUEST parameter #3784

Merged
merged 3 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pjsip/include/pjsua-lib/pjsua.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions pjsip/src/pjsua-lib/pjsua_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"));

Expand All @@ -673,6 +674,7 @@ static pj_bool_t mod_pjsua_on_rx_request(pjsip_rx_data *rdata)

return PJ_TRUE;
}
#endif

PJSUA_LOCK();

Expand Down
Loading