Thanks, Richard - your code does indeed work reliably 100% of the time, and thank you for that explanation.
I do think the docs at https://wiki.asterisk.org/wiki/display/AST/Asterisk+14+Function_SHARED could do with more clarification. BTW, there were a couple of typos in your code, so for anyone who wants to copy/paste, here's Richard's code WITH the curly braces ( Set(SHARED(sharedVar,MY_CALLER) should be Set(SHARED(sharedVar,${MY_CALLER}) ) [svtest1] exten => s,1,Answer() same => n,Verbose(1,Answered channel:${CHANNEL}) same => n,Set(__MY_CALLER=${CHANNEL(name)}) same => n,Dial(Local/s@svtest2,,g) same => n,Verbose(1,***In channel:${CHANNEL} sharedVar:${SHARED(sharedVar)}) same => n,Hangup() [svtest2] exten => s,1,NoOp() same => n,Set(SHARED(sharedVar,${MY_CALLER})="I have been set in svtest2 by ${CHANNEL(name)}") same => n,Verbose(1,***In channel:${CHANNEL} sharedVar: ${SHARED(sharedVar,Local/s@svtest2)}) same => n,Answer() same => n,Hangup() Thanks again. (BTW, looking forward to the day when Asterisk gets some kind of asynchronous dialplan application - all this "dialling a local channel" is just to get via music on hold so there's not silence while a long operation happening, as per http://lists.digium.com/pipermail/asterisk-users/2016-November/290384.html :) ) On 27 November 2016 at 16:16, Richard Mudgett <[email protected]> wrote: > [svtest1] > exten = s,1,NoOp() > same = n,Answer() > same = n,Set(__MY_CALLER=${CHANNEL(name)}) > same = n,Dial(Local/s@svtest2,,g) > same = n,NoOp(Returned SHARED(sharedVar) = '${SHARED(sharedVar)'} > same = n,Hangup() > > [svtest2] > exten = s,1,NoOp() > exten = n,Set(SHARED(sharedVar,MY_CALLER)="I have been set in svtest2 by > ${CHANNEL(name)}") > exten = n,Answer() > exten = n,Hangup() -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
