Przeglądaj źródła

sca: use To header as target if SUBSCRIBE is in-dialog

Victor Seva 9 lat temu
rodzic
commit
480399653e
1 zmienionych plików z 8 dodań i 5 usunięć
  1. 8 5
      modules/sca/sca_subscribe.c

+ 8 - 5
modules/sca/sca_subscribe.c

@@ -1082,14 +1082,17 @@ int sca_subscription_from_request(sca_mod *scam, sip_msg_t *msg, int event_type,
 				goto error;
 			}
 		}
+		if (sca_uri_extract_aor(ruri, &req_sub->target_aor) < 0) {
+			LM_ERR("Failed to extract AoR from RURI %.*s\n", STR_FMT(ruri));
+			goto error;
+		}
+	}
+	else {
+		/* we are in-dialog */
+		req_sub->target_aor = to->uri;
 	}
 
 	req_sub->subscriber = contact_uri;
-	if (sca_uri_extract_aor(ruri, &req_sub->target_aor) < 0) {
-		LM_ERR("Failed to extract AoR from RURI %.*s\n",
-				STR_FMT(ruri));
-		goto error;
-	}
 	req_sub->event = event_type;
 	req_sub->index = SCA_CALL_INFO_APPEARANCE_INDEX_ANY;
 	req_sub->expires = expires;