-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprocess.php
More file actions
105 lines (75 loc) · 2.5 KB
/
process.php
File metadata and controls
105 lines (75 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<? session_start(); ?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<?
include("connect.php");
include("stdio.php");
$name = $_REQUEST["name"];
// we get the data for the user we searched for
$resultat = mysql_query("SELECT name, ID, phone FROM `avxml_entries` WHERE ID='$name'");
while ($raekke = mysql_fetch_array($resultat)) {
extract($raekke);
if (strlen($phone) ==10){ //we'll format the number to xxx-xxx-xxxx
for ($i=0;$i<3;$i++){
$phone_split = $phone_split.substr($phone,$i,1)." ";
}
$phone_split = $phone_split.". ";
for ($i=3;$i<6;$i++){
$phone_split = $phone_split.substr($phone,$i,1)." ";
}
$phone_split = $phone_split.". ";
for ($i=6;$i<10;$i++){
$phone_split = $phone_split.substr($phone,$i,1)." ";
}
}
if (strlen($phone) ==11){ //if a corporate-number we'll format to x-xxx-xxx-xxx-xxxx
$phone_split = $phone_split.substr($phone,0,1)." ".substr($phone,1,3).", ";
$phone_split = $phone_split.". ";
for ($i=4;$i<7;$i++){
$phone_split = $phone_split.substr($phone,$i,1)." ";
}
$phone_split = $phone_split.". ";
for ($i=7;$i<11;$i++){
$phone_split = $phone_split.substr($phone,$i,1)." ";
}
}
$name = strtolower($name);
}
mysql_close($conn);
?>
<menu id="postnumber" dtmf="true">
<prompt> <!-- we now ask the user what he/she wants to do -->
<audio>
<? echo $name;?> has the number <? echo $phone_split; ?>.
</audio>
<audio src="<?php get_audio(16, "file") ?>"> <!-- get ready for options -->
<?php get_audio(16, "message") ?>
</audio>
<audio src="<?php get_audio(15, "file") ?>"> <!-- more options after the number has been found -->
<?php get_audio(15, "message") ?>
</audio>
</prompt>
<nomatch>
<audio src="<?php get_audio(4, "file") ?>">
<?php get_audio(4, "message") ?>
</audio>
<reprompt />
</nomatch>
<noinput>
<audio src="<?php get_audio(14, "file") ?>">
<?php get_audio(14, "message") ?>
</audio>
<reprompt />
</noinput>
<choice next="main_menu.php">main menu</choice>
<choice next="search.php">search</choice>
<choice next="#postnumber">repeat</choice>
<choice next="#exit">exit</choice>
</menu>
<form id="exit">
<block>
<audio src="<?php get_audio(22, "file") ?>">
<?php get_audio(22, "message") ?>
</audio><exit />
</block>
</form>
</vxml>