2
0
Эх сурвалжийг харах

sca: Fix the CID on seizing a held call from a different SCA AOR UA.

- Part of the issue reported by Kevin Scott Adams, GH #341. On seizing a
held call from another SCA subscriber UA, the Caller ID becomes the
actual AOR of the SCA. In reviewing the SIP traces the INVITE and REPLY
of seizing a held call as the 'from' and 'to' URI's set to the AOR. In
the sca_call_info_is_line_seize_reinvite() function this is handled but
was not handled when a 200 reply was issued. Uploaded, compiled and
tested.
Kevin Scott Adams 9 жил өмнө
parent
commit
dc10e8e0bb

+ 15 - 1
modules/sca/sca_call_info.c

@@ -1186,6 +1186,7 @@ static int sca_call_info_invite_reply_200_handler(sip_msg_t *msg,
 	char dlg_buf[1024];
 	str app_uri_aor = STR_NULL;
 	str state_str = STR_NULL;
+	str to_display = STR_NULL;
 	int state = SCA_APPEARANCE_STATE_UNKNOWN;
 	int slot_idx = -1;
 	int rc = -1;
@@ -1256,7 +1257,20 @@ static int sca_call_info_invite_reply_200_handler(sip_msg_t *msg,
 		goto done;
 	}
 
-	if (sca_appearance_update_unsafe(app, state, &to->display, &app_uri_aor,
+	// If the 'from_aor' and 'to_aor' don't match then we need to get the
+	// 'to_display' and 'app_uri_aor' variable values for a 200 reply for an
+	// INVITE for the call to sca_appearance_update_unsafe(). Otherwise its a
+	// 200 reply for a reINVITE and the 'to_display' and 'app_uri_aor' are
+	// already set to NULL and that won't change the appearance-uri.
+	if (!SCA_STR_EQ(from_aor, to_aor)) {
+		to_display = to->display;
+		if (sca_create_canonical_aor(msg, &app_uri_aor) < 0) {
+			LM_ERR( "sca_call_info_invite_200_reply_handler: "
+					"sca_create_canonical_aor failed\n" );
+			goto done;
+		}
+	}
+	if (sca_appearance_update_unsafe(app, state, &to_display, &app_uri_aor,
 			&dialog, NULL, contact_uri) < 0) {
 		sca_appearance_state_to_str(state, &state_str);
 		LM_ERR("sca_call_info_invite_handler: failed to update appearance "