I wouldn't do it like that...
I would let FreeSWITCH do what its good at and stop trying to create and manage sessions manually.
-- You can optionally answer but you need to set transfer_ringback instead of ringback.
session:setVariable("ringback", "local_stream://moh");
session:setVariable("ignore_early_media", "true");
session:execute("bridge","user/1007");
Which can also be expressed in pure XML as such:
<extension name="1234">
<condition field="destination_number" expression="^1234$">
<action application="set" data="ringback=local_stream://moh"/>
<action application="set" data="ignore_early_media=true"/>
<action application="bridge" data="user/1007"/>
</condition>
</extension>
There is really no need to do this with Lua. The XML dialplan can do some VERY complex things once you wrap your head around it.