Confbridge and DTMF

Hi everyone,

I am trying to make it possible for users to increase and decrease the room by pressing “#”. The problem is that it first joins the new room and then leaves it. Do you know why?"

extensions.conf file
[general]
static=yes
writeprotect=no
clearglobalvars=no

[globals]

[default]
exten => mysipnumber,1,Answer()
same => n,Set(CHANNEL(language)=sv)
same => n,NoOp(Caller ID: ${CALLERID(num)})
same => n,GotoIf($[“${CALLERID(num)}” = “anonymous”]?reject_anonymous)
same => n,GotoIf($[“${CALLERID(num):0:2}” = “00”]?reject_numbers)

same => n,Set(room=1)
same => n,SayDigits(${room})
same => n,ConfBridge(${room})
same => n,Hangup()

; Rejecting numbers
same => n(reject_anonymous),Playback(you_are_not_authorized)
same => n,Hangup()

same => n(reject_numbers),Playback(you_are_not_authorized_2)
same => n,Hangup()

[dtmf]
exten => #,1,NoOp(Moving to next room)
same => n,Set(room=${INC(room)})
same => n,SayDigits(${room})
same => n,ConfBridge(${room})

exten => *,1,NoOp(Moving to previous room)
same => n(decrement),Set(room=${DEC(room)})
same => n,SayDigits(${room})
same => n,ConfBridge(${room})

confbridge.conf file
[default_menu]
type=menu
#=dialplan_exec(dtmf,#,1)
=dialplan_exec(dtmf,,1)

Calling ConfBridge while inside a ConfBridge is not supported.

I understand. Could you please explain how I can achieve what I’m trying to do?

I can’t think of an immediate way. Someone else may have clever logic to.

Anyone have the solution to this please?

I don’t know if it’s clear for you. But I want to jump between conference on confbridge(), let say you are on conference number 1000 and you press # and go to next conference 1001 and so on.

Have you considered whether Conf Kick and BridgeAdd could be used for this?

https://docs.asterisk.org/Asterisk_21_Documentation/API_Documentation/Dialplan_Applications/ConfKick/

https://docs.asterisk.org/Asterisk_21_Documentation/API_Documentation/Dialplan_Applications/BridgeAdd/

Kick the user from the conference they are in and then add them to the next
conference in sequence…?

Antony.

In our chat line system, we do the following (Just edited your code):

[default]
exten => mysipnumber,1,Answer()
same => n,Set(CHANNEL(language)=sv)
same => n,NoOp(Caller ID: ${CALLERID(num)})
same => n,GotoIf($[“${CALLERID(num)}” = “anonymous”]?reject_anonymous)
same => n,GotoIf($[“${CALLERID(num):0:2}” = “00”]?reject_numbers)
same => n,Set(room=1)
same => n(ENTER_ROOM),SayDigits(${room})
same => n,ConfBridge(${room})
same => n,Goto(ENTER_ROOM)

[dtmf]
exten => #,1,NoOp(Moving to next room)
same => n,ConfKick(${room},${CHANNEL})
same => n,Set(room=${INC(room)})
same => n,NoOp()

exten => *,1,NoOp(Moving to previous room)
same => n,ConfKick(${room},${CHANNEL})
same => n(decrement),Set(room=${DEC(room)})
same => n,NoOp()

Note the “ENTER_ROOM” label I put in the “SayDigits” line, this will help us always come back here when a user is kicked out of the conference, because we put a “Goto” right below the confbridge.

Now for the “dtmf” context, note that I included a call to the ConfKick() application, passing the ${room} parameters before incrementing or decrementing as well as the caller’s channel, and I also removed the call to ConfBridge and SayDigits, replacing them with a simple noop.

In our system we have many more parameters to check before changing rooms, but for what you requested, just these changes should be fine!

good luck!

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