-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpage.urihand.php
97 lines (82 loc) · 3.6 KB
/
page.urihand.php
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
<?php
if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
//This file is part of FreePBX.
//
// This is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// This module is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// see <http://www.gnu.org/licenses/>.
//
// check if new version of module is available
if ($foo = urihand_vercheck()) {
print "<br>A <b>new version of this module is available</b> from the <a target='_blank' href='http://pbxossa.org'>PBX Open Source Software Alliance</a><br>";
}
if(count($_POST)){
$foo = array(
name1 => $_POST['name1'],
name2 => $_POST['name2'],
name3 => $_POST['name3']
);
urihand_editconfig($foo);
}
// get module config
$date = urihand_getconfig();
// test for presence of custom contexts module
if ($active_modules[customcontexts] ){
$ccmodule = '<b>WARNING:</b> The Custom Contexts Module is enabled on this system, and may be incompatible with this module.<br><br>';
}
?>
<h1><font face="Arial">URI Handling Module</font></h1>
<hr>
This module adds the ability to dial SIP URI's from this PBX.<br><br>
<?php print $ccmodule; ?>
<form name= "config" method="POST" action=""><a href="javascript: return false;" class="info">
Establish the configurtion items below to enable SIP URI Dialing on this platform.<br><br>
<br><hr>
The following three fields are used to set LAN/WAN IP addresses or FQDN names for LAN/WAN of the PBX. Any dialed URIs with these domains will be routed locally.
<table border="0" width="32%" id="table1">
<tr>
<td width="115">MYDOMAIN</td>
<td><input type="text" name="name1" size="27" value="<?php print $date[0]['name1']; ?>"><a href="javascript: return false;" class="info"></td>
</tr>
<tr>
<td width="115">MYFQDN1</td>
<td>
<input type="text" name="name2" size="27" value="<?php print $date[0]['name2']; ?>"><a href="javascript: return false;" class="info"></td>
</tr>
<tr>
<td width="115">MYFQDN2</td>
<td><input type="text" name="name3" size="27" value="<?php print $date[0]['name3']; ?>"><a href="javascript: return false;" class="info"></td>
</tr>
</table>
<br>
<input type="submit" value="update" name="update">
<br><hr>
<?php
echo "<br><h2><b>Configured Extensions:</b></h2>\n";
echo "For extensions to dial a SIP URI, they must be manually set to a context of 'enable-sipuri-dialing' (without quotes). The following table lists the system extensions that are using that context.<br>";
echo "<TABLE cellSpacing=1 cellPadding=1 width=900 border=1 >\n" ;
echo "<TD>Ext#</TD><TD>Description</TD><TD>Context</TD></TR>\n" ;
$list = core_devices_list(); //returns 2d array of system devices
$listcount = count($list);
$count = 0;
while ($count < $listcount) {
$device = core_devices_get($list[$count]['id']);
// print $device['id']."--".$count."---".$device['context']."---<br>";
If ($device['context'] == "enable-sipuri-dialing")
{
echo "<TR><TD><FONT face=verdana,sans-serif>" . $device['id'] . "</TD><TD>".$device['description']."</TD><TD>" .$device['context'] ."</TD>\n";
}
$count++;
}
echo "</TABLE></FORM>\n";
?>
<br><hr><br><small><center>Based on scripts originally created by Luke Hamburg, this module<br>
is now maintained by the PBX Open Source Software Alliance (POSSA)<br><br></center></small>