From aff9404d6c7c01f9bf690c1959a2d6a9c4eeaad7 Mon Sep 17 00:00:00 2001 From: PhantomVl Date: Wed, 15 Nov 2017 14:06:32 +0300 Subject: [PATCH] Add butons 'Internal', 'Inherit' --- Sccp_manager.class.php | 56 +- assets/js/sccp_manager.js | 57 +- conf/sccpgeneral.xml | 14 +- conf/sccpgeneral.xml.v431 | 1621 ++++++++++++++++++++++--------------- install.php | 14 +- views/formShow.php | 52 +- views/server.device.php | 2 + 7 files changed, 1135 insertions(+), 681 deletions(-) diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php index 74a10fd..cd4b6d3 100644 --- a/Sccp_manager.class.php +++ b/Sccp_manager.class.php @@ -914,20 +914,41 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { } if (!empty($get_settings[$hdr_arprefix . $key])) { $arr_data = ''; + $arr_clear = FALSE; foreach ($get_settings[$hdr_arprefix . $key] as $vkey => $vval) { $tmp_data = ''; foreach ($vval as $vkey => $vval) { - $tmp_data .= $vval . '/'; + switch ($vkey) { + case 'inherit': + if ($vval=='on') { + $arr_clear = TRUE; ; + } + break; + case 'internal': + if ($vval=='on') { + $tmp_data .= 'internal;'; + } + break; + default: + $tmp_data .= $vval . '/'; + break; + } } if (strlen($tmp_data) > 2) { - if (substr($tmp_data,-1)=='/') { + while (substr($tmp_data,-1)=='/') { $tmp_data = substr($tmp_data, 0, -1); } - $arr_data .= substr($tmp_data, 0, -1) . ';'; - } + $arr_data .= $tmp_data . ';'; + } + } + while (substr($arr_data,-1)==';') { + $arr_data = substr($arr_data, 0, -1); + } + if ($arr_clear) { + $value = 'NONE'; + } else { + $value = $arr_data; } - $arr_data = substr($arr_data, 0, -1); - $value = $arr_data; } } if (!empty($value)) { @@ -1078,13 +1099,28 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { foreach ($value as $vkey => $vval) { $tmp_data = ''; foreach ($vval as $vkey => $vval) { - $tmp_data .= $vval . '/'; + switch ($vkey) { + case 'inherit': + case 'internal': + if ($vval=='on') { + $tmp_data .= 'internal;'; + } + break; + default: + $tmp_data .= $vval . '/'; + break; + } } if (strlen($tmp_data) > 2) { - $arr_data .= substr($tmp_data, 0, -1) . ';'; - } + while (substr($tmp_data,-1)=='/') { + $tmp_data = substr($tmp_data, 0, -1); + } + $arr_data .= $tmp_data. ';'; + } + } + while (substr($arr_data,-1)==';') { + $arr_data = substr($arr_data, 0, -1); } - $arr_data = substr($arr_data, 0, -1); if (!($this->sccpvalues[$key1]['data'] == $arr_data)) { $save_settings[] = array('keyword' => $this->sccpvalues[$key1]['keyword'], 'data' => $arr_data, 'seq' => $this->sccpvalues[$key1]['seq'], 'type' => $this->sccpvalues[$key1]['type']); diff --git a/assets/js/sccp_manager.js b/assets/js/sccp_manager.js index f935a70..1934f75 100644 --- a/assets/js/sccp_manager.js +++ b/assets/js/sccp_manager.js @@ -309,6 +309,9 @@ $(document).ready(function () { var dev_id = $(this).data('vhide'); var dev_class = $(this).data('clhide'); var dev_val = $(this).val(); + if ($(this).data('btn') == 'checkbox') { + dev_val = $('input',this).is(":checked"); + } var dev_state = $(this).attr('checked'); if (dev_state == 'checked'){ $(dev_class).each(function () { @@ -321,11 +324,13 @@ $(document).ready(function () { }); } }); - $('.sccp_button_hide').on('click', function (e) { var dev_id = $(this).data('vhide'); var dev_class = $(this).data('clhide'); var dev_val = $(this).val(); + if ($(this).data('btn') == 'checkbox') { + dev_val = $('input',this).is(":checked"); + } $(dev_class).each(function () { if (dev_val != dev_id) { $(this).removeClass('hidden'); @@ -335,6 +340,56 @@ $(document).ready(function () { } }); }); + + $('.sccp_button_disabled').each(function () { // On page create !! + var dev_id = $(this).data('vhide'); + var dev_class = $(this).data('clhide'); + var dev_val = $(this).val(); + if ($(this).data('btn') == 'checkbox') { + dev_val = $('input',this).is(":checked"); + } + $(dev_class).find('input, select, textarea, button').each(function() { + if (dev_val == dev_id) { + $(this).removeClass('disabled'); + $(this).removeAttr('disabled') + } else { + $(this).addClass('disabled', true); + $(this).attr('disabled', 'disabled'); + } + }); + }); + + $('.sccp_button_disabled').on('click', function (e) { + var dev_id = $(this).data('vhide'); + var dev_class = $(this).data('clhide'); + var dev_val = $(this).val(); + if ($(this).data('btn') == 'checkbox') { + dev_val = $('input',this).is(":checked"); + } + $(dev_class).find('input, select, textarea, button').each(function() { + if (dev_val != dev_id) { + $(this).removeClass('disabled'); + $(this).removeAttr('disabled') + } else { + $(this).addClass('disabled', true); + $(this).attr('disabled', 'disabled'); + } + }); + }); + + + $('.button-checkbox').on('click', '', function (e) { + if ($('button',this).hasClass('active')) { + $('input', this).removeAttr('checked'); + $('button',this).removeClass('active'); + } else { + $('input', this).attr('checked'); + $('input', this).prop('checked','true'); + $('button',this).addClass('active'); + } + }); + + // ----------------------- TEST Validate ---------------- $('.need-validate').on('change', function (e) { diff --git a/conf/sccpgeneral.xml b/conf/sccpgeneral.xml index c28fae1..d526cf6 100644 --- a/conf/sccpgeneral.xml +++ b/conf/sccpgeneral.xml @@ -107,7 +107,7 @@ and open the template in the editor. Base Version before all crash :-) 0.0.0.0/0.0.0.0 - + Add Allow network Allow network settings. Blank fields will be ignored, use Network 0.0.0.0. @@ -117,7 +117,7 @@ and open the template in the editor. Base Version before all crash :-) 0.0.0.0/0.0.0.0 - + Add Deny network All RFC 1918 addresses are local networks. Should always be at least '0.0.0.0/0.0.0.0'. @@ -127,7 +127,7 @@ and open the template in the editor. Base Version before all crash :-) 0.0.0.0/0.0.0.0 - + Add local networks Local network settings. Blank fields will be ignored used Network 0.0.0.0. @@ -855,7 +855,7 @@ and open the template in the editor. Base Version before all crash :-) / - + Add Allow network Allow network settings. Blank fields will be ignored used Network 0.0.0.0. @@ -865,7 +865,7 @@ and open the template in the editor. Base Version before all crash :-) / - + Add Deny network All RFC 1918 addresses are local networks. Should always be at least '0.0.0.0/0.0.0.0'. @@ -1005,7 +1005,7 @@ and open the template in the editor. Base Version before all crash :-) / - + Add Server @@ -1015,7 +1015,7 @@ and open the template in the editor. Base Version before all crash :-) / - + Add Server diff --git a/conf/sccpgeneral.xml.v431 b/conf/sccpgeneral.xml.v431 index 96697d1..edff30b 100644 --- a/conf/sccpgeneral.xml.v431 +++ b/conf/sccpgeneral.xml.v431 @@ -6,340 +6,473 @@ and open the template in the editor. Base Version before all crash :-) --> - XML_info - NONE - - - + + XML_info + + NONE + + + - - - - dev_sshUserId - cisco - - Help. - - - - dev_sshPassword - cisco - - Help. - - - - dev_deviceProtocol - SCCP - - Help. - - - - sccp_xml_about - XML Base ver: 11.2, Sccp ver: 431 - - Help. - + + + + + + dev_sshUserId + cisco + + Help. + + + + + dev_sshPassword + cisco + + Help. + + + + + dev_deviceProtocol + SCCP + + Help. + + + + + sccp_xml_about + XML Base ver: 11.2, Sccp ver: 431 + + Help. + - + - - - servername - Vt - - Servername: This is the type of server - usually, it will be Asterisk. - - - - bindaddr - 0.0.0.0 - sccp-custom - - - port - 2000 - sccp-custom - - Bind Address: The address to bind to for SCCP. In general, it should be set to '0.0.0.0'. If you find problems with one-way audio, you can set this to a specific address in the server. Note that '127.0.0.1' is always wrong here. - : - - - - externip - - sccp-custom - - - External IP Address of the firewall, required in case the PBX is running on a seperate host behind it. IP Address that we're going to notify in RTP media stream as the pbx source address. - / - - - - keepalive - 60 - sccp-custom - number - - - Time between Keep Alive checks. Valid range is 60-300 seconds. After much trial-and-error, the minimum (60) seems to work just fine. - - debug - NONE - - - - - - Debug: Enable debugging level in SCCP module. - + + + + servername + Vt + + Servername: This is the type of server - usually, it will be Asterisk. + + + + + bindaddr + 0.0.0.0 + sccp-custom + + + port + 2000 + sccp-custom + + Bind Address: The address to bind to for SCCP. In general, it should be set to '0.0.0.0'. If you find problems with one-way audio, you can set this to a specific address in the server. Note that '127.0.0.1' is always wrong here. + : + + + + + externip + + sccp-custom + + + External IP Address of the firewall, required in case the PBX is running on a seperate host behind it. IP Address that we're going to notify in RTP media stream as the pbx source address. + / + + + + + keepalive + 60 + sccp-custom + number + + + Time between Keep Alive checks. Valid range is 60-300 seconds. After much trial-and-error, the minimum (60) seems to work just fine. + + + nat + + auto + + + + Global NAT support (default Auto) + + + debug + + NONE + + + + + + Debug: Enable debugging level in SCCP module. + - - - - permit - 0.0.0.0/0.0.0.0 - - - - Alow network settings. Blank fields will be ignored used Network 0.0.0.0/0.0.0.0 to resolve any existing connections. You can use the 'internal' connections only from the networks connected to the server. - + + + + + permit + Internal + 0.0.0.0/0.0.0.0 + + + + + + + Add Alow network + Alow network settings. Blank fields will be ignored used Network 0.0.0.0/0.0.0.0 to resolve any existing connections. You can use the 'internal' connections only from the networks connected to the server. + - - - deny - 0.0.0.0/0.0.0.0 - - - - All RFC 1918 addresses are local networks. Should always be at least '0.0.0.0/0.0.0.0'. - + + + deny + 0.0.0.0/0.0.0.0 + + + + + + + + + Add Deny network + All RFC 1918 addresses are local networks. Should always be at least '0.0.0.0/0.0.0.0'. + - - - localnet - 0.0.0.0/0.0.0.0 - - - - Local network settings. Blank fields will be ignored used Network 0.0.0.0. - + + + localnet + Internal + 0.0.0.0/0.0.0.0 + + + + + + + + + Add local networks + Local network settings. Blank fields will be ignored used Network 0.0.0.0. + - - - language - English - - SCCP Language: This is the language for your hints and other features of the phone. If you don't have any languages installed or are using a single language, you can leave this blank. - - - netlang - English_United_States - - The Network locales allows the phone to play tones (ringing, busy etc.) native to the phone's country. - - - devlang - English_United_States - - The user locale allows the phone to display text (menu items, soft keys etc.) native to the phone's language. - + + + + + language + English + + SCCP Language: This is the language for your hints and other features of the phone. If you don't have any languages installed or are using a single language, you can leave this blank. + + + + netlang + English_United_States + + The Network locales allows the phone to play tones (ringing, busy etc.) native to the phone's country. + + + + devlang + English_United_States + + The user locale allows the phone to display text (menu items, soft keys etc.) native to the phone's language. + - - - - firstdigittimeout - 16 - sccp-custom - number - - - First Digit Timeout: The amount of time after your first digit to start dialing automatically. This can be over-ridden with settings in your dialplan.xml or by using the 'immediate dial' button. - - - - digittimeout - 8 - sccp-custom - number - - - Digit Timeout: The amount of time to wait after the second (or subsequent) dialed digit. Override rules are the same as for firstdigittimeout. - - - - autoanswer_ring_time - 0 - sccp-custom - number - - - Autoanswer Ring Time: The amount of time the phones will ring when being called as Intercom or Paging mode. - - - - autoanswer_tone - 0x32 - sccp-custom - - Autoanswer Tone: The tone the phone plays back when it picks up the phone in autoanswer mode. Default is '0x32'. Silence is '0x00'. There are lots of tones, all expressed as '0XNN' where 'NN' is a hexadecimal number. - - - - remotehangup_tone - 0x32 - sccp-custom - - Remote Hangup Tone: The tone played by the phone when it received a remote hang-up signal. Use '0' to disable the tone. - - - - transfer_tone - 0x32 - sccp-custom - - Transfer Tone: The tone played when a call is transferred. Use '0' to disable the tone. - - - - callwaiting_tone - 0x2D - sccp-custom - - Call Waiting Tone: The tone played when a call is waiting. If you set this one to '0', you will not get a tone in your current call if a new call comes in, so you might want to disable call waiting for this line instead. - - echocancel - off - - - Echo Cancel: Echo Cancellation (On or Off). - - silencesuppression - off - - - Silence Suppression: Slience Suppression on the phone. - - private - on - - - Private Calling Enabled: Place a call with privacy Options (no Caller ID) turned on. Needs to be supported in Asterisk to work through SIP and DAHDI trunks. - - directed_pickup_modeanswer - off - - - Directed Pickup Mode (Answer): If a call is sent with the "directed pickup" flag, the phone will answer when set to "Yes". - - callanswerorder - oldestfirst - - - Call Answer Order: Which call should be answered first? The most common choice is "oldestfirst", but other orders are supported. - - mwilamp - On - - - - - - Set the MWI lamp style when MWI active to on, off, wink, flash or blink - - mwioncall - off - - - Set the MWI on call. - - - - - - ntp_config_enabled - off - - - Enabling NTP settings in device configuration. - - - - ntp_server - pool.ntp.org - pool.ntp.org - - NTP Server name or IP - - ntp_server_mode - unicast - - - - - Configure NTP Server protocol time syncronization - - - - - - dateformat - - Date Format: The date format for the on-screen display. Can be one of the following: (D-M-YA, M.D.Y, Y/M/D) where 'D' is Day, 'M' is Month, 'Y' is Year, 'A' is 24-hour, 'a' is 12-hour, and the separators can be '.','-','/' + + + + + + firstdigittimeout + 16 + sccp-custom + number + + + First Digit Timeout: The amount of time after your first digit to start dialing automatically. This can be over-ridden with settings in your dialplan.xml or by using the 'immediate dial' button. - - ntp_timezone - sccp-custom - - Date Format: Time zone + + + + digittimeout + 8 + sccp-custom + number + + + Digit Timeout: The amount of time to wait after the second (or subsequent) dialed digit. Override rules are the same as for firstdigittimeout. + + + + + autoanswer_ring_time + 0 + sccp-custom + number + + + Autoanswer Ring Time: The amount of time the phones will ring when being called as Intercom or Paging mode. + + + + + autoanswer_tone + 0x32 + sccp-custom + + Autoanswer Tone: The tone the phone plays back when it picks up the phone in autoanswer mode. Default is '0x32'. Silence is '0x00'. There are lots of tones, all expressed as '0XNN' where 'NN' is a hexadecimal number. + + + + + remotehangup_tone + 0x32 + sccp-custom + + Remote Hangup Tone: The tone played by the phone when it received a remote hang-up signal. Use '0' to disable the tone. + + + + + transfer_tone + 0x32 + sccp-custom + + Transfer Tone: The tone played when a call is transferred. Use '0' to disable the tone. + + + + + callwaiting_tone + 0x2D + sccp-custom + + Call Waiting Tone: The tone played when a call is waiting. If you set this one to '0', you will not get a tone in your current call if a new call comes in, so you might want to disable call waiting for this line instead. + + + echocancel + + off + + + Echo Cancel: Echo Cancellation (On or Off). + + + silencesuppression + + off + + + Silence Suppression: Slience Suppression on the phone. + + + private + + on + + + Private Calling Enabled: Place a call with privacy Options (no Caller ID) turned on. Needs to be supported in Asterisk to work through SIP and DAHDI trunks. + + + directed_pickup_modeanswer + + off + + + Directed Pickup Mode (Answer): If a call is sent with the "directed pickup" flag, the phone will answer when set to "Yes". + + + callanswerorder + + oldestfirst + + + Call Answer Order: Which call should be answered first? The most common choice is "oldestfirst", but other orders are supported. + + + mwilamp + + On + + + + + + Set the MWI lamp style when MWI active to on, off, wink, flash or blink + + + mwioncall + + off + + + Set the MWI on call. + + + + + + + directrtp + + off + + + This option set global allow devices to do direct RTP sessions (default Off) + + + earlyrtp + + none + Immediate + + + + + + The audio strem will be open in the progress and connected state. Valid options: NONE, progress, offhook, dial, ringout. Default may be Progress. + + + + + + cfwdall + + off + + + Activate the callforward softkeys. Default is On + + + cfwdbusy + + off + + + Activate the callforward busy softkeys. Default is On + + + dndFeature + + on + + + Do Not Disturb. Default is Off + + + + + + + ntp_config_enabled + + off + + + Enabling NTP settings in device configuration. + + + + + ntp_server + pool.ntp.org + pool.ntp.org + + NTP Server name or IP + + + ntp_server_mode + + unicast + + + + + Configure NTP Server protocol time syncronization + + + + + + + + dateformat + + Date Format: The date format for the on-screen display. Can be one of the following: (D-M-YA, M.D.Y, Y/M/D) where 'D' is Day, 'M' is Month, 'Y' is Year, 'A' is 24-hour, 'a' is 12-hour, and the separators can be '.','-','/' + + + + ntp_timezone + sccp-custom + + Date Format: Time zone - + + - Help_srst - You can also configure a Survivable Remote Site Telephony (SRST) reference as the last device in the CallManager(CM) list. - This proves especially useful in a remote site configuration where the phones and Asterisk are connected over a WAN network. - SRST provides users with fallback support for the IP phones that cannot access the primary, secondary, or tertiary Asterisk Node in the CallManager List because - of an Asterisk Node failure or loss of connectivity across the WAN. For the remote sites attached to multiple-service routers across the WAN, - SRST ensures that your remote users receive continuous (although minimal) service by providing call handling support directly from the SRST router. - - When IP phones lose contact with primary, secondary, and tertiary Asterisk Nodes (CM's), they must establish a connection to a local - SRST router to sustain the call-processing capability necessary to place and receive calls. - The IP phone retains the IP address of the local SRST router as a default router in the Network Configuration area of the Settings menu. - The Settings menu supports a maximum of five default router entries; however, the cnf.xml accommodates a maximum of three entries. - When a secondary Asterisk Node is not available on the network, the local SRST Router's IP address is retained as the standby - connection for Asterisk Node during normal operation. - + Help_srst + You can also configure a Survivable Remote Site Telephony (SRST) reference as the last device in the CallManager(CM) list. + This proves especially useful in a remote site configuration where the phones and Asterisk are connected over a WAN network. + SRST provides users with fallback support for the IP phones that cannot access the primary, secondary, or tertiary Asterisk Node in the CallManager List because + of an Asterisk Node failure or loss of connectivity across the WAN. For the remote sites attached to multiple-service routers across the WAN, + SRST ensures that your remote users receive continuous (although minimal) service by providing call handling support directly from the SRST router. + + When IP phones lose contact with primary, secondary, and tertiary Asterisk Nodes (CM's), they must establish a connection to a local + SRST router to sustain the call-processing capability necessary to place and receive calls. + The IP phone retains the IP address of the local SRST router as a default router in the Network Configuration area of the Settings menu. + The Settings menu supports a maximum of five default router entries; however, the cnf.xml accommodates a maximum of three entries. + When a secondary Asterisk Node is not available on the network, the local SRST Router's IP address is retained as the standby + connection for Asterisk Node during normal operation. + - srst_Option - off - - - - You enabled configure a Survivable Remote Site Telephony (SRST) reference as the last device in the CallManager(CM) list. + + srst_Option + + off + + + + You enabled configure a Survivable Remote Site Telephony (SRST) reference as the last device in the CallManager(CM) list. - srst_userModifiable + + srst_userModifiable + false The user can change the personal SRST configuration on the device - srst_isSecure + + srst_isSecure + false @@ -360,9 +493,15 @@ and open the template in the editor. Base Version before all crash :-) srst_ip 3 / - - - + + + + + + + + + Add Server Help. @@ -370,255 +509,315 @@ and open the template in the editor. Base Version before all crash :-) srst_sip 3 / - - - + + + + + + + + + Add Server Help. - - - dev_servicesURL - - - + + + + dev_servicesURL + + + - - - - - - dev_authenticationURL - - - - - The above is simply a dummy authentication page. It literally contains one word: AUTHORIZED (it receives UserId, Password, and devicename in the url - if you truly wish to implement special auth) - - - - dev_idleURL - - - - - URL of CiscoIPPhoneImage. Requires a non-zero setting in idleTimeout. - - - - dev_informationURL - - - - - - - - dev_messagesURL - - - - - - - - dev_directoryURL - - - - This is the URL for a CiscoIPPhoneMenu which gets appended to the end of the Missed/Received/Placed calls. I don't use it (I find it makes more sense to put my phone book under services) - - - - dev_proxyServerURL - - - - - - + + + + + + + dev_authenticationURL + + + + + The above is simply a dummy authentication page. It literally contains one word: AUTHORIZED (it receives UserId, Password, and devicename in the url - if you truly wish to implement special auth) + + + + + dev_idleURL + + + + + URL of CiscoIPPhoneImage. Requires a non-zero setting in idleTimeout. + + + + + dev_informationURL + + + + + + + + + dev_messagesURL + + + + + + + + + dev_directoryURL + + + + This is the URL for a CiscoIPPhoneMenu which gets appended to the end of the Missed/Received/Placed calls. I don't use it (I find it makes more sense to put my phone book under services) + + + + + dev_proxyServerURL + + + + + + - - - dev_idleTimeout - 60 - sccp-custom - number - - - - + + + + dev_idleTimeout + 60 + sccp-custom + number + + + + - - - - sccp_tos - 0x68 - sccp-custom - - - sccp_cos - 0x4 - sccp-custom - - SCCP Type Of Service / Class Of Service: SCCP Type or Class of Service - this is modifiable, but don't. - - - - audio_tos - 0xB8 - sccp-custom - - - audio_cos - 0x6 - sccp-custom - - Audio Type Of Service / Class Of Service: Audio Type or Class of Service - this is modifiable, but don't. - - - - video_tos - 0x88 - sccp-custom - - - video_cos - 0x5 - sccp-custom - - Video Type Of Service / Class Of Service: Video Type or Class of Service - this is modifiable, but don't. - + + + + + + sccp_tos + 0x68 + sccp-custom + + + sccp_cos + 0x4 + sccp-custom + + SCCP Type Of Service / Class Of Service: SCCP Type or Class of Service - this is modifiable, but don't. + + + + + audio_tos + 0xB8 + sccp-custom + + + audio_cos + 0x6 + sccp-custom + + Audio Type Of Service / Class Of Service: Audio Type or Class of Service - this is modifiable, but don't. + + + + + video_tos + 0x88 + sccp-custom + + + video_cos + 0x5 + sccp-custom + + Video Type Of Service / Class Of Service: Video Type or Class of Service - this is modifiable, but don't. + - - - Help_id2 - Setting the hotline Feature on a device, will make it connect to a predefined extension as soon as the Receiver - is picked up or the "New Call" Button is pressed. No number has to be given. This works even on devices which have - no entry in the config file or realtime database. - The hotline function can be used in : - - First time configurationThis will make it easier to register new devices and assign numbers - At a doorWhere you want people to be able to only call one number - For unprovisioned phonesTo only be able to call the helpdesk to get their phone set up - - - Be careful with this function. Especially not to the internet. So i would restring the deny/permit to 'internal' by default in that case. - - Alow =Specify a list of your networks, for example: 192.168.1.0 - deny =0.0.0.0/0.0.0.0 - permit =internal - hotline_context =sccp - hotline_label = hotline - + + + + Help_id2 + + Setting the hotline Feature on a device, will make it connect to a predefined extension as soon as the Receiver + is picked up or the "New Call" Button is pressed. No number has to be given. This works even on devices which have + no entry in the config file or realtime database. + The hotline function can be used in : + + + First time configuration + This will make it easier to register new devices and assign numbers + + + At a door + Where you want people to be able to only call one number + + + For unprovisioned phones + To only be able to call the helpdesk to get their phone set up + + + + Be careful with this function. Especially not to the internet. So i would restring the deny/permit to 'internal' by default in that case. + + + Alow = + Specify a list of your networks, for example: 192.168.1.0 + + + deny = + 0.0.0.0/0.0.0.0 + + + permit = + internal + + + hotline_context = + sccp + + + hotline_label = + hotline + + - + - hotline_enabled - off - - - Hotline Enabled: This allows unregistered extensions to connect to the system and dial the number listed below. - - - - hotline_extension - *111 + + hotline_enabled + + off + + + Hotline Enabled: This allows unregistered extensions to connect to the system and dial the number listed below. + + + + + hotline_extension + *111 + sccp-custom + + Hotline Extension: The number that gets called when a hotline is picked up. hint + + + + + hotline_label + Hot Line + sccp-custom + + Hotline Label: The label on the device + + + + + hotline_context + default + sccp-custom + + Hotline Context: This is the context through which the phone will connect. It should probably match your other contest. The default is "from-internal" but "from-internal-xfer" would also make sense by limiting the options for the person using the phone. + + + + + context + from-internal + sccp-custom + + Context: This is the context in which your phones will operate. It should match the context you are using for the rest of your phones (if you have any). The FreePBX default is 'from-internal' + + + + + regcontext + sccpregistration + sccp-custom + + If regcontext is specified in sccp.conf chan-sccp-b will dynamically create and destroy a NoOp priority 1 extension for a given peer/line which registers with the server. If the context is not specified in extension.conf, then it will be dynamically created when an chan-sccp-b agent registers + + + + musicclass + NONE + + form-control + Music Class: Available MOH Classes. These are the MOH classes listed in your current server. + + + + dial_template + NONE + sccp-custom - - Hotline Extension: The number that gets called when a hotline is picked up. hint - - - - hotline_label - Hot Line - sccp-custom - - Hotline Label: The label on the device - - - - hotline_context - default - sccp-custom - - Hotline Context: This is the context through which the phone will connect. It should probably match your other contest. The default is "from-internal" but "from-internal-xfer" would also make sense by limiting the options for the person using the phone. - - - - context - from-internal - sccp-custom - - Context: This is the context in which your phones will operate. It should match the context you are using for the rest of your phones (if you have any). The FreePBX default is 'from-internal' - - - - regcontext - sccpregistration - sccp-custom - - If regcontext is specified in sccp.conf chan-sccp-b will dynamically create and destroy a NoOp priority 1 extension for a given peer/line which registers with the server. If the context is not specified in extension.conf, then it will be dynamically created when an chan-sccp-b agent registers - - - musicclass - NONE - - form-control - Music Class: Available MOH Classes. These are the MOH classes listed in your current server. - - - dial_template - NONE - - sccp-custom - Help. - - - autoselectline_enabled - - off - - - Enables and disables auto line selection. - - meetme - off - - - enable/disable conferencing via meetme (on/off), make sure you have one of the meetme apps mentioned below activated in module.conf - - - - meetmeopts - qxd - sccp-custom - - Other options (app_meetme: A,a,b,c,C,d,D,E,e,F,i,I,l,L,m,M,o,p,P,q,r,s,S,t,T,w,x,X,1) see meetme specific documentation - + Help. + + + autoselectline_enabled + + off + + + Enables and disables auto line selection. + + + meetme + + off + + + enable/disable conferencing via meetme (on/off), make sure you have one of the meetme apps mentioned below activated in module.conf + + + + + meetmeopts + qxd + sccp-custom + + Other options (app_meetme: A,a,b,c,C,d,D,E,e,F,i,I,l,L,m,M,o,p,P,q,r,s,S,t,T,w,x,X,1) see meetme specific documentation + - - autocall_select - - off - - - - - backgroundImageAccess - off - - - I'm guessing on this one, but on some devices, the background image on the display can be modified at the device. I think this is the thing that allows that to take. - + + autocall_select + + off + + + + + + backgroundImageAccess + + off + + + I'm guessing on this one, but on some devices, the background image on the display can be modified at the device. I think this is the thing that allows that to take. + - - + + + + tftp_path /tftpboot @@ -626,7 +825,8 @@ and open the template in the editor. Base Version before all crash :-) Path to tftp home directory - + + devicetable sccpdevice @@ -635,7 +835,8 @@ and open the template in the editor. Base Version before all crash :-) Device Table: This is the devicetable for your realtime configuration. Don't change this unless you know what you are doing and have made all the appropriate changes in the rest of your Asterisk config files. There are two reasonable settings for this - the sccpdevice table or the sccpdeviceconfig view. If you do not want to use the realtime database anymore, you can set this to blank. NOT RECOMMENDED. - + + linetable sccpline @@ -645,17 +846,20 @@ and open the template in the editor. Base Version before all crash :-) - createlangdir - off - - - Say 'yes' if you need to create cisco default language directory in tftp path. + createlangdir + + off + + + Say 'yes' if you need to create cisco default language directory in tftp path. - - - + + + + + mac 000000000 @@ -684,13 +888,14 @@ and open the template in the editor. Base Version before all crash :-) - + + mac 000000000 sccp-custom - + The MAC address of the phone @@ -728,7 +933,8 @@ and open the template in the editor. Base Version before all crash :-) - + + description 000000000 @@ -736,31 +942,36 @@ and open the template in the editor. Base Version before all crash :-) The information in the upper right corner of the device screen - + + softkeyset default System default softkey - + + tzoffset 00 Time Zone offset - + + netlang English_United_States The Network locales allows the phone to play tones (ringing, busy etc.) native to the phone's country. - + + devlang Russian_Russia The user locale allows the phone to display text (menu items, soft keys etc.) native to the phone's language. - + + backgroundImage @@ -768,7 +979,8 @@ and open the template in the editor. Base Version before all crash :-) For phones that can display background images - display this one. Default is [empty] - + + ringtone @@ -778,8 +990,10 @@ and open the template in the editor. Base Version before all crash :-) - - + + + + mac 000000000 @@ -789,33 +1003,46 @@ and open the template in the editor. Base Version before all crash :-) - - transfer + + + + transfer + off Transfer allowed - cfwdall - off + + cfwdall + + NONE + Activate the callforward softkeys. Default is On - cfwdbusy - off + + cfwdbusy + + NONE + Activate the callforward busy softkeys. Default is On - dndFeature + + dndFeature - on + NONE + Do Not Disturb. Default is Off - directed_pickup + + directed_pickup + on off @@ -833,9 +1060,11 @@ and open the template in the editor. Base Version before all crash :-) - + + pickup_hide - + + directed_pickup_context @@ -843,7 +1072,9 @@ and open the template in the editor. Base Version before all crash :-) Context where direct pickup search for extensions. if not set current contect will be use. - directed_pickup_modeanswer + + directed_pickup_modeanswer + on @@ -852,8 +1083,10 @@ and open the template in the editor. Base Version before all crash :-) - - useRedialMenu + + + + useRedialMenu off @@ -869,10 +1102,21 @@ and open the template in the editor. Base Version before all crash :-) Dual-Tone Multi-Frequency: outofband is the native cisco dtmf tone play + + mwioncall + + NONE + + + + Set the MWI on call. + - mwilamp + + mwilamp - On + NONE + @@ -917,7 +1161,8 @@ and open the template in the editor. Base Version before all crash :-) Automatically show conference list to the moderator - + + conf_music_on_hold_class default @@ -931,11 +1176,20 @@ and open the template in the editor. Base Version before all crash :-) + permit - / - - - + NONE + Inherit + false + + sccp_hw-ar_permit-grinternal + + + + + + + Add Alow network Alow network settings. Blank fields will be ignored used Network 0.0.0.0. @@ -943,15 +1197,22 @@ and open the template in the editor. Base Version before all crash :-) deny / - - - + + + + + + + + + Add Deny network All RFC 1918 addresses are local networks. Should always be at least '0.0.0.0/0.0.0.0'. nat - auto + NONE + @@ -962,7 +1223,8 @@ and open the template in the editor. Base Version before all crash :-) directrtp NONE - + Auto + This option allow devices to do direct RTP sessions (default Off) @@ -970,7 +1232,8 @@ and open the template in the editor. Base Version before all crash :-) earlyrtp - none + NONE + Immediate @@ -981,7 +1244,8 @@ and open the template in the editor. Base Version before all crash :-) - + + dialtemplate_name @@ -992,70 +1256,123 @@ and open the template in the editor. Base Version before all crash :-) - - - - Help_id1 - Specifies a pattern to match dialed digits against. Note: TEMPLATE must be in uppercase. - Rules: - - match:Pattern to match, consists of one or more elements - 0 1 2 3 4 5 6 7 8 9Match digit - .Match one digit, # or * - *Match zero or more digits, # or * - \*Match a literal * - ,Play secondary dial-tone specified by tone - timeout:Number of seconds to wait for more digits if this pattern matches - line:Only apply template to the specified line (optional) - rewrite:Rewrite the matched digits before dialing, consists of one or more elements (optional) - 0 1 2 3 4 5 6 7 8 9Replace with digit - %0The entire match - %1 %2 %3 %4 %5Replace with group of digits matched, grouping is done by consecutive literal digit or . elements - %%A literal % - .Each . is replaced by the digit that was matched by the corresponding . in the pattern - tone:Secondary dial-tone to play when a , is matched, up to 3 can be specified (optional) - - + + + + Help_id1 + Specifies a pattern to match dialed digits against. Note: TEMPLATE must be in uppercase. + Rules: + + + match: + Pattern to match, consists of one or more elements + + + 0 1 2 3 4 5 6 7 8 9 + Match digit + + + . + Match one digit, # or * + + + * + Match zero or more digits, # or * + + + \* + Match a literal * + + + , + Play secondary dial-tone specified by tone + + + timeout: + Number of seconds to wait for more digits if this pattern matches + + + line: + Only apply template to the specified line (optional) + + + rewrite: + Rewrite the matched digits before dialing, consists of one or more elements (optional) + + + 0 1 2 3 4 5 6 7 8 9 + Replace with digit + + + %0 + The entire match + + + %1 %2 %3 %4 %5 + Replace with group of digits matched, grouping is done by consecutive literal digit or . elements + + + %% + A literal % + + + . + Each . is replaced by the digit that was matched by the corresponding . in the pattern + + + tone: + Secondary dial-tone to play when a , is matched, up to 3 can be specified (optional) + + + - - dialtemplate - */10/* - title - - - text1 - - - - empty - Bellcore-Alerting - Bellcore-Inside - Bellcore-Outside - Bellcore-Busy - Bellcore-BusyVerify - Bellcore-Reorder - Bellcore-CallWaiting - Bellcore-Hold - Bellcore-Reminder - Bellcore-Confirmation - Bellcore-Stutter - Bellcore-Permanent - Bellcore-None - Cisco-Zip - Cisco-ZipZip - Cisco-BeepBonk - Bellcore-dr1 - Bellcore-dr2 - Bellcore-dr3 - Bellcore-dr4 - Bellcore-dr5 - Bellcore-dr6 - CallWaiting-2 - CallWaiting-3 - CallWaiting-4 - - Alow network settings. Blank fields will be ignored used Network 0.0.0.0. - + + dialtemplate + */10/* + + title + + + + + + + + text1 + + + + + + empty + Bellcore-Alerting + Bellcore-Inside + Bellcore-Outside + Bellcore-Busy + Bellcore-BusyVerify + Bellcore-Reorder + Bellcore-CallWaiting + Bellcore-Hold + Bellcore-Reminder + Bellcore-Confirmation + Bellcore-Stutter + Bellcore-Permanent + Bellcore-None + Cisco-Zip + Cisco-ZipZip + Cisco-BeepBonk + Bellcore-dr1 + Bellcore-dr2 + Bellcore-dr3 + Bellcore-dr4 + Bellcore-dr5 + Bellcore-dr6 + CallWaiting-2 + CallWaiting-3 + CallWaiting-4 + + Alow network settings. Blank fields will be ignored used Network 0.0.0.0. + diff --git a/install.php b/install.php index 13674eb..d546d3b 100644 --- a/install.php +++ b/install.php @@ -93,11 +93,11 @@ function Get_DB_config($sccp_compatible) { 'backgroundImage' => array('create' => 'VARCHAR(255) NULL DEFAULT NULL', 'modify' => "VARCHAR(255)"), 'ringtone' => array('create' => 'VARCHAR(255) NULL DEFAULT NULL', 'modify' => "VARCHAR(255)"), 'transfer' => array('create' => 'VARCHAR(5) DEFAULT "on"', 'modify' => "VARCHAR(5)", 'def_modify' => "on"), - 'cfwdall' => array('create' => 'VARCHAR(5) DEFAULT "on"', 'modify' => "VARCHAR(5)", 'def_modify' => "on"), - 'cfwdbusy' => array('create' => 'VARCHAR(5) DEFAULT "on"', 'modify' => "VARCHAR(5)", 'def_modify' => "on"), - 'directrtp' => array('create' => 'VARCHAR(3) DEFAULT "off"', 'modify' => "VARCHAR(3)", 'def_modify' => "off"), - 'dndFeature' => array('create' => 'VARCHAR(5) DEFAULT "on"', 'modify' => "VARCHAR(5)", 'def_modify' => "on"), - 'earlyrtp' => array('create' => 'VARCHAR(10) DEFAULT "progress"', 'modify' => "VARCHAR(10)", 'def_modify' => "progress"), + 'cfwdall' => array('create' => 'VARCHAR(5) NULL DEFAULT "on"', 'modify' => "VARCHAR(5)", 'def_modify' => "on"), + 'cfwdbusy' => array('create' => 'VARCHAR(5) NULL DEFAULT "on"', 'modify' => "VARCHAR(5)", 'def_modify' => "on"), + 'directrtp' => array('create' => 'VARCHAR(3) NULL DEFAULT "off"', 'modify' => "VARCHAR(3)", 'def_modify' => "off"), + 'dndFeature' => array('create' => 'VARCHAR(5) NULL DEFAULT "on"', 'modify' => "VARCHAR(5)", 'def_modify' => "on"), + 'earlyrtp' => array('create' => 'VARCHAR(10) NULL DEFAULT "progress"', 'modify' => "VARCHAR(10)", 'def_modify' => "progress"), 'audio_tos' => array('def_modify' => "0xB8"), 'audio_cos' => array('def_modify' => "6"), 'video_tos' => array('def_modify' => "0x88"), @@ -156,8 +156,8 @@ function Get_DB_config($sccp_compatible) { 'backgroundImage' => array('create' => 'VARCHAR(255) NULL DEFAULT NULL', 'modify' => "VARCHAR(255)"), 'ringtone' => array('create' => 'VARCHAR(255) NULL DEFAULT NULL', 'modify' => "VARCHAR(255)"), 'transfer' => array('create' => "enum('on','off') NOT NULL default 'on'", 'modify' => "enum('on','off')"), - 'cfwdall' => array('create' => "enum('on','off') NOT NULL default 'on'", 'modify' => "enum('on','off')"), - 'cfwdbusy' => array('create' => "enum('on','off') NOT NULL default 'on'", 'modify' => "enum('on','off')"), + 'cfwdall' => array('create' => "enum('on','off') NULL default 'on'", 'modify' => "enum('on','off')"), + 'cfwdbusy' => array('create' => "enum('on','off') NULL default 'on'", 'modify' => "enum('on','off')"), 'directrtp' => array('create' => "enum('on','off') NULL default NULL", 'modify' => "enum('on','off')"), 'dndFeature' => array('create' => "enum('on','off') NULL default NULL", 'modify' => "enum('on','off')"), 'earlyrtp' => array('create' => "ENUM('immediate','offHook','dialing','ringout','progress','none') NULL default NULL", 'modify' => "ENUM('immediate','offHook','dialing','ringout','progress','none')"), diff --git a/views/formShow.php b/views/formShow.php index 179185d..e0c7841 100644 --- a/views/formShow.php +++ b/views/formShow.php @@ -186,7 +186,45 @@ foreach ($items as $child) { -
+ +
+ cbutton)) { + echo '
'; + foreach ($child->xpath('cbutton') as $value) { + $res_n = $res_id.'[0]['.$value['field'].']'; + $res_vf = ''; + if ($value['value']=='NONE' && empty($res_value)){ + $res_vf = 'active'; + } + $ch_key = array_search($value['value'],$res_value); + if ($ch_key !== false) { + unset($res_value[$ch_key]); + $res_vf = 'active'; + $res_value = explode(';', implode(';', $res_value)); + } + $opt_hide =''; + $opt_class="button-checkbox"; + if (!empty($value->option_hide)) { + $opt_class .= " sccp_button_hide"; + $opt_hide = ' data-vhide="'.$value->option_hide.'" data-btn="checkbox" data-clhide="'.$value->option_hide['class'].'" '; + } + if (!empty($value->option_disabled)) { + $opt_class .= " sccp_button_disabled"; + $opt_hide = ' data-vhide="'.$value->option_disabled.'" data-btn="checkbox" data-clhide="'.$value->option_disabled['class'].'" '; + } + + if (!empty($value->class)) { + $opt_class .= " ".(string)$value->class; + } + + echo ''; + echo ''; + } + echo '
'; + } + ?> +
@@ -220,12 +258,12 @@ foreach ($items as $child) { ?>
-
+
button).'" />'; + echo ''; ?>
@@ -276,7 +314,13 @@ foreach ($items as $child) { $opt_hide = ' class="sccp_button_hide" data-vhide="'.$child->option_hide.'" data-clhide="'.$child->option_hide['class'].'" '; } foreach ($child->xpath('button') as $value) { - echo ''; + $val_check = (string)$value[@value]; + if ($val_check == '' || $val_check == 'NONE' || $val_check == 'none' ) { + $val_check = (((string)$value[@value] == $res_v) ? " checked" : ""); + } else { + $val_check = (strtolower((string)$value[@value]) == strtolower($res_v) ? " checked" : ""); + } + echo ''; echo ''; $i++; } diff --git a/views/server.device.php b/views/server.device.php index a697fc7..6e7b52c 100644 --- a/views/server.device.php +++ b/views/server.device.php @@ -23,6 +23,8 @@ if (strlen($data) >0 ){ ShowGroup('sccp_dev_config',1); + echo $this->ShowGroup('sccp_dev_advconfig',1); + echo $this->ShowGroup('sccp_dev_softkey',1); echo $this->ShowGroup('sccp_dev_url',1); echo $this->ShowGroup('sccp_hotline_config',1); ?>