From: Sipwise Development Team <support@sipwise.com>
Date: Thu, 26 Mar 2020 10:06:46 +0100
Subject: sca-fix-on-hold-detection-when-upstream-flow

---
 src/modules/sca/sca_call_info.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/modules/sca/sca_call_info.c b/src/modules/sca/sca_call_info.c
index ed43fe2..419df8c 100644
--- a/src/modules/sca/sca_call_info.c
+++ b/src/modules/sca/sca_call_info.c
@@ -948,11 +948,13 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg,
 	int state = SCA_APPEARANCE_STATE_UNKNOWN;
 	int rc = -1;
 	str *target_aor = from_aor;
+	int upstream = 0;
 
 	if(SCA_CALL_INFO_IS_SHARED_CALLEE(call_info)
 			&& sca->rr_api->is_direction(msg, RR_FLOW_UPSTREAM) == 0) {
 		LM_DBG("callee is SCA and direction is 'upstream'\n");
 		target_aor = to_aor;
+		upstream = 1;
 	}
 
 	LM_DBG("For From-AOR %.*s To-AOR: %.*s: From: <%.*s> To: <%.*s> "
@@ -971,7 +973,7 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg,
 		goto done;
 	}
 
-	if(!SCA_CALL_INFO_IS_SHARED_CALLER(call_info)) {
+	if(!upstream && !SCA_CALL_INFO_IS_SHARED_CALLER(call_info)) {
 		// caller isn't SCA, no more to do. update callee in reply handler.
 		rc = 1;
 		goto done;
