Change bridges in a confbridge

Hi Everyone
I´m using
Confbridge in Asterisk 20.

I need change between conference bridge.

On confbridge menu I have one option that use teh dialplan_exec(), and send to dialplan that user dial the room number and need change the bridge.

I´m trying make with AMI. I make a confbridgekick and after a originate(). But confbridge kick drop the call.

In old version had the confbridgeadd, but in this haven´t.

How can I do?

ConfBridgeKick should result in the channel going back into the dialplan at the next priority. I would suggest showing an actual Asterisk log and accompanying dialplan to show it failing.

Asterisk Log:

In this I change of bridge 1 to bridge 200.

-- Executing [s@trocar-sala:1] Answer("PJSIP/4832960032-00000001", "") in new stack
-- Executing [s@trocar-sala:1] Answer("PJSIP/4832960032-00000001", "") in new stack
-- Executing [s@trocar-sala:2] BackGround("PJSIP/4832960032-00000001", "digite_sala_entrar") in new stack
-- Executing [s@trocar-sala:2] BackGround("PJSIP/4832960032-00000001", "digite_sala_entrar") in new stack
-- <PJSIP/4832960032-00000001> Playing 'digite_sala_entrar.slin' (language 'en')
-- <PJSIP/4832960032-00000001> Playing 'digite_sala_entrar.slin' (language 'en')
-- Executing [s@trocar-sala:3] Read("PJSIP/4832960032-00000001", "NOVA_SALA,,4,,3") in new stack
-- Executing [s@trocar-sala:3] Read("PJSIP/4832960032-00000001", "NOVA_SALA,,4,,3") in new stack
-- Accepting a maximum of 4 digits.
-- Accepting a maximum of 4 digits.
-- User entered '200'
-- User entered '200'
-- Executing [s@trocar-sala:4] AGI("PJSIP/4832960032-00000001", "mudar_sala.py,200,4832960032") in new stack
-- Executing [s@trocar-sala:4] AGI("PJSIP/4832960032-00000001", "mudar_sala.py,200,4832960032") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/mudar_sala.py
-- Launched AGI Script /var/lib/asterisk/agi-bin/mudar_sala.py

