-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcall_operator.php
More file actions
260 lines (196 loc) · 8.53 KB
/
call_operator.php
File metadata and controls
260 lines (196 loc) · 8.53 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<?php
// gettext rework
include ("./lib/defines.php");
include ("./lib/functions.php");
include ("./phpagi/phpagi-asmanager.php");
session_start();
getpost_ifset (array('action', 'confno', 'data', 'invite_num'));
// this variable specifie the debug type (0 => nothing, 1 => sql result, 2 => boucle checking, 3 other value checking)
$FG_DEBUG = 0;
// THIS VARIABLE DEFINE THE COLOR OF THE HEAD TABLE
$FG_TABLE_HEAD_COLOR = "#D1D9E7";
$FG_TABLE_EXTERN_COLOR = "#7F99CC"; //#CC0033 (Rouge)
$FG_TABLE_INTERN_COLOR = "#EDF3FF"; //#FFEAFF (Rose)
// THIS VARIABLE DEFINE THE COLOR OF THE HEAD TABLE
$FG_TABLE_ALTERNATE_ROW_COLOR[] = "#FFFFFF";
$FG_TABLE_ALTERNATE_ROW_COLOR[] = "#F2F8FF";
// THIS VARIABLE DEFINE THE COLOR OF THE ADMIN ROW
$FG_TABLE_ROW_COLOR_ADMIN = "#FCCDCA";
// The variable Var_col would define the col that we want show in your table
// First Name of the column in the html page, second name of the field
$FG_TABLE_COL = array();
$FG_TABLE_COL[]=array (_("ID"), "user_id", "12%", "center", "", "19");
$FG_TABLE_COL[]=array (_("Channel"), "chan_name", "20%", "center", "", "30");
$FG_TABLE_COL[]=array (_("ConfNo"), "confno", "12%", "center", "", "30");
$FG_TABLE_COL[]=array (_("Mode"), "mode", "12%", "center", "", "30");
// The variable LIMITE_DISPLAY define the limit of record to display by page
$FG_LIMITE_DISPLAY=30;
$FG_LIMITE_DISPLAY_BLANK_LINE=5;
// Number of column in the html table
$FG_NB_TABLE_COL=count($FG_TABLE_COL);
// The variable $FG_EDITION define if you want process to the edition of the database record
$FG_VOICE_RIGHT=true;
$FG_KICKOUT=true;
//This variable will store the total number of column
$FG_TOTAL_TABLE_COL = $FG_NB_TABLE_COL;
if ($FG_VOICE_RIGHT || $FG_KICKOUT) $FG_TOTAL_TABLE_COL++;
//This variable define the width of the HTML table
$FG_HTML_TABLE_WIDTH="100%";
/* ACTION * * * * * * *********************************************************/
if ($_SESSION['auth']) {
if ($action=='outboundcall' || $action=='quickcall'){
$as = new AGI_AsteriskManager();
// && CONNECTING
$res = $as->connect();
if (!$res){ echo _("Error connection to the manager")."!"; exit();}
if ( CHAN_TYPE == "Local") {
$channel = CHAN_TYPE . "/" . $invite_num;
} else {
$channel = CHAN_TYPE . "/" . $invite_num . "@" . OUT_PEER;
}
$application = MeetMe;
$data = $data;
$priority = 1;
$context = OUT_CONTEXT;
$callerid = OUT_CALL_CID;
$res = $as->Originate ($channel, $exten, $context, $priority, $timeout, $callerid, $variable, $account, $application, $data);
$actiondone=1;
// && DISCONNECTING
$as->disconnect();
}
} else {
$res['Message'] = "Naughty";
}
/* * * * * * * * *********************************************************/
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title><?php print GUI_TITLE; ?> control</title>
<meta http-equiv="Content-Type" content="text/html">
<link rel="stylesheet" type="text/css">
<style type="text/css" media="screen">
@import url("css/content.css");
@import url("css/docbook.css");
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body bgColor=#FFFFFF>
<br><br>
<!-- ** ** ** ** ** Part to display the conference user ** ** ** ** ** -->
<center>
<?php if ($action=="quickcall"){
if ($res['Message']=="Originate successfully queued")
$error = _("Call Placed");
else
$error = _("System error, try again later"); ?>
<font color=red><b><?php echo $error?></b></font><br>
<input type="submit" value="Close" onClick="window.close()" />
<?php } else { ?>
<FORM action=<?php echo $_SERVER[PHP_SELF]?> id=form1 method=post name=form1>
<center>
<font color=red><b><?php echo $res['Message']?></b></font>
<TABLE width="626" border="1" cellpadding="2" cellspacing="2" bordercolor="#E2E2D3" style="padding: 5px 5px 7px;">
<INPUT type="hidden" name="action" value="outboundcall">
<TBODY>
<TR>
<td width="165" valign="top" bgcolor="#D3D3F2">
<table width="100%" border="0" cellpadding="2" cellspacing="0" ><tr><td><b><?php print _("CHANNEL"); ?> </b></td></tr></table>
</td>
<TD width="405" valign="top">
<INPUT name=channel size=60 maxlength=100 value="">
</TD>
</TR>
<TR>
<td width="165" valign="top" bgcolor="#E2E2D3">
<table width="100%" border="0" cellpadding="2" cellspacing="0" ><tr><td><b><?php print _("EXTEN"); ?> </b></td></tr></table>
</td>
<TD width="405" valign="top">
<INPUT name=exten size=60 maxlength=100 value="">
</TD>
</TR>
<TR>
<td width="165" valign="top" bgcolor="#D3D3F2">
<table width="100%" border="0" cellpadding="2" cellspacing="0" ><tr><td><b><?php print _("CONTEXT"); ?></b> </td></tr></table>
</td>
<TD width="405" valign="top">
<INPUT name=context size=60 maxlength=100 value="">
</TD>
</TR>
<TR>
<td width="165" valign="top" bgcolor="#E2E2D3">
<table width="100%" border="0" cellpadding="2" cellspacing="0" ><tr><td><b><?php print _("PRIORITY"); ?> <b></td></tr></table>
</td>
<TD width="405" valign="top">
<INPUT name=priority size=60 maxlength=100 value="">
</TD>
</TR>
<TR>
<td width="165" valign="top" bgcolor="#D3D3F2">
<table width="100%" border="0" cellpadding="2" cellspacing="0" ><tr><td><b><?php print _("TIMEOUT"); ?></b> </td></tr></table>
</td>
<TD width="405" valign="top">
<INPUT name=timeout size=60 maxlength=100 value="">
</TD>
</TR>
<TR>
<td width="165" valign="top" bgcolor="#E2E2D3">
<table width="100%" border="0" cellpadding="2" cellspacing="0" ><tr><td><b><?php print _("CALLERID"); ?></b> </td></tr></table>
</td>
<TD width="405" valign="top">
<INPUT name=callerid size=60 maxlength=100 value="">
</TD>
</TR>
<TR>
<td width="165" valign="top" bgcolor="#D3D3F2">
<table width="100%" border="0" cellpadding="2" cellspacing="0" ><tr><td><b><?php print _("VARIABLE"); ?></b> </td></tr></table>
</td>
<TD width="405" valign="top">
<INPUT name=variable size=60 maxlength=100 value="">
</TD>
</TR>
<TR>
<td width="165" valign="top" bgcolor="#E2E2D3">
<table width="100%" border="0" cellpadding="2" cellspacing="0" ><tr><td><b><?php print _("ACCOUNT"); ?></b> </td></tr></table>
</td>
<TD width="405" valign="top">
<INPUT name=account size=60 maxlength=100 value="">
</TD>
</TR>
<TR>
<td width="165" valign="top" bgcolor="#D3D3F2">
<table width="100%" border="0" cellpadding="2" cellspacing="0" ><tr><td><b><?php print _("APPLICATION"); ?></b> </td></tr></table>
</td>
<TD width="405" valign="top">
<INPUT name=application size=60 maxlength=100 value="">
</TD>
</TR>
<TR>
<td width="165" valign="top" bgcolor="#E2E2D3">
<table width="100%" border="0" cellpadding="2" cellspacing="0" ><tr><td><b><?php print _("DATA"); ?></b> </td></tr></table>
</td>
<TD width="405" valign="top">
<INPUT name=data size=60 maxlength=100 value="">
</TD>
</TR>
<TR>
<td width="165" valign="top" bgcolor="#F2D3D3" colspan=2 align=right>
<input type="submit" value="MAKE THE OUTBOUND CALL" />
</td>
</TR>
</TBODY>
</TABLE>
</center>
</FORM>
</td></tr></tbody></table>
</center>
<?php } ?>
<!-- END -->
</body>
</html>