misc of python pep8 fixes

This commit is contained in:
areski
2014-07-03 13:46:56 +02:00
parent 39200cd13b
commit b0e86e65cf
5 changed files with 98 additions and 100 deletions

View File

@@ -2,24 +2,24 @@
# http://wiki.freeswitch.org/wiki/Mod_python
# before reporting errors
import sys, time
from freeswitch import *
def onDTMF(input, itype, funcargs):
console_log("1","\n\nonDTMF input: %s\n" % input)
console_log("1", "\n\nonDTMF input: %s\n" % input)
if input == "5":
return "pause"
return "pause"
if input == "3":
return "seek:+60000"
return "seek:+60000"
if input == "1":
return "seek:-60000"
return "seek:-60000"
if input == "0":
return "stop"
return None # will make the streamfile audio stop
return "stop"
return None # will make the streamfile audio stop
def handler(uuid):
console_log("1","... test from my python program\n")
console_log("1", "... test from my python program\n")
session = PySession(uuid)
session.answer()
session.setDTMFCallback(onDTMF, "")
@@ -27,13 +27,12 @@ def handler(uuid):
session.playFile("/path/to/your.mp3", "")
session.speak("Please enter telephone number with area code and press pound sign. ")
input = session.getDigits("", 11, "*#", "#", 10000)
console_log("1","result from get digits is %s\n" % input)
console_log("1", "result from get digits is %s\n" % input)
phone_number = session.playAndGetDigits(5, 11, 3, 10000, "*#",
"/sounds/test.gsm",
"/sounds/invalid.gsm",
"",
"^17771112222$");
console_log("1","result from play_and_get_digits is %s\n" % phone_number)
"^17771112222$")
console_log("1", "result from play_and_get_digits is %s\n" % phone_number)
session.transfer("1000", "XML", "default")
session.hangup("1")