WebConf : ConfBridge

This is a simple example of confbridge with admin/guest mode.

  • call 8001 to enter call conference room N° 1 as guest or admin depending on PIN code used.
  • Guest cannot speak before admin is connected.
  • Guest is unconnected when all admin leave.
You must setup  PIN codes for guest and admin via phone : 
  • 8101 : setup guest PIN code for conf room N° 1
  • 8201 : setup admin PIN code for conf room N° 1
or create config files like : 
  • echo "123" > /var/spool/asterisk/confbridge/confbridge-name-1-user.txt
  • echo "456" > /var/spool/asterisk/confbridge/confbridge-name-1-user.txt
tested with http://downloads.asterisk.org/pub/telephony/certified-asterisk/asterisk-
certified-13.13-current.tar.gz

doc : 
  • https://wiki.asterisk.org/wiki/display/AST/ConfBridge+Configuration
  • https://wiki.asterisk.org/wiki/display/AST/ConfBridge+CLI+Commands

extensions.conf
[globals]
CONFDIR=>/var/spool/asterisk/confbridge


[home]
exten => 8001,1,Macro(conference_config_file_join,1)      ; join conf num 1 as user or admin depending on PIN code    
exten => 8101,1,Macro(conference_config_file_set,1,user)  ; setup user  PIN code for conf num 1  
exten => 8201,1,Macro(conference_config_file_set,1,admin) ; setup admin PIN code for conf num 1 



[macro-conference_config_file_join]
exten => s,1,NoOp("Start config")
same => n,Set(CONFNUM=${ARG1})
same => n,Set(CONFPINUSER=${FILTER(0-9,${FILE(${CONFDIR}/conf-${CONFNUM}-user.txt)})})
same => n,Set(CONFPINADMIN=${FILTER(0-9,${FILE(${CONFDIR}/conf-${CONFNUM}-admin.txt)})})
;
same => n,Read(CONFPIN,conf-getpin,,,3,5)
same => n,Set(CONFPIN=${FILTER(0-9,${CONFPIN})})
; load config values
; display values for debug
same => n,NoOp(${CONFNUM})
same => n,NoOp(${CONFPINADMIN})
same => n,NoOp(${CONFPINUSER})
;
; detect user/admin mode
same => n,Set(CONF_USER=${IF($["${CONFPIN}" = "${CONFPINUSER}"]?guest_user:${CONF_USER})})
same => n,Set(CONF_USER=${IF($["${CONFPIN}" = "${CONFPINADMIN}"]?admin_user:${CONF_USER})})
same => n,Set(MENU=${IF($["${CONF_USER}" = "admin_user"]?channel-secure:conf-placeintoconf)})
;
same => n,NoOp(${CONF_USER})
same => n,GotoIf($["${CONF_USER}" = ""]?pinerror)
same => n,Playback(${MENU})

; Tell the user which conference this is
;same => n,Playback(conf-youareinconfnum)  
;same => n,SayDigits(${CONFNUM})

same => n,ConfBridge(${CONFNUM},FR_Bridge,${CONF_USER})
;
same => n(hangup),NoOp()
same => n,Hangup()
;
same => n(pinerror),NoOp()
same => n,Playback(conf-invalidpin);
same => n,Hangup()



[macro-conference_config_file_set]
exten => s,1,NoOp("set config")
same => n,Set(CONFNUM=${ARG1})
same => n,Set(TYPE=${ARG2})
;same => n,Read(CONFNUM,conf-getconfno,,,3,5)
;same => n,Set(CONFNUM=${FILTER(0-9,${CONFNUM})})
same => n,SayDigits(${CONFNUM})
same => n,Read(CONFPIN,conf-getpin,,,3,5)
same => n,Set(CONFPIN=${FILTER(0-9,${CONFPIN})})
same => n,NoOp(tmp/${TYPE}-${CONFNUM}.txt)
same => n,Set(FILE(${CONFDIR}/conf-${CONFNUM}-${TYPE}.txt)=${CONFPIN})
same => n,Set(CONFPINUSER=${FILTER(0-9,${FILE(${CONFDIR}/conf-${CONFNUM}-${TYPE}.txt)})})
same => n,SayDigits(${CONFPINUSER})
same => n,Hangup()




confbridge.conf
; see https://wiki.asterisk.org/wiki/display/AST/ConfBridge+Configuration

[general]

[FR_bridge]
type=bridge  
language=fr_FR  
record_conference=no


[guest_user]
type=user
admin=no
marked=no
startmuted=yes;
quiet=no
announce_user_count=yes
announce_user_count_all=yes
announce_only_user=yes
announce_join_leave=no
wait_marked=yes
end_marked=yes
denoise=yes
jitterbuffer=yes
dtmf_passthrough=no
music_on_hold_when_empty=yes 

[admin_user]
type=user
admin=yes
marked=yes
startmuted=no
quiet=no
announce_user_count=yes
announce_user_count_all=yes
announce_only_user=yes
announce_join_leave=no
wait_marked=no
end_marked=no
denoise=yes
jitterbuffer=yes
;pin=1234
dtmf_passthrough=no
music_on_hold_when_empty=yes 



[guest_menu]
type=menu
*=playback_continue(silent-conf-menu)
*=increase_rx_volume
*2=decrease_rx_volume

[admin_menu]
type=menu  
*=playback_and_continue(press&digits/1&confbridge-dec-list-vol-out&press&digits/2&confbridge-inc-list-vol-out&press&digits/3&confbridge-mute-out&confbridge-menu-exit-in&press&digits/0)
*1=decrease_listening_volume
1=decrease_listening_volume  
*2=increase_listening_volume
2=increase_listening_volume  
*3=toggle_mute
3=toggle_mute  
*0=no_op




ċ
confbridge.conf
(1k)
Patrick Nomblot,
29 Apr 2017, 03:35
ċ
extensions.conf
(4k)
Patrick Nomblot,
29 Apr 2017, 03:35
ċ
sip.conf
(1k)
Patrick Nomblot,
29 Apr 2017, 03:35
ċ
users.conf
(0k)
Patrick Nomblot,
29 Apr 2017, 03:35
Comments