[asterisk-bugs] [JIRA] (ASTERISK-27833) cmd Bridge will exit immediately if MixMonitor is not used
Frederic Steinfels (JIRA)
noreply at issues.asterisk.org
Sat May 12 14:18:56 CDT 2018
[ https://issues.asterisk.org/jira/browse/ASTERISK-27833?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=243382#comment-243382 ]
Frederic Steinfels edited comment on ASTERISK-27833 at 5/12/18 2:18 PM:
------------------------------------------------------------------------
Thanks to various feedback, I have decided to take the time to strip my example down. This second example does not verify "h" extension functionality but I assume you can easily test this. I think you can also experiment with the "beep" sample as described in my initial report.
Please also make sure you have the branch with the "a" flag in the originate command. This was added on my request. However the sample should also work without the "a" flag but I have not tested what will happen.
Dialing through local channel, not using mixmonitor. Both channels are executing the hangup handlers immediately an answer of child channel when they should not.
{noformat}
== Setting global variable 'SIPDOMAIN' to '192.168.99.10'
-- Executing [64 at internal:1] Set("PJSIP/28-00000012", "CALLEDNUM=64") in new stack
-- Executing [64 at internal:2] Dial("PJSIP/28-00000012", "Local/64 at default,300,gr") in new stack
-- Called Local/64 at default
-- Executing [64 at default:1] Goto("Local/64 at default-00000030;2", "astbugtest,s,1") in new stack
-- Goto (astbugtest,s,1)
-- Executing [s at astbugtest:1] Set("Local/64 at default-00000030;2", "CHANNEL(hangup_handler_push)=astbugtestparenthanguphandler,s,1") in new stack
-- Executing [s at astbugtest:2] Set("Local/64 at default-00000030;2", "ORIGINATECHANNELS=Local/29 at default") in new stack
-- Executing [s at astbugtest:3] Originate("Local/64 at default-00000030;2", "Local/29 at default,exten,astbugchildchanneltest,s,1,3600,ab(astbugtest,new,1(Local/64 at default-00000030;2))") in new stack
-- Local/29 at default-00000031;1 Internal Gosub(astbugtest,new,1(Local/64 at default-00000030;2)) start
-- Executing [new at astbugtest:1] Set("Local/29 at default-00000031;1", "PARENTCHANNEL=Local/64 at default-00000030;2") in new stack
[May 12 21:01:28] NOTICE[21838][C-00000006]: app_stack.c:1080 gosub_run: Local/29 at default-00000031;1 Abnormal 'Gosub(astbugtest,new,1(Local/64 at default-00000030;2))' exit. Popping routine return locations.
-- Called 29 at default
-- Executing [29 at default:1] Gosub("Local/29 at default-00000031;2", "local-sip-call,s,1(29,mobile)") in new stack
-- Executing [s at local-sip-call:1] Set("Local/29 at default-00000031;2", "CALLEDNUM=29") in new stack
-- Executing [s at local-sip-call:2] ChanIsAvail("Local/29 at default-00000031;2", "PJSIP/mobile,s") in new stack
-- Executing [s at astbugtest:4] Wait("Local/64 at default-00000030;2", "3600") in new stack
-- Executing [s at local-sip-call:3] NoOp("Local/29 at default-00000031;2", "1 0") in new stack
-- Executing [s at local-sip-call:4] GotoIf("Local/29 at default-00000031;2", "0?11:5") in new stack
-- Goto (local-sip-call,s,5)
-- Executing [s at local-sip-call:5] GotoIf("Local/29 at default-00000031;2", "0?11:6") in new stack
-- Goto (local-sip-call,s,6)
-- Executing [s at local-sip-call:6] GotoIf("Local/29 at default-00000031;2", "1?11:7") in new stack
-- Goto (local-sip-call,s,11)
-- Executing [s at local-sip-call:11] Dial("Local/29 at default-00000031;2", "PJSIP/mobile") in new stack
-- Called PJSIP/mobile
-- PJSIP/mobile-00000014 is ringing
-- Local/29 at default-00000031;1 is ringing
-- PJSIP/mobile-00000014 answered Local/29 at default-00000031;2
-- Local/29 at default-00000031;1 answered
-- Executing [s at astbugchildchanneltest:1] Set("Local/29 at default-00000031;1", "CHANNEL(hangup_handler_push)=astbugtestchildhanguphandler,s,1") in new stack
-- Channel PJSIP/mobile-00000014 joined 'simple_bridge' basic-bridge <000e21c1-05e1-4fa4-8046-afcfac638ef8>
-- Channel Local/29 at default-00000031;2 joined 'simple_bridge' basic-bridge <000e21c1-05e1-4fa4-8046-afcfac638ef8>
-- Executing [s at astbugchildchanneltest:2] Set("Local/29 at default-00000031;1", "SHARED(connecttochannel,Local/64 at default-00000030;2)=Local/29 at default-00000031;1") in new stack
-- Executing [s at astbugchildchanneltest:3] ChannelRedirect("Local/29 at default-00000031;1", "Local/64 at default-00000030;2,astbugtest,s,1000") in new stack
== Spawn extension (astbugtest, s, 1000) exited non-zero on 'Local/64 at default-00000030;2'
-- Executing [s at astbugtest:1000] NoOp("Local/64 at default-00000030;2", "Child channel has redirected me") in new stack
-- Executing [s at astbugchildchanneltest:4] Wait("Local/29 at default-00000031;1", "1000") in new stack
-- Executing [s at astbugtest:1001] Playback("Local/64 at default-00000030;2", "beep") in new stack
-- Local/64 at default-00000030;1 answered PJSIP/28-00000012
-- Channel Local/64 at default-00000030;1 joined 'simple_bridge' basic-bridge <ab2a194c-e6f3-4909-a7bb-f77a88f8e37a>
-- Channel PJSIP/28-00000012 joined 'simple_bridge' basic-bridge <ab2a194c-e6f3-4909-a7bb-f77a88f8e37a>
-- <Local/64 at default-00000030;2> Playing 'beep.gsm' (language 'en')
-- Executing [s at astbugtest:1002] NoOp("Local/64 at default-00000030;2", "") in new stack
-- Executing [s at astbugtest:1003] Bridge("Local/64 at default-00000030;2", "Local/29 at default-00000031;1,p") in new stack
== Spawn extension (astbugchildchanneltest, s, 4) exited non-zero on 'Surrogate/Local/29 at default-00000031;1'
-- Channel Local/29 at default-00000031;1 joined 'simple_bridge' basic-bridge <ad5ea4aa-8223-414a-aa3d-80b8038e895d>
-- Channel Local/64 at default-00000030;2 joined 'simple_bridge' basic-bridge <ad5ea4aa-8223-414a-aa3d-80b8038e895d>
-- <Local/29 at default-00000031;1> Playing 'beep.gsm' (language 'en')
> Move-swap optimizing Local/64 at default-00000030;2 <-- PJSIP/28-00000012.
-- Channel PJSIP/28-00000012 left 'simple_bridge' basic-bridge <ab2a194c-e6f3-4909-a7bb-f77a88f8e37a>
-- Channel Local/64 at default-00000030;2 left 'simple_bridge' basic-bridge <ad5ea4aa-8223-414a-aa3d-80b8038e895d>
-- Channel PJSIP/28-00000012 swapped with Local/64 at default-00000030;2 into 'simple_bridge' basic-bridge <ad5ea4aa-8223-414a-aa3d-80b8038e895d>
-- Channel Local/64 at default-00000030;1 left 'simple_bridge' basic-bridge <ab2a194c-e6f3-4909-a7bb-f77a88f8e37a>
-- Executing [s at astbugtest:1004] Wait("Local/64 at default-00000030;2", "5") in new stack
== Spawn extension (astbugtest, s, 1004) exited non-zero on 'Local/64 at default-00000030;2'
-- Local/64 at default-00000030;2 Internal Gosub(astbugtestparenthanguphandler,s,1) start
-- Executing [s at astbugtestparenthanguphandler:1] NoOp("Local/64 at default-00000030;2", "============== Parent channel hung up") in new stack
-- Executing [s at astbugtestparenthanguphandler:2] Return("Local/64 at default-00000030;2", "") in new stack
== Spawn extension (astbugtest, s, 1004) exited non-zero on 'Local/64 at default-00000030;2'
-- Local/64 at default-00000030;2 Internal Gosub(astbugtestparenthanguphandler,s,1) complete GOSUB_RETVAL=
> Move-swap optimizing Local/29 at default-00000031;1 <-- PJSIP/mobile-00000014.
-- Channel PJSIP/mobile-00000014 left 'simple_bridge' basic-bridge <000e21c1-05e1-4fa4-8046-afcfac638ef8>
-- Channel Local/29 at default-00000031;1 left 'simple_bridge' basic-bridge <ad5ea4aa-8223-414a-aa3d-80b8038e895d>
-- Channel PJSIP/mobile-00000014 swapped with Local/29 at default-00000031;1 into 'simple_bridge' basic-bridge <ad5ea4aa-8223-414a-aa3d-80b8038e895d>
> Bridge ad5ea4aa-8223-414a-aa3d-80b8038e895d: switching from simple_bridge technology to native_rtp
> Remotely bridged 'PJSIP/mobile-00000014' and 'PJSIP/28-00000012' - media will flow directly between them
-- Channel Local/29 at default-00000031;2 left 'simple_bridge' basic-bridge <000e21c1-05e1-4fa4-8046-afcfac638ef8>
== Spawn extension (local-sip-call, s, 11) exited non-zero on 'Local/29 at default-00000031;2'
-- Local/29 at default-00000031;1 Internal Gosub(astbugtestchildhanguphandler,s,1) start
-- Executing [s at astbugtestchildhanguphandler:1] NoOp("Local/29 at default-00000031;1", "============== Child channel hung up") in new stack
-- Executing [s at astbugtestchildhanguphandler:2] Return("Local/29 at default-00000031;1", "") in new stack
== Spawn extension (astbugchildchanneltest, s, 5) exited non-zero on 'Local/29 at default-00000031;1'
-- Local/29 at default-00000031;1 Internal Gosub(astbugtestchildhanguphandler,s,1) complete GOSUB_RETVAL=
{noformat}
With mixmonitor, child hangup handler is being executed on answer when it should not. Parent hangup handler is not executed which is correct.
{noformat}
== Setting global variable 'SIPDOMAIN' to '192.168.99.10'
-- Executing [64 at internal:1] Set("PJSIP/28-00000015", "CALLEDNUM=64") in new stack
-- Executing [64 at internal:2] Dial("PJSIP/28-00000015", "Local/64 at default,300,gr") in new stack
-- Called Local/64 at default
-- Executing [64 at default:1] Goto("Local/64 at default-00000032;2", "astbugtest,s,1") in new stack
-- Goto (astbugtest,s,1)
-- Executing [s at astbugtest:1] Set("Local/64 at default-00000032;2", "CHANNEL(hangup_handler_push)=astbugtestparenthanguphandler,s,1") in new stack
-- Executing [s at astbugtest:2] Set("Local/64 at default-00000032;2", "ORIGINATECHANNELS=Local/29 at default") in new stack
-- Executing [s at astbugtest:3] Originate("Local/64 at default-00000032;2", "Local/29 at default,exten,astbugchildchanneltest,s,1,3600,ab(astbugtest,new,1(Local/64 at default-00000032;2))") in new stack
-- Local/29 at default-00000033;1 Internal Gosub(astbugtest,new,1(Local/64 at default-00000032;2)) start
-- Executing [new at astbugtest:1] Set("Local/29 at default-00000033;1", "PARENTCHANNEL=Local/64 at default-00000032;2") in new stack
[May 12 21:07:47] NOTICE[26818][C-00000007]: app_stack.c:1080 gosub_run: Local/29 at default-00000033;1 Abnormal 'Gosub(astbugtest,new,1(Local/64 at default-00000032;2))' exit. Popping routine return locations.
-- Called 29 at default
-- Executing [29 at default:1] Gosub("Local/29 at default-00000033;2", "local-sip-call,s,1(29,mobile)") in new stack
-- Executing [s at local-sip-call:1] Set("Local/29 at default-00000033;2", "CALLEDNUM=29") in new stack
-- Executing [s at local-sip-call:2] ChanIsAvail("Local/29 at default-00000033;2", "PJSIP/mobile,s") in new stack
-- Executing [s at astbugtest:4] Wait("Local/64 at default-00000032;2", "3600") in new stack
-- Executing [s at local-sip-call:3] NoOp("Local/29 at default-00000033;2", "1 0") in new stack
-- Executing [s at local-sip-call:4] GotoIf("Local/29 at default-00000033;2", "0?11:5") in new stack
-- Goto (local-sip-call,s,5)
-- Executing [s at local-sip-call:5] GotoIf("Local/29 at default-00000033;2", "0?11:6") in new stack
-- Goto (local-sip-call,s,6)
-- Executing [s at local-sip-call:6] GotoIf("Local/29 at default-00000033;2", "1?11:7") in new stack
-- Goto (local-sip-call,s,11)
-- Executing [s at local-sip-call:11] Dial("Local/29 at default-00000033;2", "PJSIP/mobile") in new stack
-- Called PJSIP/mobile
-- PJSIP/mobile-00000017 is ringing
-- Local/29 at default-00000033;1 is ringing
-- PJSIP/mobile-00000017 answered Local/29 at default-00000033;2
-- Local/29 at default-00000033;1 answered
-- Executing [s at astbugchildchanneltest:1] Set("Local/29 at default-00000033;1", "CHANNEL(hangup_handler_push)=astbugtestchildhanguphandler,s,1") in new stack
-- Executing [s at astbugchildchanneltest:2] Set("Local/29 at default-00000033;1", "SHARED(connecttochannel,Local/64 at default-00000032;2)=Local/29 at default-00000033;1") in new stack
-- Executing [s at astbugchildchanneltest:3] ChannelRedirect("Local/29 at default-00000033;1", "Local/64 at default-00000032;2,astbugtest,s,1000") in new stack
== Spawn extension (astbugtest, s, 1000) exited non-zero on 'Local/64 at default-00000032;2'
-- Executing [s at astbugchildchanneltest:4] Wait("Local/29 at default-00000033;1", "1000") in new stack
-- Executing [s at astbugtest:1000] NoOp("Local/64 at default-00000032;2", "Child channel has redirected me") in new stack
-- Executing [s at astbugtest:1001] Playback("Local/64 at default-00000032;2", "beep") in new stack
-- Local/64 at default-00000032;1 answered PJSIP/28-00000015
-- Channel PJSIP/mobile-00000017 joined 'simple_bridge' basic-bridge <072abc15-faed-48ed-b790-792e2828fd1b>
-- Channel Local/29 at default-00000033;2 joined 'simple_bridge' basic-bridge <072abc15-faed-48ed-b790-792e2828fd1b>
-- Channel Local/64 at default-00000032;1 joined 'simple_bridge' basic-bridge <7736c840-a1fd-462d-94b5-efdb1f5ab1cb>
-- Channel PJSIP/28-00000015 joined 'simple_bridge' basic-bridge <7736c840-a1fd-462d-94b5-efdb1f5ab1cb>
-- <Local/64 at default-00000032;2> Playing 'beep.gsm' (language 'en')
-- Executing [s at astbugtest:1002] MixMonitor("Local/64 at default-00000032;2", "test.wav") in new stack
== Begin MixMonitor Recording Local/64 at default-00000032;2
-- Executing [s at astbugtest:1003] Bridge("Local/64 at default-00000032;2", "Local/29 at default-00000033;1,p") in new stack
== Spawn extension (astbugchildchanneltest, s, 4) exited non-zero on 'Surrogate/Local/29 at default-00000033;1'
-- Channel Local/29 at default-00000033;1 joined 'simple_bridge' basic-bridge <f69504a1-426e-4b23-bfbf-852c5d485eeb>
-- Channel Local/64 at default-00000032;2 joined 'simple_bridge' basic-bridge <f69504a1-426e-4b23-bfbf-852c5d485eeb>
-- <Local/29 at default-00000033;1> Playing 'beep.slin192' (language 'en')
> Move-swap optimizing Local/29 at default-00000033;1 <-- PJSIP/mobile-00000017.
-- Channel PJSIP/mobile-00000017 left 'simple_bridge' basic-bridge <072abc15-faed-48ed-b790-792e2828fd1b>
-- Channel Local/29 at default-00000033;1 left 'simple_bridge' basic-bridge <f69504a1-426e-4b23-bfbf-852c5d485eeb>
-- Channel PJSIP/mobile-00000017 swapped with Local/29 at default-00000033;1 into 'simple_bridge' basic-bridge <f69504a1-426e-4b23-bfbf-852c5d485eeb>
-- Channel Local/29 at default-00000033;2 left 'simple_bridge' basic-bridge <072abc15-faed-48ed-b790-792e2828fd1b>
-- Local/29 at default-00000033;1 Internal Gosub(astbugtestchildhanguphandler,s,1) start
-- Executing [s at astbugtestchildhanguphandler:1] NoOp("Local/29 at default-00000033;1", "============== Child channel hung up") in new stack
-- Executing [s at astbugtestchildhanguphandler:2] Return("Local/29 at default-00000033;1", "") in new stack
== Spawn extension (astbugchildchanneltest, s, 5) exited non-zero on 'Local/29 at default-00000033;1'
-- Local/29 at default-00000033;1 Internal Gosub(astbugtestchildhanguphandler,s,1) complete GOSUB_RETVAL=
== Spawn extension (local-sip-call, s, 11) exited non-zero on 'Local/29 at default-00000033;2'
{noformat}
when using goto instead of dialing a local channel, the parent channel is not hung up immediately on answer with or without mixmonitor. however child channel is hung up immediately anyway
{noformat}
== Setting global variable 'SIPDOMAIN' to '192.168.99.10'
-- Executing [64 at internal:1] Set("PJSIP/28-00000018", "CALLEDNUM=64") in new stack
-- Executing [64 at internal:2] Goto("PJSIP/28-00000018", "astbugtest,s,1") in new stack
-- Goto (astbugtest,s,1)
-- Executing [s at astbugtest:1] Set("PJSIP/28-00000018", "CHANNEL(hangup_handler_push)=astbugtestparenthanguphandler,s,1") in new stack
-- Executing [s at astbugtest:2] Set("PJSIP/28-00000018", "ORIGINATECHANNELS=Local/29 at default") in new stack
-- Executing [s at astbugtest:3] Originate("PJSIP/28-00000018", "Local/29 at default,exten,astbugchildchanneltest,s,1,3600,ab(astbugtest,new,1(PJSIP/28-00000018))") in new stack
-- Local/29 at default-00000034;1 Internal Gosub(astbugtest,new,1(PJSIP/28-00000018)) start
-- Executing [new at astbugtest:1] Set("Local/29 at default-00000034;1", "PARENTCHANNEL=PJSIP/28-00000018") in new stack
[May 12 21:10:44] NOTICE[29106][C-00000008]: app_stack.c:1080 gosub_run: Local/29 at default-00000034;1 Abnormal 'Gosub(astbugtest,new,1(PJSIP/28-00000018))' exit. Popping routine return locations.
-- Called 29 at default
-- Executing [29 at default:1] Gosub("Local/29 at default-00000034;2", "local-sip-call,s,1(29,mobile)") in new stack
-- Executing [s at local-sip-call:1] Set("Local/29 at default-00000034;2", "CALLEDNUM=29") in new stack
-- Executing [s at local-sip-call:2] ChanIsAvail("Local/29 at default-00000034;2", "PJSIP/mobile,s") in new stack
-- Executing [s at astbugtest:4] Wait("PJSIP/28-00000018", "3600") in new stack
-- Executing [s at local-sip-call:3] NoOp("Local/29 at default-00000034;2", "1 0") in new stack
-- Executing [s at local-sip-call:4] GotoIf("Local/29 at default-00000034;2", "0?11:5") in new stack
-- Goto (local-sip-call,s,5)
-- Executing [s at local-sip-call:5] GotoIf("Local/29 at default-00000034;2", "0?11:6") in new stack
-- Goto (local-sip-call,s,6)
-- Executing [s at local-sip-call:6] GotoIf("Local/29 at default-00000034;2", "1?11:7") in new stack
-- Goto (local-sip-call,s,11)
-- Executing [s at local-sip-call:11] Dial("Local/29 at default-00000034;2", "PJSIP/mobile") in new stack
-- Called PJSIP/mobile
-- PJSIP/mobile-0000001a is ringing
-- Local/29 at default-00000034;1 is ringing
-- PJSIP/mobile-0000001a answered Local/29 at default-00000034;2
-- Local/29 at default-00000034;1 answered
-- Executing [s at astbugchildchanneltest:1] Set("Local/29 at default-00000034;1", "CHANNEL(hangup_handler_push)=astbugtestchildhanguphandler,s,1") in new stack
-- Channel PJSIP/mobile-0000001a joined 'simple_bridge' basic-bridge <74173f50-98cc-473c-a614-0cdbb5dae8f3>
-- Executing [s at astbugchildchanneltest:2] Set("Local/29 at default-00000034;1", "SHARED(connecttochannel,PJSIP/28-00000018)=Local/29 at default-00000034;1") in new stack
-- Channel Local/29 at default-00000034;2 joined 'simple_bridge' basic-bridge <74173f50-98cc-473c-a614-0cdbb5dae8f3>
-- Executing [s at astbugchildchanneltest:3] ChannelRedirect("Local/29 at default-00000034;1", "PJSIP/28-00000018,astbugtest,s,1000") in new stack
== Spawn extension (astbugtest, s, 1000) exited non-zero on 'PJSIP/28-00000018'
-- Executing [s at astbugtest:1000] NoOp("PJSIP/28-00000018", "Child channel has redirected me") in new stack
-- Executing [s at astbugchildchanneltest:4] Wait("Local/29 at default-00000034;1", "1000") in new stack
-- Executing [s at astbugtest:1001] Playback("PJSIP/28-00000018", "beep") in new stack
-- <PJSIP/28-00000018> Playing 'beep.gsm' (language 'en')
-- Executing [s at astbugtest:1002] NoOp("PJSIP/28-00000018", "") in new stack
-- Executing [s at astbugtest:1003] Bridge("PJSIP/28-00000018", "Local/29 at default-00000034;1,p") in new stack
== Spawn extension (astbugchildchanneltest, s, 4) exited non-zero on 'Surrogate/Local/29 at default-00000034;1'
-- Channel Local/29 at default-00000034;1 joined 'simple_bridge' basic-bridge <2f138631-1852-4983-a179-58908ac338c8>
-- Channel PJSIP/28-00000018 joined 'simple_bridge' basic-bridge <2f138631-1852-4983-a179-58908ac338c8>
[May 12 21:10:49] WARNING[29156][C-00000008]: file.c:1245 ast_streamfile: Unable to open beep (format (slin192)): No such file or directory
> Move-swap optimizing Local/29 at default-00000034;2 <-- PJSIP/28-00000018.
-- Channel PJSIP/28-00000018 left 'simple_bridge' basic-bridge <2f138631-1852-4983-a179-58908ac338c8>
-- Channel Local/29 at default-00000034;2 left 'simple_bridge' basic-bridge <74173f50-98cc-473c-a614-0cdbb5dae8f3>
-- Channel PJSIP/28-00000018 swapped with Local/29 at default-00000034;2 into 'simple_bridge' basic-bridge <74173f50-98cc-473c-a614-0cdbb5dae8f3>
> Bridge 74173f50-98cc-473c-a614-0cdbb5dae8f3: switching from simple_bridge technology to native_rtp
> Remotely bridged 'PJSIP/28-00000018' and 'PJSIP/mobile-0000001a' - media will flow directly between them
-- Channel Local/29 at default-00000034;1 left 'simple_bridge' basic-bridge <2f138631-1852-4983-a179-58908ac338c8>
-- Local/29 at default-00000034;1 Internal Gosub(astbugtestchildhanguphandler,s,1) start
-- Executing [s at astbugtestchildhanguphandler:1] NoOp("Local/29 at default-00000034;1", "============== Child channel hung up") in new stack
-- Executing [s at astbugtestchildhanguphandler:2] Return("Local/29 at default-00000034;1", "") in new stack
== Spawn extension (astbugchildchanneltest, s, 5) exited non-zero on 'Local/29 at default-00000034;1'
-- Local/29 at default-00000034;1 Internal Gosub(astbugtestchildhanguphandler,s,1) complete GOSUB_RETVAL=
== Spawn extension (local-sip-call, s, 11) exited non-zero on 'Local/29 at default-00000034;2'
{noformat}
and finally the nice little dialplan
{noformat}
[internal]
exten => 64,1,Set(CALLEDNUM=${EXTEN})
exten => 64,n,Goto(astbugtest,s,1)
{noformat}
or
{noformat}
[internal]
exten => 64,1,Set(CALLEDNUM=${EXTEN})
exten => 64,n,Dial(Local/64 at default,300,gr)
{noformat}
{noformat}
[astbugtestparenthanguphandler]
exten => s,1,Noop(============== Parent channel hung up)
exten => s,2,Return()
[astbugtestchildhanguphandler]
exten => s,1,Noop(============== Child channel hung up)
exten => s,2,Return()
[astbugtest]
exten => s,1,Set(CHANNEL(hangup_handler_push)=astbugtestparenthanguphandler,s,1)
exten => s,2,Set(ORIGINATECHANNELS=Local/29 at default)
exten => s,3,Originate(Local/29 at default,exten,astbugchildchanneltest,s,1,3600,ab(astbugtest,new,1(${CHANNEL})))
exten => s,4,Wait(3600)
exten => new,1,Set(PARENTCHANNEL=${ARG1})
exten => s,1000,Noop(Child channel has redirected me)
exten => s,1001,Playback(beep)
;exten => s,1002,MixMonitor(test.wav)
exten => s,1002,Noop()
exten => s,1003,Bridge(${SHARED(connecttochannel)},p)
exten => s,1004,Wait(5)
exten => s,1005,Hangup()
[astbugchildchanneltest]
exten => s,1,Set(CHANNEL(hangup_handler_push)=astbugtestchildhanguphandler,s,1)
exten => s,2,Set(SHARED(connecttochannel,${PARENTCHANNEL})=${CHANNEL})
exten => s,3,ChannelRedirect(${PARENTCHANNEL},astbugtest,s,1000)
exten => s,4,Wait(1000)
{noformat}
was (Author: fredo):
Thanks to various feedback, I have decided to take the time to strip my example down. This second example does not verify "h" extension functionality but I assume you can easily test this. I think you can also experiment with the "beep" sample as described in my initial report.
Please also make sure you have the branch with the "a" flag in the originate command. This was added on my request. However the sample should also work without the "a" flag but I have not tested what will happen.
Dialing through local channel, not using mixmonitor. Both channels are executing the hangup handlers immediately an answer of child channel when they should not.
{noformat}
== Setting global variable 'SIPDOMAIN' to '192.168.99.10'
-- Executing [64 at internal:1] Set("PJSIP/28-00000012", "CALLEDNUM=64") in new stack
-- Executing [64 at internal:2] Dial("PJSIP/28-00000012", "Local/64 at default,300,gr") in new stack
-- Called Local/64 at default
-- Executing [64 at default:1] Goto("Local/64 at default-00000030;2", "astbugtest,s,1") in new stack
-- Goto (astbugtest,s,1)
-- Executing [s at astbugtest:1] Set("Local/64 at default-00000030;2", "CHANNEL(hangup_handler_push)=astbugtestparenthanguphandler,s,1") in new stack
-- Executing [s at astbugtest:2] Set("Local/64 at default-00000030;2", "ORIGINATECHANNELS=Local/29 at default") in new stack
-- Executing [s at astbugtest:3] Originate("Local/64 at default-00000030;2", "Local/29 at default,exten,astbugchildchanneltest,s,1,3600,ab(astbugtest,new,1(Local/64 at default-00000030;2))") in new stack
-- Local/29 at default-00000031;1 Internal Gosub(astbugtest,new,1(Local/64 at default-00000030;2)) start
-- Executing [new at astbugtest:1] Set("Local/29 at default-00000031;1", "PARENTCHANNEL=Local/64 at default-00000030;2") in new stack
[May 12 21:01:28] NOTICE[21838][C-00000006]: app_stack.c:1080 gosub_run: Local/29 at default-00000031;1 Abnormal 'Gosub(astbugtest,new,1(Local/64 at default-00000030;2))' exit. Popping routine return locations.
-- Called 29 at default
-- Executing [29 at default:1] Gosub("Local/29 at default-00000031;2", "local-sip-call,s,1(29,mobile)") in new stack
-- Executing [s at local-sip-call:1] Set("Local/29 at default-00000031;2", "CALLEDNUM=29") in new stack
-- Executing [s at local-sip-call:2] ChanIsAvail("Local/29 at default-00000031;2", "PJSIP/mobile,s") in new stack
-- Executing [s at astbugtest:4] Wait("Local/64 at default-00000030;2", "3600") in new stack
-- Executing [s at local-sip-call:3] NoOp("Local/29 at default-00000031;2", "1 0") in new stack
-- Executing [s at local-sip-call:4] GotoIf("Local/29 at default-00000031;2", "0?11:5") in new stack
-- Goto (local-sip-call,s,5)
-- Executing [s at local-sip-call:5] GotoIf("Local/29 at default-00000031;2", "0?11:6") in new stack
-- Goto (local-sip-call,s,6)
-- Executing [s at local-sip-call:6] GotoIf("Local/29 at default-00000031;2", "1?11:7") in new stack
-- Goto (local-sip-call,s,11)
-- Executing [s at local-sip-call:11] Dial("Local/29 at default-00000031;2", "PJSIP/mobile") in new stack
-- Called PJSIP/mobile
-- PJSIP/mobile-00000014 is ringing
-- Local/29 at default-00000031;1 is ringing
-- PJSIP/mobile-00000014 answered Local/29 at default-00000031;2
-- Local/29 at default-00000031;1 answered
-- Executing [s at astbugchildchanneltest:1] Set("Local/29 at default-00000031;1", "CHANNEL(hangup_handler_push)=astbugtestchildhanguphandler,s,1") in new stack
-- Channel PJSIP/mobile-00000014 joined 'simple_bridge' basic-bridge <000e21c1-05e1-4fa4-8046-afcfac638ef8>
-- Channel Local/29 at default-00000031;2 joined 'simple_bridge' basic-bridge <000e21c1-05e1-4fa4-8046-afcfac638ef8>
-- Executing [s at astbugchildchanneltest:2] Set("Local/29 at default-00000031;1", "SHARED(connecttochannel,Local/64 at default-00000030;2)=Local/29 at default-00000031;1") in new stack
-- Executing [s at astbugchildchanneltest:3] ChannelRedirect("Local/29 at default-00000031;1", "Local/64 at default-00000030;2,astbugtest,s,1000") in new stack
== Spawn extension (astbugtest, s, 1000) exited non-zero on 'Local/64 at default-00000030;2'
-- Executing [s at astbugtest:1000] NoOp("Local/64 at default-00000030;2", "Child channel has redirected me") in new stack
-- Executing [s at astbugchildchanneltest:4] Wait("Local/29 at default-00000031;1", "1000") in new stack
-- Executing [s at astbugtest:1001] Playback("Local/64 at default-00000030;2", "beep") in new stack
-- Local/64 at default-00000030;1 answered PJSIP/28-00000012
-- Channel Local/64 at default-00000030;1 joined 'simple_bridge' basic-bridge <ab2a194c-e6f3-4909-a7bb-f77a88f8e37a>
-- Channel PJSIP/28-00000012 joined 'simple_bridge' basic-bridge <ab2a194c-e6f3-4909-a7bb-f77a88f8e37a>
-- <Local/64 at default-00000030;2> Playing 'beep.gsm' (language 'en')
-- Executing [s at astbugtest:1002] NoOp("Local/64 at default-00000030;2", "") in new stack
-- Executing [s at astbugtest:1003] Bridge("Local/64 at default-00000030;2", "Local/29 at default-00000031;1,p") in new stack
== Spawn extension (astbugchildchanneltest, s, 4) exited non-zero on 'Surrogate/Local/29 at default-00000031;1'
-- Channel Local/29 at default-00000031;1 joined 'simple_bridge' basic-bridge <ad5ea4aa-8223-414a-aa3d-80b8038e895d>
-- Channel Local/64 at default-00000030;2 joined 'simple_bridge' basic-bridge <ad5ea4aa-8223-414a-aa3d-80b8038e895d>
-- <Local/29 at default-00000031;1> Playing 'beep.gsm' (language 'en')
> Move-swap optimizing Local/64 at default-00000030;2 <-- PJSIP/28-00000012.
-- Channel PJSIP/28-00000012 left 'simple_bridge' basic-bridge <ab2a194c-e6f3-4909-a7bb-f77a88f8e37a>
-- Channel Local/64 at default-00000030;2 left 'simple_bridge' basic-bridge <ad5ea4aa-8223-414a-aa3d-80b8038e895d>
-- Channel PJSIP/28-00000012 swapped with Local/64 at default-00000030;2 into 'simple_bridge' basic-bridge <ad5ea4aa-8223-414a-aa3d-80b8038e895d>
-- Channel Local/64 at default-00000030;1 left 'simple_bridge' basic-bridge <ab2a194c-e6f3-4909-a7bb-f77a88f8e37a>
-- Executing [s at astbugtest:1004] Wait("Local/64 at default-00000030;2", "5") in new stack
== Spawn extension (astbugtest, s, 1004) exited non-zero on 'Local/64 at default-00000030;2'
-- Local/64 at default-00000030;2 Internal Gosub(astbugtestparenthanguphandler,s,1) start
-- Executing [s at astbugtestparenthanguphandler:1] NoOp("Local/64 at default-00000030;2", "============== Parent channel hung up") in new stack
-- Executing [s at astbugtestparenthanguphandler:2] Return("Local/64 at default-00000030;2", "") in new stack
== Spawn extension (astbugtest, s, 1004) exited non-zero on 'Local/64 at default-00000030;2'
-- Local/64 at default-00000030;2 Internal Gosub(astbugtestparenthanguphandler,s,1) complete GOSUB_RETVAL=
> Move-swap optimizing Local/29 at default-00000031;1 <-- PJSIP/mobile-00000014.
-- Channel PJSIP/mobile-00000014 left 'simple_bridge' basic-bridge <000e21c1-05e1-4fa4-8046-afcfac638ef8>
-- Channel Local/29 at default-00000031;1 left 'simple_bridge' basic-bridge <ad5ea4aa-8223-414a-aa3d-80b8038e895d>
-- Channel PJSIP/mobile-00000014 swapped with Local/29 at default-00000031;1 into 'simple_bridge' basic-bridge <ad5ea4aa-8223-414a-aa3d-80b8038e895d>
> Bridge ad5ea4aa-8223-414a-aa3d-80b8038e895d: switching from simple_bridge technology to native_rtp
> Remotely bridged 'PJSIP/mobile-00000014' and 'PJSIP/28-00000012' - media will flow directly between them
-- Channel Local/29 at default-00000031;2 left 'simple_bridge' basic-bridge <000e21c1-05e1-4fa4-8046-afcfac638ef8>
== Spawn extension (local-sip-call, s, 11) exited non-zero on 'Local/29 at default-00000031;2'
-- Local/29 at default-00000031;1 Internal Gosub(astbugtestchildhanguphandler,s,1) start
-- Executing [s at astbugtestchildhanguphandler:1] NoOp("Local/29 at default-00000031;1", "============== Child channel hung up") in new stack
-- Executing [s at astbugtestchildhanguphandler:2] Return("Local/29 at default-00000031;1", "") in new stack
== Spawn extension (astbugchildchanneltest, s, 5) exited non-zero on 'Local/29 at default-00000031;1'
-- Local/29 at default-00000031;1 Internal Gosub(astbugtestchildhanguphandler,s,1) complete GOSUB_RETVAL=
{noformat}
With mixmonitor, child hangup handler is being executed on answer when it should not. Parent hangup handler is not executed which is correct.
{noformat}
== Setting global variable 'SIPDOMAIN' to '192.168.99.10'
-- Executing [64 at internal:1] Set("PJSIP/28-00000015", "CALLEDNUM=64") in new stack
-- Executing [64 at internal:2] Dial("PJSIP/28-00000015", "Local/64 at default,300,gr") in new stack
-- Called Local/64 at default
-- Executing [64 at default:1] Goto("Local/64 at default-00000032;2", "astbugtest,s,1") in new stack
-- Goto (astbugtest,s,1)
-- Executing [s at astbugtest:1] Set("Local/64 at default-00000032;2", "CHANNEL(hangup_handler_push)=astbugtestparenthanguphandler,s,1") in new stack
-- Executing [s at astbugtest:2] Set("Local/64 at default-00000032;2", "ORIGINATECHANNELS=Local/29 at default") in new stack
-- Executing [s at astbugtest:3] Originate("Local/64 at default-00000032;2", "Local/29 at default,exten,astbugchildchanneltest,s,1,3600,ab(astbugtest,new,1(Local/64 at default-00000032;2))") in new stack
-- Local/29 at default-00000033;1 Internal Gosub(astbugtest,new,1(Local/64 at default-00000032;2)) start
-- Executing [new at astbugtest:1] Set("Local/29 at default-00000033;1", "PARENTCHANNEL=Local/64 at default-00000032;2") in new stack
[May 12 21:07:47] NOTICE[26818][C-00000007]: app_stack.c:1080 gosub_run: Local/29 at default-00000033;1 Abnormal 'Gosub(astbugtest,new,1(Local/64 at default-00000032;2))' exit. Popping routine return locations.
-- Called 29 at default
-- Executing [29 at default:1] Gosub("Local/29 at default-00000033;2", "local-sip-call,s,1(29,mobile)") in new stack
-- Executing [s at local-sip-call:1] Set("Local/29 at default-00000033;2", "CALLEDNUM=29") in new stack
-- Executing [s at local-sip-call:2] ChanIsAvail("Local/29 at default-00000033;2", "PJSIP/mobile,s") in new stack
-- Executing [s at astbugtest:4] Wait("Local/64 at default-00000032;2", "3600") in new stack
-- Executing [s at local-sip-call:3] NoOp("Local/29 at default-00000033;2", "1 0") in new stack
-- Executing [s at local-sip-call:4] GotoIf("Local/29 at default-00000033;2", "0?11:5") in new stack
-- Goto (local-sip-call,s,5)
-- Executing [s at local-sip-call:5] GotoIf("Local/29 at default-00000033;2", "0?11:6") in new stack
-- Goto (local-sip-call,s,6)
-- Executing [s at local-sip-call:6] GotoIf("Local/29 at default-00000033;2", "1?11:7") in new stack
-- Goto (local-sip-call,s,11)
-- Executing [s at local-sip-call:11] Dial("Local/29 at default-00000033;2", "PJSIP/mobile") in new stack
-- Called PJSIP/mobile
-- PJSIP/mobile-00000017 is ringing
-- Local/29 at default-00000033;1 is ringing
-- PJSIP/mobile-00000017 answered Local/29 at default-00000033;2
-- Local/29 at default-00000033;1 answered
-- Executing [s at astbugchildchanneltest:1] Set("Local/29 at default-00000033;1", "CHANNEL(hangup_handler_push)=astbugtestchildhanguphandler,s,1") in new stack
-- Executing [s at astbugchildchanneltest:2] Set("Local/29 at default-00000033;1", "SHARED(connecttochannel,Local/64 at default-00000032;2)=Local/29 at default-00000033;1") in new stack
-- Executing [s at astbugchildchanneltest:3] ChannelRedirect("Local/29 at default-00000033;1", "Local/64 at default-00000032;2,astbugtest,s,1000") in new stack
== Spawn extension (astbugtest, s, 1000) exited non-zero on 'Local/64 at default-00000032;2'
-- Executing [s at astbugchildchanneltest:4] Wait("Local/29 at default-00000033;1", "1000") in new stack
-- Executing [s at astbugtest:1000] NoOp("Local/64 at default-00000032;2", "Child channel has redirected me") in new stack
-- Executing [s at astbugtest:1001] Playback("Local/64 at default-00000032;2", "beep") in new stack
-- Local/64 at default-00000032;1 answered PJSIP/28-00000015
-- Channel PJSIP/mobile-00000017 joined 'simple_bridge' basic-bridge <072abc15-faed-48ed-b790-792e2828fd1b>
-- Channel Local/29 at default-00000033;2 joined 'simple_bridge' basic-bridge <072abc15-faed-48ed-b790-792e2828fd1b>
-- Channel Local/64 at default-00000032;1 joined 'simple_bridge' basic-bridge <7736c840-a1fd-462d-94b5-efdb1f5ab1cb>
-- Channel PJSIP/28-00000015 joined 'simple_bridge' basic-bridge <7736c840-a1fd-462d-94b5-efdb1f5ab1cb>
-- <Local/64 at default-00000032;2> Playing 'beep.gsm' (language 'en')
-- Executing [s at astbugtest:1002] MixMonitor("Local/64 at default-00000032;2", "test.wav") in new stack
== Begin MixMonitor Recording Local/64 at default-00000032;2
-- Executing [s at astbugtest:1003] Bridge("Local/64 at default-00000032;2", "Local/29 at default-00000033;1,p") in new stack
== Spawn extension (astbugchildchanneltest, s, 4) exited non-zero on 'Surrogate/Local/29 at default-00000033;1'
-- Channel Local/29 at default-00000033;1 joined 'simple_bridge' basic-bridge <f69504a1-426e-4b23-bfbf-852c5d485eeb>
-- Channel Local/64 at default-00000032;2 joined 'simple_bridge' basic-bridge <f69504a1-426e-4b23-bfbf-852c5d485eeb>
-- <Local/29 at default-00000033;1> Playing 'beep.slin192' (language 'en')
> Move-swap optimizing Local/29 at default-00000033;1 <-- PJSIP/mobile-00000017.
-- Channel PJSIP/mobile-00000017 left 'simple_bridge' basic-bridge <072abc15-faed-48ed-b790-792e2828fd1b>
-- Channel Local/29 at default-00000033;1 left 'simple_bridge' basic-bridge <f69504a1-426e-4b23-bfbf-852c5d485eeb>
-- Channel PJSIP/mobile-00000017 swapped with Local/29 at default-00000033;1 into 'simple_bridge' basic-bridge <f69504a1-426e-4b23-bfbf-852c5d485eeb>
-- Channel Local/29 at default-00000033;2 left 'simple_bridge' basic-bridge <072abc15-faed-48ed-b790-792e2828fd1b>
-- Local/29 at default-00000033;1 Internal Gosub(astbugtestchildhanguphandler,s,1) start
-- Executing [s at astbugtestchildhanguphandler:1] NoOp("Local/29 at default-00000033;1", "============== Child channel hung up") in new stack
-- Executing [s at astbugtestchildhanguphandler:2] Return("Local/29 at default-00000033;1", "") in new stack
== Spawn extension (astbugchildchanneltest, s, 5) exited non-zero on 'Local/29 at default-00000033;1'
-- Local/29 at default-00000033;1 Internal Gosub(astbugtestchildhanguphandler,s,1) complete GOSUB_RETVAL=
== Spawn extension (local-sip-call, s, 11) exited non-zero on 'Local/29 at default-00000033;2'
{noformat}
when using goto instead of dialing a local channel, the parent channel is not hung up immediately on answer with or without mixmonitor. however child channel is hung up immediately anyway
{noformat}
== Setting global variable 'SIPDOMAIN' to '192.168.99.10'
-- Executing [64 at internal:1] Set("PJSIP/28-00000018", "CALLEDNUM=64") in new stack
-- Executing [64 at internal:2] Goto("PJSIP/28-00000018", "astbugtest,s,1") in new stack
-- Goto (astbugtest,s,1)
-- Executing [s at astbugtest:1] Set("PJSIP/28-00000018", "CHANNEL(hangup_handler_push)=astbugtestparenthanguphandler,s,1") in new stack
-- Executing [s at astbugtest:2] Set("PJSIP/28-00000018", "ORIGINATECHANNELS=Local/29 at default") in new stack
-- Executing [s at astbugtest:3] Originate("PJSIP/28-00000018", "Local/29 at default,exten,astbugchildchanneltest,s,1,3600,ab(astbugtest,new,1(PJSIP/28-00000018))") in new stack
-- Local/29 at default-00000034;1 Internal Gosub(astbugtest,new,1(PJSIP/28-00000018)) start
-- Executing [new at astbugtest:1] Set("Local/29 at default-00000034;1", "PARENTCHANNEL=PJSIP/28-00000018") in new stack
[May 12 21:10:44] NOTICE[29106][C-00000008]: app_stack.c:1080 gosub_run: Local/29 at default-00000034;1 Abnormal 'Gosub(astbugtest,new,1(PJSIP/28-00000018))' exit. Popping routine return locations.
-- Called 29 at default
-- Executing [29 at default:1] Gosub("Local/29 at default-00000034;2", "local-sip-call,s,1(29,mobile)") in new stack
-- Executing [s at local-sip-call:1] Set("Local/29 at default-00000034;2", "CALLEDNUM=29") in new stack
-- Executing [s at local-sip-call:2] ChanIsAvail("Local/29 at default-00000034;2", "PJSIP/mobile,s") in new stack
-- Executing [s at astbugtest:4] Wait("PJSIP/28-00000018", "3600") in new stack
-- Executing [s at local-sip-call:3] NoOp("Local/29 at default-00000034;2", "1 0") in new stack
-- Executing [s at local-sip-call:4] GotoIf("Local/29 at default-00000034;2", "0?11:5") in new stack
-- Goto (local-sip-call,s,5)
-- Executing [s at local-sip-call:5] GotoIf("Local/29 at default-00000034;2", "0?11:6") in new stack
-- Goto (local-sip-call,s,6)
-- Executing [s at local-sip-call:6] GotoIf("Local/29 at default-00000034;2", "1?11:7") in new stack
-- Goto (local-sip-call,s,11)
-- Executing [s at local-sip-call:11] Dial("Local/29 at default-00000034;2", "PJSIP/mobile") in new stack
-- Called PJSIP/mobile
-- PJSIP/mobile-0000001a is ringing
-- Local/29 at default-00000034;1 is ringing
-- PJSIP/mobile-0000001a answered Local/29 at default-00000034;2
-- Local/29 at default-00000034;1 answered
-- Executing [s at astbugchildchanneltest:1] Set("Local/29 at default-00000034;1", "CHANNEL(hangup_handler_push)=astbugtestchildhanguphandler,s,1") in new stack
-- Channel PJSIP/mobile-0000001a joined 'simple_bridge' basic-bridge <74173f50-98cc-473c-a614-0cdbb5dae8f3>
-- Executing [s at astbugchildchanneltest:2] Set("Local/29 at default-00000034;1", "SHARED(connecttochannel,PJSIP/28-00000018)=Local/29 at default-00000034;1") in new stack
-- Channel Local/29 at default-00000034;2 joined 'simple_bridge' basic-bridge <74173f50-98cc-473c-a614-0cdbb5dae8f3>
-- Executing [s at astbugchildchanneltest:3] ChannelRedirect("Local/29 at default-00000034;1", "PJSIP/28-00000018,astbugtest,s,1000") in new stack
== Spawn extension (astbugtest, s, 1000) exited non-zero on 'PJSIP/28-00000018'
-- Executing [s at astbugtest:1000] NoOp("PJSIP/28-00000018", "Child channel has redirected me") in new stack
-- Executing [s at astbugchildchanneltest:4] Wait("Local/29 at default-00000034;1", "1000") in new stack
-- Executing [s at astbugtest:1001] Playback("PJSIP/28-00000018", "beep") in new stack
-- <PJSIP/28-00000018> Playing 'beep.gsm' (language 'en')
-- Executing [s at astbugtest:1002] NoOp("PJSIP/28-00000018", "") in new stack
-- Executing [s at astbugtest:1003] Bridge("PJSIP/28-00000018", "Local/29 at default-00000034;1,p") in new stack
== Spawn extension (astbugchildchanneltest, s, 4) exited non-zero on 'Surrogate/Local/29 at default-00000034;1'
-- Channel Local/29 at default-00000034;1 joined 'simple_bridge' basic-bridge <2f138631-1852-4983-a179-58908ac338c8>
-- Channel PJSIP/28-00000018 joined 'simple_bridge' basic-bridge <2f138631-1852-4983-a179-58908ac338c8>
[May 12 21:10:49] WARNING[29156][C-00000008]: file.c:1245 ast_streamfile: Unable to open beep (format (slin192)): No such file or directory
> Move-swap optimizing Local/29 at default-00000034;2 <-- PJSIP/28-00000018.
-- Channel PJSIP/28-00000018 left 'simple_bridge' basic-bridge <2f138631-1852-4983-a179-58908ac338c8>
-- Channel Local/29 at default-00000034;2 left 'simple_bridge' basic-bridge <74173f50-98cc-473c-a614-0cdbb5dae8f3>
-- Channel PJSIP/28-00000018 swapped with Local/29 at default-00000034;2 into 'simple_bridge' basic-bridge <74173f50-98cc-473c-a614-0cdbb5dae8f3>
> Bridge 74173f50-98cc-473c-a614-0cdbb5dae8f3: switching from simple_bridge technology to native_rtp
> Remotely bridged 'PJSIP/28-00000018' and 'PJSIP/mobile-0000001a' - media will flow directly between them
-- Channel Local/29 at default-00000034;1 left 'simple_bridge' basic-bridge <2f138631-1852-4983-a179-58908ac338c8>
-- Local/29 at default-00000034;1 Internal Gosub(astbugtestchildhanguphandler,s,1) start
-- Executing [s at astbugtestchildhanguphandler:1] NoOp("Local/29 at default-00000034;1", "============== Child channel hung up") in new stack
-- Executing [s at astbugtestchildhanguphandler:2] Return("Local/29 at default-00000034;1", "") in new stack
== Spawn extension (astbugchildchanneltest, s, 5) exited non-zero on 'Local/29 at default-00000034;1'
-- Local/29 at default-00000034;1 Internal Gosub(astbugtestchildhanguphandler,s,1) complete GOSUB_RETVAL=
== Spawn extension (local-sip-call, s, 11) exited non-zero on 'Local/29 at default-00000034;2'
{noformat}
and finally the nice little dialplan
{noformat}
[internal]
exten => 64,1,Set(CALLEDNUM=${EXTEN})
exten => 64,n,Goto(astbugtest,s,1)
{noformat}
or
{noformat}
[internal]
exten => 64,1,Set(CALLEDNUM=${EXTEN})
exten => 64,n,Dial(Local/64 at default,300,gr)
{noformat}
{noformat}
[astbugtestparenthanguphandler]
exten => s,1,Noop(============== Parent channel hung up)
exten => s,2,Return()
[astbugtestchildhanguphandler]
exten => s,1,Noop(============== Child channel hung up)
exten => s,2,Return()
[astbugtest]
exten => s,1,Set(CHANNEL(hangup_handler_push)=astbugtestparenthanguphandler,s,1)
exten => s,2,Set(ORIGINATECHANNELS=Local/29 at default)
exten => s,3,Originate(Local/29 at default,exten,astbugchildchanneltest,s,1,3600,ab(astbugtest,new,1(${CHANNEL})))
exten => s,4,Wait(3600)
exten => new,1,Set(PARENTCHANNEL=${ARG1})
exten => s,1000,Noop(Child channel has redirected me)
exten => s,1001,Playback(beep)
;exten => s,1002,MixMonitor(test.wav)
exten => s,1002,Noop()
exten => s,1003,Bridge(${SHARED(connecttochannel)},p)
exten => s,1004,Wait(5)
exten => s,1005,Hangup()
{noformat}
> cmd Bridge will exit immediately if MixMonitor is not used
> ----------------------------------------------------------
>
> Key: ASTERISK-27833
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-27833
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Core/Bridging
> Affects Versions: 15.3.0
> Environment: Fedora 27, probably all
> Reporter: Frederic Steinfels
> Assignee: Unassigned
> Labels: pjsip
> Attachments: scenario2 20180502-002816-29-28.wav, scenario3 20180502-003400-29-28.wav
>
>
> The behaviour of the bridge command is different depending on wheter MixMonitor is used. MixMonitor itself does not work if used before the PlayBack(beep) command. MixMonitor works if used after the PlayBack command.
> Scenario 1: Bridge command without MixMonitor
> {noformat}
> exten => s,1001,Set(CALLEDNUM=${SHARED(connecttocid)})
> exten => s,1002,agi(googletts.agi,"Sie werden mit ${ADMIN-${SHARED(connecttoadminid)}-spokenfname} ${ADMIN-${SHARED(connecttoadminid)}-spokenlname} verbunden.",de,,1.4)
> exten => s,1003,Set(CHANNEL(hangup_handler_push)=logoutemployee,s,1(hangup_handler))
> exten => s,1004,Set(CHANNEL(after_bridge_goto)=logoutemployee,s,1(after_bridge))
> exten => s,1005,Playback(beep)
> exten => s,1006,Noop()
> exten => s,1007,Bridge(${SHARED(connecttochannel)},p)
> exten => h,1,Noop(in hangup)
> {noformat}
> This will happen:
> {noformat}
> -- Executing [s at newanswer:1001] Set("Local/69 at default-000000b8;2", "CALLEDNUM=28") in new stack
> -- Executing [s at newanswer:1002] AGI("Local/69 at default-000000b8;2", "googletts.agi,"Sie werden mit Frédéric Steinfels verbunden.",de,,1.4") in new stack
> -- Launched AGI Script /var/lib/asterisk/agi-bin/googletts.agi
> == Spawn extension (local-sccp-call, s, 14) exited non-zero on 'Local/22 at default-000000b9;2'
> -- <Local/69 at default-000000b8;2> Playing '/data/Telefon/googletts//9c3c06da9e11b5448585f24c9285641b.1.4.slin16' (escape_digits=) (sample_offset 0) (language 'en')
> -- <Local/69 at default-000000b8;2>AGI Script googletts.agi completed, returning 0
> -- Executing [s at newanswer:1003] Set("Local/69 at default-000000b8;2", "CHANNEL(hangup_handler_push)=logoutemployee,s,1(hangup_handler)") in new stack
> -- Executing [s at newanswer:1004] Set("Local/69 at default-000000b8;2", "CHANNEL(after_bridge_goto)=logoutemployee,s,1(after_bridge)") in new stack
> -- Executing [s at newanswer:1005] Playback("Local/69 at default-000000b8;2", "beep") in new stack
> -- <Local/69 at default-000000b8;2> Playing 'beep.gsm' (language 'en')
> -- Executing [s at newanswer:1006] NoOp("Local/69 at default-000000b8;2", "") in new stack
> -- Executing [s at newanswer:1007] Bridge("Local/69 at default-000000b8;2", "Local/28 at default-000000ba;1,p") in new stack
> == Spawn extension (receptionist4, s, 16) exited non-zero on 'Surrogate/Local/28 at default-000000ba;1'
> -- Channel Local/28 at default-000000ba;1 joined 'simple_bridge' basic-bridge <db41b6a4-3a40-43eb-892e-1d496da479db>
> -- Channel Local/69 at default-000000b8;2 joined 'simple_bridge' basic-bridge <db41b6a4-3a40-43eb-892e-1d496da479db>
> [May 2 00:06:18] WARNING[22967][C-0000003f]: file.c:1245 ast_streamfile: Unable to open beep (format (slin192)): No such file or directory
> > Move-swap optimizing Local/28 at default-000000ba;1 <-- PJSIP/28-000000b6.
> -- Channel PJSIP/28-000000b6 left 'simple_bridge' basic-bridge <b7992456-512e-4047-b4b2-c5a02e4b05ab>
> -- Channel Local/28 at default-000000ba;1 left 'simple_bridge' basic-bridge <db41b6a4-3a40-43eb-892e-1d496da479db>
> -- Channel PJSIP/28-000000b6 swapped with Local/28 at default-000000ba;1 into 'simple_bridge' basic-bridge <db41b6a4-3a40-43eb-892e-1d496da479db>
> -- Channel Local/28 at default-000000ba;2 left 'simple_bridge' basic-bridge <b7992456-512e-4047-b4b2-c5a02e4b05ab>
> == Spawn extension (local-sip-call, s, 11) exited non-zero on 'Local/28 at default-000000ba;2'
> -- Executing [s at receptionist4:17] Playback("Local/28 at default-000000ba;1", "beep") in new stack
> -- <Local/28 at default-000000ba;1> Playing 'beep.gsm' (language 'en')
> > Move-swap optimizing Local/69 at default-000000b8;2 <-- PJSIP/mobile-000000b4.
> -- Channel PJSIP/mobile-000000b4 left 'simple_bridge' basic-bridge <f6726fe1-c05f-4d7b-87ad-cf1eb8cfc113>
> -- Channel Local/69 at default-000000b8;2 left 'simple_bridge' basic-bridge <db41b6a4-3a40-43eb-892e-1d496da479db>
> -- Channel PJSIP/mobile-000000b4 swapped with Local/69 at default-000000b8;2 into 'simple_bridge' basic-bridge <db41b6a4-3a40-43eb-892e-1d496da479db>
> > Bridge db41b6a4-3a40-43eb-892e-1d496da479db: switching from simple_bridge technology to native_rtp
> > Remotely bridged 'PJSIP/mobile-000000b4' and 'PJSIP/28-000000b6' - media will flow directly between them
> -- Channel Local/69 at default-000000b8;1 left 'simple_bridge' basic-bridge <f6726fe1-c05f-4d7b-87ad-cf1eb8cfc113>
> -- Executing [h at newanswer:1] NoOp("Local/69 at default-000000b8;2", "in hangup") in new stack
> -- Local/69 at default-000000b8;2 Internal Gosub(logoutemployee,s,1(hangup_handler)) start
> -- Executing [s at logoutemployee:1] NoOp("Local/69 at default-000000b8;2", "I am channel Local/69 at default-000000b8;2 and and hangup_handler") in new stack
> -- Executing [s at logoutemployee:2] Return("Local/69 at default-000000b8;2", "") in new stack
> == Spawn extension (newanswer, h, 2) exited non-zero on 'Local/69 at default-000000b8;2'
> -- Local/69 at default-000000b8;2 Internal Gosub(logoutemployee,s,1(hangup_handler)) complete GOSUB_RETVAL=
> {noformat}
> when hanging up:
> {noformat}
> -- Channel PJSIP/mobile-000000b4 left 'native_rtp' basic-bridge <db41b6a4-3a40-43eb-892e-1d496da479db>
> -- Channel PJSIP/28-000000b6 left 'native_rtp' basic-bridge <db41b6a4-3a40-43eb-892e-1d496da479db>
> == Spawn extension (internal2local, s, 13) exited non-zero on 'PJSIP/mobile-000000b4'
> {noformat}
> Scenario 2: Bridge command with MixMonitor, beep after MixMonitor
> {noformat}
> exten => s,1001,Set(CALLEDNUM=${SHARED(connecttocid)})
> exten => s,1002,agi(googletts.agi,"Sie werden mit ${ADMIN-${SHARED(connecttoadminid)}-spokenfname} ${ADMIN-${SHARED(connecttoadminid)}-spokenlname} verbunden.",de,,1.4)
> exten => s,1003,Set(CHANNEL(hangup_handler_push)=logoutemployee,s,1(hangup_handler))
> exten => s,1004,Set(CHANNEL(after_bridge_goto)=logoutemployee,s,1(after_bridge))
> exten => s,1005,MixMonitor(${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${CALLERID(num)}-${CALLEDNUM}.wav)
> exten => s,1006,Playback(beep)
> exten => s,1007,Bridge(${SHARED(connecttochannel)},p)
> exten => s,1008,Noop(here ${BRIDGEPEER})
> exten => s,1009,Wait(5)
> exten => s,1010,Hangup()
> exten => h,1,Noop(in hangup)
> {noformat}
> {noformat}
> -- Executing [s at newanswer:1001] Set("Local/69 at default-000000bb;2", "CALLEDNUM=28") in new stack
> -- Executing [s at newanswer:1002] AGI("Local/69 at default-000000bb;2", "googletts.agi,"Sie werden mit Frédéric Steinfels verbunden.",de,,1.4") in new stack
> -- Launched AGI Script /var/lib/asterisk/agi-bin/googletts.agi
> -- <Local/69 at default-000000bb;2> Playing '/data/Telefon/googletts//9c3c06da9e11b5448585f24c9285641b.1.4.slin16' (escape_digits=) (sample_offset 0) (language 'en')
> -- <Local/69 at default-000000bb;2>AGI Script googletts.agi completed, returning 0
> -- Executing [s at newanswer:1003] Set("Local/69 at default-000000bb;2", "CHANNEL(hangup_handler_push)=logoutemployee,s,1(hangup_handler)") in new stack
> -- Executing [s at newanswer:1004] Set("Local/69 at default-000000bb;2", "CHANNEL(after_bridge_goto)=logoutemployee,s,1(after_bridge)") in new stack
> -- Executing [s at newanswer:1005] MixMonitor("Local/69 at default-000000bb;2", "20180502-002543-29-28.wav") in new stack
> -- Executing [s at newanswer:1006] Playback("Local/69 at default-000000bb;2", "beep") in new stack
> == Begin MixMonitor Recording Local/69 at default-000000bb;2
> -- <Local/69 at default-000000bb;2> Playing 'beep.gsm' (language 'en')
> -- Executing [s at newanswer:1007] Bridge("Local/69 at default-000000bb;2", "Local/28 at default-000000bd;1,p") in new stack
> == Spawn extension (receptionist4, s, 16) exited non-zero on 'Surrogate/Local/28 at default-000000bd;1'
> -- Channel Local/28 at default-000000bd;1 joined 'simple_bridge' basic-bridge <8e648097-8dcd-451d-9bb6-5cd7a3aa57a9>
> -- Channel Local/69 at default-000000bb;2 joined 'simple_bridge' basic-bridge <8e648097-8dcd-451d-9bb6-5cd7a3aa57a9>
> -- <Local/28 at default-000000bd;1> Playing 'beep.slin192' (language 'en')
> > Move-swap optimizing Local/28 at default-000000bd;1 <-- PJSIP/28-000000b9.
> -- Channel PJSIP/28-000000b9 left 'simple_bridge' basic-bridge <e08c964b-c6a1-4c37-8322-16118a5644c2>
> -- Channel Local/28 at default-000000bd;1 left 'simple_bridge' basic-bridge <8e648097-8dcd-451d-9bb6-5cd7a3aa57a9>
> -- Channel PJSIP/28-000000b9 swapped with Local/28 at default-000000bd;1 into 'simple_bridge' basic-bridge <8e648097-8dcd-451d-9bb6-5cd7a3aa57a9>
> -- Channel Local/28 at default-000000bd;2 left 'simple_bridge' basic-bridge <e08c964b-c6a1-4c37-8322-16118a5644c2>
> -- Executing [s at receptionist4:17] Playback("Local/28 at default-000000bd;1", "beep") in new stack
> == Spawn extension (local-sip-call, s, 11) exited non-zero on 'Local/28 at default-000000bd;2'
> -- <Local/28 at default-000000bd;1> Playing 'beep.gsm' (language 'en')
> {noformat}
> when hanging up:
> {noformat}
> -- Channel PJSIP/mobile-000000b7 left 'simple_bridge' basic-bridge <a5a00ca2-c9f0-4943-8ccc-39837695842b>
> -- Channel Local/69 at default-000000bb;1 left 'simple_bridge' basic-bridge <a5a00ca2-c9f0-4943-8ccc-39837695842b>
> == Spawn extension (internal2local, s, 13) exited non-zero on 'PJSIP/mobile-000000b7'
> -- Executing [s at logoutemployee:1] NoOp("Local/69 at default-000000bb;1", "I am channel Local/69 at default-000000bb;1 and and ") in new stack
> -- Executing [s at logoutemployee:2] Return("Local/69 at default-000000bb;1", "") in new stack
> [May 2 00:25:49] ERROR[8746][C-00000040]: app_stack.c:389 return_exec: Return without Gosub: stack is unallocated
> == Spawn extension (logoutemployee, s, 2) exited non-zero on 'Local/69 at default-000000bb;1'
> -- Channel Local/69 at default-000000bb;2 left 'simple_bridge' basic-bridge <8e648097-8dcd-451d-9bb6-5cd7a3aa57a9>
> -- Channel PJSIP/28-000000b9 left 'simple_bridge' basic-bridge <8e648097-8dcd-451d-9bb6-5cd7a3aa57a9>
> -- Executing [h at newanswer:1] NoOp("Local/69 at default-000000bb;2", "in hangup") in new stack
> -- Local/69 at default-000000bb;2 Internal Gosub(logoutemployee,s,1(hangup_handler)) start
> -- Executing [s at logoutemployee:1] NoOp("Local/69 at default-000000bb;2", "I am channel Local/69 at default-000000bb;2 and and hangup_handler") in new stack
> -- Executing [s at logoutemployee:2] Return("Local/69 at default-000000bb;2", "") in new stack
> == Spawn extension (newanswer, h, 2) exited non-zero on 'Local/69 at default-000000bb;2'
> -- Local/69 at default-000000bb;2 Internal Gosub(logoutemployee,s,1(hangup_handler)) complete GOSUB_RETVAL=
> == Spawn extension (newanswer, h, 2) exited non-zero on 'Local/69 at default-000000bb;2'
> -- Local/69 at default-000000bb;2 Internal Gosub(kill-originated,s,1) complete GOSUB_RETVAL=
> == MixMonitor close filestream (mixed)
> == End MixMonitor Recording Local/69 at default-000000bb;2
> {noformat}
> Scenario 3: Bridge command with MixMonitor, beep before MixMonitor
> {noformat}
> exten => s,1001,Set(CALLEDNUM=${SHARED(connecttocid)})
> exten => s,1002,agi(googletts.agi,"Sie werden mit ${ADMIN-${SHARED(connecttoadminid)}-spokenfname} ${ADMIN-${SHARED(connecttoadminid)}-spokenlname} verbunden.",de,,1.4)
> exten => s,1003,Set(CHANNEL(hangup_handler_push)=logoutemployee,s,1(hangup_handler))
> exten => s,1004,Set(CHANNEL(after_bridge_goto)=logoutemployee,s,1(after_bridge))
> exten => s,1005,Playback(beep)
> exten => s,1006,MixMonitor(${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${CALLERID(num)}-${CALLEDNUM}.wav)
> exten => s,1007,Bridge(${SHARED(connecttochannel)},p)
> exten => s,1008,Noop(here ${BRIDGEPEER})
> exten => s,1009,Wait(5)
> exten => s,1010,Hangup()
> exten => h,1,Noop(in hangup)
> {noformat}
> {noformat}
> -- Executing [s at newanswer:1001] Set("Local/69 at default-000000c1;2", "CALLEDNUM=28") in new stack
> -- Executing [s at newanswer:1002] AGI("Local/69 at default-000000c1;2", "googletts.agi,"Sie werden mit Frédéric Steinfels verbunden.",de,,1.4") in new stack
> -- Launched AGI Script /var/lib/asterisk/agi-bin/googletts.agi
> -- <Local/69 at default-000000c1;2> Playing '/data/Telefon/googletts//9c3c06da9e11b5448585f24c9285641b.1.4.slin16' (escape_digits=) (sample_offset 0) (language 'en')
> -- <Local/69 at default-000000c1;2>AGI Script googletts.agi completed, returning 0
> -- Executing [s at newanswer:1003] Set("Local/69 at default-000000c1;2", "CHANNEL(hangup_handler_push)=logoutemployee,s,1(hangup_handler)") in new stack
> -- Executing [s at newanswer:1004] Set("Local/69 at default-000000c1;2", "CHANNEL(after_bridge_goto)=logoutemployee,s,1(after_bridge)") in new stack
> -- Executing [s at newanswer:1005] Playback("Local/69 at default-000000c1;2", "beep") in new stack
> -- <Local/69 at default-000000c1;2> Playing 'beep.gsm' (language 'en')
> -- Executing [s at newanswer:1006] MixMonitor("Local/69 at default-000000c1;2", "20180502-003048-29-28.wav") in new stack
> -- Executing [s at newanswer:1007] Bridge("Local/69 at default-000000c1;2", "Local/28 at default-000000c3;1,p") in new stack
> == Begin MixMonitor Recording Local/69 at default-000000c1;2
> == Spawn extension (receptionist4, s, 16) exited non-zero on 'Surrogate/Local/28 at default-000000c3;1'
> -- Channel Local/28 at default-000000c3;1 joined 'simple_bridge' basic-bridge <2702b6fb-41e5-4696-bc54-cd7312b0a68d>
> -- Channel Local/69 at default-000000c1;2 joined 'simple_bridge' basic-bridge <2702b6fb-41e5-4696-bc54-cd7312b0a68d>
> -- <Local/28 at default-000000c3;1> Playing 'beep.gsm' (language 'en')
> > Move-swap optimizing Local/28 at default-000000c3;1 <-- PJSIP/28-000000bf.
> -- Channel PJSIP/28-000000bf left 'simple_bridge' basic-bridge <9078b1e8-0149-430b-acb2-3b351814be3d>
> -- Channel Local/28 at default-000000c3;1 left 'simple_bridge' basic-bridge <2702b6fb-41e5-4696-bc54-cd7312b0a68d>
> -- Channel PJSIP/28-000000bf swapped with Local/28 at default-000000c3;1 into 'simple_bridge' basic-bridge <2702b6fb-41e5-4696-bc54-cd7312b0a68d>
> -- Channel Local/28 at default-000000c3;2 left 'simple_bridge' basic-bridge <9078b1e8-0149-430b-acb2-3b351814be3d>
> -- Executing [s at receptionist4:17] Playback("Local/28 at default-000000c3;1", "beep") in new stack
> == Spawn extension (local-sip-call, s, 11) exited non-zero on 'Local/28 at default-000000c3;2'
> -- <Local/28 at default-000000c3;1> Playing 'beep.gsm' (language 'en')
> {noformat}
> when hanging up:
> {noformat}
> -- Channel PJSIP/mobile-000000bd left 'simple_bridge' basic-bridge <bf89b7d9-10af-4586-a6f7-fdc42444bcc9>
> -- Channel Local/69 at default-000000c1;1 left 'simple_bridge' basic-bridge <bf89b7d9-10af-4586-a6f7-fdc42444bcc9>
> == Spawn extension (internal2local, s, 13) exited non-zero on 'PJSIP/mobile-000000bd'
> -- Executing [s at logoutemployee:1] NoOp("Local/69 at default-000000c1;1", "I am channel Local/69 at default-000000c1;1 and and ") in new stack
> -- Executing [s at logoutemployee:2] Return("Local/69 at default-000000c1;1", "") in new stack
> [May 2 00:30:53] ERROR[12280][C-00000042]: app_stack.c:389 return_exec: Return without Gosub: stack is unallocated
> == Spawn extension (logoutemployee, s, 2) exited non-zero on 'Local/69 at default-000000c1;1'
> -- Channel Local/69 at default-000000c1;2 left 'simple_bridge' basic-bridge <2702b6fb-41e5-4696-bc54-cd7312b0a68d>
> -- Channel PJSIP/28-000000bf left 'simple_bridge' basic-bridge <2702b6fb-41e5-4696-bc54-cd7312b0a68d>
> -- Executing [h at newanswer:1] NoOp("Local/69 at default-000000c1;2", "in hangup") in new stack
> -- Local/69 at default-000000c1;2 Internal Gosub(logoutemployee,s,1(hangup_handler)) start
> -- Executing [s at logoutemployee:1] NoOp("Local/69 at default-000000c1;2", "I am channel Local/69 at default-000000c1;2 and and hangup_handler") in new stack
> -- Executing [s at logoutemployee:2] Return("Local/69 at default-000000c1;2", "") in new stack
> == Spawn extension (newanswer, h, 2) exited non-zero on 'Local/69 at default-000000c1;2'
> -- Local/69 at default-000000c1;2 Internal Gosub(logoutemployee,s,1(hangup_handler)) complete GOSUB_RETVAL=
> == Spawn extension (newanswer, h, 2) exited non-zero on 'Local/69 at default-000000c1;2'
> -- Local/69 at default-000000c1;2 Internal Gosub(kill-originated,s,1) complete GOSUB_RETVAL=
> == MixMonitor close filestream (mixed)
> == End MixMonitor Recording Local/69 at default-000000c1;2
> {noformat}
> I am seeing these errors/facts:
> - In scenario 1, after_bridge_goto is not called at all
> - In scenario 1, hangup_handler_push is called immediately after the Bridge command
> - In scenario 1, h extension is not called at all
> - In scenario 1, for some reason, the Beep command can not be played on one of the channels
> - In scenario 2, after_bridge is ok
> - In scenario 2, hangup_handler_push is ok
> - In scenario 2, h extension is ok
> - In scenario 2, mixmonitor file is too long and contains no audio except the beep
> - In scenario 3, after_bridge is ok
> - In scenario 3, hangup_handler_push is ok
> - In scenario 3, h extension is ok
> - In scenario 3, mixmonitor file is ok
> Btw: The bridge command lacks various flags that the Queue and Dial command have like pre-bridge macros (M and U flags in the dial command).
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list