[asterisk-commits] jrose: branch 11 r413876 - /branches/11/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 13 12:40:11 CDT 2014


Author: jrose
Date: Tue May 13 12:40:00 2014
New Revision: 413876

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=413876
Log:
chan_sip: Add TLS and SRTP status to CLI command 'sip show channel'

ASTERISK-23564 #close
Reported by: Patrick Laimbock
Review: https://reviewboard.asterisk.org/r/3474/

Modified:
    branches/11/channels/chan_sip.c

Modified: branches/11/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/channels/chan_sip.c?view=diff&rev=413876&r1=413875&r2=413876
==============================================================================
--- branches/11/channels/chan_sip.c (original)
+++ branches/11/channels/chan_sip.c Tue May 13 12:40:00 2014
@@ -21163,6 +21163,24 @@
 	return NULL;
 }
 
+static const char *transport2str(enum sip_transport transport)
+{
+	switch (transport) {
+	case SIP_TRANSPORT_TLS:
+		return "TLS";
+	case SIP_TRANSPORT_UDP:
+		return "UDP";
+	case SIP_TRANSPORT_TCP:
+		return "TCP";
+	case SIP_TRANSPORT_WS:
+		return "WS";
+	case SIP_TRANSPORT_WSS:
+		return "WSS";
+	}
+
+	return "Undefined";
+}
+
 /*! \brief Show details of one active dialog */
 static char *sip_show_channel(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
@@ -21281,6 +21299,10 @@
  					ast_cli(a->fd, "  S-Timer Cached Mode:    %s\n", stmode2str(cur->stimer->st_cached_mode));
  				}
 			}
+
+			/* add transport and media types */
+			ast_cli(a->fd, "  Transport:              %s\n", transport2str(cur->socket.type));
+			ast_cli(a->fd, "  Media:                  %s\n", cur->srtp ? "SRTP" : cur->rtp ? "RTP" : "None");
 
 			ast_cli(a->fd, "\n\n");
 




More information about the asterisk-commits mailing list