<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/3474/">https://reviewboard.asterisk.org/r/3474/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On April 24th, 2014, 2:31 a.m. CDT, <b>Olle E Johansson</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://reviewboard.asterisk.org/r/3474/diff/1/?file=57790#file57790line21286" style="color: black; font-weight: bold; text-decoration: underline;">/branches/11/channels/chan_sip.c</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">static char *sip_show_channel(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">21286</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="tb"> </span><span class="tb"> </span>ast_cli(a->fd, " Signaling: %s\n", cur->socket.type == SIP_TRANSPORT_TLS ? "TLS" : "non-TLS");</pre></td>
</tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">If the header is just "signalling" we should also list other transports than TLS - UDP, TCP, WS, WSS. "non-TLS" is not a good solution :-)</pre>
</blockquote>
<p>On April 24th, 2014, 10:14 a.m. CDT, <b>Patrick Laimbock</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Oej: thank you for your comment. I totally agree. The reason for TLS or non-TLS is my very limited C foo. I did some digging and came up with the patch below which seems to work (tested UDP/TLS,RTP/SRTP). Is that more like it?
diff -uNr asterisk-11.9.0.org/channels/chan_sip.c asterisk-11.9.0/channels/chan_sip.c
--- asterisk-11.9.0.org/channels/chan_sip.c 2014-04-21 22:56:05.000000000 +0200
+++ asterisk-11.9.0/channels/chan_sip.c 2014-04-24 16:14:05.116999990 +0200
@@ -21294,6 +21294,24 @@
}
}
+ /* add transport and media types */
+ char *transport_type;
+ if (cur->socket.type == SIP_TRANSPORT_TLS) {
+ transport_type = "TLS";
+ } else if (cur->socket.type == SIP_TRANSPORT_UDP) {
+ transport_type = "UDP";
+ } else if (cur->socket.type == SIP_TRANSPORT_TCP) {
+ transport_type = "TCP";
+ } else if (cur->socket.type == SIP_TRANSPORT_WS) {
+ transport_type = "WS";
+ } else if (cur->socket.type == SIP_TRANSPORT_WSS) {
+ transport_type = "WSS";
+ } else
+ transport_type = "Unknown";
+
+ ast_cli(a->fd, " Transport: %s\n", transport_type);
+ ast_cli(a->fd, " Media: %s\n", cur->srtp ? "SRTP" : "RTP");
+
ast_cli(a->fd, "\n\n");
found++;</pre>
</blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">As an addition to an existing CLI command, I have no issue with this going into all branches. There's no reasonable risk of this negatively impacting users, and given recent SSL issues, it has an obvious benefit.</pre>
<br />
<p>- Matt</p>
<br />
<p>On April 24th, 2014, 12:33 p.m. CDT, Patrick Laimbock wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By Patrick Laimbock.</div>
<p style="color: grey;"><i>Updated April 24, 2014, 12:33 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="https://issues.asterisk.org/jira/browse/ASTERISK-23564">ASTERISK-23564</a>
</div>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">AFAICT there is no way to see from the CLI if TLS and SRTP are enabled for a channel. I asked on the ML and in #asterisk but received no answer other than that nobody knew how to get that info from the CLI. This patch shows TLS or non-TLS and SRTP or RTP.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Testing was done on Asterisk-11.8.1 with TLS & RPT, TLS & SRTP, non-TLS & RPT configured and a Nexus GSM using Linphone with similar configs. AFAICT the status of the channel and media was correctly reported for each scenario.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/branches/11/channels/chan_sip.c <span style="color: grey">(412921)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/3474/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>