ConfBridge dialplan_exec configuration not working as expected

I have two channels in a ConfBridge. When one of them presses 9, I want to have them exit the conference room, place a dial, then connect and talk. Once they hang up, the caller should automatically get put back into the conference room.

ConfBridge.conf

[amtelco-conference-menu]
type=menu
9=dialplan_exec(nway-invite,9,1)
8=leave_conference

The issue is that once the caller connects to the call (Answer) the call flow continues in the dialplan and puts the channel back in the conference room right away. I am using the ‘g’ option in the Dial application, however, if I didn’t, the channel would still get placed back in the conference room right away.

I expect that the dialplan flow would stop when a call gets connected. Then once a channel hangs up, the dialplan execution would continue and end and then eventually place the channel back in the conference room.

If this is a bug in Asterisk, or something that the conference bridge menu is unable to do by design, is there any other design suggestions I can do to solve my goal? Or is there any suggestions on what I can try in order to resolve.

Thanks
Jeff

You’d need to show what the dialplan actually does.

Let me know if this is enough or what else I need to send. Thanks.

features.conf

[general]
atxfernoanswertimeout = 45

[featuremap]
blindxfer => #1
disconnect => ##
atxfer => *2

[applicationmap]
nway-start => 9#,self,Macro,nway-start
nway-test => 6,self,Playback,hello-world
nway-add => 7,self,Macro,nway-addcallee
nway-drop => 0,self,Macro,nway-dropcallee

Dialplan snippets

