<div dir="ltr"><div>the scenario is Alice calls Bob and Alice hangs up before Bob answers the call,<br></div><div>while using the default dialplan as</div><div><action application="bridge" data="user/${dialed_extension}@${domain_name}" /></div>
<div>Bob instantly goes hangup after Alice hung up,</div><div><br></div><div>but after change the dialplan to have a lua script process the bridging, as</div><div><action application="lua" data="bridge.lua $1" /> // $1 is the destination_number</div>
<div>Bob will still be ringing for quite a long time, the bridge.lua is simple:</div><div><br></div><div>dest = argv[1]</div><div><br></div><div>session:execute("set", "hangup_after_bridge=true");</div>
<div>dial_string = string.format('user/%s', dest)</div><div>sessionB = freeswitch.Session(dial_string)</div><div><br></div><div>if sessionB:ready() then</div><div><span class="" style="white-space:pre">        </span>freeswitch.bridge(session, sessionB);</div>
<div>else</div><div><span class="" style="white-space:pre">        </span>freeswitch.consoleLog("info", "---session NOT ready \n ")</div><div><span class="" style="white-space:pre">        </span>-- ORININATOR_CANCEL can be checked here though omitted for simplicity</div>
<div><span class="" style="white-space:pre">        </span>session:hangup();</div><div>end</div><div><br></div><div>why the bridge.lua is not able to respond to ORININATOR_CANCEL after Alice hangs up?</div><div><br></div></div>