forked from Mirrors/freeswitch
update sample script from branchcut to match current api, thanks\!
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5240 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
15dfbbe9f7
commit
f0573f0607
@ -1,18 +1,26 @@
|
|||||||
import sys
|
import sys, time
|
||||||
from _freeswitch import *
|
def onDTMF(input, itype, buf, buflen):
|
||||||
|
print "input=",input
|
||||||
print "Hello World"
|
print "itype=",itype
|
||||||
print sys.path
|
print "buf=",buf
|
||||||
print dir()
|
print "buflen",buflen
|
||||||
print sys.argv
|
if input == "#":
|
||||||
|
return 1
|
||||||
uuid = sys.argv[0]
|
else:
|
||||||
fs_consol_log("1","test from my python program\n")
|
return 0
|
||||||
fs_consol_clean("This is fs_consol_clean\n")
|
console_log("1","test from my python program\n")
|
||||||
fs_consol_clean("My uuid is " + uuid + "\n")
|
session.answer()
|
||||||
|
session.set_dtmf_callback(onDTMF)
|
||||||
session = fs_core_session_locate(uuid)
|
session.set_tts_parms("cepstral", "david")
|
||||||
|
session.play_file("/root/test.gsm", "")
|
||||||
fs_channel_answer(session)
|
session.speak_text("Please enter telephone number with area code and press pound sign. ")
|
||||||
|
input = session.get_digits("", 11, "*#", 10000)
|
||||||
fs_switch_ivr_session_transfer(session, "1234", "XML", "default")
|
console_log("1","result from get digits is "+ input +"\n")
|
||||||
|
phone_number = session.play_and_get_digits(5, 11, 3, 10000, "*#",
|
||||||
|
"/sounds/test.gsm",
|
||||||
|
"/sounds/invalid.gsm",
|
||||||
|
"",
|
||||||
|
"^17771112222$");
|
||||||
|
console_log("1","result from play_and_get_digits is "+ phone_number +"\n")
|
||||||
|
session.transfer("1000", "XML", "default")
|
||||||
|
session.hangup("1")
|
||||||
|
Loading…
Reference in New Issue
Block a user