[nway-placeinconf]
exten => _XXXXX-XXXXXX,1,noop(nway-placeinconf)
same => n,Answer
same => n,Set(CONFNO={EXTEN}) same => n,Set(__DYNAMIC_FEATURES=) same => n(goconf),ConfBridge({CONFNO},amtelco-conference-menu)
same => n,Read(DEST,dial,i)
same => n,NoOp(before calling 3rd party)
same => n,Set(__DYNAMIC_FEATURES=nway-add#nway-drop)
same => n,Dial(PJSIP/{DEST}@{LOCALT1TRUNK},g)
same => n,NoOp(after calling 3rd party)
same => n,Goto(goconf)

[nway-invite]

exten => 6513064910,1,Dial(PJSIP/{EXTEN}@{CALLROUTER})
same => n,NoOp(After outbound dial man)

exten => 6126706994,1,Dial(PJSIP/{EXTEN}@{CALLROUTER})
same => n,NoOp(After outbound dial man)

exten => 9,1,Read(DEST,dial,i)
same => n,Set(__DYNAMIC_FEATURES=nway-add#nway-drop#nway-test)
same => n,Dial(PJSIP/{DEST}@{CALLROUTER},g)
same => n,NoOp(should not see this right after a successful connection)

[macro-nway-start]
exten => s,1,NoOp(start)
same => n,Set(CONFNO={CALLERID(num)}-{STRFTIME({EPOCH},,%H%M%S)}) same => n,Userevent(AMTELCOCONFERENCE,bridgepeer:{BRIDGEPEER},agentsipuser:{CALLERID(num)},room:{CONFNO})
same => n,ChannelRedirect({BRIDGEPEER},nway-placeinconf,{CONFNO},1)
same => n,MacroExit()

[macro-nway-addcallee]
exten => s,1,noop(macro-nway-addcallee)
exten => s,2,ChannelRedirect({BRIDGEPEER},nway-placeinconf,{CONFNO},1)

[macro-nway-dropcallee]
exten => s,1,noop(macro-nway-dropcallee)
exten => s,2,SoftHangup(${BRIDGEPEER})

-- Local/11001@agent_callback-00000149;1 answered PJSIP/blm-crtr-v02-00000525
-- Stopped music on hold on PJSIP/blm-crtr-v02-00000525
-- Channel PJSIP/11001-00000526 joined 'simple_bridge' basic-bridge <0327f209-9acc-471f-92a6-530717d7b667>
-- Channel Local/11001@agent_callback-00000149;2 joined 'simple_bridge' basic-bridge <0327f209-9acc-471f-92a6-530717d7b667>
-- Channel Local/11001@agent_callback-00000149;1 joined 'simple_bridge' basic-bridge <3168ee2f-02ca-43ed-a118-01f5dee5e172>
-- Channel PJSIP/blm-crtr-v02-00000525 joined 'simple_bridge' basic-bridge <3168ee2f-02ca-43ed-a118-01f5dee5e172>
   > Move-swap optimizing Local/11001@agent_callback-00000149;1 <-- PJSIP/11001-00000526.
-- Channel PJSIP/11001-00000526 left 'simple_bridge' basic-bridge <0327f209-9acc-471f-92a6-530717d7b667>
-- Channel Local/11001@agent_callback-00000149;1 left 'simple_bridge' basic-bridge <3168ee2f-02ca-43ed-a118-01f5dee5e172>
-- Channel PJSIP/11001-00000526 swapped with Local/11001@agent_callback-00000149;1 into 'simple_bridge' basic-bridge <3168ee2f-02ca-43ed-a118-01f5dee5e172>
-- Channel Local/11001@agent_callback-00000149;2 left 'simple_bridge' basic-bridge <0327f209-9acc-471f-92a6-530717d7b667>

== Spawn extension (agent_callback, 11001, 5) exited non-zero on ‘Local/11001@agent_callback-00000149;2’
> 0x7fe94c3e59b0 – Strict RTP qualifying stream type: audio
> 0x7fe95000af10 – Strict RTP learning complete - Locking on source address 10.0.25.84:11098
> 0x7fe94c3e59b0 – Strict RTP switching source address to 10.0.22.27:4002
> 0x7fe94c3e59b0 – Strict RTP learning complete - Locking on source address 10.0.22.27:4002
– Executing [s@macro-nway-start:1] NoOp(“PJSIP/11001-00000526”, “start”) in new stack
– Executing [s@macro-nway-start:2] Set(“PJSIP/11001-00000526”, “CONFNO=11001-160849”) in new stack
– Executing [s@macro-nway-start:3] UserEvent(“PJSIP/11001-00000526”, “AMTELCOCONFERENCE,bridgepeer:PJSIP/blm-crtr-v02-00000525,agentsipuser:11001,room:11001-160849”) in new stack
– Executing [s@macro-nway-start:4] ChannelRedirect(“PJSIP/11001-00000526”, “PJSIP/blm-crtr-v02-00000525,nway-placeinconf,11001-160849,1”) in new stack
– Executing [s@macro-nway-start:5] MacroExit(“PJSIP/11001-00000526”, “”) in new stack
– Channel PJSIP/blm-crtr-v02-00000525 left ‘simple_bridge’ basic-bridge <3168ee2f-02ca-43ed-a118-01f5dee5e172>
– Channel PJSIP/11001-00000526 left ‘simple_bridge’ basic-bridge <3168ee2f-02ca-43ed-a118-01f5dee5e172>
– Executing [11001@agent_callback:6] NoOp(“PJSIP/11001-00000526”, “Continue in Dialplan agent_callback context”) in new stack
– Executing [11001-160849@nway-placeinconf:1] NoOp(“PJSIP/blm-crtr-v02-00000525”, “nway-placeinconf”) in new stack
– Executing [11001-160849@nway-placeinconf:2] Answer(“PJSIP/blm-crtr-v02-00000525”, “”) in new stack
– Executing [11001-160849@nway-placeinconf:3] Set(“PJSIP/blm-crtr-v02-00000525”, “CONFNO=11001-160849”) in new stack
– Executing [11001-160849@nway-placeinconf:4] Set(“PJSIP/blm-crtr-v02-00000525”, “__DYNAMIC_FEATURES=”) in new stack
– Executing [11001-160849@nway-placeinconf:5] ConfBridge(“PJSIP/blm-crtr-v02-00000525”, “11001-160849,amtelco-conference-menu”) in new stack
– Executing [11001@agent_callback:7] NoOp(“PJSIP/11001-00000526”, “Channel: PJSIP/11001-00000526”) in new stack
– Executing [11001@agent_callback:8] NoOp(“PJSIP/11001-00000526”, “Conference Number: 11001-160849”) in new stack
– Executing [11001@agent_callback:9] ChannelRedirect(“PJSIP/11001-00000526”, “PJSIP/11001-00000526,nway-placeinconf,11001-160849,1”) in new stack
– Executing [11001-160849@nway-placeinconf:1] NoOp(“PJSIP/11001-00000526”, “nway-placeinconf”) in new stack
– Executing [11001-160849@nway-placeinconf:2] Answer(“PJSIP/11001-00000526”, “”) in new stack
– Executing [11001-160849@nway-placeinconf:3] Set(“PJSIP/11001-00000526”, “CONFNO=11001-160849”) in new stack
– Executing [11001-160849@nway-placeinconf:4] Set(“PJSIP/11001-00000526”, “__DYNAMIC_FEATURES=”) in new stack
– Executing [11001-160849@nway-placeinconf:5] ConfBridge(“PJSIP/11001-00000526”, “11001-160849,amtelco-conference-menu”) in new stack
– Channel CBAnn/11001-160849-0000014a;2 joined ‘softmix’ base-bridge <9b82e7bf-fba6-4355-9ba1-bd5f2986e6c3>
[Jan 30 16:08:49] WARNING[22398][C-00000307]: res_musiconhold.c:1441 load_realtime_musiconhold: Music on Hold class ‘answeringservice’ not found in memory/database. Verify your configuration.
– Started music on hold, class ‘default’, on channel ‘PJSIP/blm-crtr-v02-00000525’
– Channel PJSIP/blm-crtr-v02-00000525 joined ‘softmix’ base-bridge <9b82e7bf-fba6-4355-9ba1-bd5f2986e6c3>
– Stopped music on hold on PJSIP/blm-crtr-v02-00000525
– Channel PJSIP/11001-00000526 joined ‘softmix’ base-bridge <9b82e7bf-fba6-4355-9ba1-bd5f2986e6c3>
– Executing [9@nway-invite:1] NoOp(“PJSIP/11001-00000526”, “start”) in new stack
– Executing [9@nway-invite:2] Set(“PJSIP/11001-00000526”, “__DYNAMIC_FEATURES=nway-add#nway-drop#nway-test”) in new stack
– Executing [9@nway-invite:3] Dial(“PJSIP/11001-00000526”, “PJSIP/6126706994@blm-crtr-v02,g”) in new stack
– Called PJSIP/6126706994@blm-crtr-v02
> 0x7fe9500ce080 – Strict RTP learning after remote address set to: 10.0.25.32:11186
– PJSIP/blm-crtr-v02-00000527 is making progress passing it to PJSIP/11001-00000526
– PJSIP/blm-crtr-v02-00000527 is making progress passing it to PJSIP/11001-00000526
– PJSIP/blm-crtr-v02-00000527 is making progress passing it to PJSIP/11001-00000526
– PJSIP/blm-crtr-v02-00000527 is making progress passing it to PJSIP/11001-00000526
– PJSIP/blm-crtr-v02-00000527 is making progress passing it to PJSIP/11001-00000526
– PJSIP/blm-crtr-v02-00000527 is making progress passing it to PJSIP/11001-00000526
– PJSIP/blm-crtr-v02-00000527 is making progress passing it to PJSIP/11001-00000526
– PJSIP/blm-crtr-v02-00000527 is making progress passing it to PJSIP/11001-00000526
– PJSIP/blm-crtr-v02-00000527 is making progress passing it to PJSIP/11001-00000526
– PJSIP/blm-crtr-v02-00000527 is making progress passing it to PJSIP/11001-00000526
– PJSIP/blm-crtr-v02-00000527 is making progress passing it to PJSIP/11001-00000526
– PJSIP/blm-crtr-v02-00000527 is making progress passing it to PJSIP/11001-00000526
– PJSIP/blm-crtr-v02-00000527 is making progress passing it to PJSIP/11001-00000526
– PJSIP/blm-crtr-v02-00000527 is making progress passing it to PJSIP/11001-00000526
> 0x7fe9500ce080 – Strict RTP switching to RTP target address 10.0.25.32:11186 as source
– PJSIP/blm-crtr-v02-00000527 answered PJSIP/11001-00000526
– Channel PJSIP/blm-crtr-v02-00000527 joined ‘simple_bridge’ basic-bridge
– Executing [9@nway-invite:4] NoOp(“PJSIP/11001-00000526”, “should not see this right after a successful connection”) in new stack
– Auto fallthrough, channel ‘PJSIP/11001-00000526’ status is ‘ANSWER’
> 0x7fe9500ce080 – Strict RTP learning after remote address set to: 10.0.25.84:17072
> 0x7fe9500ce080 – Strict RTP switching to RTP target address 10.0.25.84:17072 as source
> 0x7fe9500ce080 – Strict RTP learning complete - Locking on source address 10.0.25.84:17072
> 0x7fe9500ce080 – Strict RTP learning after remote address set to: 10.0.25.32:11186
– Channel PJSIP/blm-crtr-v02-00000527 left ‘simple_bridge’ basic-bridge
> 0x7fe95000af10 – Strict RTP learning after remote address set to: 10.0.25.32:17492
– Channel PJSIP/blm-crtr-v02-00000525 left ‘softmix’ base-bridge <9b82e7bf-fba6-4355-9ba1-bd5f2986e6c3>
– Started music on hold, class ‘default’, on channel ‘PJSIP/11001-00000526’
– Stopped music on hold on PJSIP/11001-00000526
– Channel PJSIP/11001-00000526 left ‘softmix’ base-bridge <9b82e7bf-fba6-4355-9ba1-bd5f2986e6c3>
– Channel CBAnn/11001-160849-0000014a;2 left ‘softmix’ base-bridge <9b82e7bf-fba6-4355-9ba1-bd5f2986e6c3>
== MixMonitor close filestream (mixed)
== End MixMonitor Recording PJSIP/11001-00000526
h

It’s likely the use of Dial() in the dialplan. You’re still in the conference bridge fundamentally, even if you’re executing dialplan. Since you can’t be in two bridges at once the bridge that Dial() creates for the call likely fails when the channel attempts to join. I believe this has come up a few times in the past on the forum, I do not recall what (if anything) people did instead.

{Above fixed for failing to correctly markup for the forum, assuming what damage that caused.]

; IMPORTANT NOTE: The applicationmap is not intended to be used for all Asterisk
; applications. When applications are used in extensions.conf, they are executed
; by the PBX core. In this case, these applications are executed outside of the
; PBX core, so it does not make sense to use any application which has any
; concept of dialplan flow. Examples of this would be things like Goto,
; Background, WaitExten, and many more. The exceptions to this are Gosub and
; Macro routines which must complete for the call to continue.
;

This is how I got it to do what I needed it to do. dialplan_exec(context,exten,priority) runs dialplan applications in the realm of the confbridge as jColp mentions above. However, “leave_conference” will leave the realm of the confbridge and continue the dialplan execution. Therefore, when I want to invite another party to the conference call, I will “leave_conference”, run dialplan to Dial() and then put back into the conference room (using features.conf to channel redirect the 3rd party and Goto() in the dialplan to put the agent back in the conference room). Finally, when I want the agent to leave the conference room for good, with original caller and 3rd party by themselves, I do a dialplan_exec() that just hangs up the agent channel.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.