-
Notifications
You must be signed in to change notification settings - Fork 16
/
chansip.page.php
1118 lines (1090 loc) · 48.1 KB
/
chansip.page.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
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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php /* $Id:$ */
if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
// Original Release by Philippe Lindheimer
// Copyright Philippe Lindheimer (2009)
// Copyright Bandwidth.com (2009)
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* Determines how many columns per row for the codecs and formats the table */
$cols_per_row = 4;
$width = (100.0 / $cols_per_row);
$tabindex = 0;
$error_displays = [];
$action = $_POST['action'] ?? '';
$sip_settings['nat'] = $_POST['nat'] ?? 'yes';
$sip_settings['nat_mode'] = $_POST['nat_mode'] ?? 'externip';
$sip_settings['externip_val'] = isset($_POST['externip_val']) ? htmlspecialchars((string) $_POST['externip_val']) : '';
$sip_settings['externhost_val'] = isset($_POST['externhost_val']) ? htmlspecialchars((string) $_POST['externhost_val']) : '';
$sip_settings['externrefresh'] = isset($_POST['externhostrefresh']) ? htmlspecialchars((string) $_POST['externhostrefresh']) : '120';
// QaD fix for localization, xgettext does not pickup the localization string in the code
$add_field = _("Add Field");
$auto_configure = _("Auto Configure");
$add_local_network_field = _("Add Local Network Field");
$submit_changes = _("Submit Changes");
$p_idx = 0;
$n_idx = 0;
while (isset($_POST["localnet_$p_idx"])) {
if ($_POST["localnet_$p_idx"] != '') {
$sip_settings["localnet_$n_idx"] = htmlspecialchars((string) $_POST["localnet_$p_idx"]);
$sip_settings["netmask_$n_idx"] = htmlspecialchars((string) $_POST["netmask_$p_idx"]);
$n_idx++;
}
$p_idx++;
}
$general_sip_settings = sipsettings_get();
// With the new sorting, the vars should come to us in the sorted order so just use that
//
$sip_settings['canreinvite'] = $_POST['canreinvite'] ?? 'no';
$sip_settings['checkmwi'] = isset($_POST['checkmwi']) ? htmlspecialchars((string) $_POST['checkmwi']) : '10';
$sip_settings['notifyringing'] = $_POST['notifyringing'] ?? 'yes';
$sip_settings['notifyhold'] = $_POST['notifyhold'] ?? 'yes';
$sip_settings['registertimeout'] = isset($_POST['registertimeout']) ? htmlspecialchars((string) $_POST['registertimeout']) : '20';
$sip_settings['registerattempts'] = isset($_POST['registerattempts']) ? htmlspecialchars((string) $_POST['registerattempts']) : '0';
$sip_settings['maxexpiry'] = isset($_POST['maxexpiry']) ? htmlspecialchars((string) $_POST['maxexpiry']) : '3600';
$sip_settings['minexpiry'] = isset($_POST['minexpiry']) ? htmlspecialchars((string) $_POST['minexpiry']) : '60';
$sip_settings['defaultexpiry'] = isset($_POST['defaultexpiry']) ? htmlspecialchars((string) $_POST['defaultexpiry']) : '120';
$sip_settings['jbenable'] = $_POST['jbenable'] ?? 'no';
$sip_settings['jbforce'] = $_POST['jbforce'] ?? 'no';
$sip_settings['jbimpl'] = $_POST['jbimpl'] ?? 'fixed';
$sip_settings['jbmaxsize'] = isset($_POST['jbmaxsize']) ? htmlspecialchars((string) $_POST['jbmaxsize']) : '200';
$sip_settings['jbresyncthreshold'] = isset($_POST['jbresyncthreshold']) ? htmlspecialchars((string) $_POST['jbresyncthreshold']) : '1000';
$sip_settings['jblog'] = $_POST['jblog'] ?? 'no';
$sip_settings['context'] = isset($_POST['context']) ? htmlspecialchars((string) $_POST['context']) : '';
$sip_settings['bindaddr'] = isset($_POST['bindaddr']) ? htmlspecialchars((string) $_POST['bindaddr']) : '';
$sip_settings['bindport'] = isset($_POST['bindport']) ? htmlspecialchars((string) $_POST['bindport']) : '';
$sip_settings['allowguest'] = $_POST['allowguest'] ?? 'no';
$sip_settings['srvlookup'] = $_POST['srvlookup'] ?? 'no';
$sip_settings['tcpenable'] = $_POST['tcpenable'] ?? 'no';
$sip_settings['callevents'] = $_POST['callevents'] ?? 'no';
$sip_settings['tlsenable'] = $_POST['tlsenable'] ?? 'no';
$sip_settings['csipcertid'] = $_POST['csipcertid'] ?? '';
$sip_settings['tlsclientmethod'] = $_POST['tlsclientmethod'] ?? 'tlsv1';
$sip_settings['tlsdontverifyserver'] = $_POST['tlsdontverifyserver'] ?? '';
$sip_settings['tlsbindaddr'] = isset($_POST['tlsbindaddr']) ? htmlspecialchars((string) $_POST['tlsbindaddr']) : '';
$sip_settings['tlsbindport'] = isset($_POST['tlsbindport']) ? htmlspecialchars((string) $_POST['tlsbindport']) : '';
$p_idx = 0;
$n_idx = 0;
while (isset($_POST["sip_custom_key_$p_idx"])) {
if ($_POST["sip_custom_key_$p_idx"] != '') {
$sip_settings["sip_custom_key_$n_idx"] = htmlspecialchars((string) $_POST["sip_custom_key_$p_idx"]);
$sip_settings["sip_custom_val_$n_idx"] = htmlspecialchars((string) $_POST["sip_custom_val_$p_idx"]);
$n_idx++;
}
$p_idx++;
}
switch ($action) {
case "edit": //just delete and re-add
if (($errors = sipsettings_edit($sip_settings)) !== true) {
$error_displays = sipsettings_process_errors($errors);
} else {
needreload();
//redirect_standard();
}
break;
default:
/* only get them if first time load, if they pressed submit, use values from POST */
$sip_settings = sipsettings_get();
}
$error_displays = array_merge($error_displays,sipsettings_check_custom_files());
?>
<div class="alert alert-info"><?php echo _('These settings apply only to SIP Legacy [chan_sip]')?></div>
<h2><?php echo _("Edit Settings"); ?></h2>
<?php
/* EXTRACT THE VARIABLE HERE - MAKE SURE THEY ARE ALL MASSAGED ABOVE */
//
extract($sip_settings);
?>
<input type="hidden" name="action" value="edit">
<?php
/* if there were erros on the submit then create error box */
if (!empty($error_displays)) {
?>
<div class="sip-errors">
<p><?php echo _("ERRORS") ?></p>
<ul>
<?php
foreach ($error_displays as $div_disp) {
echo "<li>".$div_disp['div']."</li>";
}
?>
</ul>
</div>
<?php
}
?>
<div class="section-title" data-for="sscsnat">
<h3><i class="fa fa-minus"></i> <?php echo _("NAT Settings") ?></h3>
</div>
<div class="section" data-id="sscsnat">
<!--NAT-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="nat"><?php echo _("NAT") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="nat"></i>
</div>
<div class="col-md-9 radioset">
<input id="nat-yes" type="radio" name="nat" value="yes" <?php echo $nat=="yes"?"checked=\"yes\"":""?>/>
<label for="nat-yes"><?php echo _("yes")?></label>
<input id="nat-no" type="radio" name="nat" value="no" <?php echo $nat=="no"?"checked=\"no\"":""?>/>
<label for="nat-no"><?php echo _("no")?></label>
<input id="nat-never" type="radio" name="nat" value="never" <?php echo $nat=="never"?"checked=\"never\"":""?>/>
<label for="nat-never"><?php echo _("never")?></label>
<input id="nat-route" type="radio" name="nat" value="route" <?php echo $nat=="route"?"checked=\"route\"":""?>/>
<label for="nat-route"><?php echo _("route")?></label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="nat-help" class="help-block fpbx-help-block"><?php echo _("Asterisk NAT setting:<br /> yes = Always ignore info and assume NAT<br /> no = Use NAT mode only according to RFC3581 <br /> never = Never attempt NAT mode or RFC3581 <br /> route = Assume NAT, don't send rport")?></span>
</div>
</div>
</div>
<!--END NAT-->
<!--IP Configuration-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="nat_mode"><?php echo _("IP Configuration") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="nat_mode"></i>
</div>
<div class="col-md-9 radioset">
<input id="nat-none" type="radio" name="nat_mode" value="public" <?php echo $nat_mode=="public"?"checked=\"public\"":""?>/>
<label for="nat-none"><?php echo _("Public IP") ?></label>
<input id="externip1" type="radio" name="nat_mode" value="externip" <?php echo $nat_mode=="externip"?"checked=\"externip\"":""?>/>
<label for="externip1"><?php echo _("Static IP") ?></label>
<input id="externhost" type="radio" name="nat_mode" value="externhost" <?php echo $nat_mode=="externhost"?"checked=\"externhost\"":""?>/>
<label for="externhost"><?php echo _("Dynamic IP") ?></label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="nat_mode-help" class="help-block fpbx-help-block"><?php echo _("Indicate whether the box has a public IP or requires NAT settings.<br/>If the public address is not correctly detected you can supply the external address manually.<br/>If your IP address is not static you can specify a dynamicDNS host name under Dynamic IP.<br/> Automatic configuration of what is often put in sip_nat.conf")?></span>
</div>
</div>
</div>
<!--END IP Configuration-->
<div class="nat-settings externip">
<!--Override External IP-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="externip_val"><?php echo _("Override External IP") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="externip_val"></i>
</div>
<div class="col-md-9">
<?php
$placeholder = FreePBX::Sipsettings()->getConfig('externip');
if (!$placeholder) {
$placeholder = "Enter IP Address";
}
?>
<input type="text" class="form-control" id="externip_val" name="externip_val" value="<?php echo $externip_val ?? '' ?>" placeholder="<?php echo $placeholder; ?>">
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="externip_val-help" class="help-block fpbx-help-block"><?php echo _("External Static IP or FQDN as seen on the WAN side of the router. (asterisk: externip)")." "._("Note that this will, by default, inherit the settings from the General page")?></span>
</div>
</div>
</div>
<!--END Override External IP-->
</div>
<div class="nat-settings externhost">
<!--Dynamic Host-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="externhost_val"><?php echo _("Dynamic Host") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="externhost_val"></i>
</div>
<div class="col-md-9">
<input type="text" class="form-control" id="externhost_val" name="externhost_val" value="<?php echo $externhost_val ?? '' ?>">
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="externhost_val-help" class="help-block fpbx-help-block"><?php echo _("External FQDN as seen on the WAN side of the router and updated dynamically, e.g. mydomain.example.com. (asterisk: externhost)")?></span>
</div>
</div>
</div>
<!--END Dynamic Host-->
<!--Dynamic Host Refresh-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="externhostrefresh"><?php echo _("Dynamic Host Refresh") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="externhostrefresh"></i>
</div>
<div class="col-md-9">
<div class="input-group">
<input type="number" class="form-control" id="externhostrefresh" name="externhostrefresh" value="<?php echo $externrefresh ?? ''?>">
<span class="input-group-addon"><?php echo _("Seconds")?></span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="externhostrefresh-help" class="help-block fpbx-help-block"><?php echo _("Asterisk: externrefresh. How often to lookup and refresh the External Host FQDN, in seconds.")?></span>
</div>
</div>
</div>
<!--END Dynamic Host Refresh-->
</div>
</div>
<?php if(\FreePBX::Modules()->moduleHasMethod("certman","getDefaultCertDetails")) {?>
<div class="section-title" data-for="csiptls"><h3>
<i class="fa fa-minus"></i> <?php echo _("TLS/SSL/SRTP Settings")?></h3>
</div>
<div class="section" data-id="csiptls">
<div class="element-container">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="tlsenable"><?php echo _("Enable TLS") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="tlsenable"></i>
</div>
<div class="col-md-9 radioset">
<input type="radio" name="tlsenable" id="tlsenableyes" value="yes" <?php $tlsenable = $tlsenable ?? ''; echo ($tlsenable == "yes"?"CHECKED":"") ?>>
<label for="tlsenableyes"><?php echo _("Yes");?></label>
<input type="radio" name="tlsenable" id="tlsenableno" value="no" <?php echo ($tlsenable == "no"?"CHECKED":"") ?>>
<label for="tlsenableno"><?php echo _("No");?></label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="tlsenable-help" class="help-block fpbx-help-block"><?php echo _("Enable server for incoming TLS (secure) connections.")?></span>
</div>
</div>
</div>
<div class="element-container">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="csipcalistfile"><?php echo _("Certificate Manager") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="csipcalistfile"></i>
</div>
<div class="col-md-9">
<select class="form-control" id="csipcalistfile" name="csipcertid">
<option value=""><?php echo "--"._("Select a Certificate")."--"?></option>
<?php $csipcertid = $csipcertid ?? ''; foreach(\FreePBX::Certman()->getAllManagedCertificates() as $cert) { ?>
<option value="<?php echo $cert['cid']?>" <?php echo $csipcertid == $cert['cid'] ? 'selected' : ''?>><?php echo $cert['basename']?></option>
<?php } ?>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="csipcalistfile-help" class="help-block fpbx-help-block"><?php echo _("Select a certificate to use for the TLS transport. These are configured in the module Certificate Manager")?></span>
</div>
</div>
</div>
<div class="element-container">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="tlsclientmethod"><?php echo _("SSL Method") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="tlsclientmethod"></i>
</div>
<div class="col-md-9 radioset">
<?php $tlsclientmethod = $tlsclientmethod ?? ''; ?>
<select class="form-control" id="tlsclientmethod" name="tlsclientmethod">
<option value="tlsv1" <?php echo ($tlsclientmethod == "tlsv1"?"selected":"") ?>>tlsv1</option>
<option value="sslv2" <?php echo ($tlsclientmethod == "sslv2"?"selected":"") ?>>sslv2 (<?php echo _('Insecure')?>)</option>
<option value="sslv3" <?php echo ($tlsclientmethod == "sslv3"?"selected":"") ?>>sslv3 (<?php echo _('Insecure')?>)</option>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="tlsclientmethod-help" class="help-block fpbx-help-block"><?php echo _("Method of SSL transport (TLS ONLY). The default is currently tlsv1, but may change with future releases.")?></span>
</div>
</div>
</div>
<div class="element-container">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="tlsdontverifyserver"><?php echo _("Don't Verify Server") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="tlsdontverifyserver"></i>
</div>
<?php $tlsdontverifyserver = $tlsdontverifyserver ?? ''; ?>
<div class="col-md-9 radioset">
<input type="radio" name="tlsdontverifyserver" id="tlsdontverifyserveryes" value="yes" <?php echo ($tlsdontverifyserver == "yes"?"CHECKED":"") ?>>
<label for="tlsdontverifyserveryes"><?php echo _("Yes");?></label>
<input type="radio" name="tlsdontverifyserver" id="tlsdontverifyserverno" value="no" <?php echo ($tlsdontverifyserver == "no"?"CHECKED":"") ?>>
<label for="tlsdontverifyserverno"><?php echo _("No");?></label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="tlsdontverifyserver-help" class="help-block fpbx-help-block"><?php echo _("Don't Require verification of server certificate (TLS ONLY).")?></span>
</div>
</div>
</div>
</div>
<?php } ?>
<div class="section-title" data-for="sscsmedia">
<h3><i class="fa fa-minus"></i> <?php echo _("MEDIA & RTP Settings")?></h3>
</div>
<div class="section" data-id="sscsmedia">
<!--Non-Standard g726-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="g726nonstandard"><?php echo _("Non-Standard g726") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="g726nonstandard"></i>
</div>
<div class="col-md-9 radioset">
<input id="g726nonstandard-yes" type="radio" name="g726nonstandard" value="yes" <?php echo $g726nonstandard=="yes"?"checked=\"yes\"":""?>/>
<label for="g726nonstandard-yes"><?php echo _("Yes") ?></label>
<input id="g726nonstandard-no" type="radio" name="g726nonstandard" value="no" <?php echo $g726nonstandard=="no"?"checked=\"no\"":""?>/>
<label for="g726nonstandard-no"><?php echo _("No") ?></label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="g726nonstandard-help" class="help-block fpbx-help-block"><?php echo _("Asterisk: g726nonstandard. If the peer negotiates G726-32 audio, use AAL2 packing order instead of RFC3551 packing order (this is required for Sipura and Grandstream ATAs, among others). This is contrary to the RFC3551 specification, the peer _should_ be negotiating AAL2-G726-32 instead.")?></span>
</div>
</div>
</div>
<!--END Non-Standard g726-->
<!--Reinvite Behavior-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="canreinvite"><?php echo _("Reinvite Behavior") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="canreinvite"></i>
</div>
<div class="col-md-9 radioset">
<input id="canreinvite-yes" type="radio" name="canreinvite" value="yes" <?php echo $canreinvite=="yes"?"checked=\"yes\"":""?>/>
<label for="canreinvite-yes"><?php echo _("yes") ?></label>
<input id="canreinvite-no" type="radio" name="canreinvite" value="no" <?php echo $canreinvite=="no"?"checked=\"no\"":""?>/>
<label for="canreinvite-no"><?php echo _("no") ?></label>
<input id="canreinvite-nonat" type="radio" name="canreinvite" value="nonat" <?php echo $canreinvite=="nonat"?"checked=\"nonat\"":""?>/>
<label for="canreinvite-nonat">nonat</label>
<input id="canreinvite-update" type="radio" name="canreinvite" value="update" <?php echo $canreinvite=="update"?"checked=\"update\"":""?>/>
<label for="canreinvite-update">update</label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="canreinvite-help" class="help-block fpbx-help-block"><?php echo _("Asterisk: canreinvite. yes: standard reinvites; no: never; nonat: An additional option is to allow media path redirection (reinvite) but only when the peer where the media is being sent is known to not be behind a NAT (as the RTP core can determine it based on the apparent IP address the media arrives from; update: use UPDATE for media path redirection, instead of INVITE. (yes = update + nonat)")?></span>
</div>
</div>
</div>
<!--END Reinvite Behavior-->
</div>
<div class="section-title" data-for="sscsnotif">
<h3><i class="fa fa-minus"></i> <?php echo _("Notification & MWI")?></h3>
</div>
<div class="section" data-id="sscsnotif">
<!--MWI Polling Freq-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="checkmwi"><?php echo _("MWI Polling Freq") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="checkmwi"></i>
</div>
<div class="col-md-9">
<input type="number" class="form-control" id="checkmwi" name="checkmwi" value="<?php echo $checkmwi ?>">
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="checkmwi-help" class="help-block fpbx-help-block"><?php echo _("Frequency in seconds to check if MWI state has changed and inform peers.")?></span>
</div>
</div>
</div>
<!--END MWI Polling Freq-->
<!--Notify Ringing-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="notifyringing"><?php echo _("Notify Ringing") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="notifyringing"></i>
</div>
<div class="col-md-9 radioset">
<input id="notifyringing-yes" type="radio" name="notifyringing" value="yes" <?php echo $notifyringing=="yes"?"checked=\"yes\"":""?>/>
<label for="notifyringing-yes"><?php echo _("Yes") ?></label>
<input id="notifyringing-no" type="radio" name="notifyringing" value="no" <?php echo $notifyringing=="no"?"checked=\"no\"":""?>/>
<label for="notifyringing-no"><?php echo _("No") ?></label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="notifyringing-help" class="help-block fpbx-help-block"><?php echo _("Control whether subscriptions already INUSE get sent RINGING when another call is sent. Useful when using BLF.")?></span>
</div>
</div>
</div>
<!--END Notify Ringing-->
<!--Notify Hold-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="notifyhold"><?php echo _("Notify Hold") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="notifyhold"></i>
</div>
<div class="col-md-9 radioset">
<input id="notifyhold-yes" type="radio" name="notifyhold" value="yes" <?php echo $notifyhold=="yes"?"checked=\"yes\"":""?>/>
<label for="notifyhold-yes"><?php echo _("Yes") ?></label>
<input id="notifyhold-no" type="radio" name="notifyhold" value="no" <?php echo $notifyhold=="no"?"checked=\"no\"":""?>/>
<label for="notifyhold-no"><?php echo _("No") ?></label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="notifyhold-help" class="help-block fpbx-help-block"><?php echo _("Control whether subscriptions INUSE get sent ONHOLD when call is placed on hold. Useful when using BLF.")?></span>
</div>
</div>
</div>
<!--END Notify Hold-->
</div>
<div class="section-title" data-for="sscsregist">
<h3><i class="fa fa-minus"></i> <?php echo _("Registration Settings")?></h3>
</div>
<div class="section" data-id="sscsregist">
<!--Registration Timeout-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="registertimeout"><?php echo _("Registration Timeout") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="registertimeout"></i>
</div>
<div class="col-md-9">
<input type="number" class="form-control" id="registertimeout" name="registertimeout" value="<?php echo $registertimeout ?>">
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="registertimeout-help" class="help-block fpbx-help-block"><?php echo _("Retry registration attempts every registertimeout seconds until successful or until registrationattempts tries have been made.")?></span>
</div>
</div>
</div>
<!--END Registration Timeout-->
<!--Registration Attempts-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="registerattempts"><?php echo _("Registration Attempts") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="registerattempts"></i>
</div>
<div class="col-md-9">
<input type="number" class="form-control" id="registerattempts" name="registerattempts" value="<?php echo $registerattempts ?>">
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="registerattempts-help" class="help-block fpbx-help-block"><?php echo _("Number of times to try and register before giving up. A value of 0 means keep trying forever. Normally this should be set to 0 so that Asterisk will continue to register until successful in the case of network or gateway outages.")?></span>
</div>
</div>
</div>
<!--END Registration Attempts-->
<!--Regitration Minimum Expiry-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="minexpiry"><?php echo _("Registration Minimum Expiry") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="minexpiry"></i>
</div>
<div class="col-md-9">
<input type="number" class="form-control" id="minexpiry" name="minexpiry" value="<?php echo $minexpiry ?>">
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="minexpiry-help" class="help-block fpbx-help-block"><?php echo _("Minimum length of registrations/subscriptions.")?></span>
</div>
</div>
</div>
<!--END Regitration Minimum Expiry-->
<!--Regitration Maximum Expiry-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="maxexpiry"><?php echo _("Registration Maximum Expiry") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="maxexpiry"></i>
</div>
<div class="col-md-9">
<input type="text" class="form-control" id="maxexpiry" name="maxexpiry" value="<?php echo $maxexpiry ?>">
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="maxexpiry-help" class="help-block fpbx-help-block"><?php echo _("Maximum allowed time of incoming registrations")?></span>
</div>
</div>
</div>
<!--END Regitration Maximum Expiry-->
<!--Registration Default Expiry-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="defaultexpiry"><?php echo _("Registration Default Expiry") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="defaultexpiry"></i>
</div>
<div class="col-md-9">
<input type="number" class="form-control" id="defaultexpiry" name="defaultexpiry" value="<?php echo $defaultexpiry ?>">
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="defaultexpiry-help" class="help-block fpbx-help-block"><?php echo _("Default length of incoming and outgoing registrations.")?></span>
</div>
</div>
</div>
<!--END Registration Default Expiry-->
</div>
<div class="section-title" data-for="sscsjb">
<h3><i class="fa fa-minus"></i> <?php echo _("Jitter Buffer Settings")?></h3>
</div>
<div class="section" data-id="sscsjb">
<!--Enable Jitter Buffer-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="jbenable"><?php echo _("Enable Jitter Buffer") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="jbenable"></i>
</div>
<div class="col-md-9 radioset">
<input id="jbenable-yes" type="radio" name="jbenable" value="yes" <?php echo $jbenable=="yes"?"checked=\"yes\"":""?>/>
<label for="jbenable-yes"><?php echo _("Yes") ?></label>
<input id="jbenable-no" type="radio" name="jbenable" value="no" <?php echo $jbenable=="no"?"checked=\"no\"":""?>/>
<label for="jbenable-no"><?php echo _("No") ?></label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="jbenable-help" class="help-block fpbx-help-block"><?php echo _("Enables the use of a jitterbuffer on the receiving side of a SIP channel. An enabled jitterbuffer will be used only if the sending side can create and the receiving side can not accept jitter. The SIP channel can accept jitter, thus a jitterbuffer on the receive SIP side will be used only if it is forced and enabled. An example is if receiving from a jittery channel to voicemail, the jitter buffer will be used if enabled. However, it will not be used when sending to a SIP endpoint since they usually have their own jitter buffers. See jbforce to force its use always.")?></span>
</div>
</div>
</div>
<!--END Enable Jitter Buffer-->
<div class="jitter-buffer">
<!--Force Jitter Buffer-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="jbforce"><?php echo _("Force Jitter Buffer") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="jbforce"></i>
</div>
<div class="col-md-9 radioset">
<input id="jbforce-yes" type="radio" name="jbforce" value="yes" <?php echo $jbforce=="yes"?"checked=\"yes\"":""?>/>
<label for="jbforce-yes"><?php echo _("Yes") ?></label>
<input id="jbforce-no" type="radio" name="jbforce" value="no" <?php echo $jbforce=="no"?"checked=\"no\"":""?>/>
<label for="jbforce-no"><?php echo _("No") ?></label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="jbforce-help" class="help-block fpbx-help-block"><?php echo _("Forces the use of a jitterbuffer on the receive side of a SIP channel. Normally the jitter buffer will not be used if receiving a jittery channel but sending it off to another channel such as another SIP channel to an endpoint, since there is typically a jitter buffer at the far end. This will force the use of the jitter buffer before sending the stream on. This is not typically desired as it adds additional latency into the stream.")?></span>
</div>
</div>
</div>
<!--END Force Jitter Buffer-->
<!--Implementation-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="jbimpl"><?php echo _("Implementation") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="jbimpl"></i>
</div>
<div class="col-md-9 radioset">
<input id="jbimpl-fixed" type="radio" name="jbimpl" value="fixed" <?php echo $jbimpl=="fixed"?"checked=\"fixed\"":""?>/>
<label for="jbimpl-fixed"><?php echo _("Fixed") ?></label>
<input id="jbimpl-adaptive" type="radio" name="jbimpl" value="adaptive" <?php echo $jbimpl=="adaptive"?"checked=\"adaptive\"":""?>/>
<label for="jbimpl-adaptive"><?php echo _("Adaptive") ?></label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="jbimpl-help" class="help-block fpbx-help-block"><?php echo _("Jitterbuffer implementation, used on the receiving side of a SIP channel. Two implementations are currently available:<br /> fixed: size always equals to jbmaxsize;<br /> adaptive: with variable size (the new jb of IAX2).")?></span>
</div>
</div>
</div>
<!--END Implementation-->
<!--Jitter Buffer Logging-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="jblog"><?php echo _("Jitter Buffer Logging") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="jblog"></i>
</div>
<div class="col-md-9 radioset">
<input id="jblog-yes" type="radio" name="jblog" value="yes" <?php echo $jblog=="yes"?"checked=\"yes\"":""?>/>
<label for="jblog-yes"><?php echo _("Yes") ?></label>
<input id="jblog-no" type="radio" name="jblog" value="no" <?php echo $jblog=="no"?"checked=\"no\"":""?>/>
<label for="jblog-no"><?php echo _("No") ?></label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="jblog-help" class="help-block fpbx-help-block"><?php echo _("Enables jitter buffer frame logging.")?></span>
</div>
</div>
</div>
<!--END Jitter Buffer Logging-->
<!--Jitter Buffer Max Size-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="jbmaxsize"><?php echo _("Jitter Buffer Max Size") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="jbmaxsize"></i>
</div>
<div class="col-md-9">
<input type="text" class="form-control" id="jbmaxsize" name="jbmaxsize" value="<?php echo $jbmaxsize ?>">
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="jbmaxsize-help" class="help-block fpbx-help-block"><?php echo _("Max length of the jitterbuffer in milliseconds.")?></span>
</div>
</div>
</div>
<!--END Jitter Buffer Max Size-->
<!--Jitter Buffer Resync Threshold-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="jbresyncthreshold"><?php echo _("Jitter Buffer Resync Threshold") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="jbresyncthreshold"></i>
</div>
<div class="col-md-9">
<input type="number" min="-1" class="form-control" id="jbresyncthreshold" name="jbresyncthreshold" value="<?php echo $jbresyncthreshold ?>">
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="jbresyncthreshold-help" class="help-block fpbx-help-block"><?php echo _("Jump in the frame timestamps over which the jitterbuffer is resynchronized. Useful to improve the quality of the voice, with big jumps in/broken timestamps, usually sent from exotic devices and programs. Can be set to -1 to disable.")?></span>
</div>
</div>
</div>
<!--END Jitter Buffer Resync Threshold-->
</div>
</div>
<div class="section-title" data-for="sscsadv">
<h3><i class="fa fa-minus"></i> <?php echo _("Advanced General Settings")?></h3>
</div>
<div class="section" data-id="sscsadv">
<!--Default Context-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="context"><?php echo _("Default Context") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="context"></i>
</div>
<div class="col-md-9">
<input type="text" class="form-control validate-alphanumeric" id="context" name="context" value="<?php echo $context ?>">
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="context-help" class="help-block fpbx-help-block"><?php echo _("Default context for incoming calls if not specified. FreePBX sets this to from-sip-external which is used in conjunction with the Allow Anonymous SIP calls. If you change this you will effect that behavior. It is recommended to leave this blank.")?></span>
</div>
</div>
</div>
<!--END Default Context-->
<?php
$tt = _("Asterisk: bindaddr. The IP address to bind to and listen for calls on the Bind Port. If set to 0.0.0.0 Asterisk will listen on all addresses. It is recommended to leave this blank.");
$tt .= ' ' . _("Note that chan_sip does not support IPv6 for UDP protocols. An address of '::' will listen on both IPv4 and IPv6, but is not recommended. If you want to use IPv6, it is recommended to use PJSip for those devices or trunks.");
?>
<!--Bind Address-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="bindaddr"><?php echo _("Bind Address") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="bindaddr"></i>
</div>
<div class="col-md-9">
<input type="text" class="form-control validate-ip" id="bindaddr" name="bindaddr" placeholder='0.0.0.0' value="<?php echo $bindaddr ?>">
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="bindaddr-help" class="help-block fpbx-help-block"><?php echo $tt ?></span>
</div>
</div>
</div>
<!--END Bind Address-->
<!--Bind Port-->
<div class="element-container">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="bindport"><?php echo _("Bind Port") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="bindport"></i>
</div>
<div class="col-md-9">
<input type="text" class="form-control validate-ip-port" id="bindport" name="bindport" value="<?php echo $bindport ?>">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="bindport-help" class="help-block fpbx-help-block"><?php echo _("Local incoming UDP (and TCP if enabled) port that Asterisk will bind to and listen for chan_SIP messages. If left blank, it will default to 5060. Legacy installs (when only a single SIP driver was present) would set the chan_sip bind port to 5060, but new installs set it to 5160.")?></span>
</div>
</div>
</div>
<!--END Bind Port-->
<!--Bind Address-->
<div class="element-container">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="tlsbindaddr"><?php echo _("TLS Bind Address") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="tlsbindaddr"></i>
</div>
<div class="col-md-9">
<input type="text" class="form-control validate-ip" id="tlsbindaddr" name="tlsbindaddr" placeholder='::' value="<?php echo $tlsbindaddr ?? '' ?>">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="tlsbindaddr-help" class="help-block fpbx-help-block"><?php echo _("TCP Port to listen on for TLS (Encrypted) connections. Defaults to '::', which listens on all interfaces for both IPv4 and IPv6 connections. Note that PJSip is preferable for all IPv6 communications."); ?></span>
</div>
</div>
</div>
<!--END Bind Address-->
<!--Bind Port-->
<div class="element-container">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="tlsbindport"><?php echo _("TLS Bind Port") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="tlsbindport"></i>
</div>
<div class="col-md-9">
<input type="text" class="form-control validate-ip-port" id="tlsbindport" name="tlsbindport" value="<?php echo $tlsbindport ?? ''; ?>">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="tlsbindport-help" class="help-block fpbx-help-block"><?php echo _("Local incoming TCP Port that Asterisk will bind to and listen for TLS SIP messages.")?></span>
</div>
</div>
</div>
<!--END Bind Port-->
<!--SRV Lookup-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="srvlookup"><?php echo _("Enable SRV Lookup") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="srvlookup"></i>
</div>
<div class="col-md-9 radioset">
<input id="srvlookup-yes" type="radio" name="srvlookup" value="yes" <?php echo $srvlookup=="yes"?"checked=\"yes\"":""?>/>
<label for="srvlookup-yes"><?php echo _("Yes") ?></label>
<input id="srvlookup-no" type="radio" name="srvlookup" value="no" <?php echo $srvlookup=="no"?"checked=\"no\"":""?>/>
<label for="srvlookup-no"><?php echo _("No") ?></label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="srvlookup-help" class="help-block fpbx-help-block"><?php echo _(" See current version of Asterisk for limitations on SRV functionality.")?></span>
</div>
</div>
</div>
<!--END SRV Lookup-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="tcpenable"><?php echo _("Enable TCP") ?></label>
<i class="fa fa-question-circle fpbx-help-icon" data-for="tcpenable"></i>
</div>
<div class="col-md-9 radioset">
<input id="tcpenable-yes" type="radio" name="tcpenable" value="yes" <?php echo $tcpenable=="yes"?"checked=\"yes\"":""?>/>
<label for="tcpenable-yes"><?php echo _("Yes") ?></label>
<input id="tcpenable-no" type="radio" name="tcpenable" value="no" <?php echo (!isset($tcpenable) || $tcpenable=="no")?"checked=\"no\"":""?>/>
<label for="tcpenable-no"><?php echo _("No") ?></label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="tcpenable-help" class="help-block fpbx-help-block"><?php echo _("Enable TCP")?></span>
</div>
</div>
</div>
<!--Call Events-->
<div class="element-container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<div class="col-md-3">
<label class="control-label" for="callevents"><?php echo _("Call Events") ?></label>