Changeset 11366

Show
Ignore:
Timestamp:
02/13/11 16:32:26 (2 years ago)
Author:
p_lindheimer
Message:

closes #4812 adds some common device defaults for fields that are likely to be changed

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.9/libfreepbx.install.php

    r11293 r11366  
    16581658  $freepbx_conf->define_conf_setting('BRAND_CSS_CUSTOM',$set); 
    16591659 
     1660  // 
     1661  // CATEGORY: Device Setting Defaults 
     1662  // 
     1663  $set['category'] = 'New Device Defaults'; 
     1664  $set['level'] = 0; 
     1665 
     1666// ALWAYS_SHOW_DEVICE_DETAILS 
     1667  $set['value'] = false; 
     1668  $set['options'] = ''; 
     1669  $set['name'] = 'Show all Device Setting on Add'; 
     1670  $set['description'] = 'When adding a new extension/device, setting this to true will show most available device settings that are displayed when you edit the same extension/device. Otherwise, just a few basic settings are displayed.'; 
     1671  $set['readonly'] = 0; 
     1672  $set['type'] = CONF_TYPE_BOOL; 
     1673  $set['emptyok'] = 0; 
     1674  $set['sortorder'] = 10; 
     1675  $freepbx_conf->define_conf_setting('ALWAYS_SHOW_DEVICE_DETAILS',$set); 
     1676 
     1677  // DEVICE_SIP_CANREINVITE 
     1678  $set['value'] = 'yes'; 
     1679  $set['options'] = array('no', 'yes', 'nonat', 'update'); 
     1680  $set['name'] = 'SIP canrenivite (directmedia)'; 
     1681  $set['description'] = 'Default setting for SIP canreinvite (same as directmedia). See Asterisk documentation for details.'; 
     1682  $set['readonly'] = 0; 
     1683  $set['type'] = CONF_TYPE_SELECT; 
     1684  $set['emptyok'] = 0; 
     1685  $set['sortorder'] = 20; 
     1686  $freepbx_conf->define_conf_setting('DEVICE_SIP_CANREINVITE',$set); 
     1687 
     1688  // DEVICE_SIP_TRUSTRPID 
     1689  $set['value'] = 'yes'; 
     1690  $set['options'] = array('no', 'yes'); 
     1691  $set['name'] = 'SIP trustrpid'; 
     1692  $set['description'] = 'Default setting for SIP trustrpid. See Asterisk documentation for details.'; 
     1693  $set['readonly'] = 0; 
     1694  $set['type'] = CONF_TYPE_SELECT; 
     1695  $set['emptyok'] = 0; 
     1696  $set['sortorder'] = 30; 
     1697  $freepbx_conf->define_conf_setting('DEVICE_SIP_TRUSTRPID',$set); 
     1698 
     1699  // DEVICE_SIP_SENDRPID 
     1700  $set['value'] = 'no'; 
     1701  $set['options'] = array('no', 'yes', 'pai'); 
     1702  $set['name'] = 'SIP trustrpid'; 
     1703  $set['description'] = "Default setting for SIP sendrpid. A value of 'yes' is equivalent to 'rpid' and will send the 'Remote-Pary-ID' header. A value of 'pai' is only valid starting with Asterisk 1.8 and will send the 'P-Asserted-Identity' header. See Asterisk documentation for details."; 
     1704  $set['readonly'] = 0; 
     1705  $set['type'] = CONF_TYPE_SELECT; 
     1706  $set['emptyok'] = 0; 
     1707  $set['sortorder'] = 40; 
     1708  $freepbx_conf->define_conf_setting('DEVICE_SIP_SENDRPID',$set); 
     1709 
     1710  // DEVICE_SIP_NAT 
     1711  $set['value'] = 'yes'; 
     1712  $set['options'] = array('no', 'yes', 'never', 'route'); 
     1713  $set['name'] = 'SIP nat'; 
     1714  $set['description'] = "Default setting for SIP nat. A 'yes' will attempt to handle nat, also works for local (uses the network ports and address instead of the reported ports), 'no' follows the protocol, 'never' tries to block it, no RFC3581, 'route' ignores the rport information. See Asterisk documentation for details."; 
     1715  $set['readonly'] = 0; 
     1716  $set['type'] = CONF_TYPE_SELECT; 
     1717  $set['emptyok'] = 0; 
     1718  $set['sortorder'] = 50; 
     1719  $freepbx_conf->define_conf_setting('DEVICE_SIP_NAT',$set); 
     1720 
     1721  // DEVICE_SIP_ENCRYPTION 
     1722  $set['value'] = 'no'; 
     1723  $set['options'] = array('no', 'yes'); 
     1724  $set['name'] = 'SIP encryption'; 
     1725  $set['description'] = "Default setting for SIP encryption. Whether to offer SRTP encrypted media (and only SRTP encrypted media) on outgoing calls to a peer. Calls will fail with HANGUPCAUSE=58 if the peer does not support SRTP. See Asterisk documentation for details."; 
     1726  $set['readonly'] = 0; 
     1727  $set['type'] = CONF_TYPE_SELECT; 
     1728  $set['emptyok'] = 0; 
     1729  $set['sortorder'] = 60; 
     1730  $freepbx_conf->define_conf_setting('DEVICE_SIP_ENCRYPTION',$set); 
     1731 
     1732  // DEVICE_SIP_QUALIFYFREQ 
     1733  $set['value'] = 60; 
     1734  $set['options'] = array(15, 86400); 
     1735  $set['name'] = 'SIP qualifyfreq'; 
     1736  $set['description'] = "Default setting for SIP qualifyfreq. Only valid for Asterisk 1.6 and above. Frequency that 'qualify' OPTIONS messages will be sent to the device. Can help to keep NAT holes open but not dependable for remote client firewalls. See Asterisk documentation for details."; 
     1737  $set['readonly'] = 0; 
     1738  $set['type'] = CONF_TYPE_INT; 
     1739  $set['emptyok'] = 0; 
     1740  $set['sortorder'] = 70; 
     1741  $freepbx_conf->define_conf_setting('DEVICE_SIP_QUALIFYFREQ',$set); 
     1742 
     1743  // DEVICE_QUALIFY 
     1744  $set['value'] = 'yes'; 
     1745  $set['options'] = ''; 
     1746  $set['name'] = 'SIP and IAX qualify'; 
     1747  $set['description'] = "Default setting for SIP and IAX qualify. Whether to send periodic OPTIONS messages (for SIP) or otherwise monitor the channel, and at what point to consider the channel unavailable. A value of 'yes' is equivalent to 2000, time in msec. Can help to keep NAT holes open with SIP but not dependable for remote client firewalls. See Asterisk documentation for details."; 
     1748  $set['readonly'] = 0; 
     1749  $set['type'] = CONF_TYPE_TEXT; 
     1750  $set['emptyok'] = 0; 
     1751  $set['sortorder'] = 80; 
     1752  $freepbx_conf->define_conf_setting('DEVICE_QUALIFY',$set); 
     1753 
     1754  // DEVICE_DISALLOW 
     1755  $set['value'] = ''; 
     1756  $set['options'] = ''; 
     1757  $set['name'] = 'SIP and IAX disallow'; 
     1758  $set['description'] = "Default setting for SIP and IAX disallow (for codecs). Codecs to disallow, can help to reset from the general settings by setting a value of 'all' and then specifically including allowed codecs with the 'allow' directive. Values van be separated with '&' e.g. 'g729&g722'. See Asterisk documentation for details."; 
     1759  $set['readonly'] = 0; 
     1760  $set['type'] = CONF_TYPE_TEXT; 
     1761  $set['emptyok'] = 1; 
     1762  $set['sortorder'] = 90; 
     1763  $freepbx_conf->define_conf_setting('DEVICE_DISALLOW',$set); 
     1764 
     1765  // DEVICE_ALLOW 
     1766  $set['value'] = ''; 
     1767  $set['options'] = ''; 
     1768  $set['name'] = 'SIP and IAX allow'; 
     1769  $set['description'] = "Default setting for SIP and IAX allow (for codecs). Codecs to allow in addition to those set in general settings unless explicitly 'disallowed' for the device. Values van be separated with '&' e.g. 'ulaw&g729&g729' where the preference order is preserved. See Asterisk documentation for details."; 
     1770  $set['readonly'] = 0; 
     1771  $set['type'] = CONF_TYPE_TEXT; 
     1772  $set['emptyok'] = 1; 
     1773  $set['sortorder'] = 90; 
     1774  $freepbx_conf->define_conf_setting('DEVICE_ALLOW',$set); 
     1775 
     1776  // DEVICE_CALLGROUP 
     1777  $set['value'] = ''; 
     1778  $set['options'] = ''; 
     1779  $set['name'] = 'SIP & DAHDI callgroup'; 
     1780  $set['description'] = "Default setting for SIP, DAHDI (and Zap) callgroup. Callgroup(s) that the device is part of, can be one or more callgroups, e.g. '1,3-5' would be in groups 1,3,4,5. See Asterisk documentation for details."; 
     1781  $set['readonly'] = 0; 
     1782  $set['type'] = CONF_TYPE_TEXT; 
     1783  $set['emptyok'] = 1; 
     1784  $set['sortorder'] = 100; 
     1785  $freepbx_conf->define_conf_setting('DEVICE_CALLGROUP',$set); 
     1786 
     1787  // DEVICE_PICKUPGROUP 
     1788  $set['value'] = ''; 
     1789  $set['options'] = ''; 
     1790  $set['name'] = 'SIP & DAHDI pickupgroup'; 
     1791  $set['description'] = "Default setting for SIP, DAHDI (and Zap) pickupgroup. Pickupgroups(s) that the device can pickup calls from, can be one or more groups, e.g. '1,3-5' would be in groups 1,3,4,5. Device does not have to be in a group to be able to pickup calls from that group. See Asterisk documentation for details."; 
     1792  $set['readonly'] = 0; 
     1793  $set['type'] = CONF_TYPE_TEXT; 
     1794  $set['emptyok'] = 1; 
     1795  $set['sortorder'] = 110; 
     1796  $freepbx_conf->define_conf_setting('DEVICE_PICKUPGROUP',$set); 
    16601797 
    16611798  // The following settings are used in various modules prior to 2.9. If they are found in amportal.conf then we 
  • modules/branches/2.9/core/functions.inc.php

    r11353 r11366  
    40804080function core_devices_addsip($account) { 
    40814081  global $db; 
     4082  global $amp_conf; 
    40824083 
    40834084  $flag = 2; 
     
    41014102    $sipfields[] = array($account,'accountcode',$db->escapeSimple((isset($_REQUEST['accountcode']))?$_REQUEST['accountcode']:''),$flag++); 
    41024103    $sipfields[] =array($account,'secret',$db->escapeSimple((isset($_REQUEST['secret']))?$_REQUEST['secret']:''),$flag++); 
    4103     $sipfields[] = array($account,'canreinvite',$db->escapeSimple((isset($_REQUEST['canreinvite']))?$_REQUEST['canreinvite']:'no'),$flag++); 
    4104     $sipfields[] = array($account,'trustrpid',$db->escapeSimple((isset($_REQUEST['trustrpid']))?$_REQUEST['trustrpid']:'no'),$flag++); 
    4105     $sipfields[] = array($account,'sendrpid',$db->escapeSimple((isset($_REQUEST['sendrpid']))?$_REQUEST['sendrpid']:'no'),$flag++); 
     4104    $sipfields[] = array($account,'canreinvite',$db->escapeSimple((isset($_REQUEST['canreinvite']))?$_REQUEST['canreinvite']:$amp_conf['DEVICE_SIP_CANREINVITE']),$flag++); 
     4105    $sipfields[] = array($account,'trustrpid',$db->escapeSimple((isset($_REQUEST['trustrpid']))?$_REQUEST['trustrpid']:$amp_conf['DEVICE_SIP_TRUSTRPID']),$flag++); 
     4106    $sipfields[] = array($account,'sendrpid',$db->escapeSimple((isset($_REQUEST['sendrpid']))?$_REQUEST['sendrpid']:$amp_conf['DEVICE_SIP_SENDRPID']),$flag++); 
    41064107    $sipfields[] = array($account,'context',$db->escapeSimple((isset($_REQUEST['context']))?$_REQUEST['context']:'from-internal'),$flag++); 
    41074108    $sipfields[] = array($account,'dtmfmode',$db->escapeSimple((isset($_REQUEST['dtmfmode']))?$_REQUEST['dtmfmode']:''),$flag++); 
     
    41104111    $sipfields[] = array($account,'mailbox',$db->escapeSimple((isset($_REQUEST['mailbox']) && !empty($_REQUEST['mailbox']))?$_REQUEST['mailbox']:$account.'@device'),$flag++); 
    41114112    $sipfields[] = array($account,'username',$db->escapeSimple((isset($_REQUEST['username']))?$_REQUEST['username']:$account),$flag++); 
    4112     $sipfields[] = array($account,'nat',$db->escapeSimple((isset($_REQUEST['nat']))?$_REQUEST['nat']:'yes'),$flag++); 
     4113    $sipfields[] = array($account,'nat',$db->escapeSimple((isset($_REQUEST['nat']))?$_REQUEST['nat']:),$flag++); 
    41134114    $sipfields[] = array($account,'port',$db->escapeSimple((isset($_REQUEST['port']))?$_REQUEST['port']:'5060'),$flag++); 
    4114     $sipfields[] = array($account,'qualify',$db->escapeSimple((isset($_REQUEST['qualify']))?$_REQUEST['qualify']:'yes'),$flag++); 
     4115    $sipfields[] = array($account,'qualify',$db->escapeSimple((isset($_REQUEST['qualify']))?$_REQUEST['qualify']:$amp_conf['DEVICE_QUALIFY']),$flag++); 
    41154116    if (version_compare($amp_conf['ASTVERSION'],'1.6','ge')) { 
    4116       $sipfields[] = array($account,'qualifyfreq',$db->escapeSimple((isset($_REQUEST['qualifyfreq']))?$_REQUEST['qualifyfreq']:'60'),$flag++); 
     4117      $sipfields[] = array($account,'qualifyfreq',$db->escapeSimple((isset($_REQUEST['qualifyfreq']))?$_REQUEST['qualifyfreq']:$amp_conf['DEVICE_SIP_QUALIFYFREQ']),$flag++); 
    41174118    } 
    41184119    if (version_compare($amp_conf['ASTVERSION'],'1.8','ge')) { 
    41194120      $sipfields[] = array($account,'transport',$db->escapeSimple((isset($_REQUEST['transport']))?$_REQUEST['transport']:'udp'),$flag++); 
    4120       $sipfields[] = array($account,'encryption',$db->escapeSimple((isset($_REQUEST['encryption']))?$_REQUEST['encryption']:'no'),$flag++); 
     4121      $sipfields[] = array($account,'encryption',$db->escapeSimple((isset($_REQUEST['encryption']))?$_REQUEST['encryption']:$amp_conf['DEVICE_SIP_ENCRYPTION']),$flag++); 
    41214122    } 
    4122     $sipfields[] = array($account,'callgroup',$db->escapeSimple((isset($_REQUEST['callgroup']))?$_REQUEST['callgroup']:''),$flag++); 
    4123     $sipfields[] = array($account,'pickupgroup',$db->escapeSimple((isset($_REQUEST['pickupgroup']))?$_REQUEST['pickupgroup']:''),$flag++); 
     4123    $sipfields[] = array($account,'callgroup',$db->escapeSimple((isset($_REQUEST['callgroup']))?$_REQUEST['callgroup']:$amp_conf['DEVICE_CALLGROUP']),$flag++); 
     4124    $sipfields[] = array($account,'pickupgroup',$db->escapeSimple((isset($_REQUEST['pickupgroup']))?$_REQUEST['pickupgroup']:$amp_conf['DEVICE_PICKUPGROUP']),$flag++); 
    41244125    $sipfields[] = array($account,'deny',$db->escapeSimple((isset($_REQUEST['deny']))?$_REQUEST['deny']:''),$flag++); 
    41254126    $sipfields[] = array($account,'permit',$db->escapeSimple((isset($_REQUEST['permit']))?$_REQUEST['permit']:''),$flag++); 
    4126     $sipfields[] = array($account,'disallow',$db->escapeSimple((isset($_REQUEST['disallow']))?$_REQUEST['disallow']:''),$flag++); 
    4127     $sipfields[] = array($account,'allow',$db->escapeSimple((isset($_REQUEST['allow']))?$_REQUEST['allow']:''),$flag++); 
     4127    $sipfields[] = array($account,'disallow',$db->escapeSimple((isset($_REQUEST['disallow']))?$_REQUEST['disallow']:$amp_conf['DEVICE_DISALLOW']),$flag++); 
     4128    $sipfields[] = array($account,'allow',$db->escapeSimple((isset($_REQUEST['allow']))?$_REQUEST['allow']:$amp_conf['DEVICE_ALLOW']),$flag++); 
    41284129 
    41294130    $vmexten = isset($_REQUEST['vmexten'])?$db->escapeSimple(trim($_REQUEST['vmexten'])):''; 
     
    41734174function core_devices_addiax2($account) { 
    41744175  global $db; 
     4176  global $amp_conf; 
    41754177 
    41764178  $flag = 2; 
     
    41984200      array($account,'username',$db->escapeSimple(($_REQUEST['username'])?$_REQUEST['username']:$account),$flag++), 
    41994201      array($account,'port',$db->escapeSimple(($_REQUEST['port'])?$_REQUEST['port']:'4569'),$flag++), 
    4200       array($account,'qualify',$db->escapeSimple(($_REQUEST['qualify'])?$_REQUEST['qualify']:'yes'),$flag++), 
     4202      array($account,'qualify',$db->escapeSimple(($_REQUEST['qualify'])?$_REQUEST['qualify']:$amp_conf['DEVICE_QUALIFY']),$flag++), 
    42014203      array($account,'deny',$db->escapeSimple((isset($_REQUEST['deny']))?$_REQUEST['deny']:''),$flag++), 
    42024204      array($account,'permit',$db->escapeSimple((isset($_REQUEST['permit']))?$_REQUEST['permit']:''),$flag++),       
    4203       array($account,'disallow',$db->escapeSimple(($_REQUEST['disallow'])?$_REQUEST['disallow']:''),$flag++), 
    4204       array($account,'allow',$db->escapeSimple(($_REQUEST['allow'])?$_REQUEST['allow']:''),$flag++), 
     4205      array($account,'disallow',$db->escapeSimple(($_REQUEST['disallow'])?$_REQUEST['disallow']:$amp_conf['DEVICE_DISALLOW']),$flag++), 
     4206      array($account,'allow',$db->escapeSimple(($_REQUEST['allow'])?$_REQUEST['allow']:$amp_conf['DEVICE_ALLOW']),$flag++), 
    42054207      array($account,'accountcode',$db->escapeSimple(($_REQUEST['accountcode'])?$_REQUEST['accountcode']:''),$flag++), 
    42064208      array($account,'requirecalltoken',$db->escapeSimple(($_REQUEST['requirecalltoken'])?$_REQUEST['requirecalltoken']:''),$flag++) 
     
    42524254function core_devices_addzap($account) { 
    42534255  global $db; 
     4256  global $amp_conf; 
    42544257     
    42554258  foreach ($_REQUEST as $req=>$data) { 
     
    42814284      array($account,'callprogress',$db->escapeSimple(($_REQUEST['callprogress'])?$_REQUEST['callprogress']:'no')), 
    42824285      array($account,'accountcode',$db->escapeSimple((isset($_REQUEST['accountcode']))?$_REQUEST['accountcode']:'')), 
    4283       array($account,'callgroup',$db->escapeSimple((isset($_REQUEST['callgroup']))?$_REQUEST['callgroup']:'')), 
    4284       array($account,'pickupgroup',$db->escapeSimple((isset($_REQUEST['pickupgroup']))?$_REQUEST['pickupgroup']:'')), 
     4286      array($account,'callgroup',$db->escapeSimple((isset($_REQUEST['callgroup']))?$_REQUEST['callgroup']:$amp_conf['DEVICE_CALLGROUP'])), 
     4287      array($account,'pickupgroup',$db->escapeSimple((isset($_REQUEST['pickupgroup']))?$_REQUEST['pickupgroup']:$amp_conf['DEVICE_PICKUPGROUP'])), 
    42854288      array($account,'channel',$db->escapeSimple(($_REQUEST['channel'])?$_REQUEST['channel']:'')) 
    42864289    ); 
     
    43044307function core_devices_adddahdi($account) { 
    43054308  global $db; 
     4309  global $amp_conf; 
    43064310     
    43074311  foreach ($_REQUEST as $req=>$data) { 
     
    43334337      array($account,'callprogress',$db->escapeSimple(($_REQUEST['callprogress'])?$_REQUEST['callprogress']:'no')), 
    43344338      array($account,'accountcode',$db->escapeSimple((isset($_REQUEST['accountcode']))?$_REQUEST['accountcode']:'')), 
    4335       array($account,'callgroup',$db->escapeSimple((isset($_REQUEST['callgroup']))?$_REQUEST['callgroup']:'')), 
    4336       array($account,'pickupgroup',$db->escapeSimple((isset($_REQUEST['pickupgroup']))?$_REQUEST['pickupgroup']:'')), 
     4339      array($account,'callgroup',$db->escapeSimple((isset($_REQUEST['callgroup']))?$_REQUEST['callgroup']:$amp_conf['DEVICE_CALLGROUP'])), 
     4340      array($account,'pickupgroup',$db->escapeSimple((isset($_REQUEST['pickupgroup']))?$_REQUEST['pickupgroup']:$amp_conf['DEVICE_PICKUPGROUP'])), 
    43374341      array($account,'channel',$db->escapeSimple(($_REQUEST['channel'])?$_REQUEST['channel']:'')) 
    43384342    ); 
     
    64356439    $tmparr['accountcode'] = array('value' => '', 'tt' => $tt, 'level' => 1); 
    64366440    $tt = _("Callgroup(s) that this device is part of, can be one or more callgroups, e.g. '1,3-5' would be in groups 1,3,4,5."); 
    6437     $tmparr['callgroup'] = array('value' => '', 'tt' => $tt, 'level' => 1); 
     6441    $tmparr['callgroup'] = array('value' => $amp_conf['DEVICE_CALLGROUP'], 'tt' => $tt, 'level' => 1); 
    64386442    $tt = _("Pickupgroups(s) that this device can pickup calls from, can be one or more groups, e.g. '1,3-5' would be in groups 1,3,4,5. Device does not have to be in a group to be able to pickup calls from that group."); 
    6439     $tmparr['pickupgroup'] = array('value' => '', 'tt' => $tt, 'level' => 1); 
     6443    $tmparr['pickupgroup'] = array('value' => $amp_conf['DEVICE_PICKUPGROUP'], 'tt' => $tt, 'level' => 1); 
    64406444    $tt = _("Mailbox for this device. This should not be changed unless you know what you are doing."); 
    64416445    $tmparr['mailbox'] = array('value' => '', 'tt' => $tt, 'level' => 2); 
     
    64916495    $tmparr['accountcode'] = array('value' => '', 'tt' => $tt, 'level' => 1); 
    64926496    $tt = _("Callgroup(s) that this device is part of, can be one or more callgroups, e.g. '1,3-5' would be in groups 1,3,4,5."); 
    6493     $tmparr['callgroup'] = array('value' => '', 'tt' => $tt, 'level' => 1); 
     6497    $tmparr['callgroup'] = array('value' => $amp_conf['DEVICE_CALLGROUP'], 'tt' => $tt, 'level' => 1); 
    64946498    $tt = _("Pickupgroups(s) that this device can pickup calls from, can be one or more groups, e.g. '1,3-5' would be in groups 1,3,4,5. Device does not have to be in a group to be able to pickup calls from that group."); 
    6495     $tmparr['pickupgroup'] = array('value' => '', 'tt' => $tt, 'level' => 1); 
     6499    $tmparr['pickupgroup'] = array('value' => $amp_conf['DEVICE_PICKUPGROUP'], 'tt' => $tt, 'level' => 1); 
    64966500    $tt = _("Mailbox for this device. This should not be changed unless you know what you are doing."); 
    64976501    $tmparr['mailbox'] = array('value' => '', 'tt' => $tt, 'level' => 2); 
     
    65286532    $tmparr['port'] = array('value' => '4569', 'tt' => $tt, 'level' => 1); 
    65296533    $tt = _("Setting to yes (equivalent to 2000 msec) will send an OPTIONS packet to the endpoint periodically (default every minute). Used to monitor the health of the endpoint. If delays are longer then the qualify time, the endpoint will be taken offline and conisdered unreachable. Can be set to a value which is the msec threshhold. Setting to no will turn this off. Can also be helpful to keep NAT pinholes open."); 
    6530     $tmparr['qualify'] = array('value' => 'yes', 'tt' => $tt, 'level' => 1); 
     6534    $tmparr['qualify'] = array('value' => $amp_conf['DEVICE_QUALIFY'], 'tt' => $tt, 'level' => 1); 
    65316535    $tt = _("Disallowed codecs. Set this to all to remove all codecs defined in the general settings and then specify specific codecs separated by '&' on the 'allow' setting, or just disallow specific codecs separated by '&'."); 
    6532     $tmparr['disallow'] = array('value' => '', 'tt' => $tt, 'level' => 1); 
     6536    $tmparr['disallow'] = array('value' => $amp_conf['DEVICE_DISALLOW'], 'tt' => $tt, 'level' => 1); 
    65336537    $tt = _("Allow specific codecs, separated by the '&' sign and in priority order. E.g. 'ulaw&g729'. Codecs allowed in the general settings will also be allowed unless removed with the 'disallow' directive."); 
    6534     $tmparr['allow'] = array('value' => '', 'tt' => $tt, 'level' => 1); 
     6538    $tmparr['allow'] = array('value' => $amp_conf['DEVICE_ALLOW'], 'tt' => $tt, 'level' => 1); 
    65356539    $tt = _("How to dial this device, this should not be changed unless you know what you are doing."); 
    65366540    $tmparr['dial'] = array('value' => '', 'tt' => $tt, 'level' => 2); 
     
    65686572    $tt = _("The DTMF signalling mode used by this device, usually rfc2833 for most phones."); 
    65696573    $tmparr['dtmfmode'] = array('value' => 'rfc2833', 'tt' => $tt, 'select' => $select, 'level' => 0, 'jsvalidation' => 'isEmpty()', 'failvalidationmsg' => $msgInvalidDTMFMODE ); 
     6574  // $amp_conf['DEVICE_SIP_CANREINVITE'] 
     6575  // $amp_conf['DEVICE_SIP_TRUSTRPID'] 
     6576  // $amp_conf['DEVICE_SIP_SENDRPID'] 
     6577  // $amp_conf['DEVICE_SIP_NAT'] 
     6578  // $amp_conf['DEVICE_SIP_ENCRYPTION'] 
     6579  // $amp_conf['DEVICE_SIP_QUALIFYFREQ'] 
     6580  // $amp_conf['DEVICE_QUALIFY'] 
     6581  // $amp_conf['DEVICE_DISALLOW'] 
     6582  // $amp_conf['DEVICE_ALLOW'] 
     6583  // $amp_conf['DEVICE_CALLGROUP'] 
     6584  // $amp_conf['DEVICE_PICKUPGROUP'] 
    65706585 
    65716586    unset($select); 
     
    65756590    $select[] = array('value' => 'nonat', 'text' => 'nonat'); 
    65766591    $select[] = array('value' => 'update', 'text' => 'update'); 
    6577     $tmparr['canreinvite'] = array('value' => 'no', 'tt' => $tt, 'select' => $select, 'level' => 1); 
     6592    $tmparr['canreinvite'] = array('value' => $amp_conf['DEVICE_SIP_CANREINVITE'], 'tt' => $tt, 'select' => $select, 'level' => 1); 
    65786593 
    65796594    $tt = _("Asterisk context this device will send calls to. Only change this is you know what you are doing."); 
     
    65876602    $select[] = array('value' => 'yes', 'text' => _('Yes')); 
    65886603    $tt = _("Whether Asterisk should trust the RPID settings from this device. Usually should be yes for CONNECTEDLINE() functionality to work if supported by the endpoint."); 
    6589     $tmparr['trustrpid'] = array('value' => 'no', 'tt' => $tt, 'select' => $select, 'level' => 1); 
     6604    $tmparr['trustrpid'] = array('value' => $amp_conf['DEVICE_SIP_TRUSTRPID'], 'tt' => $tt, 'select' => $select, 'level' => 1); 
    65906605 
    65916606    unset($select); 
     
    65976612    } 
    65986613    $tt = _("Whether Asterisk should send RPID (or PAI) info to the device. Usually should be enabled to the settings used by your device for CONNECTEDLINE() functionality to work if supported by the endpoint."); 
    6599     $tmparr['sendrpid'] = array('value' => 'no', 'tt' => $tt, 'select' => $select, 'level' => 1); 
     6614    $tmparr['sendrpid'] = array('value' => $amp_conf['DEVICE_SIP_SENDRPID'], 'tt' => $tt, 'select' => $select, 'level' => 1); 
    66006615 
    66016616    unset($select); 
     
    66126627    $select[] = array('value' => 'route', 'text' => _('route - NAT no rport')); 
    66136628    $tt = _("NAT setting, see Asterisk documentation for details. Yes usually works for both internal and external devices. Set to No if the device will always be internal."); 
    6614     $tmparr['nat'] = array('value' => 'yes', 'tt' => $tt, 'select' => $select, 'level' => 1); 
     6629    $tmparr['nat'] = array('value' => $amp_conf['DEVICE_SIP_NAT'], 'tt' => $tt, 'select' => $select, 'level' => 1); 
    66156630 
    66166631    $tt = _("Endpoint port number to use, usually 5060. Some 2 ports devices such as ATA may used 5061 for the second port."); 
    66176632    $tmparr['port'] = array('value' => '5060', 'tt' => $tt, 'level' => 1); 
    66186633    $tt = _("Setting to yes (equivalent to 2000 msec) will send an OPTIONS packet to the endpoint periodically (default every minute). Used to monitor the health of the endpoint. If delays are longer then the qualify time, the endpoint will be taken offline and conisdered unreachable. Can be set to a value which is the msec threshhold. Setting to no will turn this off. Can also be helpful to keep NAT pinholes open."); 
    6619     $tmparr['qualify'] = array('value' => 'yes', 'tt' => $tt, 'level' => 1); 
     6634    $tmparr['qualify'] = array('value' => $amp_conf['DEVICE_QUALIFY'], 'tt' => $tt, 'level' => 1); 
    66206635    if (version_compare($amp_conf['ASTVERSION'],'1.6','ge')) { 
    66216636      $tt = _("Frequency in seconds to send qualify messages to the endpoint."); 
    6622       $tmparr['qualifyfreq'] = array('value' => '60', 'tt' => $tt, 'level' => 1); 
     6637      $tmparr['qualifyfreq'] = array('value' => $amp_conf['DEVICE_SIP_QUALIFYFREQ'], 'tt' => $tt, 'level' => 1); 
    66236638    } 
    66246639    if (version_compare($amp_conf['ASTVERSION'],'1.8','ge')) { 
     
    66336648      $select[] = array('value' => 'yes', 'text' => _('Yes')); 
    66346649      $tt = _("Whether to offer SRTP encrypted media (and only SRTP encrypted media) on outgoing calls to a peer. Calls will fail with HANGUPCAUSE=58 if the peer does not support SRTP. Defaults to no."); 
    6635       $tmparr['encryption'] = array('value' => 'no', 'tt' => $tt, 'select' => $select, 'level' => 1); 
     6650      $tmparr['encryption'] = array('value' => $amp_conf['DEVICE_SIP_ENCRYPTION'], 'tt' => $tt, 'select' => $select, 'level' => 1); 
    66366651    } 
    66376652 
    66386653    $tt = _("Callgroup(s) that this device is part of, can be one or more callgroups, e.g. '1,3-5' would be in groups 1,3,4,5."); 
    6639     $tmparr['callgroup'] = array('value' => '', 'tt' => $tt, 'level' => 1); 
     6654    $tmparr['callgroup'] = array('value' => $amp_conf['DEVICE_CALLGROUP'], 'tt' => $tt, 'level' => 1); 
    66406655    $tt = _("Pickupgroups(s) that this device can pickup calls from, can be one or more groups, e.g. '1,3-5' would be in groups 1,3,4,5. Device does not have to be in a group to be able to pickup calls from that group."); 
    6641     $tmparr['pickupgroup'] = array('value' => '', 'tt' => $tt, 'level' => 1); 
     6656    $tmparr['pickupgroup'] = array('value' => $amp_conf['DEVICE_PICKUPGROUP'], 'tt' => $tt, 'level' => 1); 
    66426657    $tt = _("Disallowed codecs. Set this to all to remove all codecs defined in the general settings and then specify specific codecs separated by '&' on the 'allow' setting, or just disallow specific codecs separated by '&'."); 
    6643     $tmparr['disallow'] = array('value' => '', 'tt' => $tt, 'level' => 1); 
     6658    $tmparr['disallow'] = array('value' => $amp_conf['DEVICE_DISALLOW'], 'tt' => $tt, 'level' => 1); 
    66446659    $tt = _("Allow specific codecs, separated by the '&' sign and in priority order. E.g. 'ulaw&g729'. Codecs allowed in the general settings will also be allowed unless removed with the 'disallow' directive."); 
    6645     $tmparr['allow'] = array('value' => '', 'tt' => $tt, 'level' => 1); 
     6660    $tmparr['allow'] = array('value' => $amp_conf['DEVICE_ALLOW'], 'tt' => $tt, 'level' => 1); 
    66466661    $tt = _("How to dial this device, this should not be changed unless you know what you are doing."); 
    66476662    $tmparr['dial'] = array('value' => '', 'tt' => $tt, 'level' => 2);