Project

General

Profile

Feature #4881 » SAT-IP-Print-UDP-RTP-ports-in-connection-status-v3.diff

version 3 - Mono Polimorph, 2018-02-12 16:45

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
607 607
                { name: 'server_port' },
608 608
                { name: 'peer', sortType: stype },
609 609
                { name: 'peer_port' },
610
                { name: 'peer_udp_ports' },
610 611
                { name: 'proxy' },
611 612
                { name: 'user', sortType: stype },
612 613
                {
......
645 646
            }, {
646 647
                width: 50,
647 648
                id: 'peer_port',
648
                header: _("Client Port"),
649
                header: _("Client TCP Port"),
649 650
                dataIndex: 'peer_port',
650 651
                sortable: true
651 652
            }, {
652 653
                width: 50,
654
                id: 'peer_udp_ports',
655
                header: _("Client UDP Ports"),
656
                dataIndex: 'peer_udp_ports',
657
                sortable: false,
658
                renderer: function(v) {
659
                    // return ("000");
660
                    var r = [];
661
                    Ext.each(v, function(port) {
662
                      r.push(port);
663
                    });
664
                    if (r.length < 1) return "";
665
                    r.sort();
666
                    return r.join(',');
667
                }
668
            }, {
669
                width: 50,
653 670
                id: 'user',
654 671
                header: _("Username"),
655 672
                dataIndex: 'user',
(3-3/4)