Confbridge doesn't allow new member if first member is out

I’m running asterisk 13.17.1 and I have to use dynamic rooms. It seems work ok, however I have a situation, when a first member access confbridge a new room is active, so new members are able to dial and get in the same room, Just dialing a number and then dialing the conference room number. But, if the first member exits, no new members can access the conference room. We listen a message conf-invalid. My confbridge has to allow new members even if first member is out.
Here is my extensions.conf:

[from-TECHMAHINDRA]
exten => 41992,1,NoOp(${CALLERID(num)})
same => n,Goto(conferencia,s,1)

[conferencia]
exten => s,1,Answer()
exten => s,2,NoOp()
exten => s,3,Set(TIMEOUT=0)
exten => s,4,Set(INVALID=0)
exten => s,5,Background(bemvindo)
exten => s,6,Waitexten(6)
exten => 1,1,Macro(enter_conference)
exten => 2,1,GotoIf([{LEN(${CALLERID(num)})} > 7]?externo,s,1)
exten => 2,2,Macro(create_conference)

exten => i,1,Set(INVALID=[{INVALID}+1])
exten => i,2,Playback(invalida)
exten => i,3,GotoIf([{INVALID} > 2]?desliga,s,1)
exten => i,4,Goto(conferencia,s,5)

exten => t,1,Set(TIMEOUT=[{TIMEOUT}+1])
exten => t,2,Playback(desculpe)
exten => t,3,GotoIf([{TIMEOUT} > 2]?desliga,s,1)
exten => t,4,Goto(conferencia,s,5)

[macro-create_conference]
exten => s,1,Set(__CONFERENCENUM={RAND(9001,9999)}) same => n,GotoIf([{GROUP_COUNT({CONFERENCENUM}@conference)} > 0] ? 1)
same => n,Set(GROUP(conference)={CONFERENCENUM}) same => n,Playback(conf-enteringno) same => n,SayDigits({CONFERENCENUM})
same => n,ConfBridge(${CONFERENCENUM},my_bridge,my_user)

[macro-enter_conference]
exten => s,1,Set(INVALID=0)
same => 2,Read(CONFERENCENUM,conf-getconfno,4)
same => 3,Wait(4)
same => 4,GotoIf([{GROUP_COUNT({CONFERENCENUM}@conference)} == 0] ? 6) same => 5,ConfBridge({CONFERENCENUM},my_bridge,my_user)
same => 6,Set(INVALID=[{INVALID}+1])
same => 7,Playback(conf-invalid)
same => 8,GotoIf([{INVALID} > 2]?desliga,s,1)
same => 9,Goto(2)

[externo]
exten => s,1,Answer()
same => n,Playback(call_externa)
same => n,Hangup()
[desliga]
exten => s,1,Answer()
same => n,Playback(agradecemos)
same => n,HangUp()

Here is my confbridge.conf

[my_bridge]
type=bridge
max_members=10
regcontext=from-TECHMAHINDRA
language=en_US

[my_user]
type=user
music_on_hold_when_empty=yes
announce_join_leave=yes

[my_menu]
type=menu

I’d suggest providing the actual console output when this happens so it can be seen what goes on. Your dialplan logic is what ultimately decides this and plays the message, so we have to see what it is actually doing.

1 Like

Hi @jcolp, here is the output: here are 3 calls, first I entered in the room, so a second member entered, then I left the room (I was the first member) then after leave I tried to get in again, but It didn’t work.

