diff --git a/plug-in/ivr/log.pyc b/plug-in/ivr/log.pyc deleted file mode 100644 index 6036f057..00000000 Binary files a/plug-in/ivr/log.pyc and /dev/null differ diff --git a/plug-in/ivr/scripts/10.py b/plug-in/ivr/scripts/10.py deleted file mode 100644 index f2c8c64f..00000000 --- a/plug-in/ivr/scripts/10.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python - -# path for wav files -wav_path = "/home/ilk/answer_machine/wav/ivr/" -# path for received messages -messages_path = "/tmp/ivr/" -x=100 - - -import os -import ivr -import re -print "Python: Try to redirect" -ret = ivr.redirect("") -if ret : - print "Python: Redirected" -else: - print "Python: Not redirected" - - - diff --git a/plug-in/ivr/scripts/10.pyc b/plug-in/ivr/scripts/10.pyc deleted file mode 100644 index c73b5114..00000000 Binary files a/plug-in/ivr/scripts/10.pyc and /dev/null differ diff --git a/plug-in/ivr/scripts/10.wav b/plug-in/ivr/scripts/10.wav deleted file mode 100644 index 5d685cbc..00000000 Binary files a/plug-in/ivr/scripts/10.wav and /dev/null differ diff --git a/plug-in/ivr/scripts/11.py b/plug-in/ivr/scripts/11.py deleted file mode 100644 index dd3578cd..00000000 --- a/plug-in/ivr/scripts/11.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env python - -# path for wav files -wav_path = "/home/ilk/answer_machine/wav/ivr/" -# path for received messages -messages_path = "/tmp/ivr/" -x=100 - - -import os -import ivr -import re - -# function returns name from URI -def get_name(str): - user_expr_ext = re.compile(' 0: - if x > 3: - x=ivr.playAndDetect(wav_path + "ivr_instruction.wav",60000) - if x == 1: - # listen message - ivr.play(messages_path + callee + "/" + files) - x=100 - if x == 2: - # delete message - os.remove(messages_path + callee + "/" + files) - x=1 - ivr.play(wav_path + "ivr_next_message.wav") - break - if x == 3: - # listen next message - x=1 - ivr.play(wav_path + "ivr_next_message.wav") - break - # no new messages - if x > 0: - ivr.play(wav_path + "ivr_no_messages.wav") -# if user is not user of mailbox -# user can left message -else : - print "play invitation" - ivr.play(wav_path + "ivr_invitation.wav") - print "record message" - if os.path.isdir(messages_path + callee) != True: - os.mkdir(messages_path + callee) - ivr.record(messages_path + callee + "/" + callee + str(ivr.getTime()) + ".wav", 60) - diff --git a/plug-in/ivr/scripts/11.pyc b/plug-in/ivr/scripts/11.pyc deleted file mode 100644 index 22dbe85e..00000000 Binary files a/plug-in/ivr/scripts/11.pyc and /dev/null differ diff --git a/plug-in/ivr/scripts/11.wav b/plug-in/ivr/scripts/11.wav deleted file mode 100644 index 91b1398e..00000000 Binary files a/plug-in/ivr/scripts/11.wav and /dev/null differ diff --git a/plug-in/ivr/scripts/12.py b/plug-in/ivr/scripts/12.py deleted file mode 100644 index 3f7e15ab..00000000 --- a/plug-in/ivr/scripts/12.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python - -# path for wav files -wav_path = "/home/ilk/answer_machine/wav/ivr/" -# path for received messages -messages_path = "/tmp/ivr/" -x=100 -ret=0 - - -import os -import ivr -import re -x=ivr.playAndDetect(wav_path + "ivr_redirect.wav",60000) -print "Python: Try to redirect" -if x == 1: - ret = ivr.redirect("") -if x == 2: - ret = ivr.redirect("") -if ret : - print "Python: Redirected" -else: - print "Python: Not redirected" diff --git a/plug-in/ivr/scripts/12.pyc b/plug-in/ivr/scripts/12.pyc deleted file mode 100644 index 103cd5e5..00000000 Binary files a/plug-in/ivr/scripts/12.pyc and /dev/null differ diff --git a/plug-in/ivr/scripts/3.py b/plug-in/ivr/scripts/3.py deleted file mode 100644 index 3d88614b..00000000 --- a/plug-in/ivr/scripts/3.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python - -import ivr -import time - -class BeatBox: - def __init__(self): - self.number_path = "/home/ssa/ivr/bbox/numbers/" - self.bbox_path  = "/home/ssa/ivr/bbox/" - self.lastchar = -1 - self.bbox_mode = 0 - - def onDTMF(self, key): - print "onDTMF, key = ", key - print "lastchar = ", self.lastchar - if self.lastchar == 0 and key == 0 : - self.bbox_mode = not self.bbox_mode - if self.bbox_mode: - ivr.enqueueMediaFile(self.bbox_path + "b"+str(key) +".wav") - else: - ivr.enqueueMediaFile(self.number_path + str(key) +".wav")        - self.lastchar = key - - def onMediaQueueEmpty(self): - print "media ran out..." - #ivr.enqueueMediaFile(self.bbox_path + "numbers/0.wav") - -print "IVR" -print "IVIVI" - -b = BeatBox() - -def onDTMF_m(key): - b.onDTMF(key) -def onMQE_m(): - b.onMediaQueueEmpty() - -ivr.setCallback(onDTMF_m, "onDTMF") -ivr.setCallback(onMQE_m, "onMediaQueueEmpty") -ivr.startRecording("/home/ssa/ivr/bbox/recorded/" + ivr.getFrom() + " - " + time.ctime() + ".wav") -ivr.enableDTMFDetection() -ivr.enqueueMediaFile("/home/ssa/ivr/bbox/intro1.wav") -ivr.sleep(60) - diff --git a/plug-in/ivr/scripts/9.py b/plug-in/ivr/scripts/9.py deleted file mode 100644 index 1f3e682b..00000000 --- a/plug-in/ivr/scripts/9.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python - -wav_path = "/home/ilk/answer_machine/wav/horoscope/" -m=100 -date=0 - -import os -import ivr -print "Try horoscope " -m = ivr.playAndDetect(wav_path + "enter_month.wav",60000) -if m >= 0: - if m == 1 : - m2 = ivr.detect(6000) - if m2 >= 0 and m2 < 3: - date = 1000 + m2 * 100 - else : - date = m * 100 - else : - if m == 0 : - m2 = ivr.detect(6000) - date = m2 * 100 - else : - date = m * 100 - d = ivr.playAndDetect(wav_path + "enter_date.wav",60000) - if d >= 0 and d < 4: - d2 = ivr.detect(6000) - if d2 >= 0: - date += d * 10 + d2 - else : - date += d - else : - date += d - if 121 <= date <= 131 or 201 <= date <= 219 : - ivr.play(wav_path + "hor_1.wav") - if 220 <= date <= 231 or 301 <= date <= 319 : - ivr.play(wav_path + "hor_2.wav") - if 320 <= date <= 331 or 401 <= date <= 418 : - ivr.play(wav_path + "hor_3.wav") - if 419 <= date <= 431 or 501 <= date <= 519 : - ivr.play(wav_path + "hor_4.wav") - if 520 <= date <= 531 or 601 <= date <= 620 : - ivr.play(wav_path + "hor_5.wav") - if 621 <= date <= 631 or 701 <= date <= 721 : - ivr.play(wav_path + "hor_6.wav") - if 722 <= date <= 731 or 801 <= date <= 822 : - ivr.play(wav_path + "hor_7.wav") - if 823 <= date <= 831 or 901 <= date <= 922 : - ivr.play(wav_path + "hor_8.wav") - if 923 <= date <= 931 or 1001 <= date <= 1022 : - ivr.play(wav_path + "hor_9.wav") - if 1023 <= date <= 1031 or 1101 <= date <= 1121 : - ivr.play(wav_path + "hor_10.wav") - if 1122 <= date <= 1131 or 1201 <= date <= 1220 : - ivr.play(wav_path + "hor_11.wav") - if 1221 <= date <= 1231 or 101 <= date <= 120 : - ivr.play(wav_path + "hor_12.wav") diff --git a/plug-in/ivr/scripts/9.pyc b/plug-in/ivr/scripts/9.pyc deleted file mode 100644 index 97826c83..00000000 Binary files a/plug-in/ivr/scripts/9.pyc and /dev/null differ diff --git a/plug-in/ivr/scripts/DTMF-detection.pl b/plug-in/ivr/scripts/DTMF-detection.pl deleted file mode 100644 index 9a0ec45d..00000000 --- a/plug-in/ivr/scripts/DTMF-detection.pl +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/perl -# DTMF testing script for sems ivr (perl version) -# The purpose of this is to illustrate how to write a perl script for sems ivr module -# It plays back the keys user enters and can be used for DTMF detection testing. -my @keys=(); -use Sys::Syslog qw(:DEFAULT setlogsock); - -syslog('info', 'this is the beginning'); -my $wav_path = '/usr/local/lib/sems/audio/'; - -# enable DTMF detection, it is disabled by default -ivr::enableDTMFDetection(); - -# setup callback functions -# It is important to setup the OnBYE callback. This gives the script a chance to exit -# gracefully. This allows files to be close, database updated, state synchronized. -# Otherwise the script is killed by the sems ivr module abruptly. -syslog('info', 'setting DTMF callback: '. ivr::setCallback('func_on_DTMF', 'onDTMF') ); -syslog('info', 'setting BYE callback: '. ivr::setCallback('func_on_BYE', 'onBYE') ); - -# play initial greeting -syslog('info', 'filling media '. ivr::enqueueMediaFile($wav_path . 'thanks_calling_number_reader.wav', 0)); - -# save the user input to a wav file, use called user and domain as part of file name -# username part is retrived via ivr::getUser() -# domain is retrieved via ivr::getDomain() -ivr::startRecording('/tmp/record-(' . ivr::getUser(). '@'. ivr::getDomain(). ')-'. ivr::getTime(). '.wav'); - -# if not key input for 3 cycles, then exit. Each cycle is 5 seconds (or 5000 msec) -# It is important for the script to exist by itself. For example, it the caller UA crashes, -# it won't be able to send BYE, this instance of the script is going to be a orphan. -# This can easily to be a victim of DOS attack. -my $exit_flag=3; - -# main loop -while($exit_flag>=0) { - - # sleep 5000 msec, there are other functions of seconds and useconds - # it either sleeps for 5000 msec or interrupted by ivr::wakeUp(); - $sleep_time = ivr::msleep(5000); - syslog('info', 'wake up after sleep '. $sleep_time . ' msec.\n'); - - # user input key is saved in @keys array - my $key = shift (@keys); - - # check if there is any key - if (defined($key)) { - syslog('info', 'A new key '. $key . " is pressed after $sleep_time msec"); - - # play the key wav file - ivr::enqueueMediaFile("$wav_path" . $key . '.wav', 0); - - # we get a key, restart timer - $exit_flag=3; - - } else { - # no key input, decrease exit counter - $exit_flag--; - } -} - -# stop recording -ivr::stopRecording(); - -#syslog('info', 'processed in ' .ivr::yield() . 'usec'); - -syslog('info', 'this is the end'); - -# reset the callback function, recommended, avoid callback function called after script is over -syslog('info', 'setting DTMF callback: '. ivr::setCallback('', 'onDTMF') ); -syslog('info', 'setting BYE callback: '. ivr::setCallback('', 'onBYE') ); - - -# DTMF callback function, called when there is any key input -sub func_on_DTMF { - # save the key to @keys - push @keys, @_; - syslog('info', "callback says: a key @_ is entered"); - # wakeup main script sleep function - ivr::wakeUp(); -} - -# BYE callback function, called when caller hangs up -sub func_on_BYE { - syslog('info', 'callback says: a bye in detected'); - # set flag for main loop - $exit_flag=0; - # wakeup main script sleep function - ivr::wakeUp(); -} - diff --git a/plug-in/ivr/scripts/horoscope.py b/plug-in/ivr/scripts/horoscope.py deleted file mode 100644 index 92365240..00000000 --- a/plug-in/ivr/scripts/horoscope.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python - -wav_path = "/home/ilk/answer_machine/wav/horoscope/" -x=100 - -import os -import ivr -print "Try horoscope " -x=ivr.playAndDetect(wav_path + "hor_invitation.wav",60000) -if x == 0: - ivr.play(wav_path + "hor_1.wav") -if x == 1: - ivr.play(wav_path + "hor_2.wav") -if x == 2: - ivr.play(wav_path + "hor_3.wav") -if x == 3: - ivr.play(wav_path + "hor_4.wav") -if x == 4: - ivr.play(wav_path + "hor_5.wav") -if x == 5: - ivr.play(wav_path + "hor_6.wav") -if x == 6: - ivr.play(wav_path + "hor_7.wav") -if x == 7: - ivr.play(wav_path + "hor_8.wav") -if x == 8: - ivr.play(wav_path + "hor_9.wav") -if x == 9: - ivr.play(wav_path + "hor_10.wav") -if x == 10: - ivr.play(wav_path + "hor_11.wav") -if x == 11: - ivr.play(wav_path + "hor_12.wav") diff --git a/plug-in/ivr/scripts/horoscope.pyc b/plug-in/ivr/scripts/horoscope.pyc deleted file mode 100644 index 3648484d..00000000 Binary files a/plug-in/ivr/scripts/horoscope.pyc and /dev/null differ diff --git a/plug-in/ivr/scripts/horoscope_date.py b/plug-in/ivr/scripts/horoscope_date.py deleted file mode 100644 index 1f3e682b..00000000 --- a/plug-in/ivr/scripts/horoscope_date.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python - -wav_path = "/home/ilk/answer_machine/wav/horoscope/" -m=100 -date=0 - -import os -import ivr -print "Try horoscope " -m = ivr.playAndDetect(wav_path + "enter_month.wav",60000) -if m >= 0: - if m == 1 : - m2 = ivr.detect(6000) - if m2 >= 0 and m2 < 3: - date = 1000 + m2 * 100 - else : - date = m * 100 - else : - if m == 0 : - m2 = ivr.detect(6000) - date = m2 * 100 - else : - date = m * 100 - d = ivr.playAndDetect(wav_path + "enter_date.wav",60000) - if d >= 0 and d < 4: - d2 = ivr.detect(6000) - if d2 >= 0: - date += d * 10 + d2 - else : - date += d - else : - date += d - if 121 <= date <= 131 or 201 <= date <= 219 : - ivr.play(wav_path + "hor_1.wav") - if 220 <= date <= 231 or 301 <= date <= 319 : - ivr.play(wav_path + "hor_2.wav") - if 320 <= date <= 331 or 401 <= date <= 418 : - ivr.play(wav_path + "hor_3.wav") - if 419 <= date <= 431 or 501 <= date <= 519 : - ivr.play(wav_path + "hor_4.wav") - if 520 <= date <= 531 or 601 <= date <= 620 : - ivr.play(wav_path + "hor_5.wav") - if 621 <= date <= 631 or 701 <= date <= 721 : - ivr.play(wav_path + "hor_6.wav") - if 722 <= date <= 731 or 801 <= date <= 822 : - ivr.play(wav_path + "hor_7.wav") - if 823 <= date <= 831 or 901 <= date <= 922 : - ivr.play(wav_path + "hor_8.wav") - if 923 <= date <= 931 or 1001 <= date <= 1022 : - ivr.play(wav_path + "hor_9.wav") - if 1023 <= date <= 1031 or 1101 <= date <= 1121 : - ivr.play(wav_path + "hor_10.wav") - if 1122 <= date <= 1131 or 1201 <= date <= 1220 : - ivr.play(wav_path + "hor_11.wav") - if 1221 <= date <= 1231 or 101 <= date <= 120 : - ivr.play(wav_path + "hor_12.wav") diff --git a/plug-in/ivr/scripts/horoscope_date.pyc b/plug-in/ivr/scripts/horoscope_date.pyc deleted file mode 100644 index a893c5c8..00000000 Binary files a/plug-in/ivr/scripts/horoscope_date.pyc and /dev/null differ diff --git a/plug-in/ivr/scripts/ivr.py b/plug-in/ivr/scripts/ivr.py deleted file mode 100644 index 56462d77..00000000 --- a/plug-in/ivr/scripts/ivr.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python - -# path for wav files -wav_path = "/home/rco/src/cvs/sems/new_audio/wav/ivr/" -# path for received messages -messages_path = "/tmp/ivr/" -x=100 - - -import os -import ivr -import re - -# function returns name from URI -def get_name(str): - user_expr_ext = re.compile('") -if ret : - print "Python: Redirected" -else: - print "Python: Not redirected" diff --git a/plug-in/ivr/scripts/redirect.pyc b/plug-in/ivr/scripts/redirect.pyc deleted file mode 100644 index b0698ead..00000000 Binary files a/plug-in/ivr/scripts/redirect.pyc and /dev/null differ diff --git a/plug-in/ivr/ser_for_ivr.cfg b/plug-in/ivr/ser_for_ivr.cfg deleted file mode 100644 index 49aa7c8b..00000000 --- a/plug-in/ivr/ser_for_ivr.cfg +++ /dev/null @@ -1,121 +0,0 @@ -# -# $Id: ser_for_ivr.cfg,v 1.1.8.1 2005/09/02 13:47:47 rco Exp $ -# -# this script is configured for use as voicemail UAS; it processes -# INVITEs and BYEs and asks SEMS to record media via "vm"; in this -# script, all record-routing and other constructs known from proxy -# scripts are not present -- it is a simple UAS -# - -# ----------- global configuration parameters ------------------------ - -debug=9 # debug level (cmd line: -dddddddddd) -#fork=yes -log_stderror=yes # (cmd line: -E) - - -check_via=no # (cmd. line: -v) -dns=no # (cmd. line: -r) -rev_dns=no # (cmd. line: -R) -port=5060 -children=4 -fifo="/tmp/ser_fifo" -listen=195.37.78.184 - -# ------------------ module loading ---------------------------------- - -loadmodule "modules/sl/sl.so" -loadmodule "modules/tm/tm.so" -loadmodule "modules/rr/rr.so" -loadmodule "modules/maxfwd/maxfwd.so" -loadmodule "modules/usrloc/usrloc.so" -loadmodule "modules/registrar/registrar.so" -loadmodule "modules/vm/vm.so" -loadmodule "modules/dbtext/dbtext.so" - - -# ----------------- setting module-specific parameters --------------- - -# You may want to define things like databases here. Please refer to -# the extensive SER documentation for this purpose. Module parameters -# are always described in the modules README files. -# -# For pure ivr functionality only a database is needed, we use -# a simple textfile for this purpose. Actually this is only neccessary until -# the vm module is reworked. Simply copy the etc/db directory from the ivr -# directory somewhere and specify it in the following statement: - -modparam("voicemail", "db_url","/home/ilk/sip_router/modules/vm/db") - -# ------------------------- request routing logic ------------------- - -# main routing logic - -route{ - - - # initial sanity checks -- messages with - # max_forwars==0, or excessively long requests - if (!mf_process_maxfwd_header("10")) { - sl_send_reply("483","Too Many Hops"); - break; - }; - if (msg:len >= max_len ) { - sl_send_reply("513", "Message too big"); - break; - }; - - if (!uri==myself) { - sl_send_reply("404", "not reponsible for host in r-uri"); - break; - }; - - if (method=="REGISTER") { - -# Uncomment this if you want to use digest authentication -# if (!www_authorize("iptel.org", "subscriber")) { -# www_challenge("iptel.org", "0"); -# break; -# }; - - save("location"); - break; - }; - - - # ivr specific configuration - begin - - if(method=="ACK" || method=="INVITE" || method=="BYE"){ - - if (!t_newtran()) { - log("could not create new transaction\n"); - sl_send_reply("500","could not create new transaction"); - break; - }; - - t_reply("100","Trying -- just wait a minute !"); - if(method=="INVITE"){ - log("**************** vm start - begin ******************\n"); - if (uri=~"sip:ivr@.*") { - if (!vm("/tmp/am_fifo", "ivr")) { - log("couldn't contact ivr server\n"); - t_reply("500", "couldn not contact ivr server"); - }; - }; - log("**************** vm start - end ******************\n"); - } else if(method=="BYE"){ - log("**************** vm end - begin ******************\n"); - if(!vm("/tmp/am_fifo","bye")){ - log("could not contact ivr\n"); - t_reply("500","could not contact ivr"); - }; - log("**************** vm end - end ******************\n"); - }; - break; - }; - if (method=="CANCEL") { - sl_send_reply("200", "cancels are junked here"); - break; - }; - sl_send_reply("501", "method not understood here"); -}