<p>George Joseph <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/12769">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
Benjamin Keith Ford: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_rtp: Accept hostname as well as ip address as destination<br><br>The UnicastRTP channel driver provided by chan_rtp now accepts<br>"<hostname>:<port>" as an alternative to "<ip_address>:<port>"<br>in the destination. The first AAAA (preferred) or A record resolved<br>will be used as the destination. The lookup is synchronous so beware<br>of possible dialplan delays if you specify a hostname.<br><br>Change-Id: Ie6f95b983a8792bf0dacc64c7953a41032dba677<br>---<br>M channels/chan_rtp.c<br>A doc/CHANGES-staging/chan_rtp.txt<br>2 files changed, 24 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/channels/chan_rtp.c b/channels/chan_rtp.c</span><br><span>index 7d9e26d..d8f7324 100644</span><br><span>--- a/channels/chan_rtp.c</span><br><span>+++ b/channels/chan_rtp.c</span><br><span>@@ -43,6 +43,7 @@</span><br><span> #include "asterisk/causes.h"</span><br><span> #include "asterisk/format_cache.h"</span><br><span> #include "asterisk/multicast_rtp.h"</span><br><span style="color: hsl(120, 100%, 40%);">+#include "asterisk/dns_core.h"</span><br><span> </span><br><span> /* Forward declarations */</span><br><span> static struct ast_channel *multicast_rtp_request(const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause);</span><br><span>@@ -293,9 +294,23 @@</span><br><span> ast_log(LOG_ERROR, "Destination is required for the 'UnicastRTP' channel\n");</span><br><span> goto failure;</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> if (!ast_sockaddr_parse(&address, args.destination, PARSE_PORT_REQUIRE)) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_ERROR, "Destination '%s' could not be parsed\n", args.destination);</span><br><span style="color: hsl(0, 100%, 40%);">- goto failure;</span><br><span style="color: hsl(120, 100%, 40%);">+ int rc;</span><br><span style="color: hsl(120, 100%, 40%);">+ char *host;</span><br><span style="color: hsl(120, 100%, 40%);">+ char *port;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ rc = ast_sockaddr_split_hostport(args.destination, &host, &port, PARSE_PORT_REQUIRE);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!rc) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_log(LOG_ERROR, "Unable to parse destination '%s' into host and port\n", args.destination);</span><br><span style="color: hsl(120, 100%, 40%);">+ goto failure;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ rc = ast_dns_resolve_ipv6_and_ipv4(&address, host, port);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (rc != 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_log(LOG_ERROR, "Unable to resolve host '%s'\n", host);</span><br><span style="color: hsl(120, 100%, 40%);">+ goto failure;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> }</span><br><span> </span><br><span> if (!ast_strlen_zero(args.options)</span><br><span>diff --git a/doc/CHANGES-staging/chan_rtp.txt b/doc/CHANGES-staging/chan_rtp.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..ce908ee</span><br><span>--- /dev/null</span><br><span>+++ b/doc/CHANGES-staging/chan_rtp.txt</span><br><span>@@ -0,0 +1,7 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: chan_rtp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+The UnicastRTP channel driver provided by chan_rtp now accepts</span><br><span style="color: hsl(120, 100%, 40%);">+"<hostname>:<port>" as an alternative to "<ip_address>:<port>" in the destination.</span><br><span style="color: hsl(120, 100%, 40%);">+The first AAAA (preferred) or A record resolved will be used as the destination.</span><br><span style="color: hsl(120, 100%, 40%);">+The lookup is synchronous so beware of possible dialplan delays if you specify a</span><br><span style="color: hsl(120, 100%, 40%);">+hostname.</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/12769">change 12769</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/12769"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: Ie6f95b983a8792bf0dacc64c7953a41032dba677 </div>
<div style="display:none"> Gerrit-Change-Number: 12769 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>