– Executing [41992@from-TECHMAHINDRA:1] NoOp(“PJSIP/CORE-00000006”, “109614”) in new stack
– Executing [41992@from-TECHMAHINDRA:2] Goto(“PJSIP/CORE-00000006”, “conferencia,s,1”) in new stack
– Goto (conferencia,s,1)
– Executing [s@conferencia:1] Answer(“PJSIP/CORE-00000006”, “”) in new stack
> 0x7f735004a3a0 – Probation passed - setting RTP source address to 10.101.2.165:19244
– Executing [s@conferencia:2] NoOp(“PJSIP/CORE-00000006”, “”) in new stack
– Executing [s@conferencia:3] Set(“PJSIP/CORE-00000006”, “TIMEOUT=0”) in new stack
– Executing [s@conferencia:4] Set(“PJSIP/CORE-00000006”, “INVALID=0”) in new stack
– Executing [s@conferencia:5] BackGround(“PJSIP/CORE-00000006”, “bemvindo”) in new stack
– <PJSIP/CORE-00000006> Playing ‘bemvindo.slin’ (language ‘en’)
– Executing [2@conferencia:1] GotoIf(“PJSIP/CORE-00000006”, “0?externo,s,1”) in new stack
– Executing [2@conferencia:2] Macro(“PJSIP/CORE-00000006”, “criar_conferencia”) in new stack
– Executing [s@macro-criar_conferencia:1] Set(“PJSIP/CORE-00000006”, “__CONFERENCENUM=9969”) in new stack
– Executing [s@macro-criar_conferencia:2] GotoIf(“PJSIP/CORE-00000006”, “0 ? 1”) in new stack
– Executing [s@macro-criar_conferencia:3] Set(“PJSIP/CORE-00000006”, “GROUP(conference)=9969”) in new stack
– Executing [s@macro-criar_conferencia:4] Playback(“PJSIP/CORE-00000006”, “conf-enteringno”) in new stack
– <PJSIP/CORE-00000006> Playing ‘conf-enteringno.slin’ (language ‘en’)
– Executing [s@macro-criar_conferencia:5] SayDigits(“PJSIP/CORE-00000006”, “9969”) in new stack
– <PJSIP/CORE-00000006> Playing ‘digits/9.slin’ (language ‘en’)
– <PJSIP/CORE-00000006> Playing ‘digits/9.slin’ (language ‘en’)
– <PJSIP/CORE-00000006> Playing ‘digits/6.slin’ (language ‘en’)
– <PJSIP/CORE-00000006> Playing ‘digits/9.slin’ (language ‘en’)
– Executing [s@macro-criar_conferencia:6] ConfBridge(“PJSIP/CORE-00000006”, “9969,my_bridge,my_user”) in new stack
– <PJSIP/CORE-00000006> Playing ‘vm-rec-name.slin’ (language ‘en’)
– <PJSIP/CORE-00000006> Playing ‘beep.gsm’ (language ‘en’)
– x=0, open writing: /var/spool/asterisk/confbridge/confbridge-name-9969-1586200757.17 format: sln, 0x7f7348005450
– User ended message by pressing #
– <PJSIP/CORE-00000006> Playing ‘auth-thankyou.slin’ (language ‘en’)
– Channel CBAnn/9969-00000002;2 joined ‘softmix’ base-bridge
– <PJSIP/CORE-00000006> Playing ‘conf-onlyperson.slin’ (language ‘en’)
– <CBAnn/9969-00000002;1> Playing ‘/var/spool/asterisk/confbridge/confbridge-name-9969-1586200757.17.slin’ (language ‘en_US’)
– <CBAnn/9969-00000002;1> Playing ‘conf-hasjoin.slin’ (language ‘en_US’)
– <PJSIP/CORE-00000006> Playing ‘confbridge-join.gsm’ (language ‘en’)
– <CBAnn/9969-00000002;1> Playing ‘confbridge-join.gsm’ (language ‘en_US’)
– Started music on hold, class ‘default’, on channel ‘PJSIP/CORE-00000006’
– Channel PJSIP/CORE-00000006 joined ‘softmix’ base-bridge
== Setting global variable ‘SIPDOMAIN’ to ‘10.101.2.241’
== Using SIP RTP Audio TOS bits 184
– Executing [41992@from-TECHMAHINDRA:1] NoOp(“PJSIP/CORE-00000007”, “109693”) in new stack
– Executing [41992@from-TECHMAHINDRA:2] Goto(“PJSIP/CORE-00000007”, “conferencia,s,1”) in new stack
– Goto (conferencia,s,1)
– Executing [s@conferencia:1] Answer(“PJSIP/CORE-00000007”, “”) in new stack
> 0x7f7350035ba0 – Probation passed - setting RTP source address to 10.101.2.165:12338
– Executing [s@conferencia:2] NoOp(“PJSIP/CORE-00000007”, “”) in new stack
– Executing [s@conferencia:3] Set(“PJSIP/CORE-00000007”, “TIMEOUT=0”) in new stack
– Executing [s@conferencia:4] Set(“PJSIP/CORE-00000007”, “INVALID=0”) in new stack
– Executing [s@conferencia:5] BackGround(“PJSIP/CORE-00000007”, “bemvindo”) in new stack
– <PJSIP/CORE-00000007> Playing ‘bemvindo.slin’ (language ‘en’)
– Executing [1@conferencia:1] Macro(“PJSIP/CORE-00000007”, “entrar_conferencia”) in new stack
– Executing [s@macro-entrar_conferencia:1] Set(“PJSIP/CORE-00000007”, “INVALID=0”) in new stack
– Executing [s@macro-entrar_conferencia:2] Read(“PJSIP/CORE-00000007”, “CONFERENCENUM,conf-getconfno,4”) in new stack
– Accepting a maximum of 4 digits.
– <PJSIP/CORE-00000007> Playing ‘conf-getconfno.slin’ (language ‘en’)
– User entered ‘9969’
– Executing [s@macro-entrar_conferencia:3] Wait(“PJSIP/CORE-00000007”, “4”) in new stack
– Executing [s@macro-entrar_conferencia:4] GotoIf(“PJSIP/CORE-00000007”, “0 ? 6”) in new stack
– Executing [s@macro-entrar_conferencia:5] ConfBridge(“PJSIP/CORE-00000007”, “9969,my_bridge,my_user”) in new stack
– <PJSIP/CORE-00000007> Playing ‘vm-rec-name.slin’ (language ‘en’)
– <PJSIP/CORE-00000007> Playing ‘beep.gsm’ (language ‘en’)
– x=0, open writing: /var/spool/asterisk/confbridge/confbridge-name-9969-1586200882.20 format: sln, 0x7f7368007040
– User ended message by pressing #
– <PJSIP/CORE-00000007> Playing ‘auth-thankyou.slin’ (language ‘en’)
– Stopped music on hold on PJSIP/CORE-00000006
– <CBAnn/9969-00000002;1> Playing ‘/var/spool/asterisk/confbridge/confbridge-name-9969-1586200882.20.slin’ (language ‘en_US’)
– <CBAnn/9969-00000002;1> Playing ‘conf-hasjoin.slin’ (language ‘en_US’)
– <PJSIP/CORE-00000007> Playing ‘confbridge-join.gsm’ (language ‘en’)
– <CBAnn/9969-00000002;1> Playing ‘confbridge-join.gsm’ (language ‘en_US’)
– Channel PJSIP/CORE-00000007 joined ‘softmix’ base-bridge
– Channel PJSIP/CORE-00000006 left ‘softmix’ base-bridge
– Started music on hold, class ‘default’, on channel ‘PJSIP/CORE-00000007’
– <CBAnn/9969-00000002;1> Playing ‘/var/spool/asterisk/confbridge/confbridge-name-9969-1586200757.17.slin’ (language ‘en_US’)
– <CBAnn/9969-00000002;1> Playing ‘conf-hasleft.slin’ (language ‘en_US’)
– <CBAnn/9969-00000002;1> Playing ‘confbridge-leave.gsm’ (language ‘en_US’)
== Setting global variable ‘SIPDOMAIN’ to ‘10.101.2.241’
== Using SIP RTP Audio TOS bits 184
– Executing [41992@from-TECHMAHINDRA:1] NoOp(“PJSIP/CORE-00000008”, “109614”) in new stack
– Executing [41992@from-TECHMAHINDRA:2] Goto(“PJSIP/CORE-00000008”, “conferencia,s,1”) in new stack
– Goto (conferencia,s,1)
– Executing [s@conferencia:1] Answer(“PJSIP/CORE-00000008”, “”) in new stack
> 0x7f73500200f0 – Probation passed - setting RTP source address to 10.101.2.165:8586
– Executing [s@conferencia:2] NoOp(“PJSIP/CORE-00000008”, “”) in new stack
– Executing [s@conferencia:3] Set(“PJSIP/CORE-00000008”, “TIMEOUT=0”) in new stack
– Executing [s@conferencia:4] Set(“PJSIP/CORE-00000008”, “INVALID=0”) in new stack
– Executing [s@conferencia:5] BackGround(“PJSIP/CORE-00000008”, “bemvindo”) in new stack
– <PJSIP/CORE-00000008> Playing ‘bemvindo.slin’ (language ‘en’)
– Executing [1@conferencia:1] Macro(“PJSIP/CORE-00000008”, “entrar_conferencia”) in new stack
– Executing [s@macro-entrar_conferencia:1] Set(“PJSIP/CORE-00000008”, “INVALID=0”) in new stack
– Executing [s@macro-entrar_conferencia:2] Read(“PJSIP/CORE-00000008”, “CONFERENCENUM,conf-getconfno,4”) in new stack
– Accepting a maximum of 4 digits.
– <PJSIP/CORE-00000008> Playing ‘conf-getconfno.slin’ (language ‘en’)
– User entered ‘9969’
– Executing [s@macro-entrar_conferencia:3] Wait(“PJSIP/CORE-00000008”, “4”) in new stack
– Executing [s@macro-entrar_conferencia:4] GotoIf(“PJSIP/CORE-00000008”, “1 ? 6”) in new stack
– Goto (macro-entrar_conferencia,s,6)
– Executing [s@macro-entrar_conferencia:6] Set(“PJSIP/CORE-00000008”, “INVALID=1”) in new stack
– Executing [s@macro-entrar_conferencia:7] Playback(“PJSIP/CORE-00000008”, “conf-invalid”) in new stack
– <PJSIP/CORE-00000008> Playing ‘conf-invalid.slin’ (language ‘en’)
– Executing [s@macro-entrar_conferencia:8] GotoIf(“PJSIP/CORE-00000008”, “0?desliga,s,1”) in new stack
– Executing [s@macro-entrar_conferencia:9] Goto(“PJSIP/CORE-00000008”, “2”) in new stack
– Goto (macro-entrar_conferencia,s,2)
– Executing [s@macro-entrar_conferencia:2] Read(“PJSIP/CORE-00000008”, “CONFERENCENUM,conf-getconfno,4”) in new stack
– Accepting a maximum of 4 digits.
– <PJSIP/CORE-00000008> Playing ‘conf-getconfno.slin’ (language ‘en’)
– User disconnected
– Stopped music on hold on PJSIP/CORE-00000007
– Channel PJSIP/CORE-00000007 left ‘softmix’ base-bridge
[Apr 6 16:22:42] WARNING[124179][C-00000007]: pbx.c:4985 ast_context_remove_extension_callerid2: Cannot find extension 9969 in root_table in context from-TECHMAHINDRA
– <CBAnn/9969-00000002;1> Playing ‘/var/spool/asterisk/confbridge/confbridge-name-9969-1586200882.20.slin’ (language ‘en_US’)

The channel that creates the conference bridge (the first member) has its GROUP for conference set to that of the conference bridge. No other member does. If they leave the GROUP_COUNT value goes to 0. You have dialplan logic that checks the value of GROUP_COUNT and if it is 0, then it plays back conf-invalid. I presume that whenever a channel enters the conference bridge you’d want to set their GROUP for conference to that of the conference bridge.

That’s right. My logic had an intention if a dialed room doesn’t exist, so it goes to invalid. But I’d like to keep the conference available if users leave and enter in the conference later. Is it possible?

I stated in my response what I think you want to do, but ultimately you write the logic so you need to determine under what conditions you expect that to happen - and how to have the logic account for that. It may be as simple as what I said.

1 Like

I set up this way:
same => 4,GotoIf([{GROUP_COUNT(${CONFERENCENUM}@conference)} == 10] ? 6)

== 10
Now it is perfect! I was lost in my own logic!
Thank you so much @jcolp!

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