== Manager ‘admin’ logged on from 127.0.0.1
== Manager ‘admin’ logged on from 127.0.0.1
== Manager ‘admin’ logged off from 127.0.0.1
== Manager ‘admin’ logged off from 127.0.0.1
– <PJSIP/4832960032-00000001>AGI Script mudar_sala.py completed, returning 0
– <PJSIP/4832960032-00000001>AGI Script mudar_sala.py completed, returning 0
– Executing [s@trocar-sala:5] AGI(“PJSIP/4832960032-00000001”, “pegar_sala.py,4832960032”) in new stack
– Executing [s@trocar-sala:5] AGI(“PJSIP/4832960032-00000001”, “pegar_sala.py,4832960032”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/pegar_sala.py
– Launched AGI Script /var/lib/asterisk/agi-bin/pegar_sala.py
– <PJSIP/4832960032-00000001>AGI Script pegar_sala.py completed, returning 0
– <PJSIP/4832960032-00000001>AGI Script pegar_sala.py completed, returning 0
– Executing [s@trocar-sala:6] Playback(“PJSIP/4832960032-00000001”, “entrando_sala&num2&num0&num0”) in new stack
– Executing [s@trocar-sala:6] Playback(“PJSIP/4832960032-00000001”, “entrando_sala&num2&num0&num0”) in new stack
– <PJSIP/4832960032-00000001> Playing ‘entrando_sala.slin’ (language ‘en’)
– <PJSIP/4832960032-00000001> Playing ‘entrando_sala.slin’ (language ‘en’)
– <PJSIP/4832960032-00000001> Playing ‘num2.slin’ (language ‘en’)
– <PJSIP/4832960032-00000001> Playing ‘num2.slin’ (language ‘en’)
– <PJSIP/4832960032-00000001> Playing ‘num0.slin’ (language ‘en’)
– <PJSIP/4832960032-00000001> Playing ‘num0.slin’ (language ‘en’)
– <PJSIP/4832960032-00000001> Playing ‘num0.slin’ (language ‘en’)
– <PJSIP/4832960032-00000001> Playing ‘num0.slin’ (language ‘en’)
– Executing [s@trocar-sala:7] Playback(“PJSIP/4832960032-00000001”, “beep”) in new stack
– Executing [s@trocar-sala:7] Playback(“PJSIP/4832960032-00000001”, “beep”) in new stack
– <PJSIP/4832960032-00000001> Playing ‘beep.slin’ (language ‘en’)
– <PJSIP/4832960032-00000001> Playing ‘beep.slin’ (language ‘en’)
– Executing [s@trocar-sala:8] ConfBridge(“PJSIP/4832960032-00000001”, “1,1,default_user,sample_user_menu”) in new stack
– Executing [s@trocar-sala:8] ConfBridge(“PJSIP/4832960032-00000001”, “1,1,default_user,sample_user_menu”) in new stack
– Auto fallthrough, channel ‘PJSIP/4832960032-00000001’ status is ‘UNKNOWN’
– Auto fallthrough, channel ‘PJSIP/4832960032-00000001’ status is ‘UNKNOWN’
– Channel PJSIP/4832960032-00000001 left ‘softmix’ base-bridge
– Channel PJSIP/4832960032-00000001 left ‘softmix’ base-bridge
– <PJSIP/4832960032-00000001> Playing ‘conf-kicked.slin’ (language ‘en’)
– <PJSIP/4832960032-00000001> Playing ‘conf-kicked.slin’ (language ‘en’)
– <CBAnn/1-00000001;1> Playing ‘confbridge-join.slin’ (language ‘en’)
– <CBAnn/1-00000001;1> Playing ‘confbridge-join.slin’ (language ‘en’)
– <CBAnn/1-00000001;1> Playing ‘confbridge-leave.slin’ (language ‘en’)
– <CBAnn/1-00000001;1> Playing ‘confbridge-leave.slin’ (language ‘en’)
– <CBAnn/1-00000001;1> Playing ‘confbridge-leave.slin’ (language ‘en’)
– <CBAnn/1-00000001;1> Playing ‘confbridge-leave.slin’ (language ‘en’)
– Channel CBAnn/1-00000001;2 left ‘softmix’ base-bridge
– Channel CBAnn/1-00000001;2 left ‘softmix’ base-bridge
– Executing [s@entrar-sala:8] Set(“PJSIP/4832960032-00000001”, “SALA=”) in new stack
– Executing [s@entrar-sala:8] Set(“PJSIP/4832960032-00000001”, “SALA=”) in new stack
– Auto fallthrough, channel ‘PJSIP/4832960032-00000001’ status is ‘UNKNOWN’
– Auto fallthrough, channel ‘PJSIP/4832960032-00000001’ status is ‘UNKNOWN’
– Executing [h@entrar-sala:1] NoOp(“PJSIP/4832960032-00000001”, “EXTENSÃO H EXECUTADA: Removendo participante ao desligar”) in new stack
– Executing [h@entrar-sala:1] NoOp(“PJSIP/4832960032-00000001”, “EXTENSÃO H EXECUTADA: Removendo participante ao desligar”) in new stack
– Executing [h@entrar-sala:2] AGI(“PJSIP/4832960032-00000001”, “sair_sala.py,4832960032”) in new stack
– Executing [h@entrar-sala:2] AGI(“PJSIP/4832960032-00000001”, “sair_sala.py,4832960032”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/sair_sala.py
– Launched AGI Script /var/lib/asterisk/agi-bin/sair_sala.py
– <PJSIP/4832960032-00000001>AGI Script sair_sala.py completed, returning 0
– <PJSIP/4832960032-00000001>AGI Script sair_sala.py completed, returning 0
– Executing [h@entrar-sala:3] Hangup(“PJSIP/4832960032-00000001”, “”) in new stack
– Executing [h@entrar-sala:3] Hangup(“PJSIP/4832960032-00000001”, “”) in new stack
== Spawn extension (entrar-sala, h, 3) exited non-zero on ‘PJSIP/4832960032-00000001’
== Spawn extension

Dialplan:

[trocar-sala]
exten => s,1,Answer()
exten => s,n,Background(digite_sala_entrar)
exten => s,n,Read(NOVA_SALA,4,3)
exten => s,n,AGI(mudar_sala.py,${NOVA_SALA},${CALLERID(num)})
exten => s,n,AGI(pegar_sala.py,${CALLERID(num)})
exten => s,n,Playback(entrando_sala&${SALA_ATUAL})
exten => s,n,Playback(beep)
exten => s,n,ConfBridge(${SALA},${SALA},default_user,sample_user_menu)

There are no further dialplan instructions after ConfBridge is executed, so if a channel were kicked it would auto fallthrough and hang up.

And what do I need to finish after Confbridge()?

From my understanding this confbridge() is already to enter the bridge, normally I end it with a hangup().

Write out the specific flow, without implementation details, of how you would expect it to work and then potentially I, or someone else, could provide input.

-I incoming on bridge 1
-When in this bridge I press bridge menu option 6, send me to dialplan.
-I digit the number of other bridge, for exemple 200
-I´m will redirect to bridge 200.

This is the behavior I hope will happen.

Thank you.

That sounds like implementation details, to me!

This is a question about how I configue change between bridges on a confbridge, using asterisk 20.

You’ve been advised to change the question into one that describes the intended end user experience, in terms that would make sense to someone who has no understanding of the internals of a PABX.

OK, I understand.

I will re-write my question.

I am facing the same issue described in this post: Moving between conferences confbridge(), but I am using Asterisk 20.

My approach was to use ConfBridgeKick() to remove the participant from the current conference and then Originate() to place them in another conference. However, the call drops during the process.

I would like to know if this is the correct procedure for this type of interaction or if there is a better-recommended way to handle moving participants between conferences in Asterisk 20.

Hi everyone

I keep trying to transfer a user from a bridge. Now I’m trying to use ChannelRedirect().

When I do the channel redirect via the CLI it works normally. But when I try in Dialplan, it doesn’t make the change, I tried ChannelRedirect(), I tried it through System(asterisk -rx’…') and I tried it through the AMI. But none of these worked. The CLI displays the following message

Auto fallthrough, channel ‘PJSIP/4832960032-00000001’ status is ‘UNKNOWN’

This doesn’t help much sense without details of the dialplan carrying the original call and that triggering the redirect.

OK.

I try change of bridge 1 to bridge 5

Following the dialplan and CLI logs:

Dial Plan:

[change-bridge]
exten => s,1,Answer()
exten => s,n,ChannelRedirect(${CHANNEL},other-bridge,s,1)

[other-bridge]
exten => s,1,Answer()
exten => s,n,Playback(beep)
exten => s,n,ConfBridge(5,5,default_user,sample_user_menu)

CLI logs:
instance-20241106-150218CLI> confbridge list 1
Channel Flags User Profile Bridge Profile Menu CallerID
============================== ====== ================ ================ ================ ================
PJSIP/4832960032-00000000 default_user 1 sample_user_menu 4832960032
instance-20241106-150218
CLI> confbridge list 5
No conference bridge named ‘5’ found!
– Executing [s@change-bridge:1] Answer(“PJSIP/4832960032-00000000”, “”) in new stack
– Executing [s@change-bridge:1] Answer(“PJSIP/4832960032-00000000”, “”) in new stack
– Executing [s@change-bridge:2] ChannelRedirect(“PJSIP/4832960032-00000000”, “PJSIP/4832960032-00000000,other-bridge,s,1”) in new stack
– Executing [s@change-bridge:2] ChannelRedirect(“PJSIP/4832960032-00000000”, “PJSIP/4832960032-00000000,other-bridge,s,1”) in new stack
– Executing [s@other-bridge:1] Answer(“PJSIP/4832960032-00000000”, “”) in new stack
– Executing [s@other-bridge:1] Answer(“PJSIP/4832960032-00000000”, “”) in new stack
– Executing [s@other-bridge:2] Playback(“PJSIP/4832960032-00000000”, “beep”) in new stack
– Executing [s@other-bridge:2] Playback(“PJSIP/4832960032-00000000”, “beep”) in new stack
– <PJSIP/4832960032-00000000> Playing ‘beep.slin’ (language ‘en’)
– <PJSIP/4832960032-00000000> Playing ‘beep.slin’ (language ‘en’)
– Executing [s@other-bridge:3] ConfBridge(“PJSIP/4832960032-00000000”, “5,5,default_user,sample_user_menu”) in new stack
– Executing [s@other-bridge:3] ConfBridge(“PJSIP/4832960032-00000000”, “5,5,default_user,sample_user_menu”) in new stack
– Channel CBAnn/5-00000001;2 joined ‘softmix’ base-bridge <6ccb14bb-1655-42ed-94dd-b6f1c53808e7>
– Channel CBAnn/5-00000001;2 joined ‘softmix’ base-bridge <6ccb14bb-1655-42ed-94dd-b6f1c53808e7>
– <CBAnn/5-00000001;1> Playing ‘confbridge-join.slin’ (language ‘en’)
– <CBAnn/5-00000001;1> Playing ‘confbridge-join.slin’ (language ‘en’)
– <CBAnn/5-00000001;1> Playing ‘confbridge-leave.slin’ (language ‘en’)
– <CBAnn/5-00000001;1> Playing ‘confbridge-leave.slin’ (language ‘en’)
– Channel CBAnn/5-00000001;2 left ‘softmix’ base-bridge <6ccb14bb-1655-42ed-94dd-b6f1c53808e7>
– Channel CBAnn/5-00000001;2 left ‘softmix’ base-bridge <6ccb14bb-1655-42ed-94dd-b6f1c53808e7>
– Auto fallthrough, channel ‘PJSIP/4832960032-00000000’ status is ‘UNKNOWN’
– Auto fallthrough, channel ‘PJSIP/4832960032-00000000’ status is ‘UNKNOWN’
instance-20241106-150218CLI> confbridge list 1
Channel Flags User Profile Bridge Profile Menu CallerID
============================== ====== ================ ================ ================ ================
PJSIP/4832960032-00000000 default_user 1 sample_user_menu 4832960032
instance-20241106-150218
CLI> confbridge list 5
No conference bridge named ‘5’ found!

When I use channel redirect on CLI:

instance-20241106-150218CLI> confbridge list 1
Channel Flags User Profile Bridge Profile Menu CallerID
============================== ====== ================ ================ ================ ================
PJSIP/4832960032-00000000 default_user 1 sample_user_menu 4832960032
instance-20241106-150218
CLI> confbridge list 5
No conference bridge named ‘5’ found!
instance-20241106-150218CLI> channel redirect PJSIP/4832960032-00000000 other-bridge,s,1
Channel ‘PJSIP/4832960032-00000000’ successfully redirected to other-bridge,s,1
– Channel PJSIP/4832960032-00000000 left ‘softmix’ base-bridge
– Channel PJSIP/4832960032-00000000 left ‘softmix’ base-bridge
– <CBAnn/1-00000000;1> Playing ‘confbridge-leave.slin’ (language ‘en’)
– <CBAnn/1-00000000;1> Playing ‘confbridge-leave.slin’ (language ‘en’)
– Channel CBAnn/1-00000000;2 left ‘softmix’ base-bridge
– Channel CBAnn/1-00000000;2 left ‘softmix’ base-bridge
– Executing [s@other-bridge:1] Answer(“PJSIP/4832960032-00000000”, “”) in new stack
– Executing [s@other-bridge:1] Answer(“PJSIP/4832960032-00000000”, “”) in new stack
– Executing [s@other-bridge:2] Playback(“PJSIP/4832960032-00000000”, “beep”) in new stack
– Executing [s@other-bridge:2] Playback(“PJSIP/4832960032-00000000”, “beep”) in new stack
– <PJSIP/4832960032-00000000> Playing ‘beep.slin’ (language ‘en’)
– <PJSIP/4832960032-00000000> Playing ‘beep.slin’ (language ‘en’)
– Executing [s@other-bridge:3] ConfBridge(“PJSIP/4832960032-00000000”, “5,5,default_user,sample_user_menu”) in new stack
– Executing [s@other-bridge:3] ConfBridge(“PJSIP/4832960032-00000000”, “5,5,default_user,sample_user_menu”) in new stack
– Channel CBAnn/5-00000002;2 joined ‘softmix’ base-bridge <4adf2008-6f1a-4dd2-ad78-ac3e577926f5>
– Channel CBAnn/5-00000002;2 joined ‘softmix’ base-bridge <4adf2008-6f1a-4dd2-ad78-ac3e577926f5>
– Channel PJSIP/4832960032-00000000 joined ‘softmix’ base-bridge <4adf2008-6f1a-4dd2-ad78-ac3e577926f5>
– Channel PJSIP/4832960032-00000000 joined ‘softmix’ base-bridge <4adf2008-6f1a-4dd2-ad78-ac3e577926f5>
– <CBAnn/5-00000002;1> Playing ‘confbridge-join.slin’ (language ‘en’)
– <CBAnn/5-00000002;1> Playing ‘confbridge-join.slin’ (language ‘en’)
instance-20241106-150218
CLI> confbridge list 1
No conference bridge named ‘1’ found!
instance-20241106-150218*CLI> confbridge list 5
Channel Flags User Profile Bridge Profile Menu CallerID
============================== ====== ================ ================ ================ ================
PJSIP/4832960032-00000000 default_user 5

This is clearly not a sensible thing to do, although it seems to have worked better than I would have expected. If it is going to work, it is not going to do anything more than GoTo would do.

What did you think it would do that a GoTo would not do?

I don’t really understand why I’m seeing double here! If that is more than a logging issue, things have gotten very confused.

Whilst I could imagine that doing this might undermine the channel, in that case, I’d expect it to terminate before it even got to the conference application.

When providing logs, please always use the log file. Screen scrapes do not include time stamps, and they can be very useful.

I need change of the bridge 1 to bridge 5, I used GoTo and not work too.

When I use command on CLI work, but on Dialplan not work.

The message that show me is:
Auto fallthrough, channel ‘PJSIP/4832960032-00000000’ status is ‘UNKNOWN’

You can’t possibly be in a bridge when that dialplan executes the ChanelRedirect.

I suspect the reason that it doesn’t work like GoTo is that the developer never imagined that anyone would use ChannelRedirect to undermine itself, and, whilst I can imagine cases where it might make sense for it to do that, this is not one of them.

I don’t seem to remember your ever explaining the real world objective of this.

(At a guess, it is ending up running on two threads, and undermining the soft hangup which would have terminated the original thread. But, as there is not a bridge from which it is being broken out, there’s no need for channel redirect, anyway.)

I will explain the flow better.

I enter a bridge, and press option 6 from the bridge menu (6=dialplan_exec(change-bridge,s,1)), and it executes the dialplan mentioned above.

From what I read in the documentation, this makes me leave the bridge and be able to execute a dialplan function.

If not, is there any way to leave the bridge and execute the command?

Especially because of the use of Answer (which is unnecessary) I thought this was being executed on an incoming call.

However, undermining ones own execution is always risky, and its an area that easy to get wrong in the implementation, or may, like some operations in feature code processing, not be supported,simply because it is difficult.

Because there is a high risk of things not supported, it is important to explain what you actually want to achieve, for the user, as it allows people to think of less risky approaches to the problem.

Also providing partial information about the implementation doesn’t help. One needs the part of the configuration that defines the menu, and to include the start of the first bridging application.