[asterisk-commits] jrose: trunk r413878 - in /trunk: ./ channels/ include/asterisk/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 13 13:09:19 CDT 2014


Author: jrose
Date: Tue May 13 13:09:13 2014
New Revision: 413878

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=413878
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/
........

Merged revisions 413876 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413877 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c
    trunk/include/asterisk/netsock2.h
    trunk/main/netsock2.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=413878&r1=413877&r2=413878
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue May 13 13:09:13 2014
@@ -21527,6 +21527,10 @@
  				}
 			}
 
+			/* add transport and media types */
+			ast_cli(a->fd, "  Transport:              %s\n", ast_transport2str(cur->socket.type));
+			ast_cli(a->fd, "  Media:                  %s\n", cur->srtp ? "SRTP" : cur->rtp ? "RTP" : "None");
+
 			ast_cli(a->fd, "\n\n");
 
 			found++;

Modified: trunk/include/asterisk/netsock2.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/netsock2.h?view=diff&rev=413878&r1=413877&r2=413878
==============================================================================
--- trunk/include/asterisk/netsock2.h (original)
+++ trunk/include/asterisk/netsock2.h Tue May 13 13:09:13 2014
@@ -567,6 +567,17 @@
 int ast_sockaddr_hash(const struct ast_sockaddr *addr);
 
 /*!
+ * \since 12.3
+ *
+ * \brief
+ * Returns a string representation of an ast_transport
+ *
+ * \retval Name of the tranpsort if it is defined
+ * \retval Undefined if the transport is undefined
+ */
+const char *ast_transport2str(enum ast_transport transport);
+
+/*!
  * \since 1.8
  *
  * \brief

Modified: trunk/main/netsock2.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/netsock2.c?view=diff&rev=413878&r1=413877&r2=413878
==============================================================================
--- trunk/main/netsock2.c (original)
+++ trunk/main/netsock2.c Tue May 13 13:09:13 2014
@@ -489,6 +489,24 @@
 	}
 }
 
+const char *ast_transport2str(enum ast_transport transport)
+{
+	switch (transport) {
+	case AST_TRANSPORT_TLS:
+		return "TLS";
+	case AST_TRANSPORT_UDP:
+		return "UDP";
+	case AST_TRANSPORT_TCP:
+		return "TCP";
+	case AST_TRANSPORT_WS:
+		return "WS";
+	case AST_TRANSPORT_WSS:
+		return "WSS";
+	}
+
+	return "Undefined";
+}
+
 int ast_accept(int sockfd, struct ast_sockaddr *addr)
 {
 	addr->len = sizeof(addr->ss);




More information about the asterisk-commits mailing list