<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Patch Set 12: Code-Review-1</p><p style="white-space: pre-wrap; word-wrap: break-word;">(1 comment)</p><p style="white-space: pre-wrap; word-wrap: break-word;">Is UUID absolutely required?  Could you just use the unique channel id, whether auto-generated or provided in an ARI call?   If so, then chan_audiosocket could easily plug into the new externalMedia thing with encapsulation "audiosocket" and transport "tcp". with no other changes to your code.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">Would it be sufficient to use something like UUIDv5, which creates a UUID from the SHA-1 hash of a namespace and name?  That could be deterministic so long as there is an agreed namespace UUID (arbitrary generated UUID for "Asterisk" perhaps?).</p><p style="white-space: pre-wrap; word-wrap: break-word;">This would supply a means by which we could use the unique channel ID but still conform to the existing AudioSocket protocol specification.<br></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11579">View Change</a></p><p>18 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/11579/10/apps/app_audiosocket.c">File apps/app_audiosocket.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/10/apps/app_audiosocket.c@30">Patch Set #10, Line 30:</a> <code style="font-family:monospace,monospace">       <support_level>core</support_level></code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Done</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/10/apps/app_audiosocket.c@75">Patch Set #10, Line 75:</a> <code style="font-family:monospace,monospace">static int audiosocket_exec(struct ast_channel *chan, const char *data);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Done</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/10/apps/app_audiosocket.c@85">Patch Set #10, Line 85:</a> <code style="font-family:monospace,monospace">    );</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Done</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/10/apps/app_audiosocket.c@102">Patch Set #10, Line 102:</a> <code style="font-family:monospace,monospace">          ast_log(LOG_ERROR, "failed to connect to AudioSocket\n");</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Done</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/10/apps/app_audiosocket.c@113">Patch Set #10, Line 113:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><br>       if (ast_set_write_format(chan, ast_format_slin)) {<br>            ast_log(LOG_ERROR, "Failed to set write format to SLINEAR\n");<br>              return 1;<br>     }<br>     if (ast_set_read_format(chan, ast_format_slin)) {<br>             ast_log(LOG_ERROR, "Failed to set read format to SLINEAR\n");<br>               return 1;<br>     }<br></pre></blockquote></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Done</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/10/apps/app_audiosocket.c@131">Patch Set #10, Line 131:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">       if (ast_channel_state(chan) != AST_STATE_UP) {<br>                        return 0;<br>             }<br></pre></blockquote></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Done</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/10/apps/app_audiosocket.c@137">Patch Set #10, Line 137:</a> <code style="font-family:monospace,monospace">                    ast_log(LOG_WARNING, "No frame received\n");</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Done</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/10/apps/app_audiosocket.c@141">Patch Set #10, Line 141:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">      f->delivery.tv_sec = 0;<br>            f->delivery.tv_usec = 0;<br></pre></blockquote></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Done</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/10/apps/app_audiosocket.c@156">Patch Set #10, Line 156:</a> <code style="font-family:monospace,monospace">          if (!(f = ast_audiosocket_receive_frame(svc))) {</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Within this function you are not freeing the frame returned by ast_audiosocket_receive_frame. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/10/apps/app_audiosocket.c@183">Patch Set #10, Line 183:</a> <code style="font-family:monospace,monospace">    .support_level = AST_MODULE_SUPPORT_CORE,</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Done</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/11579/10/channels/chan_audiosocket.c">File channels/chan_audiosocket.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/10/channels/chan_audiosocket.c@136">Patch Set #10, Line 136:</a> <code style="font-family:monospace,monospace"> struct audiosocket_instance *instance;</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">At line 172 you allocate this structure. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/10/channels/chan_audiosocket.c@260">Patch Set #10, Line 260:</a> <code style="font-family:monospace,monospace">    .support_level = AST_MODULE_SUPPORT_CORE,</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Done</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/11579/10/res/res_audiosocket.c">File res/res_audiosocket.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/10/res/res_audiosocket.c@55">Patch Set #10, Line 55:</a> <code style="font-family:monospace,monospace"></code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Nice; I didn't know about autoservice.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/10/res/res_audiosocket.c@106">Patch Set #10, Line 106:</a> <code style="font-family:monospace,monospace"> * \brief Handle the connection that was started by launch_netscript.</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Done</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/10/res/res_audiosocket.c@174">Patch Set #10, Line 174:</a> <code style="font-family:monospace,monospace">        usleep(100);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Done</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Leftover from debugging</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/10/res/res_audiosocket.c@196">Patch Set #10, Line 196:</a> <code style="font-family:monospace,monospace">   if (!(buf = ast_malloc(3 + f->datalen))) {</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Done</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Whatever solution I had to this before was lost, but it seems like variable length stack-allocated arrays are a contentious subject.  Is there another way which I am missing?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/10/res/res_audiosocket.c@307">Patch Set #10, Line 307:</a> <code style="font-family:monospace,monospace">   return &f;</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Done</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/11579/12/res/res_audiosocket.c">File res/res_audiosocket.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/12/res/res_audiosocket.c@62">Patch Set #12, Line 62:</a> <code style="font-family:monospace,monospace">           ast_sockaddr_resolve(&addrs, server, PARSE_PORT_REQUIRE, AST_AF_UNSPEC))) {</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">You may want to use the new ast_dns_resolve_ipv6_and_ipv4 API I just created. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">The only problem with ast_dns_resolve_ipv6_and_ipv4 is that it only returns the first AAAA or A record.  I need a way to walk through all the options so that if one host is unavailable, I can failover to the next in the DNS set.  This is necessary if I have no loadbalancer in place.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11579">change 11579</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/+/11579"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ie866e6c4fa13178ec76f2a6971ad3590a3a588b5 </div>
<div style="display:none"> Gerrit-Change-Number: 11579 </div>
<div style="display:none"> Gerrit-PatchSet: 13 </div>
<div style="display:none"> Gerrit-Owner: Seán C. McCord <ulexus@gmail.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-Reviewer: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Seán C. McCord <ulexus@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Sun, 22 Sep 2019 18:48:32 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Comment-In-Reply-To: Seán C. McCord <ulexus@gmail.com> </div>
<div style="display:none"> Comment-In-Reply-To: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>