<s> from flask import Flask , request , render_template <EOL> import plivohelper <EOL> import os <EOL> response_server = Flask ( "<STR_LIT>" ) <EOL> response_server . debug = True <EOL> @ response_server . errorhandler ( <NUM_LIT> ) <EOL> def page_not_found ( error ) : <EOL> """<STR_LIT>""" <EOL> print "<STR_LIT>" <EOL> return '<STR_LIT>' , <NUM_LIT> <EOL> @ response_server . route ( '<STR_LIT>' , methods = [ '<STR_LIT:GET>' , '<STR_LIT:POST>' ] ) <EOL> def ringing ( ) : <EOL> """<STR_LIT>""" <EOL> print "<STR_LIT>" <EOL> return "<STR_LIT:OK>" <EOL> @ response_server . route ( '<STR_LIT>' , methods = [ '<STR_LIT:GET>' , '<STR_LIT:POST>' ] ) <EOL> def hangup ( ) : <EOL> """<STR_LIT>""" <EOL> print "<STR_LIT>" <EOL> return "<STR_LIT:OK>" <EOL> @ response_server . route ( '<STR_LIT>' , methods = [ '<STR_LIT:GET>' , '<STR_LIT:POST>' ] ) <EOL> def waitmusic ( ) : <EOL> if request . method == '<STR_LIT:POST>' : <EOL> print request . form . items ( ) <EOL> else : <EOL> print request . args . items ( ) <EOL> r = plivohelper . Response ( ) <EOL> r . addSpeak ( "<STR_LIT>" ) <EOL> r . addSpeak ( "<STR_LIT>" ) <EOL> r . addPlay ( "<STR_LIT>" ) <EOL> print "<STR_LIT>" % r <EOL> return render_template ( '<STR_LIT>' , response = r ) <EOL> @ response_server . route ( '<STR_LIT>' , methods = [ '<STR_LIT:GET>' , '<STR_LIT:POST>' ] ) <EOL> def answered ( ) : <EOL> if request . method == '<STR_LIT:POST>' : <EOL> try : <EOL> print "<STR_LIT>" % request . form [ '<STR_LIT>' ] <EOL> except : <EOL> pass <EOL> else : <EOL> try : <EOL> print "<STR_LIT>" % request . args [ '<STR_LIT>' ] <EOL> except : <EOL> pass <EOL> r = plivohelper . Response ( ) <EOL> p = r . addConference ( "<STR_LIT>" , muted = False , <EOL> enterSound = "<STR_LIT>" , exitSound = "<STR_LIT>" , <EOL> startConferenceOnEnter = True , endConferenceOnExit = True , <EOL> waitSound = "<STR_LIT>" , <EOL> timeLimit = <NUM_LIT> , hangupOnStar = True ) <EOL> print "<STR_LIT>" % r <EOL> return render_template ( '<STR_LIT>' , response = r ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> if not os . path . isfile ( "<STR_LIT>" ) : <EOL> print "<STR_LIT>" <EOL> else : <EOL> response_server . run ( host = '<STR_LIT:127.0.0.1>' , port = <NUM_LIT> ) </s>
