exten => conference,1,NoOp(Dynamic Conference Bridge Application) same => n,Set(CHANNEL(language)=fs) same => n,Set(inConference=0) ; local variable so we can control hangup behavior same => n,Set(IS_INTERNAL=${PJSIP_HEADER(read,X-Company-Tenant)}) same => n,Set(CALLER_UA=${PJSIP_HEADER(read,User-Agent)}) same => n,Verbose(3, Caller's UA:${CALLER_UA} | Value of IS_INTERNAL:${IS_INTERNAL}) same => n,ExecIf($[ "${IS_INTERNAL}" != "" || "${CALLER_UA}" = "Company Media v3" || "${CALLER_UA}" = "Company Media v4"]?Set(CDR(is_internal)=1):Set(CDR(is_internal)=0)) same => n,UserEvent(CallerLocation,Channel: ${CHANNEL},UniqueID: ${UNIQUEID}, Internal: ${CDR(is_internal)}) same => n,Verbose(2,Caller ID of user dialing conference: ${CALLERID(num)} | Caller ID Name: ${CALLERID(name)}) same => n,Set(CUSTOM_NAME=${PJSIP_HEADER(read,X-Company-CallerID-Name)}) same => n,ExecIf($[ "${CUSTOM_NAME}" != "" ]?Set(CALLERID(name)=${CUSTOM_NAME})) same => n,Set(CALLERID(ANI-num)=${PJSIP_HEADER(read,X-Company-CallerID-Num)}) ; Check Remote CID same => n,MacroIf($[ "${CALLERID(name)}" = "" || "${CALLERID(name)}" = "${CALLERID(num)}" ]?readcnam,${CALLERID(num)}) same => n,Verbose(1, Final Caller ID Set to ${CALLERID(name)} and ${CALLERID(num)}) ; Let's see if we're directly entering the conference same => n,GotoIf($[ "${IN_DIAL_TO_BRIDGE}" = "1" ]?conflog) same => n,Set(attempts=0) same => n,Set(CHANNEL(musicclass)=Company) same => n,ExecIf($[ "${IS_INTERNAL}" != ""]?Set(TENANT=${IS_INTERNAL}):Set(TENANT=${CONFBRIDGE_GETTENANT(${INCOMING_DID})})) ; Zero out the tenant if we are in fact a "global" conference number same => n,Set(IS_GLOBAL_NUM=${CONFBRIDGE_IS_GLOBAL_NUMBER(${INCOMING_DID})}) same => n,ExecIf($[ "${IS_GLOBAL_NUM}" = "1" ]?Set(TENANT=)) ; Check if we have a direct dial same => n,Set(DIRECT_DIAL_CONF=) same => n,Set(DIRECT_DIAL_CONF=${PJSIP_HEADER(read,X-Company-DirectDialConference)}) ; Check if bridge DID is dedicated to a tenant / conference room same => n,ExecIf($[ "${DIRECT_DIAL_CONF}" != "" ]?Set(confno=${DIRECT_DIAL_CONF})) same => n,ExecIf($[ "${DIRECT_DIAL_CONF}" != "" ]?Set(PLAY_WELCOME=welcome-fs-conf&)) same => n,ExecIf($[ "${DIRECT_DIAL_CONF}" != "" ]?Set(INCOMING_DID=${CONFBRIDGE_DID_LOCKED_TO_ROOM(${DIRECT_DIAL_CONF})})) same => n,GotoIf($[ "${DIRECT_DIAL_CONF}" != "" ]?confentered) same => n,Set(IS_DEDICATED_ROOM=${CONFBRIDGE_BRIDGE_DEDICATED(${INCOMING_DID})}) same => n,ExecIf($[ "${IS_DEDICATED_ROOM}" != "" ]?Set(confno=${IS_DEDICATED_ROOM})) same => n,ExecIf($[ "${IS_DEDICATED_ROOM}" != "" ]?Set(PLAY_WELCOME=welcome-fs-conf&)) same => n,GotoIf($[ "${IS_DEDICATED_ROOM}" != "" ]?confentered) exten => conference,n(getconf),Verbose(1,Interactively entering conference) same => n,Answer same => n,Set(ARRAY(ENABLE_CUSTOM_GREETING,GREETING_FILE,PINLESS_ENTRY)=${CONFBRIDGE_CUSTOM_BRIDGE(${INCOMING_DID})}) same => n,ExecIf($[ "${ENABLE_CUSTOM_GREETING}" = "1" ]?Set(CONF_GREETING=${GREETING_FILE}&):Set(CONF_GREETING=welcome-fs-conf&)) same => n,ExecIf($[ "${ENABLE_CUSTOM_GREETING}" = "1" && "${GREETING_FILE}" = "" ]?Set(CONF_GREETING=)) same => n,Verbose(5,Conference Custom Greeting set to ${ENABLE_CUSTOM_GREETING} with file name ${CONF_GREETING}) same => n,Wait(.5) same => n,Read(confno,${CONF_GREETING}conf-getconfno)