播放IVR时从菜单中选择星号

时间:2018-10-29 14:30:08

标签: asterisk ivr

我正在尝试在星号中创建一个IVR菜单。我的问题是如何在播放选择项时使星号能够从IVR菜单中进行选择。如果我选择停止播放菜单,然后跳到下一个动作? 现在,我必须聆听整个wav文件,完成后,我只能做出选择。

我的配置如下:

[egy_mainmenu]
exten => s,1,Wait(1)
exten => s,n,NoOp(${CALLERID(all)})
exten => s,n,Set(CHANNEL(language)=hu)
exten => s,n,Answer
exten => s,n,Set(row="${REALTIME(isopen,name,q-egy)}")
exten => s,n,Set(row=${CUT(row,",",2)});
exten => s,n,Set(row=${CUT(row,"=",2)});
exten => s,n,GotoIf($["${row}" = "1"]?s,openhours)
exten => s,n,Macro(closed,"q-egy")
exten => s,n,Playback(egy-open)
exten => s,n,Wait(2)
exten => s,n,Hangup

exten => s,n(openhours),Wait(1)
exten => s,n(skip),Set(FILENAME=${STRFTIME(${EPOCH},,%Y%m%d)}-${UNIQUEID})
exten => s,n,Set(MONITOR_FILENAME=/var/spool/asterisk/monitor/${FILENAME})
exten => s,n,Set(MONITOR_EXEC=/usr/local/bin/asterisk_wav2ogg ${FILENAME}.wav)
exten => s,n,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes)
exten => s,n,Set(CALLERID(name)=Egy)
exten => s,n,Background(egy_welcome,m)
exten => s,n,WaitExten(5)
exten => _[12345],1,Goto(egy_mainmenu_${EXTEN},s,1)

[egy_mainmenu_1]
exten => s,1,NoOp(${QUEUESTATUS})
exten => s,n,Set(CALLERID(name)=KGFB)
exten => s,n,Queue(q-egy,hRt,,,3600)
exten => s,n,GotoIf($["${QUEUESTATUS}" = "TIMEOUT"]?timeout)
exten => s,n,GotoIf($["${QUEUESTATUS}" = "FULL"]?full)
exten => s,n,GotoIf($["${QUEUESTATUS}" = "JOINEMPTY"]?joinempty)
exten => s,n,GotoIf($["${QUEUESTATUS}" = "LEAVEEMPTY"]?leaveempty)
exten => s,n,Goto(hup)

1 个答案:

答案 0 :(得分:0)

@Chris是正确的,它可以使用此方法(我必须在此行中删除m参数:exten => s,n,Background(egy_welcome,m)):

from django.db.backends.postgresql_psycopg2.base import DatabaseWrapper as DaWr
from django.core.cache import caches
from django.conf import settings


class DatabaseWrapper(DaWr):
    """Custom database backend version for GSSAPI auth
    get user creds from Kerberos and get ticket"""
    def __init__(self, *args, **kwargs):
        super(DatabaseWrapper, self).__init__(*args, **kwargs)

    def get_connection_params(self):
        conn_params = super(DatabaseWrapper, self).get_connection_params()
        if settings.GSSAPI_ENABLED_OPTION:
            local = caches['local']
            principal = local.get(settings.GSSAPI_USER_PRINCIPAL_KEY)
            conn_params['user'] = principal
        return conn_params