<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 27, 2016 at 11:13 AM, Jonathan H <span dir="ltr"><<a href="mailto:lardconcepts@gmail.com" target="_blank">lardconcepts@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thanks, Richard - your code does indeed work reliably 100% of the<br>
time, and thank you for that explanation.<br>
<br>
I do think the docs at<br>
<a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+14+Function_SHARED" rel="noreferrer" target="_blank">https://wiki.asterisk.org/<wbr>wiki/display/AST/Asterisk+14+<wbr>Function_SHARED</a><br>
could do with more clarification.<br>
<br>
BTW, there were a couple of typos in your code, so for anyone who<br>
wants to copy/paste, here's Richard's code WITH the curly braces  (<br>
Set(SHARED(sharedVar,MY_<wbr>CALLER) should be<br>
Set(SHARED(sharedVar,${MY_<wbr>CALLER}) )<br>
<span class="gmail-"><br>
[svtest1]<br>
exten => s,1,Answer()<br>
    same => n,Verbose(1,Answered channel:${CHANNEL})<br>
</span>    same => n,Set(__MY_CALLER=${CHANNEL(<wbr>name)})<br>
    same => n,Dial(Local/s@svtest2,,g)<br>
    same => n,Verbose(1,***In channel:${CHANNEL} sharedVar:${SHARED(sharedVar)}<wbr>)<br>
<span class="gmail-">    same => n,Hangup()<br>
<br>
[svtest2]<br>
exten => s,1,NoOp()<br>
</span>    same => n,Set(SHARED(sharedVar,${MY_<wbr>CALLER})="I have been set in<br>
<span class="gmail-">svtest2 by ${CHANNEL(name)}")<br>
</span><span class="gmail-">    same => n,Verbose(1,***In channel:${CHANNEL} sharedVar:<br>
${SHARED(sharedVar,Local/s@<wbr>svtest2)})<br>
    same => n,Answer()<br>
    same => n,Hangup()<br>
<br>
</span>Thanks again.<br>
<br>
(BTW, looking forward to the day when Asterisk gets some kind of<br>
asynchronous dialplan application - all this "dialling a local<br>
channel" is just to get via music on hold so there's not silence while<br>
a long operation happening, as per<br>
<a href="http://lists.digium.com/pipermail/asterisk-users/2016-November/290384.html" rel="noreferrer" target="_blank">http://lists.digium.com/<wbr>pipermail/asterisk-users/2016-<wbr>November/290384.html</a><br>
:) )<br></blockquote><div><br></div><div>Have you looked into ARI [1]?  I think it would be a closer fit to what you want<br></div><div>to do.<br></div><div><br></div><div>Richard<br></div></div><br>[1] <a href="https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=29395573">https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=29395573</a><br></div></div>