mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-18 15:49:56 +00:00
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/11@413876 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -21163,6 +21163,24 @@ static char *complete_sip_notify(const char *line, const char *word, int pos, in
|
|||||||
return NULL;
|
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 */
|
/*! \brief Show details of one active dialog */
|
||||||
static char *sip_show_channel(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
|
static char *sip_show_channel(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
|
||||||
{
|
{
|
||||||
@@ -21282,6 +21300,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");
|
ast_cli(a->fd, "\n\n");
|
||||||
|
|
||||||
found++;
|
found++;
|
||||||
|
|||||||
Reference in New Issue
Block a user