]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Backport Asterisk 11 r413876 to 1.8
authorJonathan Rose <jrose@digium.com>
Fri, 23 May 2014 16:06:57 +0000 (16:06 +0000)
committerJonathan Rose <jrose@digium.com>
Fri, 23 May 2014 16:06:57 +0000 (16:06 +0000)
........
r413876 | jrose | 2014-05-13 12:40:00 -0500 (Tue, 13 May 2014) | 6 lines

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/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@414488 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 5a4590128e8440532e4cecd33b251616623c31d4..4e16f5015e37faf242737a9fa39ae0ba7fdeca5b 100644 (file)
@@ -19339,6 +19339,20 @@ static char *complete_sipnotify(const char *line, const char *word, int pos, int
        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";
+       }
+
+       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)
 {
@@ -19440,6 +19454,10 @@ static char *sip_show_channel(struct ast_cli_entry *e, int cmd, struct ast_cli_a
                                }
                        }
 
+                       /* 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");
 
                        found++;