diff --git a/src/satip/rtsp.c b/src/satip/rtsp.c index 7641b85..3bb6d5a 100644 --- a/src/satip/rtsp.c +++ b/src/satip/rtsp.c @@ -1656,8 +1656,9 @@ rtsp_flush_requests(http_connection_t *hc) static void rtsp_stream_status ( void *opaque, htsmsg_t *m ) { - http_connection_t *hc = opaque; - char buf[128]; + http_connection_t *hc = opaque; char buf[128]; + int buf_size = sizeof(buf); + struct session *rs = NULL; htsmsg_add_str(m, "type", "SAT>IP"); if (hc->hc_proxy_ip) { @@ -1666,6 +1667,23 @@ rtsp_stream_status ( void *opaque, htsmsg_t *m ) } if (hc->hc_username) htsmsg_add_str(m, "user", hc->hc_username); + + buf[0]='\0'; + TAILQ_FOREACH(rs, &rtsp_sessions, link) { + if (buf_size < 10) break; + if (hc->hc_session && + strcmp(rs->session, hc->hc_session) == 0 && + strcmp(rs->peer_ipstr, hc->hc_peer_ipstr) == 0 && + rs->rtp_peer_port > 0) { + if (rs->rtp_peer_port == RTSP_TCP_DATA) + buf_size -= snprintf(buf + sizeof(buf) - buf_size, buf_size, "%sAVP", buf_size == sizeof(buf)? "" : ","); + else + buf_size -= snprintf(buf + sizeof(buf) - buf_size, buf_size, "%s%d+1", buf_size == sizeof(buf)? "" : ",", rs->rtp_peer_port); + } + } + if (buf[0] != '\0') { + htsmsg_set_str(m, "peer_udp_ports", buf); + } } /* diff --git a/src/webui/static/app/status.js b/src/webui/static/app/status.js index 0ac4b78..3a7db18 100644 --- a/src/webui/static/app/status.js +++ b/src/webui/static/app/status.js @@ -607,6 +607,7 @@ tvheadend.status_conns = function(panel, index) { { name: 'server_port' }, { name: 'peer', sortType: stype }, { name: 'peer_port' }, + { name: 'peer_udp_ports' }, { name: 'proxy' }, { name: 'user', sortType: stype }, { @@ -645,11 +646,17 @@ tvheadend.status_conns = function(panel, index) { }, { width: 50, id: 'peer_port', - header: _("Client Port"), + header: _("Client TCP Port"), dataIndex: 'peer_port', sortable: true }, { width: 50, + id: 'peer_udp_ports', + header: _("Client UDP Ports"), + dataIndex: 'peer_udp_ports', + sortable: true + }, { + width: 50, id: 'user', header: _("Username"), dataIndex: 'user',