Commit 74f63975fd for freeswitch.com
commit 74f63975fdb94bde3a05ec75001ae9ae055b511c
Author: Dmitry Verenitsin <morbit85@gmail.com>
Date: Tue Nov 17 17:48:10 2026 +0500
[core] Do not start an MSRP client without a remote path
When the remote side offers `a=setup:passive`, negotiation started the
MSRP client whether or not the offer carried an `a=path`, and the
client then asserted on the missing `remote_path`. Start the client
only when a path was negotiated. In `msrp_worker()`, also stop with an
error instead of asserting when there is no path, and when the path
gives no host or port.
diff --git a/src/switch_core_media.c b/src/switch_core_media.c
index f8825aab74..760bb41c13 100644
--- a/src/switch_core_media.c
+++ b/src/switch_core_media.c
@@ -5101,7 +5101,11 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
smh->msrp_session->secure ? "s" : "",
ip, smh->msrp_session->local_port, smh->msrp_session->call_id);
- switch_msrp_start_client(smh->msrp_session);
+ if (zstr(smh->msrp_session->remote_path)) {
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "MSRP remote is passive but sent no path, not connecting\n");
+ } else {
+ switch_msrp_start_client(smh->msrp_session);
+ }
}
switch_core_session_start_text_thread(session);
diff --git a/src/switch_msrp.c b/src/switch_msrp.c
index 17d8a25edf..90028ae539 100644
--- a/src/switch_msrp.c
+++ b/src/switch_msrp.c
@@ -1130,7 +1130,11 @@ static void *SWITCH_THREAD_FUNC msrp_worker(switch_thread_t *thread, void *obj)
msrp_session = helper->msrp_session;
msrp_session->running = 1;
- switch_assert(msrp_session->remote_path);
+ if (zstr(msrp_session->remote_path)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "MSRP %s has no remote path to connect to\n", msrp_session->call_id);
+ goto end;
+ }
+
dup = switch_core_strdup(pool, msrp_session->remote_path);
switch_assert(dup);
@@ -1155,8 +1159,9 @@ static void *SWITCH_THREAD_FUNC msrp_worker(switch_thread_t *thread, void *obj)
}
}
- if (!remote_ip || remote_port <= 0) {
+ if (zstr(remote_ip) || remote_port <= 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error get remote MSRP ip:port from path: [%s]\n", msrp_session->remote_path);
+ goto end;
}
if (switch_sockaddr_info_get(&sa, remote_ip, SWITCH_UNSPEC, remote_port, 0, pool) != SWITCH_STATUS_SUCCESS) {