<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>I wouldn't do it like that...</div><div><br></div><div>I would let FreeSWITCH do what its good at and stop trying to create and manage sessions manually.</div><div><br></div><div><div>-- You can optionally answer but you need to set transfer_ringback instead of ringback.</div><div>session:setVariable("ringback", "local_stream://moh"); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>session:setVariable("ignore_early_media", "true"); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>session:execute("bridge","user/1007"); &nbsp;</div><div><br></div><div>Which can also be expressed in pure XML as such:</div><div><br></div><div><div>&lt;extension name="1234"&gt;</div><div>&nbsp;&nbsp;&lt;condition field="destination_number" expression="^1234$"&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp;&lt;action application="set" data="ringback=local_stream://moh"/&gt;</div><div>&nbsp;&nbsp; &nbsp;&lt;action application="set" data="ignore_early_media=true"/&gt;</div><div>&nbsp;&nbsp; &nbsp;&lt;action application="bridge" data="user/1007"/&gt;</div><div>&nbsp;&nbsp;&lt;/condition&gt;</div><div>&lt;/extension&gt;</div><div><br></div><div>There is really no need to do this with Lua. &nbsp;The XML dialplan can do some VERY complex things once you wrap your head around it.</div><div><br></div><div>In addition I would recommend you get the latest 1.0.5 build&nbsp;<a href="http://files-sync.freeswitch.org/windows_installer/">http://files-sync.freeswitch.org/windows_installer/</a> &nbsp;Its tagged as 1.0.4 and shouldn't be.</div><div><br></div></div></div><div>/b</div><div><br></div><div><br></div><div><br><div><div>On Feb 4, 2010, at 8:48 PM, Adam Wilt wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi all,<div><br></div><div>I want to park an inbound call and play hold music while I simultaneously place another outbound call.<div>But the hold music doesn't play while the lua script is placing the second call. When the lua script ends, the hold music finally starts.&nbsp;</div><div>Here's my example code:</div><div><br></div></div><blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><div><div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><font class="Apple-style-span" color="#000099">#!/usr/local/bin/lua</font></span></div></div></div><div><div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><font class="Apple-style-span" color="#000099">&nbsp;&nbsp;&nbsp;</font></span></div></div></div><div><div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><font class="Apple-style-span" color="#000099">session:answer()</font></span></div></div></div><div><div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><font class="Apple-style-span" color="#000099">api = freeswitch.API()</font></span></div></div></div><div><div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><font class="Apple-style-span" color="#000099">api:executeString("bgapi uuid_park " .. tostring(session.uuid))</font></span></div></div></div><div><div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><font class="Apple-style-span" color="#000099">api:executeString("bgapi uuid_broadcast " .. tostring(session.uuid) &nbsp;.. " /freeswitch/sounds/music/8000/danza-espanola-op-37-h-142-xii-arabesca.wav")</font></span></div></div></div><div><div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><font class="Apple-style-span" color="#000099">local new_session = freeswitch.Session("sofia/gateway/myprovider/15555555555")</font></span></div></div></div></blockquote><div><div><div><br></div><div>So it seems like the script is blocking the original session, despite the fact that I'm using bgapi. &nbsp;I'd really appreciate if somebody could help me with this.</div><div><br></div><div>By the way, I'm using FreeSWITCH 1.0.4 in Windows.</div><div><br></div><div>Thanks,</div><div>Adam</div></div></div></blockquote></div><br></div></body></html>