<div>Hi All,</div><div><br></div><div>I recently implemented "missed call" functionality into my lua app: an inbound call comes in, I check the DB if it should be a "missed call". If so, the call is terminated and the caller is called back through an outbound call. This is useful in places like India where people are charged for outbound calls only.</div>
<div><br></div><div>Thanks to help from folks on FS IRC, I implemented like so:</div><div><ol><li>script1.lua takes the inbound call</li><li>If missed call is to be made, invoke script2.lua (passing script1's uuid) through a bgapi call, and let script1.lua terminate</li>
<li>in script2.lua, uuid_kill the session from script1.lua, and make an outbound call to the original caller</li></ol><div>Two questions:</div></div><div><ol><li>Are there any problems with this implementation from correctness and performance standpoints?</li>
<li>I am using this app over a TDM (PRI) connection. During very heavy load, there is a race condition: after killing the original session but before initiating the new outbound call in script2, the available channel could be grabbed. Is there any way to fix or mitigate this race?</li>
</ol><div>Thanks,</div></div><div>Neil</div>