That's because the second legs Lua is running in the first legs session thread. So it can't hang up yet.On Fri, Feb 26, 2021 at 3:40 PM Тимур Ситдиков <sitdikovt@gmail.com> wrote:Hi Brian!Yes, B hangs up right after pick up. Also there's an error about non available channels in console._________________________________________________________________________сб, 27 февр. 2021 г., 02:07 Brian West <brian@freeswitch.com>:Tim,Based on your description, I would guess that the B-Leg hangs up when they answer after the a-leg is gone??/bOn Fri, Feb 26, 2021 at 12:42 PM Тимур Ситдиков <sitdikovt@gmail.com> wrote:Hi all. Need help with a simple call script._________________________________________________________________________
I'm got this in dialplan<extension name="call_lua_home"><condition field="destination_number" expression="^(1007)$"><!-- <action application="set" data="session_in_hangup_hook=true"/> --> For hangup hook try<action application="lua" data="fork.lua"/></condition></extension>And this in fork.luaif session:ready() thenapi = freeswitch.API()contact = api:execute("sofia_contact", "*/1007@compA.com");caller = session:getVariable("caller_id_number");session1 = freeswitch.Session("{origination_caller_id_name="..caller.."}[leg_timeout=30]"..contact.."");-- session:setHangupHook("HangupHook");if session1:ready() thenfreeswitch.bridge(session, session1);endfreeswitch.consoleLog("WARNING","=====SCRIPT END\n");session:hangup()endWhen Caller is hanging up before B-leg answers - Bleg is continuing to ring. There are still 2 channels in 'show channels' after A-leg hangs up.
I want to drop B-leg when A-leg hangs up. Is it possible?UPD Tried to use hangup hook. It works with stramFile, but no luck with session.function HangupHook(s, status)freeswitch.consoleLog("WARNING","Event fired breaking out\n");return exit;-- return die;endsession:answer();session:setHangupHook("HangupHook");while (session:ready() == true) dosession:streamFile("/usr/share/freeswitch/sounds/en/us/callie/ivr/16000/ivr-on_hold_indefinitely.wav");-- session1 = freeswitch.Session("{origination_caller_id_name="..caller.."}[leg_timeout=30]"..contact.."");endfreeswitch.consoleLog("WARNING","=====SCRIPT END\n");session:hangup()endCan anyone help me with this?Thanks! Regards,Tim
The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.
Join our online community to chat in real time https://signalwire.community
Professional FreeSWITCH Services
sales@freeswitch.com
https://freeswitch.com
Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com--_________________________________________________________________________Brian West | Co-founder and Developer
Need Commercial support? email sales@freeswitch.com
FreeSWITCH Solutions | 17345 Civic Drive #2531 Brookfield, WI 53045
Email: brian@freeswitch.com
Mobile: 918-424-9378
Website: https://www.FreeSWITCH.com
The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.
Join our online community to chat in real time https://signalwire.community
Professional FreeSWITCH Services
sales@freeswitch.com
https://freeswitch.com
Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com
The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.
Join our online community to chat in real time https://signalwire.community
Professional FreeSWITCH Services
sales@freeswitch.com
https://freeswitch.com
Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com--_________________________________________________________________________Brian West | Co-founder and Developer
Need Commercial support? email sales@freeswitch.com
FreeSWITCH Solutions | 17345 Civic Drive #2531 Brookfield, WI 53045
Email: brian@freeswitch.com
Mobile: 918-424-9378
Website: https://www.FreeSWITCH.com
The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.
Join our online community to chat in real time https://signalwire.community
Professional FreeSWITCH Services
sales@freeswitch.com
https://freeswitch.com
Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com