Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd_recordNewAnnouncement patch #9

Open
larsimmisch opened this issue Apr 11, 2014 · 0 comments
Open

cmd_recordNewAnnouncement patch #9

larsimmisch opened this issue Apr 11, 2014 · 0 comments

Comments

@larsimmisch
Copy link
Owner

This bug report/patch was submitted via email from Mirko Ciecisnki:

anbei eine geänderte Funktion cmd_recordNewAnnouncement (incoming.py, Capisuite 0.5).
Bei mir klappte das Remote-Aufsprechen eines neuen Ansagetextes nicht. Das lag daran, dass die neue Ansage announcment-tmp.la im received Ordner abgelegt wurde, aber eigentlich eine Ebene höher liegen muss.

Ev. kannst du die Änderungen verifizieren und dann einpflegen.

def cmd_recordNewAnnouncement(config, user, call, userdir):
    """
    remote inquiry command: record new announcement (uses german wave snippets!)
    'config' ConfigParser instance holding the config data
    'user' name of the user who is responsible for this
    'call' reference to the call. Needed by all capisuite functions
    'userdir' spool_dir of the current_user
    """
    say(config, user, call, "bitte-neue-ansage-komplett.la", "beep.la")
 
    tmpfile = os.path.join(userdir, "announcement-tmp.la")
    announcementuserdir = os.path.join( config.get('GLOBAL', "voice_user_dir"), user)
    while 1:
        call.audio_receive(tmpfile, 60, 3)
        say(config, user, call, "neue-ansage-lautet.la")
        call.audio_send(tmpfile)
        say(config, user, call, "wenn-einverstanden-1.la")
        cmd = call.read_DTMF(0, 1)
        # todo: allow eg. '9' for cancel and go back to menu
        if cmd == "1":
            break
        else:
            say(config, user, call, "bitte-neue-ansage-kurz.la", "beep.la")
 
    userannouncement = os.path.join(announcementuserdir,
                       config.getUser(user, "announcement", "announcement.la"))
    os.rename(tmpfile, userannouncement)
    fileutils._setProtection(user, 0666, userannouncement)
    say(config, user, call, "ansage-gespeichert.la")
 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant