Dialplan — Язык приветствий
Файл: /etc/asterisk/extensions_language.conf
[play-localized]
exten => s,1,Set(PLMSG=${ARG1})
same => n,Set(ENDLANG=${ODBC_GET_ENDPOINT_LANG(${CHANNEL(endpoint)})})
same => n,GotoIf($["${ENDLANG}" = "kz"]?kz)
same => n,Playback(callbox/system/${PLMSG})
same => n,Return()
same => n(kz),Playback(callbox/system/${PLMSG}_kz)
same => n,Return()
[callbox-select-language]
exten => *44,1,NoOp(=== Language selection for ${CHANNEL(endpoint)} ===)
same => n,Set(ENDPOINT_ID=${CHANNEL(endpoint)})
same => n,Answer()
same => n(menu),Read(LANG_CHOICE,callbox/system/callbox-select-lang,1,,1,5)
same => n,GotoIf($["${LANG_CHOICE}" = "1"]?set_kz)
same => n,GotoIf($["${LANG_CHOICE}" = "2"]?set_ru)
same => n,Playback(callbox/system/callbox-invalid-input)
same => n,Goto(menu)
same => n(set_kz),Set(RESULT=${ODBC_SET_ENDPOINT_LANG(kz,${ENDPOINT_ID})})
same => n,Playback(callbox/system/callbox-lang-selected-kz)
same => n,Hangup()
same => n(set_ru),Set(RESULT=${ODBC_SET_ENDPOINT_LANG(ru,${ENDPOINT_ID})})
same => n,Playback(callbox/system/callbox-lang-selected-ru)
same => n,Hangup()
exten => i,1,Playback(callbox/system/callbox-invalid-input)
same => n,Goto(*44,menu)