├── .gitignore
├── Desktops
├── 320x196x4
│ ├── List.xml
│ ├── tux-tn.png
│ ├── tux.png
│ ├── ubuntu-tn.png
│ └── ubuntu.png
├── 320x212x12
│ └── List.xml
├── 320x212x16
│ └── List.xml
├── 320x216x16
│ ├── List.xml
│ ├── cisco-tn.png
│ ├── cisco.png
│ ├── goldengate-tn.png
│ ├── goldengate.png
│ ├── win7-tn.png
│ └── win7.png
└── 95x34x1
│ └── List.xml
├── LICENSE
├── README.md
├── files
├── SEP(mac_address).cnf.xml
├── SEP(mac_address)_2012.cnf.xml
├── SEP(mac_address)_2014.cnf.xml
└── dialplan.xml
├── images
├── 7975.png
├── fleet.png
├── folder_contents.png
├── ipv4settings.png
├── tftpd64.png
├── tftpd64settings.png
├── tftpsettings.png
└── transport.png
└── phonebook
├── .DS_Store
├── add_contact.php
├── config.php
├── contacts.php
├── delete_contact.php
├── edit_contact.php
├── index.php
└── search.php
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
--------------------------------------------------------------------------------
/Desktops/320x196x4/List.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
--------------------------------------------------------------------------------
/Desktops/320x196x4/tux-tn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buba0/Cisco-7900-series-freepbx-setup/e77e8cae9af97370b22b1b19ebbb3653573530c8/Desktops/320x196x4/tux-tn.png
--------------------------------------------------------------------------------
/Desktops/320x196x4/tux.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buba0/Cisco-7900-series-freepbx-setup/e77e8cae9af97370b22b1b19ebbb3653573530c8/Desktops/320x196x4/tux.png
--------------------------------------------------------------------------------
/Desktops/320x196x4/ubuntu-tn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buba0/Cisco-7900-series-freepbx-setup/e77e8cae9af97370b22b1b19ebbb3653573530c8/Desktops/320x196x4/ubuntu-tn.png
--------------------------------------------------------------------------------
/Desktops/320x196x4/ubuntu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buba0/Cisco-7900-series-freepbx-setup/e77e8cae9af97370b22b1b19ebbb3653573530c8/Desktops/320x196x4/ubuntu.png
--------------------------------------------------------------------------------
/Desktops/320x212x12/List.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/Desktops/320x212x16/List.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/Desktops/320x216x16/List.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
8 |
9 |
--------------------------------------------------------------------------------
/Desktops/320x216x16/cisco-tn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buba0/Cisco-7900-series-freepbx-setup/e77e8cae9af97370b22b1b19ebbb3653573530c8/Desktops/320x216x16/cisco-tn.png
--------------------------------------------------------------------------------
/Desktops/320x216x16/cisco.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buba0/Cisco-7900-series-freepbx-setup/e77e8cae9af97370b22b1b19ebbb3653573530c8/Desktops/320x216x16/cisco.png
--------------------------------------------------------------------------------
/Desktops/320x216x16/goldengate-tn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buba0/Cisco-7900-series-freepbx-setup/e77e8cae9af97370b22b1b19ebbb3653573530c8/Desktops/320x216x16/goldengate-tn.png
--------------------------------------------------------------------------------
/Desktops/320x216x16/goldengate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buba0/Cisco-7900-series-freepbx-setup/e77e8cae9af97370b22b1b19ebbb3653573530c8/Desktops/320x216x16/goldengate.png
--------------------------------------------------------------------------------
/Desktops/320x216x16/win7-tn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buba0/Cisco-7900-series-freepbx-setup/e77e8cae9af97370b22b1b19ebbb3653573530c8/Desktops/320x216x16/win7-tn.png
--------------------------------------------------------------------------------
/Desktops/320x216x16/win7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buba0/Cisco-7900-series-freepbx-setup/e77e8cae9af97370b22b1b19ebbb3653573530c8/Desktops/320x216x16/win7.png
--------------------------------------------------------------------------------
/Desktops/95x34x1/List.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2025 Buba
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # How to Register Cisco 7900 Series Phones to FreePBX
2 |
3 | 
4 |
5 | ## NOTE
6 | All of the content of this repository is taken from my website as it is easier to add stuff here rather than on the website.
7 | https://buba.pw/tutorial
8 |
9 | ## NOTE 2
10 | I TESTED THIS ONLY ON 7975G and 7942G SO I DON'T KNOW IF IT WORKS ON OTHER MODELS, FEEL FREE TO TEST AND SHARE YOUR EXPERIENCES!!!!
11 |
12 | ## Introduction
13 | Welcome! This tutorial will guide you through the process of setting up [Cisco 7900](https://www.cisco.com/c/en/us/products/collaboration-endpoints/unified-ip-phone-7900-series/index.html) phones to work with [FreePBX](https://www.freepbx.org/).
14 |
15 | For [clabretro](https://www.youtube.com/@clabretro), I've found SIP firmware for 7965 phones. You can download it from the official Cisco link below:
16 |
17 | [**SIP Firmware**](https://software.cisco.com/download/home/281346596/type/282074288/release/9.4(2)SR3)
18 |
19 | If you don’t have a Cisco account or can’t download it, email me, and I'll send it to you. Make sure to download:
20 |
21 | ```
22 | cmterm-7945_7965-sip.9-4-2-1SR3-1.zip
23 | ```
24 |
25 | ---
26 |
27 | ## Steps
28 |
29 | ### 1. Reset Your Phone
30 | 1. Power down the phone by unplugging the 48VDC PoE Ethernet cable or power adapter.
31 | 2. Plug the power source back in while holding the `#` key. Keep holding it until the line buttons start flashing.
32 | 3. When the line buttons flash, press `123456789*0#`.
33 |
34 | ### 2. Set Up a TFTP Server to Upgrade the Phone Firmware to SIP
35 | 1. Install [Tftpd64](https://pjo2.github.io/tftpd64/) on a Windows machine.
36 | 2. Configure your Ethernet adapter settings as shown:
37 |
38 | 
39 |
40 | 3. Open Tftpd64 and adjust the settings as shown:
41 |
42 | 
43 |
44 | 4. Set the "Current Directory" to the folder containing the firmware files:
45 |
46 | 
47 |
48 | ### 3. Upgrade the Phone Firmware
49 | 1. Connect the phone to a PoE switch (or non-PoE switch with a power injector). Cisco 7900 series phones have known issues with auto MDI-X.
50 | 2. Power on the phone. It will display the "Upgrading" screen.
51 | 3. Wait for the phone to display an IP address and begin downloading files from the TFTP server. You can monitor this in Tftpd64.
52 | 4. Once the phone finishes downloading, it will reboot automatically.
53 |
54 | ### 4. Set Up a TFTP Server on FreePBX
55 | 1. Install the TFTP server on Debian 12:
56 |
57 | ```sh
58 | sudo apt install tftpd-hpa
59 | ```
60 |
61 | **Note:** `tftpd-hpa` is often installed along with FreePBX.
62 |
63 | 2. Configure the TFTP server by editing `/etc/default/tftpd-hpa`:
64 |
65 | 
66 |
67 | 3. Restart the TFTP server:
68 |
69 | ```sh
70 | sudo systemctl restart tftpd-hpa.service
71 | ```
72 |
73 | ### 5. Provision the Phone
74 | 1. Upload the configuration file (e.g., `SEP[MAC_ADDRESS].cnf.xml`) to the TFTP server directory (typically `/tftpboot` or `/srv/tftp`).
75 | 2. Some phones are picky about config files, so try one of these:
76 |
77 | - [Download 2012 Config](files/SEP(mac_address)_2012.cnf.xml)
78 | - [Download 2014 Config](files/SEP(mac_address)_2014.cnf.xml)
79 |
80 | 3. Upload `dialplan.xml` to the same directory:
81 |
82 | - [Download Dialplan](files/dialplan.xml)
83 |
84 | 4. Configure the phone:
85 | - Press the **Checkmark** button → `Network Configuration` → `IPv4 Configuration` → `Alternate TFTP`
86 | - Press `**#` to unlock settings
87 | - Click `Yes` to enable Alternate TFTP
88 | - Scroll to `TFTP Server 1` and set it to the TFTP server's IP
89 | 5. Restart the phone. It should provision automatically.
90 |
91 | ### 6. Enable TCP Transport in FreePBX (If the Phone Does Not Register)
92 | 1. Go to **Settings** → **Asterisk SIP Settings** → **SIP Settings [chan_pjsip]** in the FreePBX admin panel.
93 | 2. Adjust the transport settings as shown:
94 |
95 | 
96 |
97 | 3. Click **Submit** and **Apply Config**, then restart FreePBX and the phone.
98 |
99 | ### 7. Enable G722 Codec in FreePBX for HD voice
100 | By default my config allows you to use HD voice or G722 codec, to make use of this
101 | 1. Go to the IP of your FreePBX and log in
102 | 2. Once on the dashboard hover over **Settings**
103 | 3. Click on **Asterisk SIP Settings**
104 | 4. Scroll down to **Codecs**
105 | 5. Enable **"g722"** and move it to the top of the list
106 | 6. Press Submit and Apply Config
107 | 7. For good measure I'd restart both the FreePBX server and the phones
108 |
109 | ---
110 |
111 | ### 8. Custom Backgrounds
112 | You can customize the background of your Cisco 7900 series phones by adding a `Desktops` directory to the TFTP server directory where `SEP[MAC_ADDRESS].cnf.xml` and `dialplan.xml` are stored.
113 |
114 | Image dimensions for different phone models:
115 | | Phone Model | Full Image | Thumbnail (25% of full image) | Color Depth | Directory Path |
116 | |-------------------|-----------------|----------------|-------------|--------------------------|
117 | | **7906G / 7911G** | 95 x 34 | 23 x 8 | Grayscale | /Desktops/95x34x1 |
118 | | **7941G / 7961G** | 320 x 196 | 80 x 49 | Grayscale | /Desktops/320x196x4 |
119 | | **7942G / 7962G** | 320 x 196 | 80 x 49 | Grayscale | /Desktops/320x196x4 |
120 | | **7945G / 7965G** | 320 x 212 | 80 x 53 | 16-bit Color| /Desktops/320x212x16 |
121 | | **7970G / 7971G** | 320 x 212 | 80 x 53 | 12-bit Color| /Desktops/320x212x12 |
122 | | **7975G** | 320 x 216 | 80 x 54 | 16-bit Color| /Desktops/320x216x16 |
123 |
124 | Images should be in PNG format.
125 |
126 | 1. Create the following directory structure:
127 |
128 | For 7942 for example:
129 | ```
130 | /tftpboot/Desktops/320x196x4/
131 | ```
132 | For 7975:
133 | ```
134 | /tftpboot/Desktops/320x216x16/
135 | ```
136 |
137 | 2. Place your custom background images in `320x196x4/` or `320x196x4/`. These must be in 320x196 resolution with 4-bit color depth or monochrome, if made for 7942. Refer to the table above for your phone's display details.
138 | 3. Add a `List.xml` file inside the desired directory eg: `320x196x4` or `320x216x16` to specify available backgrounds.
139 | 4. Example `List.xml` format:
140 | ```xml
141 |
142 |
144 |
146 |
147 | ```
148 | 5. Restart the phone and navigate to the settings to select the new background.
149 |
150 | ---
151 |
152 | ### 9. Phonebook
153 | I have been doing some tinkering and made a kind of phonebook by accident. If you want a phone book of sorts then I've attached a folder called [phonebook](phonebook/). In there there are PHP files, index.html we're interested about. Place the files in `/var/www/html/webapp` directory. It reads off of a database and returns the values with cisco phone format. you need to make a database called "phonebook" and a table "employees":
154 | ```sql
155 | CREATE DATABASE phonebook;
156 | USE phonebook;
157 | CREATE TABLE employees (
158 | id INT AUTO_INCREMENT PRIMARY KEY,
159 | name VARCHAR(100) NOT NULL,
160 | phone VARCHAR(20) NOT NULL
161 | );
162 | ```
163 | Next create a user that can access that database:
164 | ```sql
165 | CREATE USER 'user'@'%' IDENTIFIED BY 'password';
166 | GRANT ALL PRIVILEGES ON phonebook.* TO 'user'@'%';
167 | ```
168 | Next you want to go to the [phone config](files/SEP(mac_address)_2014.cnf.xml) and find:
169 | ```xml
170 |
171 | ```
172 | and add a URL like this:
173 | ```xml
174 | http://freepbx_ip_address/webapp/index.php
175 | ```
176 | Now when you press the globe icon on the phone the service will show a list of users that you put in.
177 |
178 | In the [index.php](phonebook/index.php) there is a variable called `$limit = X` where X is the number of contacts per page. If there is more entries in the phonebook than the value of this variable, the directory/phonebook will have a softkey "Next" and "Previous"
179 |
180 | Go to `http://freepbx_ip_address/webapp/contacts.php` to manage your contacts.
181 | ***UPDATE DATABASE CREDENTIALS IN [THE CONFIG FILE](phonebook/config.php) FOR THE SERVICE TO WORK***
182 |
183 | ## Contact
184 | If you have any questions, feel free to reach out at [kubab945@gmail.com](mailto:kubab945@gmail.com).
185 |
186 | Or open a [GitHub issue](https://github.com/buba0/Cisco-7900-series-freepbx-setup/issues).
187 |
188 | © 2025 [buba.pw](https://buba.pw)
189 | ## Star History
190 |
191 | [](https://www.star-history.com/#buba0/Cisco-7900-series-freepbx-setup&Date)
192 |
--------------------------------------------------------------------------------
/files/SEP(mac_address).cnf.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 | SIP
5 |
6 |
7 | D/M/YY
8 | Central Europe Standard/Daylight Time
9 |
10 |
11 | 0.pl.pool.ntp.org
12 | Unicast
13 |
14 |
15 |
16 |
17 | true
18 |
19 |
20 |
21 | x.x.x.x
22 | Station
23 |
24 | 2000
25 | 5060
26 | 5061
27 |
28 | x.x.x.x
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | true
37 | 1
38 |
39 |
40 | false
41 | false
42 | 0
43 | 1
44 | 0
45 | 0
46 | 1
47 | 0
48 | 1,2,3,4,5,6,7
49 | 00:01
50 | 00:01
51 | 00:01
52 | 1
53 | 1
54 | 1
55 |
56 | g722
57 | 2
58 |
59 | 1
60 | 1
61 | 0
62 |
63 | $SERVICESURL
64 |
65 |
66 |
67 | 96
68 | 0
69 | 96
70 | 4
71 | 0
72 |
73 |
74 | 3804
75 |
76 |
77 |
78 | false
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 | true
91 | x--serviceuri-cfwdall
92 | x-cisco-serviceuri-pickup
93 | x-cisco-serviceuri-opickup
94 | x-cisco-serviceuri-gpickup
95 | x-cisco-serviceuri-meetme
96 | x-cisco-serviceuri-abbrdial
97 | false
98 | 2
99 | true
100 | true
101 | 2
102 | 2
103 | 1
104 | 5
105 | true
106 |
107 |
108 | 6
109 | 10
110 | 180
111 | 3600
112 | 5
113 | 120
114 | 120
115 | 5
116 | 500
117 | 4000
118 | 70
119 | false
120 | None
121 |
122 | 1
123 | false
124 | true
125 | false
126 | false
127 | g722
128 | 101
129 | 3
130 | avt
131 | false
132 | false
133 | 3
134 | 1
135 | true
136 | 10
137 | true
138 | 10100
139 | 10300
140 | 5060
141 | 184
142 | 0
143 | dialplan.xml
144 | 4
145 | something
146 | false
147 | false
148 |
149 |
150 |
151 | 9
152 | XXXX
153 | x.x.x.x
154 | 5060
155 | XXXX
156 | XXXX
157 |
158 | 2
159 |
160 | 3
161 | XXXX
162 | 12345678
163 | false
164 | 1
165 |
166 | 4
167 | 5
168 | XXXX
169 |
170 | true
171 | false
172 | false
173 | true
174 |
175 |
176 |
177 |
178 |
179 | 2
180 |
181 | Missed Calls
182 | Application:Cisco/MissedCalls
183 |
184 |
185 |
186 |
187 | Voicemail
188 | Application:Cisco/Voicemail
189 |
190 |
191 |
192 |
193 | Received Calls
194 | Application:Cisco/ReceivedCalls
195 |
196 |
197 |
198 |
199 | Placed Calls
200 | Application:Cisco/PlacedCalls
201 |
202 |
203 |
204 |
205 | PhoneBook
206 |
207 |
208 |
209 |
210 |
211 |
--------------------------------------------------------------------------------
/files/SEP(mac_address)_2012.cnf.xml:
--------------------------------------------------------------------------------
1 |
2 | SIP
3 | admin
4 | admin
5 | 0
6 |
7 |
8 |
9 | D/M/YY
10 | Central Europe Standard/Daylight Time
11 |
12 |
13 | 0.pl.pool.ntp.org
14 | Unicast
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | 2000
25 | 5060
26 |
27 | 192.168.1.16
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | true
37 |
38 |
39 | true
40 | false
41 | 2
42 | true
43 | true
44 | 2
45 | 2
46 | 0
47 | true
48 | x-serviceuri-cfwdall
49 | x-cisco-serviceuri-pickup
50 | x-cisco-serviceuri-opickup
51 | x-cisco-serviceuri-gpickup
52 | x-cisco-serviceuri-meetme
53 | x-cisco-serviceuri-abbrdial
54 |
55 |
56 |
57 | 6
58 | 10
59 | 180
60 | 3600
61 | 5
62 | 120
63 | 120
64 | 5
65 | 500
66 | 4000
67 | 70
68 | true
69 | None
70 |
71 |
72 | 1
73 | false
74 | true
75 | false
76 | false
77 | g722
78 | 101
79 | 3
80 | avt
81 | false
82 | false
83 | 3
84 | false
85 | JB
86 | 0
87 | false
88 | 10
89 | false
90 | 10000
91 | 20000
92 |
93 |
94 |
95 | 9
96 | 3000
97 | USECALLMANAGER
98 | 5060
99 | 3000
100 | 3000
101 |
102 | 2
103 |
104 | 3
105 | 3000
106 | 12345678
107 | false
108 | 3
109 | *97
110 | 4
111 | 5
112 | 3000
113 |
114 | true
115 | true
116 | false
117 | true
118 |
119 |
120 |
121 |
122 |
123 | 5060
124 | 184
125 | 0
126 | dialplan.xml
127 |
128 |
129 |
130 | true
131 | 1
132 |
133 |
134 |
135 |
136 | false
137 | false
138 | 0
139 | 1
140 | 0
141 | 0
142 | 0
143 | 0
144 | 1
145 | 1
146 | 1
147 |
148 | 0
149 | 22
150 | g722
151 | 2
152 |
153 |
154 | 002
155 | United_Kingdom
156 |
157 | United_Kingdom
158 | 64
159 | 1.0.0.0-4
160 |
161 |
162 | 1
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 | 2
171 | 96
172 | 0
173 | 96
174 | 0
175 |
176 |
177 | 3804
178 |
179 |
180 | 4
181 |
182 | false
183 |
--------------------------------------------------------------------------------
/files/SEP(mac_address)_2014.cnf.xml:
--------------------------------------------------------------------------------
1 |
2 | SIP
3 | admin
4 | admin
5 | 0
6 |
7 |
8 |
9 | D/M/YY
10 | Central Europe Standard/Daylight Time
11 |
12 |
13 | 0.pl.pool.ntp.org
14 | Unicast
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | 2000
25 | 5060
26 |
27 | 192.168.1.16
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | true
37 |
38 |
39 | true
40 | false
41 | 2
42 | true
43 | true
44 | 2
45 | 2
46 | 0
47 | true
48 | x-serviceuri-cfwdall
49 | x-cisco-serviceuri-pickup
50 | x-cisco-serviceuri-opickup
51 | x-cisco-serviceuri-gpickup
52 | x-cisco-serviceuri-meetme
53 | x-cisco-serviceuri-abbrdial
54 |
55 |
56 |
57 | 6
58 | 10
59 | 180
60 | 3600
61 | 5
62 | 120
63 | 120
64 | 5
65 | 500
66 | 4000
67 | 70
68 | true
69 | None
70 |
71 |
72 | 1
73 | false
74 | true
75 | false
76 | false
77 | g722
78 | 101
79 | 3
80 | avt
81 | false
82 | false
83 | 3
84 | false
85 | JB
86 | 0
87 | false
88 | 10
89 | false
90 | 10000
91 | 20000
92 |
93 |
94 |
95 | 9
96 | 3000
97 | USECALLMANAGER
98 | 5060
99 | 3000
100 | 3000
101 |
102 | 2
103 |
104 | 3
105 | 3000
106 | 12345678
107 | false
108 | 3
109 | *97
110 | 4
111 | 5
112 | 1000
113 |
114 | true
115 | true
116 | false
117 | true
118 |
119 |
120 |
121 |
122 |
123 | 5160
124 | 184
125 | 0
126 | dialplan.xml
127 |
128 |
129 |
130 | true
131 | 1
132 |
133 |
134 |
135 |
136 | false
137 | false
138 | 0
139 | 1
140 | 0
141 | 0
142 | 0
143 | 0
144 | 1
145 | 1
146 | 1
147 |
148 | 0
149 | 22
150 | g722
151 | 2
152 |
153 |
154 | 002
155 |
156 | 1
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 | 2
165 | 96
166 | 0
167 | 96
168 | 0
169 |
170 |
171 | 3804
172 |
173 |
174 | 4
175 |
176 | false
177 |
--------------------------------------------------------------------------------
/files/dialplan.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/images/7975.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buba0/Cisco-7900-series-freepbx-setup/e77e8cae9af97370b22b1b19ebbb3653573530c8/images/7975.png
--------------------------------------------------------------------------------
/images/fleet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buba0/Cisco-7900-series-freepbx-setup/e77e8cae9af97370b22b1b19ebbb3653573530c8/images/fleet.png
--------------------------------------------------------------------------------
/images/folder_contents.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buba0/Cisco-7900-series-freepbx-setup/e77e8cae9af97370b22b1b19ebbb3653573530c8/images/folder_contents.png
--------------------------------------------------------------------------------
/images/ipv4settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buba0/Cisco-7900-series-freepbx-setup/e77e8cae9af97370b22b1b19ebbb3653573530c8/images/ipv4settings.png
--------------------------------------------------------------------------------
/images/tftpd64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buba0/Cisco-7900-series-freepbx-setup/e77e8cae9af97370b22b1b19ebbb3653573530c8/images/tftpd64.png
--------------------------------------------------------------------------------
/images/tftpd64settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buba0/Cisco-7900-series-freepbx-setup/e77e8cae9af97370b22b1b19ebbb3653573530c8/images/tftpd64settings.png
--------------------------------------------------------------------------------
/images/tftpsettings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buba0/Cisco-7900-series-freepbx-setup/e77e8cae9af97370b22b1b19ebbb3653573530c8/images/tftpsettings.png
--------------------------------------------------------------------------------
/images/transport.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buba0/Cisco-7900-series-freepbx-setup/e77e8cae9af97370b22b1b19ebbb3653573530c8/images/transport.png
--------------------------------------------------------------------------------
/phonebook/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buba0/Cisco-7900-series-freepbx-setup/e77e8cae9af97370b22b1b19ebbb3653573530c8/phonebook/.DS_Store
--------------------------------------------------------------------------------
/phonebook/add_contact.php:
--------------------------------------------------------------------------------
1 | connect_error) {
9 | die("Connection failed: " . $conn->connect_error);
10 | }
11 |
12 | if ($_SERVER["REQUEST_METHOD"] == "POST") {
13 | // Sanitize input
14 | $name = $conn->real_escape_string($_POST['name']);
15 | $phone = $conn->real_escape_string($_POST['phone']);
16 |
17 | $sql = "INSERT INTO employees (name, phone) VALUES ('$name', '$phone')";
18 | if ($conn->query($sql) === TRUE) {
19 | // Redirect back to contacts list
20 | header("Location: contacts.php");
21 | exit();
22 | } else {
23 | echo "Error: " . $conn->error;
24 | }
25 | }
26 |
27 | $conn->close();
28 | ?>
29 |
--------------------------------------------------------------------------------
/phonebook/config.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/phonebook/contacts.php:
--------------------------------------------------------------------------------
1 | connect_error) {
9 | die("Connection failed: " . $conn->connect_error);
10 | }
11 |
12 | // Fetch all contacts, sorted by phone number in ascending order
13 | $sql = "SELECT id, name, phone FROM employees ORDER BY phone ASC";
14 | $result = $conn->query($sql);
15 | ?>
16 |
17 |
18 |
19 |
20 | Contact List
21 |
28 |
29 |
30 | Contact List
31 |
32 |
33 | Name |
34 | Phone |
35 | Actions |
36 |
37 | num_rows > 0): ?>
38 | fetch_assoc()): ?>
39 |
40 | |
41 | |
42 |
43 | Edit
44 | Delete
45 | |
46 |
47 |
48 |
49 | No contacts found. |
50 |
51 |
52 |
53 | Add New Contact
54 |
61 |
62 |
63 | close();
65 | ?>
66 |
--------------------------------------------------------------------------------
/phonebook/delete_contact.php:
--------------------------------------------------------------------------------
1 | connect_error) {
9 | die("Connection failed: " . $conn->connect_error);
10 | }
11 |
12 | if (isset($_GET['id'])) {
13 | $id = intval($_GET['id']);
14 | $sql = "DELETE FROM employees WHERE id=$id";
15 | if ($conn->query($sql) === TRUE) {
16 | header("Location: contacts.php");
17 | exit();
18 | } else {
19 | echo "Error deleting record: " . $conn->error;
20 | }
21 | } else {
22 | echo "Invalid request.";
23 | }
24 | $conn->close();
25 | ?>
26 |
--------------------------------------------------------------------------------
/phonebook/edit_contact.php:
--------------------------------------------------------------------------------
1 | connect_error) {
9 | die("Connection failed: " . $conn->connect_error);
10 | }
11 |
12 | if ($_SERVER["REQUEST_METHOD"] == "POST") {
13 | // Process the update
14 | $id = intval($_POST['id']);
15 | $name = $conn->real_escape_string($_POST['name']);
16 | $phone = $conn->real_escape_string($_POST['phone']);
17 |
18 | $sql = "UPDATE employees SET name='$name', phone='$phone' WHERE id=$id";
19 | if ($conn->query($sql) === TRUE) {
20 | header("Location: contacts.php");
21 | exit();
22 | } else {
23 | echo "Error updating record: " . $conn->error;
24 | }
25 | } else if (isset($_GET['id'])) {
26 | // Retrieve existing contact information to populate the form
27 | $id = intval($_GET['id']);
28 | $sql = "SELECT id, name, phone FROM employees WHERE id=$id";
29 | $result = $conn->query($sql);
30 | if ($result->num_rows == 1) {
31 | $contact = $result->fetch_assoc();
32 | } else {
33 | echo "Contact not found.";
34 | exit();
35 | }
36 | } else {
37 | echo "Invalid request.";
38 | exit();
39 | }
40 | ?>
41 |
42 |
43 |
44 |
45 | Edit Contact
46 |
47 |
48 | Edit Contact
49 |
57 |
58 | Back to Contact List
59 |
60 |
61 | close();
63 | ?>
64 |
--------------------------------------------------------------------------------
/phonebook/index.php:
--------------------------------------------------------------------------------
1 | connect_error) {
9 | die("Database connection failed");
10 | }
11 |
12 | // Get the base URL dynamically
13 | $base_url = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
14 |
15 | // Handle pagination and search
16 | $page = isset($_GET['page']) ? max(1, intval($_GET['page'])) : 1;
17 | $search = isset($_GET['search']) ? $conn->real_escape_string($_GET['search']) : "";
18 | $limit = 100;
19 | $offset = ($page - 1) * $limit;
20 |
21 | // Build query based on search
22 | $where_clause = "";
23 | if (!empty($search)) {
24 | $where_clause = "WHERE name LIKE '%$search%' OR phone LIKE '%$search%'";
25 | }
26 |
27 | $sql = "SELECT name, phone FROM employees $where_clause ORDER BY phone ASC LIMIT $limit OFFSET $offset";
28 | $result = $conn->query($sql);
29 |
30 | // Check if more pages exist
31 | $total_query = "SELECT COUNT(*) as total FROM employees $where_clause";
32 | $total_result = $conn->query($total_query);
33 | $total_row = $total_result->fetch_assoc();
34 | $total_records = $total_row['total'];
35 | $has_next = ($page * $limit) < $total_records;
36 |
37 | // Start XML output
38 | echo "";
39 | echo "";
40 | echo "Contacts" . (!empty($search) ? " - Search Results" : " (Page $page)") . "";
41 | echo "Select a contact to dial";
42 |
43 | if ($result->num_rows > 0) {
44 | while ($row = $result->fetch_assoc()) {
45 | echo "";
46 | echo "" . htmlspecialchars($row['name']) . "";
47 | echo "" . htmlspecialchars($row['phone']) . "";
48 | echo "";
49 | }
50 | } else {
51 | echo "No Contacts";
52 | echo "No contacts found";
53 | }
54 |
55 | // Soft keys
56 | echo "";
57 | echo "Exit";
58 | echo "1";
59 | echo "SoftKey:Exit";
60 | echo "";
61 |
62 | echo "";
63 | echo "Search";
64 | echo "2";
65 | echo "$base_url/search.php";
66 | echo "";
67 |
68 | if ($page > 1) {
69 | echo "";
70 | echo "Previous";
71 | echo "3";
72 | echo "$base_url/index.php?page=" . ($page - 1) . "&search=$search";
73 | echo "";
74 | }
75 |
76 | if ($has_next) {
77 | echo "";
78 | echo "Next";
79 | echo "4";
80 | echo "$base_url/index.php?page=" . ($page + 1) . "&search=$search";
81 | echo "";
82 | }
83 |
84 | echo "";
85 | echo "Dial";
86 | echo "5";
87 | echo "SoftKey:Dial";
88 | echo "";
89 |
90 | echo "";
91 |
92 | // Close the database connection
93 | $conn->close();
94 | ?>
95 |
--------------------------------------------------------------------------------
/phonebook/search.php:
--------------------------------------------------------------------------------
1 | ";
9 | echo "";
10 | echo "Search Contacts";
11 | echo "Enter name or number";
12 | echo "$base_url/index.php";
13 |
14 | echo "";
15 | echo "Search";
16 | echo "search";
17 | echo "A";
18 | echo "";
19 |
20 | echo "";
21 | echo "Search";
22 | echo "3";
23 | echo "SoftKey:Submit";
24 | echo "";
25 |
26 | echo "";
27 | echo "Clear";
28 | echo "2";
29 | echo "SoftKey:Delete";
30 | echo "";
31 |
32 | echo "";
33 | echo "Exit";
34 | echo "1";
35 | echo "SoftKey:Exit";
36 | echo "";
37 |
38 | echo "";
39 | ?>
40 |
--------------------------------------------------------------------------------