SAT-IP-Print-UDP-RTP-ports-in-connection-status-v4.diff

version 4 - Mono Polimorph, 2018-02-12 21:08

Download (2.65 KB)

View differences:

src/satip/rtsp.c
1658 1658
{
1659 1659
  http_connection_t *hc = opaque;
1660 1660
  char buf[128];
1661
  struct session *rs = NULL;
1662
  htsmsg_t *l;
1663
  int udpport;
1661 1664

  
1662 1665
  htsmsg_add_str(m, "type", "SAT>IP");
1663 1666
  if (hc->hc_proxy_ip) {
......
1666 1669
  }
1667 1670
  if (hc->hc_username)
1668 1671
    htsmsg_add_str(m, "user", hc->hc_username);
1672

  
1673
  l = htsmsg_create_list();
1674
  TAILQ_FOREACH(rs, &rtsp_sessions, link) {
1675
    if (hc->hc_session &&
1676
        strcmp(rs->session, hc->hc_session) == 0 &&
1677
        strcmp(rs->peer_ipstr, hc->hc_peer_ipstr) == 0 &&
1678
        rs->rtp_peer_port > 0) {
1679
      udpport = rs->rtp_peer_port;
1680
      if ( udpport == RTSP_TCP_DATA ) {
1681
        htsmsg_add_s32(l, NULL, -1);
1682
      } else {
1683
        htsmsg_add_s32(l, NULL, udpport);
1684
        htsmsg_add_s32(l, NULL, udpport+1);
1685
      }
1686
    }
1687
  }
1688
  htsmsg_add_msg(m, "peer_udp_ports", l);
1669 1689
}
1670 1690

  
1671 1691
/*
src/webui/static/app/status.js
625 625
                { name: 'server_port' },
626 626
                { name: 'peer', sortType: stype },
627 627
                { name: 'peer_port' },
628
                { name: 'peer_udp_ports' },
628 629
                { name: 'proxy' },
629 630
                { name: 'user', sortType: stype },
630 631
                {
......
663 664
            }, {
664 665
                width: 50,
665 666
                id: 'peer_port',
666
                header: _("Client Port"),
667
                header: _("Client TCP Port"),
667 668
                dataIndex: 'peer_port',
668 669
                sortable: true
669 670
            }, {
670 671
                width: 50,
672
                id: 'peer_udp_ports',
673
                header: _("Client UDP Ports"),
674
                dataIndex: 'peer_udp_ports',
675
                sortable: false,
676
                renderer: function(v) {
677
                    var r = [];
678
                    Ext.each(v, function(port) {
679
                      r.push(port);
680
                    });
681
                    if (r.length < 1) return "";
682
                    r.sort(function(a, b){return a-b});
683
                    return r.join(',');
684
                }
685
            }, {
686
                width: 50,
671 687
                id: 'user',
672 688
                header: _("Username"),
673 689
                dataIndex: 'user',