;Version("3.3.1255.135")
;InformationalVersion("3.3.1255.0")

[nixxis-conference]

exten => conf,1,Answer
exten => conf,n,Set(TIMEOUT(absolute)=14400)
exten => conf,n,NoOp(Getting a conference call for room: ${SIP_HEADER(x-cr-con)})
exten => conf,n,Set(CONF_ROOM=${SIP_HEADER(x-cr-con)})
exten => conf,n,GotoIf($["${CONF_ROOM}" == ""]?nixxis-conference,conf,101)
exten => conf,n,Set(astver=${SHELL(asterisk -rx "core show version")})
exten => conf,n,NoOp(Version: ${astver})
exten => conf,n,Set(astver=${astver:0:11})
exten => conf,n,GotoIf($["${astver}" == "Asterisk 11"]?AstEleven)

exten => conf,n,NoOp(Ast 1.x code)
exten => conf,n,ConfBridge(${CONF_ROOM},q)
exten => conf,n,Goto(End)

exten => conf,n(AstEleven),NoOp(Ast 11 code)
exten => conf,n,Set(CONFBRIDGE(user,announce_only_user)=no)
exten => conf,n,ConfBridge(${CONF_ROOM})

exten => conf,n(End),HangUp
exten => conf,101,Busy
