Browse code

added contacts list and call recording and upgraded SIP.js library

DoubleBastionAdmin authored on 21/05/2024 02:08:44
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,169 @@
1
+<?php
2
+/*
3
+ @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
+
5
+ @author Double Bastion LLC
6
+
7
+ @license GNU AGPL version 3 or any later version
8
+
9
+ This program is free software; you can redistribute it and/or
10
+ modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
+ License as published by the Free Software Foundation; either
12
+ version 3 of the License, or any later version.
13
+
14
+ This program is distributed in the hope that it will be useful,
15
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
+ GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
+
19
+ You should have received a copy of the GNU Affero General Public
20
+ License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
+
22
+
23
+
24
+ This is a modified version of the original file "index.html".
25
+ Below is the copyright notice of ctxSip phone (https://github.com/collecttix/ctxSip)
26
+ which also applies to the original "index.html" file, as part of ctxSip phone:
27
+
28
+
29
+   The MIT License (MIT)
30
+
31
+   Copyright (c) 2014 Collecttix
32
+
33
+   Permission is hereby granted, free of charge, to any person obtaining a copy
34
+   of this software and associated documentation files (the "Software"), to deal
35
+   in the Software without restriction, including without limitation the rights
36
+   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
37
+   copies of the Software, and to permit persons to whom the Software is
38
+   furnished to do so, subject to the following conditions:
39
+
40
+   The above copyright notice and this permission notice shall be included in
41
+   all copies or substantial portions of the Software.
42
+
43
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
44
+   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45
+   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
46
+   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
47
+   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
48
+   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
49
+   THE SOFTWARE.
50
+*/
51
+
52
+declare(strict_types=1);
53
+?>
54
+
55
+<!DOCTYPE html>
56
+<html lang="en">
57
+
58
+<head>
59
+  <meta charset="utf-8" />
60
+  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
61
+  <title>SIP Trip Phone</title>
62
+  <link rel="icon" href="data:," />
63
+  <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
64
+  <link rel="stylesheet" type="text/css" href="css/font-awesome-4.7.0/css/font-awesome.min.css" />
65
+  <link rel="stylesheet" type="text/css" href="css/ctxSip.css" />
66
+  <script type="text/javascript" src="../js/crypto-js-4.1.1.min.js"></script>
67
+  <script type="text/javascript" src="scripts/jquery-1.11.3.min.js"></script>
68
+  <script type="text/javascript" src="scripts/bootstrap.min.js"></script>
69
+  <script type="text/javascript" src="scripts/moment.min.js"></script>
70
+  <script type="text/javascript" src="scripts/fix-webm-duration.js"></script>
71
+  <script type="text/javascript" src="scripts/sip.min.js"></script>
72
+  <script type="text/javascript" src="scripts/app.js"></script>
73
+</head>
74
+
75
+<body id="sipClient">
76
+
77
+  <div id="flContainer" class="container-fluid">
78
+
79
+    <div class="clearfix sipStatus">
80
+        <div id="txtCallStatus" class="pull-right">&nbsp;</div>
81
+        <div id="txtRegStatus"></div>
82
+        <div id="volumeBtn">
83
+             <button id="btnVol" class="btn btn-sm btn-primary dropdown-toggle" data-toggle="dropdown" title="Volume"><i class="fa fa-fw fa-volume-up"></i></button>
84
+             <div class="dropdown-menu volumeDropdown"><input id="sldVolume" type="range" min="0" max="100" value="100" step="1" /></div>
85
+        </div>
86
+    </div>
87
+
88
+    <div class="form-group" id="phoneUI">
89
+        <div class="input-group">
90
+            <div class="input-group-btn">
91
+                <button id="dropDownButton" class="btn btn-sm btn-primary dropdown-toggle" data-toggle="dropdown" title="Show keypad">
92
+                    <i class="fa fa-th"></i>
93
+                </button>
94
+                <div id="sip-dialpad" class="dropdown-menu">
95
+                  <div id="dialpadWrap">
96
+                    <button type="button" onclick="document.getElementById('dtmfTone').cloneNode(true).play()" class="btn btn-default digit" data-digit="1">1<span>&nbsp;</span></button>
97
+                    <button type="button" onclick="document.getElementById('dtmfTone').cloneNode(true).play()" class="btn btn-default digit" data-digit="2,A,B,C">2<span>ABC</span></button>
98
+                    <button type="button" onclick="document.getElementById('dtmfTone').cloneNode(true).play()" class="btn btn-default digit" data-digit="3,D,E,F">3<span>DEF</span></button>
99
+                    <button type="button" onclick="document.getElementById('dtmfTone').cloneNode(true).play()" class="btn btn-default digit" data-digit="4,G,H,I">4<span>GHI</span></button>
100
+                    <button type="button" onclick="document.getElementById('dtmfTone').cloneNode(true).play()" class="btn btn-default digit" data-digit="5,J,K,L">5<span>JKL</span></button>
101
+                    <button type="button" onclick="document.getElementById('dtmfTone').cloneNode(true).play()" class="btn btn-default digit" data-digit="6,M,N,O">6<span>MNO</span></button>
102
+                    <button type="button" onclick="document.getElementById('dtmfTone').cloneNode(true).play()" class="btn btn-default digit" data-digit="7,P,Q,R,S">7<span>PQRS</span></button>
103
+                    <button type="button" onclick="document.getElementById('dtmfTone').cloneNode(true).play()" class="btn btn-default digit" data-digit="8,T,U,V">8<span>TUV</span></button>
104
+                    <button type="button" onclick="document.getElementById('dtmfTone').cloneNode(true).play()" class="btn btn-default digit" data-digit="9,W,X,Y,Z">9<span>WXYZ</span></button>
105
+                    <button type="button" onclick="document.getElementById('dtmfTone').cloneNode(true).play()" class="btn btn-default digit" data-digit="*">*<span>&nbsp;</span></button>
106
+                    <button type="button" onclick="document.getElementById('dtmfTone').cloneNode(true).play()" class="btn btn-default digit" data-digit="0,+">0<span>+</span></button>
107
+                    <button type="button" onclick="document.getElementById('dtmfTone').cloneNode(true).play()" class="btn btn-default digit" data-digit="#">#<span>&nbsp;</span></button>
108
+                    <div class="clearfix">&nbsp;</div>
109
+                    <button id="callButton" class="btn btn-success btn-block btnCall" title="Call"><i class="fa fa-phone"></i>Call</button>
110
+                  </div>
111
+                </div>
112
+            </div>
113
+            <div id="selectFromNmbr"><div id="fromNmbrTitle"><i class="fa fa-sign-out" title="'From' number"></i></div><select id="fromNumber" title="Choose a number to call from"></select></div>
114
+            <input type="text" name="number" id="numDisplay" class="form-control text-center input-sm" value="" placeholder="Enter recipient's number" autocomplete="false" title="Recipient" />
115
+            <div id="deleteInput" title="Backspace"></div>
116
+            <div class="input-group-btn input-group-btn-sm">
117
+                 <div id="contactsUsersList" title="Show list of phone numbers of contacts and Nextcloud users"><div id="ctctsUsrsLst" class="contUsrsLst"></div></div>
118
+            </div>
119
+        </div>
120
+    </div>
121
+
122
+    <div id="wndSpace" class="well-sip">
123
+        <div id="sip-splash" class="text-muted text-center panel panel-default">
124
+            <div class="panel-body">
125
+                <div class="page-header">
126
+                  <span><img src="images/sip_trip_phone_logo_large.svg" style="display:block;margin:0px auto;width:80px;height:80px" /></span>
127
+                  <h3>SIP Trip Phone</h3>
128
+                </div>
129
+                <p class="lead">To make a call click on the button in the upper-left corner, enter a phone number and press 'Call'.
130
+                   You can also use your keyboard to enter phone numbers and press 'Enter' to make calls.</p>
131
+            </div>
132
+        </div>
133
+
134
+        <div id="sip-log" class="panel panel-default">
135
+            <div class="panel-heading">
136
+                <span class="text-muted panel-title">Recent Calls <span class="pull-right" style="cursor:pointer;"><i class="fa fa-trash text-muted sipLogClear" title="Clear log"></i></span></span>
137
+            </div>
138
+            <div id="sip-logitems" class="list-group">
139
+                <p class="text-muted text-center">No recent calls from this browser.</p>
140
+            </div>
141
+        </div>
142
+    </div>
143
+
144
+    <div id="mdlError" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" data-keyboard="false">
145
+        <div class="modal-dialog modal-sm">
146
+            <div class="modal-content">
147
+                <div class="modal-header">
148
+                    <h4 class="modal-title">Sip Error</h4>
149
+                </div>
150
+                <div class="modal-body text-center text-danger">
151
+                    <h3><i class="fa fa-3x fa-ban"></i></h3>
152
+                    <p class="lead">Sip registration failed. No calls can be handled.</p>
153
+                </div>
154
+            </div>
155
+        </div>
156
+    </div>
157
+
158
+  </div>
159
+
160
+  <audio id="ringtone" src="sounds/incoming.ogg" loop></audio>
161
+  <audio id="ringbacktone" src="sounds/outgoing.ogg" loop></audio>
162
+  <audio id="dtmfTone" src="sounds/dtmf.ogg" preload></audio>
163
+  <audio id="warnUser" src="sounds/warnrec.ogg" preload></audio>
164
+
165
+  <video id="outputVideo"></video>
166
+  <audio id="outputAudio"></audio>
167
+
168
+</body>
169
+</html>