Sorry if I wasted anyone's time. I've answered my own question. To set the variable on the A-leg of a call originated by a Lua script I put the variable here:<div><br></div><div><div> local session = freeswitch.Session("{my_variable='" .. myVariable .. "'}user/<a href="mailto:1001@stuff.com" target="_blank">1001@stuff.com</a>")</div>
<div> if session:hangupCause() == "SUCCESS" then</div><div> session:transfer("ext_in_mycontext", "XML", "mycontext")</div><div><br></div><br><div class="gmail_quote">On Mon, Mar 21, 2011 at 2:59 PM, elijah <span dir="ltr"><<a href="mailto:elijah@crankenstein.com">elijah@crankenstein.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Actually, I think the behavior I'm seeing is that I'm not able to retrieve these variables on the A-leg, but they are present on the B-leg. How should I insert custom channel variables into the A-leg of a call originated from Lua, so that they appear in the CALL_HANGUP_COMPLETE event on this first leg?<div>
<div></div><div class="h5"><div>
<br></div><div><br><div class="gmail_quote">On Mon, Mar 21, 2011 at 11:50 AM, elijah <span dir="ltr"><<a href="mailto:elijah@crankenstein.com" target="_blank">elijah@crankenstein.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>In a Lua script I instantiate a new call leg and (attempt to) insert a new channel variable:</div><br><div> local session = freeswitch.Session("user/<a href="mailto:1001@stuff.com" target="_blank">1001@stuff.com</a>")</div>
<div> if session:hangupCause() == "SUCCESS" then</div><div> session:execute("export", "my_variable=" .. myVariable)</div><div> session:transfer("ext_in_mycontext", "XML", "mycontext")</div>
<div><br></div><div>However, I am not able to retrieve my custom channel variable later. This call leg is established correctly but there is no point in this call leg's life where I can seem to find my variable. Is there another method by which I should try to insert a channel variable in a newly created call leg?</div>
<div><br></div><div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>