[Pkg-voip-commits] r5750 - in /freepbx-modules/trunk: ./ debian/ debian/patches/ modules/announcement/ modules/announcement/i18n/ modules/announcement/i18n/it_IT/ modules/announcement/i18n/it_IT/LC_MESSAGES/ modules/asterisk-cli/ modules/asteriskinfo/ modules/backup/ modules/backup/bin/ modules/backup/i18n/it_IT/ modules/backup/i18n/it_IT/LC_MESSAGES/ modules/blacklist/ modules/blacklist/i18n/it_IT/ modules/blacklist/i18n/it_IT/LC_MESSAGES/ modules/callback/ modules/callforward/ modules/callwaiting/ modules/cidlookup/ modules/cidlookup/i18n/it_IT/ modules/cidlookup/i18n/it_IT/LC_MESSAGES/ modules/conferences/ modules/conferences/i18n/it_IT/ modules/conferences/i18n/it_IT/LC_MESSAGES/ modules/core/ modules/core/agi-bin/ modules/core/etc/ modules/customappsreg/ modules/customerdb/ modules/customerdb/i18n/it_IT/ modules/customerdb/i18n/it_IT/LC_MESSAGES/ modules/dashboard/ modules/dashboard/i18n/ modules/dashboard/i18n/it_IT/ modules/dashboard/i18n/it_IT/LC_MESSAGES/ modules/daynight/ modules/daynight/i18n/it_IT/ modules/daynight/i18n/it_IT/LC_MESSAGES/ modules/dictate/ modules/disa/ modules/disa/i18n/it_IL/ modules/disa/i18n/it_IL/LC_MESSAGES/ modules/donotdisturb/ modules/featurecodeadmin/ modules/featurecodeadmin/i18n/it_IT/ modules/featurecodeadmin/i18n/it_IT/LC_MESSAGES/ modules/findmefollow/ modules/findmefollow/i18n/it_IL/ modules/findmefollow/i18n/it_IL/LC_MESSAGES/ modules/gabcast/ modules/infoservices/ modules/inventorydb/ modules/ivr/ modules/ivr/i18n/it_IT/ modules/ivr/i18n/it_IT/LC_MESSAGES/ modules/languages/ modules/logfiles/ modules/manager/ modules/manager/i18n/it_IT/ modules/manager/i18n/it_IT/LC_MESSAGES/ modules/miscapps/ modules/miscapps/i18n/ modules/miscapps/i18n/it_IT/ modules/miscapps/i18n/it_IT/LC_MESSAGES/ modules/miscdests/ modules/miscdests/i18n/it_IT/ modules/miscdests/i18n/it_IT/LC_MESSAGES/ modules/music/ modules/music/i18n/it_IT/ modules/music/i18n/it_IT/LC_MESSAGES/ modules/paging/ modules/paging/i18n/it_IT/ modules/paging/i18n/it_IT/LC_MESSAGES/ modules/parking/ modules/parking/i18n/it_IT/ modules/parking/i18n/it_IT/LC_MESSAGES/ modules/pbdirectory/ modules/phonebook/ modules/phpagiconf/ modules/phpinfo/ modules/pinsets/ modules/pinsets/i18n/it_IL/ modules/pinsets/i18n/it_IL/LC_MESSAGES/ modules/printextensions/ modules/printextensions/i18n/it_IT/ modules/printextensions/i18n/it_IT/LC_MESSAGES/ modules/queues/ modules/queues/i18n/it_IT/ modules/queues/i18n/it_IT/LC_MESSAGES/ modules/recordings/ modules/recordings/i18n/it_IT/ modules/recordings/i18n/it_IT/LC_MESSAGES/ modules/ringgroups/ modules/speeddial/ modules/timeconditions/ modules/timeconditions/i18n/it_IT/ modules/timeconditions/i18n/it_IT/LC_MESSAGES/ modules/vmblast/ modules/voicemail/

tzafrir-guest at alioth.debian.org tzafrir-guest at alioth.debian.org
Sun May 18 19:52:05 UTC 2008


Author: tzafrir-guest
Date: Sun May 18 19:52:05 2008
New Revision: 5750

URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=5750
Log:
FreePBX 2.4.0 - the modules.

Added:
    freepbx-modules/trunk/modules/announcement/i18n/
    freepbx-modules/trunk/modules/announcement/i18n/it_IT/
    freepbx-modules/trunk/modules/announcement/i18n/it_IT/LC_MESSAGES/
    freepbx-modules/trunk/modules/announcement/i18n/it_IT/LC_MESSAGES/announcement.mo   (with props)
    freepbx-modules/trunk/modules/announcement/i18n/it_IT/LC_MESSAGES/announcement.po
    freepbx-modules/trunk/modules/backup/i18n/it_IT/
    freepbx-modules/trunk/modules/backup/i18n/it_IT/LC_MESSAGES/
    freepbx-modules/trunk/modules/backup/i18n/it_IT/LC_MESSAGES/backup.mo   (with props)
    freepbx-modules/trunk/modules/backup/i18n/it_IT/LC_MESSAGES/backup.po
    freepbx-modules/trunk/modules/blacklist/i18n/it_IT/
    freepbx-modules/trunk/modules/blacklist/i18n/it_IT/LC_MESSAGES/
    freepbx-modules/trunk/modules/blacklist/i18n/it_IT/LC_MESSAGES/blacklist.mo   (with props)
    freepbx-modules/trunk/modules/blacklist/i18n/it_IT/LC_MESSAGES/blacklist.po
    freepbx-modules/trunk/modules/cidlookup/i18n/it_IT/
    freepbx-modules/trunk/modules/cidlookup/i18n/it_IT/LC_MESSAGES/
    freepbx-modules/trunk/modules/cidlookup/i18n/it_IT/LC_MESSAGES/cidlookup.mo   (with props)
    freepbx-modules/trunk/modules/cidlookup/i18n/it_IT/LC_MESSAGES/cidlookup.po
    freepbx-modules/trunk/modules/conferences/i18n/it_IT/
    freepbx-modules/trunk/modules/conferences/i18n/it_IT/LC_MESSAGES/
    freepbx-modules/trunk/modules/conferences/i18n/it_IT/LC_MESSAGES/conferences.mo   (with props)
    freepbx-modules/trunk/modules/conferences/i18n/it_IT/LC_MESSAGES/conferences.po
    freepbx-modules/trunk/modules/core/agi-bin/user_login_out.agi   (with props)
    freepbx-modules/trunk/modules/core/page.zapchandids.php
    freepbx-modules/trunk/modules/customappsreg/
    freepbx-modules/trunk/modules/customappsreg/functions.inc.php
    freepbx-modules/trunk/modules/customappsreg/install.php
    freepbx-modules/trunk/modules/customappsreg/module.xml
    freepbx-modules/trunk/modules/customappsreg/page.customdests.php
    freepbx-modules/trunk/modules/customappsreg/page.customextens.php
    freepbx-modules/trunk/modules/customappsreg/uninstall.php
    freepbx-modules/trunk/modules/customerdb/i18n/it_IT/
    freepbx-modules/trunk/modules/customerdb/i18n/it_IT/LC_MESSAGES/
    freepbx-modules/trunk/modules/customerdb/i18n/it_IT/LC_MESSAGES/customerdb.mo   (with props)
    freepbx-modules/trunk/modules/customerdb/i18n/it_IT/LC_MESSAGES/customerdb.po
    freepbx-modules/trunk/modules/dashboard/i18n/
    freepbx-modules/trunk/modules/dashboard/i18n/it_IT/
    freepbx-modules/trunk/modules/dashboard/i18n/it_IT/LC_MESSAGES/
    freepbx-modules/trunk/modules/dashboard/i18n/it_IT/LC_MESSAGES/dashboard.mo   (with props)
    freepbx-modules/trunk/modules/dashboard/i18n/it_IT/LC_MESSAGES/dashboard.po
    freepbx-modules/trunk/modules/daynight/i18n/it_IT/
    freepbx-modules/trunk/modules/daynight/i18n/it_IT/LC_MESSAGES/
    freepbx-modules/trunk/modules/daynight/i18n/it_IT/LC_MESSAGES/daynight.mo   (with props)
    freepbx-modules/trunk/modules/daynight/i18n/it_IT/LC_MESSAGES/daynight.po
    freepbx-modules/trunk/modules/disa/i18n/it_IL/
    freepbx-modules/trunk/modules/disa/i18n/it_IL/LC_MESSAGES/
    freepbx-modules/trunk/modules/disa/i18n/it_IL/LC_MESSAGES/disa.mo   (with props)
    freepbx-modules/trunk/modules/disa/i18n/it_IL/LC_MESSAGES/disa.po
    freepbx-modules/trunk/modules/featurecodeadmin/i18n/it_IT/
    freepbx-modules/trunk/modules/featurecodeadmin/i18n/it_IT/LC_MESSAGES/
    freepbx-modules/trunk/modules/featurecodeadmin/i18n/it_IT/LC_MESSAGES/featurecodeadmin.mo   (with props)
    freepbx-modules/trunk/modules/featurecodeadmin/i18n/it_IT/LC_MESSAGES/featurecodeadmin.po
    freepbx-modules/trunk/modules/findmefollow/i18n/it_IL/
    freepbx-modules/trunk/modules/findmefollow/i18n/it_IL/LC_MESSAGES/
    freepbx-modules/trunk/modules/findmefollow/i18n/it_IL/LC_MESSAGES/findmefollow.mo   (with props)
    freepbx-modules/trunk/modules/findmefollow/i18n/it_IL/LC_MESSAGES/findmefollow.po
    freepbx-modules/trunk/modules/ivr/i18n/it_IT/
    freepbx-modules/trunk/modules/ivr/i18n/it_IT/LC_MESSAGES/
    freepbx-modules/trunk/modules/ivr/i18n/it_IT/LC_MESSAGES/ivr.mo   (with props)
    freepbx-modules/trunk/modules/ivr/i18n/it_IT/LC_MESSAGES/ivr.po
    freepbx-modules/trunk/modules/languages/
    freepbx-modules/trunk/modules/languages/functions.inc.php
    freepbx-modules/trunk/modules/languages/install.php
    freepbx-modules/trunk/modules/languages/module.xml
    freepbx-modules/trunk/modules/languages/page.languages.php
    freepbx-modules/trunk/modules/languages/uninstall.php
    freepbx-modules/trunk/modules/manager/i18n/it_IT/
    freepbx-modules/trunk/modules/manager/i18n/it_IT/LC_MESSAGES/
    freepbx-modules/trunk/modules/manager/i18n/it_IT/LC_MESSAGES/manager.mo   (with props)
    freepbx-modules/trunk/modules/manager/i18n/it_IT/LC_MESSAGES/manager.po
    freepbx-modules/trunk/modules/miscapps/i18n/
    freepbx-modules/trunk/modules/miscapps/i18n/it_IT/
    freepbx-modules/trunk/modules/miscapps/i18n/it_IT/LC_MESSAGES/
    freepbx-modules/trunk/modules/miscapps/i18n/it_IT/LC_MESSAGES/miscapps.mo   (with props)
    freepbx-modules/trunk/modules/miscapps/i18n/it_IT/LC_MESSAGES/miscapps.po
    freepbx-modules/trunk/modules/miscdests/i18n/it_IT/
    freepbx-modules/trunk/modules/miscdests/i18n/it_IT/LC_MESSAGES/
    freepbx-modules/trunk/modules/miscdests/i18n/it_IT/LC_MESSAGES/miscdests.mo   (with props)
    freepbx-modules/trunk/modules/miscdests/i18n/it_IT/LC_MESSAGES/miscdests.po
    freepbx-modules/trunk/modules/music/i18n/it_IT/
    freepbx-modules/trunk/modules/music/i18n/it_IT/LC_MESSAGES/
    freepbx-modules/trunk/modules/music/i18n/it_IT/LC_MESSAGES/music.mo   (with props)
    freepbx-modules/trunk/modules/music/i18n/it_IT/LC_MESSAGES/music.po
    freepbx-modules/trunk/modules/paging/i18n/it_IT/
    freepbx-modules/trunk/modules/paging/i18n/it_IT/LC_MESSAGES/
    freepbx-modules/trunk/modules/paging/i18n/it_IT/LC_MESSAGES/paging.mo   (with props)
    freepbx-modules/trunk/modules/paging/i18n/it_IT/LC_MESSAGES/paging.po
    freepbx-modules/trunk/modules/parking/i18n/it_IT/
    freepbx-modules/trunk/modules/parking/i18n/it_IT/LC_MESSAGES/
    freepbx-modules/trunk/modules/parking/i18n/it_IT/LC_MESSAGES/parking.mo   (with props)
    freepbx-modules/trunk/modules/parking/i18n/it_IT/LC_MESSAGES/parking.po
    freepbx-modules/trunk/modules/pinsets/i18n/it_IL/
    freepbx-modules/trunk/modules/pinsets/i18n/it_IL/LC_MESSAGES/
    freepbx-modules/trunk/modules/pinsets/i18n/it_IL/LC_MESSAGES/pinsets.mo   (with props)
    freepbx-modules/trunk/modules/pinsets/i18n/it_IL/LC_MESSAGES/pinsets.po
    freepbx-modules/trunk/modules/printextensions/i18n/it_IT/
    freepbx-modules/trunk/modules/printextensions/i18n/it_IT/LC_MESSAGES/
    freepbx-modules/trunk/modules/printextensions/i18n/it_IT/LC_MESSAGES/printextensions.mo   (with props)
    freepbx-modules/trunk/modules/printextensions/i18n/it_IT/LC_MESSAGES/printextensions.po
    freepbx-modules/trunk/modules/queues/i18n/it_IT/
    freepbx-modules/trunk/modules/queues/i18n/it_IT/LC_MESSAGES/
    freepbx-modules/trunk/modules/queues/i18n/it_IT/LC_MESSAGES/queues.mo   (with props)
    freepbx-modules/trunk/modules/queues/i18n/it_IT/LC_MESSAGES/queues.po
    freepbx-modules/trunk/modules/queues/uninstall.php
    freepbx-modules/trunk/modules/recordings/i18n/it_IT/
    freepbx-modules/trunk/modules/recordings/i18n/it_IT/LC_MESSAGES/
    freepbx-modules/trunk/modules/recordings/i18n/it_IT/LC_MESSAGES/recordings.mo   (with props)
    freepbx-modules/trunk/modules/recordings/i18n/it_IT/LC_MESSAGES/recordings.po
    freepbx-modules/trunk/modules/timeconditions/i18n/it_IT/
    freepbx-modules/trunk/modules/timeconditions/i18n/it_IT/LC_MESSAGES/
    freepbx-modules/trunk/modules/timeconditions/i18n/it_IT/LC_MESSAGES/timeconditions.mo   (with props)
    freepbx-modules/trunk/modules/timeconditions/i18n/it_IT/LC_MESSAGES/timeconditions.po
    freepbx-modules/trunk/modules/vmblast/
    freepbx-modules/trunk/modules/vmblast/functions.inc.php
    freepbx-modules/trunk/modules/vmblast/install.php
    freepbx-modules/trunk/modules/vmblast/install.sql
    freepbx-modules/trunk/modules/vmblast/module.xml
    freepbx-modules/trunk/modules/vmblast/page.vmblast.php
    freepbx-modules/trunk/modules/vmblast/uninstall.sql
Modified:
    freepbx-modules/trunk/debian/changelog
    freepbx-modules/trunk/debian/patches/fix_chmod
    freepbx-modules/trunk/debian/patches/sqlite_autoincrement
    freepbx-modules/trunk/debian/patches/sqlite_no_change
    freepbx-modules/trunk/fpx-modules
    freepbx-modules/trunk/modules/announcement/functions.inc.php
    freepbx-modules/trunk/modules/announcement/module.xml
    freepbx-modules/trunk/modules/announcement/page.announcement.php
    freepbx-modules/trunk/modules/asterisk-cli/module.xml
    freepbx-modules/trunk/modules/asteriskinfo/module.xml
    freepbx-modules/trunk/modules/backup/bin/restoreastdb.php
    freepbx-modules/trunk/modules/backup/module.xml
    freepbx-modules/trunk/modules/backup/schedule_functions.php
    freepbx-modules/trunk/modules/blacklist/functions.inc.php
    freepbx-modules/trunk/modules/blacklist/module.xml
    freepbx-modules/trunk/modules/callback/functions.inc.php
    freepbx-modules/trunk/modules/callback/module.xml
    freepbx-modules/trunk/modules/callback/page.callback.php
    freepbx-modules/trunk/modules/callforward/module.xml
    freepbx-modules/trunk/modules/callwaiting/module.xml
    freepbx-modules/trunk/modules/cidlookup/functions.inc.php
    freepbx-modules/trunk/modules/cidlookup/install.php
    freepbx-modules/trunk/modules/cidlookup/module.xml
    freepbx-modules/trunk/modules/conferences/functions.inc.php
    freepbx-modules/trunk/modules/conferences/module.xml
    freepbx-modules/trunk/modules/conferences/page.conferences.php
    freepbx-modules/trunk/modules/core/agi-bin/dialparties.agi
    freepbx-modules/trunk/modules/core/agi-bin/fixlocalprefix
    freepbx-modules/trunk/modules/core/etc/extensions.conf
    freepbx-modules/trunk/modules/core/etc/iax.conf
    freepbx-modules/trunk/modules/core/etc/sip.conf
    freepbx-modules/trunk/modules/core/functions.inc.php
    freepbx-modules/trunk/modules/core/install.php
    freepbx-modules/trunk/modules/core/module.xml
    freepbx-modules/trunk/modules/core/page.ampusers.php
    freepbx-modules/trunk/modules/core/page.did.php
    freepbx-modules/trunk/modules/core/page.routing.php
    freepbx-modules/trunk/modules/core/page.trunks.php
    freepbx-modules/trunk/modules/customerdb/module.xml
    freepbx-modules/trunk/modules/dashboard/class.astinfo.php
    freepbx-modules/trunk/modules/dashboard/module.xml
    freepbx-modules/trunk/modules/dashboard/page.index.php
    freepbx-modules/trunk/modules/daynight/functions.inc.php
    freepbx-modules/trunk/modules/daynight/module.xml
    freepbx-modules/trunk/modules/daynight/page.daynight.php
    freepbx-modules/trunk/modules/dictate/functions.inc.php
    freepbx-modules/trunk/modules/dictate/module.xml
    freepbx-modules/trunk/modules/disa/functions.inc.php
    freepbx-modules/trunk/modules/disa/module.xml
    freepbx-modules/trunk/modules/disa/page.disa.php
    freepbx-modules/trunk/modules/donotdisturb/module.xml
    freepbx-modules/trunk/modules/featurecodeadmin/functions.inc.php
    freepbx-modules/trunk/modules/featurecodeadmin/module.xml
    freepbx-modules/trunk/modules/featurecodeadmin/page.featurecodeadmin.php
    freepbx-modules/trunk/modules/findmefollow/functions.inc.php
    freepbx-modules/trunk/modules/findmefollow/module.xml
    freepbx-modules/trunk/modules/findmefollow/page.findmefollow.php
    freepbx-modules/trunk/modules/gabcast/functions.inc.php
    freepbx-modules/trunk/modules/gabcast/module.xml
    freepbx-modules/trunk/modules/gabcast/page.gabcast.php
    freepbx-modules/trunk/modules/infoservices/module.xml
    freepbx-modules/trunk/modules/inventorydb/module.xml
    freepbx-modules/trunk/modules/ivr/functions.inc.php
    freepbx-modules/trunk/modules/ivr/module.xml
    freepbx-modules/trunk/modules/ivr/page.ivr.php
    freepbx-modules/trunk/modules/logfiles/module.xml
    freepbx-modules/trunk/modules/manager/module.xml
    freepbx-modules/trunk/modules/miscapps/functions.inc.php
    freepbx-modules/trunk/modules/miscapps/module.xml
    freepbx-modules/trunk/modules/miscapps/page.miscapps.php
    freepbx-modules/trunk/modules/miscdests/functions.inc.php
    freepbx-modules/trunk/modules/miscdests/module.xml
    freepbx-modules/trunk/modules/miscdests/page.miscdests.php
    freepbx-modules/trunk/modules/music/module.xml
    freepbx-modules/trunk/modules/music/page.music.php
    freepbx-modules/trunk/modules/paging/functions.inc.php
    freepbx-modules/trunk/modules/paging/install.php
    freepbx-modules/trunk/modules/paging/module.xml
    freepbx-modules/trunk/modules/paging/page.paging.php
    freepbx-modules/trunk/modules/paging/uninstall.php
    freepbx-modules/trunk/modules/parking/functions.inc.php
    freepbx-modules/trunk/modules/parking/module.xml
    freepbx-modules/trunk/modules/pbdirectory/functions.inc.php
    freepbx-modules/trunk/modules/pbdirectory/module.xml
    freepbx-modules/trunk/modules/phonebook/module.xml
    freepbx-modules/trunk/modules/phpagiconf/module.xml
    freepbx-modules/trunk/modules/phpinfo/module.xml
    freepbx-modules/trunk/modules/pinsets/functions.inc.php
    freepbx-modules/trunk/modules/pinsets/module.xml
    freepbx-modules/trunk/modules/printextensions/module.xml
    freepbx-modules/trunk/modules/queues/functions.inc.php
    freepbx-modules/trunk/modules/queues/install.php
    freepbx-modules/trunk/modules/queues/module.xml
    freepbx-modules/trunk/modules/queues/page.queues.php
    freepbx-modules/trunk/modules/recordings/functions.inc.php
    freepbx-modules/trunk/modules/recordings/module.xml
    freepbx-modules/trunk/modules/recordings/page.recordings.php
    freepbx-modules/trunk/modules/ringgroups/functions.inc.php
    freepbx-modules/trunk/modules/ringgroups/module.xml
    freepbx-modules/trunk/modules/ringgroups/page.ringgroups.php
    freepbx-modules/trunk/modules/speeddial/module.xml
    freepbx-modules/trunk/modules/timeconditions/functions.inc.php
    freepbx-modules/trunk/modules/timeconditions/module.xml
    freepbx-modules/trunk/modules/timeconditions/page.timeconditions.php
    freepbx-modules/trunk/modules/voicemail/functions.inc.php
    freepbx-modules/trunk/modules/voicemail/module.xml

Modified: freepbx-modules/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/debian/changelog?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/debian/changelog (original)
+++ freepbx-modules/trunk/debian/changelog Sun May 18 19:52:05 2008
@@ -1,3 +1,10 @@
+freepbx-modules (2.4.0) UNRELEASED; urgency=low
+
+  * New upstream release.
+  * Still open for changes. 
+
+ -- Tzafrir Cohen <tzafrir.cohen at xorcom.com>  Sun, 18 May 2008 22:50:25 +0300
+
 freepbx-modules (2.3.1) UNRELEASED; urgency=low
 
   [Diego Iastrubni]

Modified: freepbx-modules/trunk/debian/patches/fix_chmod
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/debian/patches/fix_chmod?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/debian/patches/fix_chmod (original)
+++ freepbx-modules/trunk/debian/patches/fix_chmod Sun May 18 19:52:05 2008
@@ -14,16 +14,6 @@
  					} else {
  						$nopass = true;
  					}
---- freepbx-modules-2.3.1.orig/modules/parking/functions.inc.php
-+++ freepbx-modules-2.3.1/modules/parking/functions.inc.php
-@@ -70,7 +70,6 @@ function parking_get_config($engine) {
- 		fwrite($fh, ";***              PARKING LOT HAS BEEN DISABLED              ***\n");
- 		}
- 		fclose($fh);
--		chmod($filename, 0660);
- 		break;
- 	}
- }
 --- freepbx-modules-2.3.1.orig/modules/parking/uninstall.php
 +++ freepbx-modules-2.3.1/modules/parking/uninstall.php
 @@ -25,7 +25,6 @@ function parking_remove_config() {

Modified: freepbx-modules/trunk/debian/patches/sqlite_autoincrement
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/debian/patches/sqlite_autoincrement?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/debian/patches/sqlite_autoincrement (original)
+++ freepbx-modules/trunk/debian/patches/sqlite_autoincrement Sun May 18 19:52:05 2008
@@ -1,7 +1,7 @@
 sqlite allows AUTO_INCREMENT. But only if it is called AUTOINCREMENT.
 And on a PRIMARY KEY (part of its definition).
---- freepbx-modules-2.3.1.orig/modules/backup/install.php
-+++ freepbx-modules-2.3.1/modules/backup/install.php
+--- freepbx-modules-2.4.0.orig/modules/backup/install.php
++++ freepbx-modules-2.4.0/modules/backup/install.php
 @@ -3,7 +3,14 @@
  global $db;
  global $amp_conf;
@@ -28,8 +28,8 @@
  );";
  
  $check = $db->query($sql);
---- freepbx-modules-2.3.1.orig/modules/ivr/install.php
-+++ freepbx-modules-2.3.1/modules/ivr/install.php
+--- freepbx-modules-2.4.0.orig/modules/ivr/install.php
++++ freepbx-modules-2.4.0/modules/ivr/install.php
 @@ -1,5 +1,15 @@
  <?php
 -sql('CREATE TABLE IF NOT EXISTS ivr ( ivr_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, displayname VARCHAR(50), deptname VARCHAR(50), enable_directory VARCHAR(8), enable_directdial VARCHAR(8), timeout INT, announcement VARCHAR(255), dircontext VARCHAR ( 50 ) DEFAULT "default" )');
@@ -58,8 +58,8 @@
      $result = $db->query($sql);
      if(DB::IsError($result)) {
              die_freepbx($result->getDebugInfo());
---- freepbx-modules-2.3.1.orig/modules/recordings/install.php
-+++ freepbx-modules-2.3.1/modules/recordings/install.php
+--- freepbx-modules-2.4.0.orig/modules/recordings/install.php
++++ freepbx-modules-2.4.0/modules/recordings/install.php
 @@ -21,8 +21,16 @@ $fcc->setDefault('*99');
  $fcc->update();
  unset($fcc);
@@ -97,8 +97,8 @@
  $result = $db->query($sql);
  if(DB::IsError($result)) {
  	die_freepbx($result->getDebugInfo());
---- freepbx-modules-2.3.1.orig/modules/disa/install.php
-+++ freepbx-modules-2.3.1/modules/disa/install.php
+--- freepbx-modules-2.4.0.orig/modules/disa/install.php
++++ freepbx-modules-2.4.0/modules/disa/install.php
 @@ -2,6 +2,27 @@
  
  global $db;
@@ -127,17 +127,17 @@
  // Manage upgrade from DISA 1.0
  // r2.0 Add Timeouts and add wait for confirmation
  $sql = "SELECT digittimeout FROM disa";
---- freepbx-modules-2.3.1.orig/modules/disa/install.sql
+--- freepbx-modules-2.4.0.orig/modules/disa/install.sql
 +++ /dev/null
 @@ -1 +0,0 @@
 -CREATE TABLE IF NOT EXISTS disa ( disa_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY , displayname VARCHAR( 50 ), pin VARCHAR ( 50 ), cid VARCHAR ( 50 ), context VARCHAR ( 50 ), digittimeout INT, resptimeout INT, needconf VARCHAR( 10 ) ); 
---- freepbx-modules-2.3.1.orig/modules/ivr/install.sql
+--- freepbx-modules-2.4.0.orig/modules/ivr/install.sql
 +++ /dev/null
 @@ -1,2 +0,0 @@
 -CREATE TABLE IF NOT EXISTS ivr ( ivr_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, displayname VARCHAR(50), deptname VARCHAR(50), enable_directory VARCHAR(8), enable_directdial VARCHAR(8), timeout INT, announcement VARCHAR(255), dircontext VARCHAR ( 50 ) DEFAULT "default" );
 -CREATE TABLE IF NOT EXISTS ivr_dests ( ivr_id INT NOT NULL, selection VARCHAR(10), dest VARCHAR(50), ivr_ret TINYINT(1) NOT NULL DEFAULT 0);
 --- /dev/null
-+++ freepbx-modules-2.3.1/modules/customerdb/install.php
++++ freepbx-modules-2.4.0/modules/customerdb/install.php
 @@ -0,0 +1,31 @@
 +<?php
 +
@@ -170,12 +170,12 @@
 +}
 +
 +?>
---- freepbx-modules-2.3.1.orig/modules/customerdb/install.sql
+--- freepbx-modules-2.4.0.orig/modules/customerdb/install.sql
 +++ /dev/null
 @@ -1 +0,0 @@
 -CREATE TABLE IF NOT EXISTS customerdb (id int UNIQUE AUTO_INCREMENT, name varchar(45) not null, addr1 varchar(150) not null,  addr2 varchar(150) null, city varchar(50) not null, state varchar(5) not null, zip varchar(12) null, sip varchar(20) null, did varchar(45) null, device varchar(50) null, ip varchar(20) null, serial varchar(50) null, account varchar(6) null, email varchar(150) null, username varchar(25) null, password varchar(25) null);
 --- /dev/null
-+++ freepbx-modules-2.3.1/modules/phpagiconf/install.php
++++ freepbx-modules-2.4.0/modules/phpagiconf/install.php
 @@ -0,0 +1,39 @@
 +<?php
 +
@@ -216,8 +216,63 @@
 +}
 +
 +?>
---- freepbx-modules-2.3.1.orig/modules/phpagiconf/install.sql
+--- freepbx-modules-2.4.0.orig/modules/phpagiconf/install.sql
 +++ /dev/null
 @@ -1,2 +0,0 @@
 -CREATE TABLE IF NOT EXISTS `phpagiconf` ( `phpagiid` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `debug` BOOL , `error_handler` BOOL , `err_email` VARCHAR( 50 ) , `hostname` VARCHAR( 255 ) , `tempdir` VARCHAR( 255 ) , `festival_text2wave` VARCHAR( 255 ) , `asman_server` VARCHAR( 255 ) , `asman_port` INT NOT NULL , `asman_user` VARCHAR( 50 ) , `asman_secret` VARCHAR( 255 ) , `cepstral_swift` VARCHAR( 255 ) , `cepstral_voice` VARCHAR( 50 ) , `setuid` BOOL , `basedir` VARCHAR( 255 ) ) TYPE = MYISAM ;
 -
+--- freepbx-modules-2.4.0.orig/modules/cidlookup/install.php
++++ freepbx-modules-2.4.0/modules/cidlookup/install.php
+@@ -15,7 +15,14 @@ if (! function_exists("outn")) {
+ 	}
+ }
+ 
+-$autoincrement = (($amp_conf["AMPDBENGINE"] == "sqlite") || ($amp_conf["AMPDBENGINE"] == "sqlite3")) ? "AUTOINCREMENT":"AUTO_INCREMENT";
++$autoincrement = "AUTO_INCREMENT";
++if (($amp_conf["AMPDBENGINE"] == "sqlite") || ($amp_conf["AMPDBENGINE"] == "sqlite3")) {
++	$autoincrement = "AUTOINCREMENT";
++	function sqlite_concat($str1, $str2) {
++		return $str1 . $str2;
++	}
++	sqlite_create_function($db, 'CONCAT', 'sqlite_concat', 2);
++}
+ 
+ // create the tables
+ $sql = "CREATE TABLE IF NOT EXISTS cidlookup (
+--- freepbx-modules-2.4.0.orig/modules/ringgroups/install.php
++++ freepbx-modules-2.4.0/modules/ringgroups/install.php
+@@ -15,20 +15,21 @@ if(DB::IsError($check)) {
+             die_freepbx($result->getDebugInfo());
+     }
+ 
+-    // update existing groups
+-    $sql = "UPDATE ringgroups SET description = CONCAT('Ring Group ', grpnum) WHERE description IS NULL ;";
+-    $result = $db->query($sql);
+-    if(DB::IsError($result)) {
+-            die_freepbx($result->getDebugInfo());
+-    }
+-
+     if ( ($db_engine != 'sqlite') && ($db_engine != 'sqlite3' ) ) {
+-        // make new field required
+-        $sql = "ALTER TABLE `ringgroups` CHANGE `description` `description` VARCHAR( 35 ) NOT NULL ;";
+-        $result = $db->query($sql);
+-        if(DB::IsError($result)) {
+-            die_freepbx($result->getDebugInfo());
+-        }
++	    // FIXME: define an sqlite function CONCAT so this can work.
++	    // update existing groups
++	    $sql = "UPDATE ringgroups SET description = CONCAT('Ring Group ', grpnum) WHERE description IS NULL ;";
++	    $result = $db->query($sql);
++	    if(DB::IsError($result)) {
++		    die_freepbx($result->getDebugInfo());
++	    }
++
++	    // make new field required
++	    $sql = "ALTER TABLE `ringgroups` CHANGE `description` `description` VARCHAR( 35 ) NOT NULL ;";
++	    $result = $db->query($sql);
++	    if(DB::IsError($result)) {
++		    die_freepbx($result->getDebugInfo());
++	    }
+     }
+ }
+ // Version 1.2 upgrade

Modified: freepbx-modules/trunk/debian/patches/sqlite_no_change
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/debian/patches/sqlite_no_change?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/debian/patches/sqlite_no_change (original)
+++ freepbx-modules/trunk/debian/patches/sqlite_no_change Sun May 18 19:52:05 2008
@@ -93,17 +93,3 @@
  }
  
  ?>
---- freepbx-modules-2.3.1.orig/modules/queues/install.php
-+++ freepbx-modules-2.3.1/modules/queues/install.php
-@@ -23,6 +23,11 @@ if (!DB::IsError($results)) { // error -
- 	}
- }
- 
-+$db_engine = $amp_conf["AMPDBENGINE"];
-+if ( ($db_engine != 'sqlite') && ($db_engine != 'sqlite3' ) ) {
-+	// No need to CHANGE table columns below.
-+	return true;
-+}
- // Version 2.2.11 change (#1659)
- //
- $results = $db->query("ALTER TABLE `queues` CHANGE `id` `id` VARCHAR( 45 ) NOT NULL DEFAULT '-1'");

Modified: freepbx-modules/trunk/fpx-modules
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/fpx-modules?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/fpx-modules (original)
+++ freepbx-modules/trunk/fpx-modules Sun May 18 19:52:05 2008
@@ -118,7 +118,7 @@
 
 function getversion()
 {
-	return "2.3";
+	return "2.4";
 }
 
 // borrowed from freepbx

Modified: freepbx-modules/trunk/modules/announcement/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/announcement/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/announcement/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/announcement/functions.inc.php Sun May 18 19:52:05 2008
@@ -7,6 +7,31 @@
 		$extens[] = array('destination' => 'app-announcement-'.$row[0].',s,1', 'description' => $row[1]);
 	}
 	return $extens;
+}
+
+function announcement_getdest($exten) {
+	return array('app-announcement-'.$exten.',s,1');
+}
+
+function announcement_getdestinfo($dest) {
+	global $active_modules;
+
+	if (substr(trim($dest),0,17) == 'app-announcement-') {
+		$exten = explode(',',$dest);
+		$exten = substr($exten[0],17);
+
+		$thisexten = announcement_get($exten);
+		if (empty($thisexten)) {
+			return array();
+		} else {
+			$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup';
+			return array('description' => 'Annoucement : '.$thisexten['description'],
+			             'edit_url' => 'config.php?display=announcement&type='.$type.'&extdisplay='.urlencode($exten),
+								  );
+		}
+	} else {
+		return false;
+	}
 }
 
 function announcement_get_config($engine) {
@@ -71,10 +96,17 @@
 
 function announcement_get($announcement_id) {
 	global $db;
-	$sql = "SELECT announcement_id, description, recording, allow_skip, post_dest, return_ivr, noanswer, repeat_msg FROM announcement WHERE announcement_id = ".addslashes($announcement_id);
-	$row = $db->getRow($sql);
+	$sql = "SELECT announcement_id, description, recording, allow_skip, post_dest, return_ivr, noanswer, repeat_msg FROM announcement WHERE announcement_id = '".addslashes($announcement_id)."'";
+	$row = $db->getRow($sql,DB_FETCHMODE_ASSOC);
 	if(DB::IsError($row)) {
 		die_freepbx($row->getMessage()."<br><br>Errpr selecting row from announcement");	
+	}
+	// Added Associative query above but put positional indexes back to maintain backward compatibility
+	//
+	$i = 0;
+	foreach ($row as $item) {
+		$row[$i] = $item;
+		$i++;
 	}
 	return $row;
 }
@@ -122,4 +154,31 @@
 	}
 }
 
+function announcement_check_destinations($dest=true) {
+	global $active_modules;
+
+	$destlist = array();
+	if (is_array($dest) && empty($dest)) {
+		return $destlist;
+	}
+	$sql = "SELECT announcement_id, post_dest, description FROM announcement ";
+	if ($dest !== true) {
+		$sql .= "WHERE post_dest in ('".implode("','",$dest)."')";
+	}
+	$results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
+
+	$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup';
+
+	foreach ($results as $result) {
+		$thisdest = $result['post_dest'];
+		$thisid   = $result['annoucement_id'];
+		$destlist[] = array(
+			'dest' => $thisdest,
+			'description' => 'Annoucement: '.$result['description'],
+			'edit_url' => 'config.php?display=announcement&type='.$type.'&extdisplay='.urlencode($thisid),
+		);
+	}
+	return $destlist;
+}
+
 ?>

Added: freepbx-modules/trunk/modules/announcement/i18n/it_IT/LC_MESSAGES/announcement.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/announcement/i18n/it_IT/LC_MESSAGES/announcement.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/announcement/i18n/it_IT/LC_MESSAGES/announcement.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/announcement/i18n/it_IT/LC_MESSAGES/announcement.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/announcement/i18n/it_IT/LC_MESSAGES/announcement.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/announcement/i18n/it_IT/LC_MESSAGES/announcement.po (added)
+++ freepbx-modules/trunk/modules/announcement/i18n/it_IT/LC_MESSAGES/announcement.po Sun May 18 19:52:05 2008
@@ -1,0 +1,125 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-01-23 16:44+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: Italian <LL at li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: page.announcement.php:87
+msgid "Edit Announcement"
+msgstr "Modifica Annuncio"
+
+#: page.announcement.php:87
+msgid "Add Announcement"
+msgstr "Aggiungi Annuncio"
+
+#: page.announcement.php:89
+msgid "Description"
+msgstr "Descrizione"
+
+#: page.announcement.php:89
+msgid "The name of this announcement"
+msgstr "Il nome dell'annuncio"
+
+#: page.announcement.php:95
+msgid "Recording"
+msgstr "Registrazione"
+
+#: page.announcement.php:95
+msgid ""
+"Message to be played.<br>To add additional recordings use the \"System "
+"Recordings\" MENU to the left"
+msgstr "Messaggio da riprodurre.<br>Per aggiungere ulteriori registrazioni, utilizzare \"Registrazioni di Sistema\" nel menu di sinistra."
+
+#: page.announcement.php:112
+msgid "Allow Skip"
+msgstr "Permetti Salta"
+
+#: page.announcement.php:112
+msgid "If the caller is allowed to press a key to skip the message."
+msgstr "Se si vuole permettere al chiamante di saltare il messaggio premendo un tasto."
+
+#: page.announcement.php:116
+msgid "Destination after playback"
+msgstr "Destinazione dopo la riproduzione"
+
+#: page.announcement.php:125
+msgid "Delete"
+msgstr "Elimina"
+
+msgid "Invalid description specified"
+msgstr "Descrizione specificata non valida"
+
+msgid "Submit Changes"
+msgstr "Applica"
+
+msgid "Core"
+msgstr "Sistema"
+
+msgid "Conferences"
+msgstr "Conferenze"
+
+msgid "Phonebook Directory"
+msgstr "Rubrica"
+
+msgid "Queues"
+msgstr "Code"
+
+msgid "Ring Groups"
+msgstr "Gruppi di chiamata"
+
+msgid "Speed dial functions"
+msgstr "Selezione breve"
+
+msgid "Time Conditions"
+msgstr "Condizioni Temporali"
+
+msgid "Custom Contexts"
+msgstr "Contesti Personalizzati"
+
+msgid "Extended Routing"
+msgstr "Rotte specifiche"
+
+msgid "Custom App<span><br>ADVANCED USERS ONLY<br><br>Uses Goto() to send caller to a custom context.<br><br>The context name should start with \"custom-\", and be in the format custom-context,extension,priority. Example entry:<br><br><b>custom-myapp,s,1</b><br><br>The <b>[custom-myapp]</b> context would need to be created and included in extensions_custom.conf</span>"
+msgstr "Applicazione Personalizzata<span>SOLO UTENTI AVANZATI<br>Utilizzare Goto() per inviare la chiamata verso un contesto personalizzato.<br><br>Il nome del contesto deve iniziare per \"custom-\" e deve essere nel formato custom-contesto,extension,priorità. Esempio: <br><br><b>custom-app,s,1</b><br><br><b>Il contesto [custom-app] </b> deve poi essere creato e incluso nel file extensions_custom.conf</span>"
+
+msgid "Voicemail"
+msgstr "Casella Vocale"
+
+msgid "Extensions"
+msgstr "Interni"
+
+msgid "Day Night Mode"
+msgstr "Controllo Giorno Notte"
+
+msgid "Terminate Call"
+msgstr "Termina Chiamata"
+
+msgid "Repeat"
+msgstr "Ripeti"
+
+msgid "Key to press that will allow for the message to be replayed. If you choose this option there will be a short delay inserted after the message. If a longer delay is needed it should be incoporated into the recording."
+msgstr "Il tasto da premere per ripetere l'annuncio. Se si sceglie questa opzione ci sarà un breve ritardo dopo il messaggio. Per allungare questo tempo, includerlo nella registrazione."
+
+msgid "Return to IVR"
+msgstr "Ritorna all'IVR"
+
+msgid "If this announcement came from an IVR and this box is checked, the destination below will be ignored and instead it will return to the calling IVR. Otherwise, the destinatino below will be taken. Don't check if not using in this mode. <br>The IVR return location will be to the last IVR in the call chain that was called so be careful to only check when needed. For example, if an IVR directs a call to another destination which eventually calls this annoucement and this box is checked, it will return to that IVR which may not be the expected behavior."
+msgstr "Se questo annuncio proviene da un IVR e questa opzione è selezionata, la destinazione di sotto verrà ignorata e la chiamata ritornerà all'IVR. Altrimenti, la destinazione di sotto verrà presa in considerazione. Non selezionare se non si utilizzà questa modalità. <br> L'IVR di ritorno sarà l'ultimo IVR richiamato nel percorso della chiamata quindi stare attenti a impostare solo quando serve. Per esempio, se un IVR dirotta una chiamata verso un'altra destinazione che richiama a sua volta questo annuncio e l'impostazione è selezionata, la chiamata ritornerà all'IVR iniziale e questo magari non è il comportamento che ci si aspetta."
+
+msgid "Don't Answer Channel"
+msgstr "Non Rispondere al Canale"
+
+msgid "Check this to keep the channel from explicitly being answered. When checked, the message will be played and if the channel is not already answered it will be delivered as early media if the channel supports that. When not checked, the channel is answered followed by a 1 second delay. When using an annoucement from an IVR or other sources that have already answered the channel, that 1 second delay may not be desired."
+msgstr "Selezionare questa opzione per non rispondere esplicitamente alla chiamata. Se impostato, il messaggio verrà riprodotto e se la chiamata non è già stata risposta, verrà inviato come early media (il canale lo deve però supportare). Se non impostato, il canale verrà risposto seguito da 1 secondo di ritardo. Quando si utilizza un annuncio proveniente da un IVR o da altre sorgenti che hanno risposto al canale, questo secondo di ritardo puo' essere evitato."

Modified: freepbx-modules/trunk/modules/announcement/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/announcement/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/announcement/module.xml (original)
+++ freepbx-modules/trunk/modules/announcement/module.xml Sun May 18 19:52:05 2008
@@ -1,8 +1,10 @@
 <module>
 	<rawname>announcement</rawname>
 	<name>Announcements</name>
-	<version>0.8.5.2</version>
+	<version>2.4.0.1</version>
 	<changelog>
+		*2.4.0.1* added 2.4.0 dependency
+		*2.4.0* added support for extension/destination registry and other minor changes
 		*0.8.5.2* #2172 deprecated use of |
 		*0.8.5.1* bump for rc1
 		*0.8.5* fixed some undefined variables
@@ -24,9 +26,12 @@
 	<description>
 		Plays back one of the system recordings (optionally allowing the user to skip it) and then goes to another destination.
 	</description>
+	<depends>
+		<version>2.4.0</version>
+	</depends>
 	<menuitems>
 		<announcement>Announcements</announcement>
 	</menuitems>
-	<location>release/2.3/announcement-0.8.5.1.tgz</location>
-	<md5sum>c466721479ef3467fecf454d82e7a1cc</md5sum>
+	<location>release/2.4/announcement-2.4.0.tgz</location>
+	<md5sum>8404405d746c2b152d2d5de7359f7268</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/announcement/page.announcement.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/announcement/page.announcement.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/announcement/page.announcement.php (original)
+++ freepbx-modules/trunk/modules/announcement/page.announcement.php Sun May 18 19:52:05 2008
@@ -100,7 +100,7 @@
 	<tr>
 		<td><a href="#" class="info"><?php echo _("Recording")?><span><?php echo _("Message to be played.<br>To add additional recordings use the \"System Recordings\" MENU to the left")?></span></a></td>
 		<td>
-			&nbsp;&nbsp;<select name="recording"/>
+			<select name="recording"/>
 			<?php
 				$tresults = recordings_list();
 				$default = (isset($recording) ? $recording : '');
@@ -117,7 +117,7 @@
 	<tr>
 		<td><a href="#" class="info"><?php echo _("Repeat")?><span><?php echo _("Key to press that will allow for the message to be replayed. If you choose this option there will be a short delay inserted after the message. If a longer delay is needed it should be incoporated into the recording.")?></span></a></td>
 		<td>
-			&nbsp;&nbsp;<select name="repeat_msg"/>
+			<select name="repeat_msg"/>
 			<?php
 				$default = isset($repeat_msg) ? $repeat_msg : '';
 				for ($i=0; $i<=9; $i++ ) {
@@ -159,6 +159,19 @@
 			</td>		
 			
 			</tr>
+			<?php
+
+			if ($extdisplay) {
+				$usage_list = framework_display_destination_usage(announcement_getdest($extdisplay));
+				if (!empty($usage_list)) {
+				?>
+					<tr><td colspan="2">
+					<a href="#" class="info"><?php echo $usage_list['text']?>:<span><?php echo $usage_list['tooltip']?></span></a>
+					</td></tr>
+				<?php
+				}
+			}
+			?>
 			</table>
 			</form>
 			

Modified: freepbx-modules/trunk/modules/asterisk-cli/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/asterisk-cli/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/asterisk-cli/module.xml (original)
+++ freepbx-modules/trunk/modules/asterisk-cli/module.xml Sun May 18 19:52:05 2008
@@ -1,7 +1,7 @@
 <module>
 	<rawname>asterisk-cli</rawname>
 	<name>Asterisk CLI</name>
-	<version>1.1.2.1</version>
+	<version>2.4.0</version>
 	<type>tool</type>
 	<category>System Administration</category>
 	<menuitems>
@@ -11,8 +11,9 @@
 		<engine>asterisk</engine>
 	</depends>
 	<location>release/2.3/asterisk-cli-1.1.2.1.tgz</location>
-	<md5sum>5bfad012ed96fe9c81b900a17751c25f</md5sum>
+	<md5sum>aa181223d6368fe0f99ffea46e189087</md5sum>
 	<changelog>
+		*2.4.0* 2.4 branch (added IT translations also)
 		*1.1.2.1* bump for rc1
 		*1.1.2* fix syntax error, extra =
 		*1.1.1* #2070 fix proper use of script tags

Modified: freepbx-modules/trunk/modules/asteriskinfo/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/asteriskinfo/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/asteriskinfo/module.xml (original)
+++ freepbx-modules/trunk/modules/asteriskinfo/module.xml Sun May 18 19:52:05 2008
@@ -1,7 +1,7 @@
 <module>
 	<rawname>asteriskinfo</rawname>
 	<name>Asterisk Info</name>
-	<version>0.3.0.1</version>
+	<version>2.4.0</version>
 	<type>tool</type>
 	<category>System Administration</category>
 	<description>
@@ -14,11 +14,12 @@
 		<engine>asterisk</engine>
 	</depends>
 	<changelog>
+		*2.4.0* bumped to 2.4
 		*0.3.0.1* bump for rc1
 		*0.3.0* #2187 Fix for Asterisk 1.4
 		*0.2.0* Add depends asterisk xml tag, proper error checking for manager connection, center table titles
 		*0.1.0* Initial release
 	</changelog>
 	<location>release/2.3/asteriskinfo-0.3.0.1.tgz</location>
-	<md5sum>c62e2db14ebaa1fcac7a29f6a999145c</md5sum>
+	<md5sum>d5ea7804c1d21ed3878efec9c3ded554</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/backup/bin/restoreastdb.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/backup/bin/restoreastdb.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/backup/bin/restoreastdb.php (original)
+++ freepbx-modules/trunk/modules/backup/bin/restoreastdb.php Sun May 18 19:52:05 2008
@@ -3,6 +3,19 @@
 // No use outputting anything, as env forces php headers to appear. Sigh.
 
 global $argv;
+
+// Astdb trees that should be deleted before the restore
+//
+$deltree = array(
+	'AMPUSER',
+	'DEVICE',
+	'CF',
+	'CFB',
+	'CFU',
+	'CW',
+	'DND',
+	'DAYNIGHT',
+);
 
 function getconf($filename) {
         $file = file($filename);
@@ -27,14 +40,21 @@
 	// You must supply a single filename, which will be written to /tmp
 	exit;
 }
-$dump = file_get_contents("/tmp/ampbackups.$argv[1]/astdb.dump");
+$dump = file_get_contents("/tmp/ampbackups.".$argv[1]."/astdb.dump");
 $arr = explode("\n", $dump);
+
+// Before restoring, let's clear out all of the current settings for the main objects
+//
+foreach ($deltree as $family) {
+	$astman->database_deltree($family);
+}
+
 foreach ($arr as $line) {
 	$result = preg_match("/\[(.+)\] \[(.+)\]/", $line, $matches);
 	// Now, the bad ones we know about are the ones that start with //, anything starting with SIP or IAX,
 	// and RG (which are only temporary anyway).
 	if (!isset($matches[1]) || $matches[1] == "") { continue; }
-	$pattern = "/(^\/\/)|(^\/IAX)|(^\/SIP)|(^\/RG)|(^\/BLKVM)|(^\/FM)/";
+	$pattern = "/(^\/\/)|(^\/IAX)|(^\/SIP)|(^\/RG)|(^\/BLKVM)|(^\/FM)|(^\/dundi)/";
 	if (preg_match($pattern, $matches[1])) { continue; }
 	preg_match("/(.+)\/(.+)$/", $matches[1], $famkey);
 	$famkey[1]=trim($famkey[1], '/');

Added: freepbx-modules/trunk/modules/backup/i18n/it_IT/LC_MESSAGES/backup.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/backup/i18n/it_IT/LC_MESSAGES/backup.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/backup/i18n/it_IT/LC_MESSAGES/backup.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/backup/i18n/it_IT/LC_MESSAGES/backup.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/backup/i18n/it_IT/LC_MESSAGES/backup.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/backup/i18n/it_IT/LC_MESSAGES/backup.po (added)
+++ freepbx-modules/trunk/modules/backup/i18n/it_IT/LC_MESSAGES/backup.po Sun May 18 19:52:05 2008
@@ -1,0 +1,329 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-01-23 17:05+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: Italian <LL at li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: page.backup.php:108
+msgid "Add Backup Schedule"
+msgstr "Aggiungi Pianificazione Backup"
+
+#: page.backup.php:109
+msgid "Restore from Backup"
+msgstr "Ripristina da Backup"
+
+#: page.backup.php:130 page.backup.php:153 page.backup.php:197
+msgid "System Backup"
+msgstr "Backup di Sistema"
+
+#: page.backup.php:138 page.backup.php:163
+msgid "Run Schedule"
+msgstr "Esegui Pianificazione"
+
+#: page.backup.php:154
+msgid "Delete Backup Schedule"
+msgstr "Elimina Pianificazione Backup"
+
+#: page.backup.php:178
+msgid "System Restore"
+msgstr "Ripristino di Sistema"
+
+#: schedule_functions.php:22
+msgid "DELETE ALL THE DATA IN THIS SET"
+msgstr "ELIMINA TUTTI I DATI IN QUESTO BACKUP"
+
+#: schedule_functions.php:22
+msgid "Delete this backup set and all data associated with this backup set.."
+msgstr "Elimina questo set di backup e i dati associati ad esso..."
+
+#: schedule_functions.php:38
+msgid "Delete File Set"
+msgstr "Elimina Set di File"
+
+#: schedule_functions.php:38
+msgid "Delete this backup set."
+msgstr "Elimina questo set di backup."
+
+#: schedule_functions.php:43
+msgid "Restore Entire Backup Set"
+msgstr "Ripristina l'interno Set di Backup"
+
+#: schedule_functions.php:43
+msgid "Restore your Complete Backup set overwriting all files."
+msgstr "Ripristina il Set di Backup Completo sovrascrivendo tutti i files."
+
+#: schedule_functions.php:47
+msgid "Restore VoiceMail Files"
+msgstr "Ripristina file Caselle Vocali"
+
+#: schedule_functions.php:47
+msgid ""
+"Restore your Voicemail files from this backup set.  NOTE! This will delete "
+"any voicemail currently in the voicemail boxes."
+msgstr "Ripristina i file delle Caselle Vocali da questo set di backup. NOTA! Questo eliminerà tutte le impostazione delle caselle vocali correntemente in uso."
+
+#: schedule_functions.php:54
+msgid "Restore System Recordings Files"
+msgstr "Ripristina i file delle Registrazioni di Sistema"
+
+#: schedule_functions.php:54
+msgid ""
+"Restore your system Voice Recordings including AutoAttendent files from this "
+"backup set.  NOTE! This will OVERWRITE any voicerecordings  currently on the "
+"system. It will NOT delete new files not currently in the backup set"
+msgstr "Ripristina da questo set di Backup tutte le Registrazioni di Sistema inclusi i file dell'IVR. NOTA! SOVRASCRIVERA' tutte le registrazioni correntemente in uso ma NON cancellerà quelle non presenti nel backup."
+
+#: schedule_functions.php:59
+msgid "Restore System Configuration"
+msgstr "Ripristina Configurazione di Sistema"
+
+#: schedule_functions.php:59
+msgid ""
+"Restore your system configuration from this backup set.  NOTE! This will "
+"OVERWRITE any System changes you have made since this backup... ALL Itemes "
+"will be reset to what they were at the time of this backup set.."
+msgstr "Ripristina la configurazione di sistema da questo set di backup. NOTA: questo SOVRASCRIVERA' tutti i cambiamenti di sistema effettuati fino a questo backup... TUTTO sarà impostato fino al momento in cui è stato fatto questo backup..."
+
+#: schedule_functions.php:64
+msgid "Restore Operator Panel"
+msgstr "Ripristina il Pannello Operatore"
+
+#: schedule_functions.php:64
+msgid ""
+"Restore the Operator Panel from this backup set.  NOTE! This will OVERWRITE "
+"any Operator Panel Changes you have made since this backup... ALL Itemes "
+"will be reset to what they were at the time of this backup set.."
+msgstr "Ripristina il Pannello Operatore da questo set di backup. NOTA! questo SOVRASCRIVERA' tutte le modifiche effettuate sul Pannello fino al momento in cui è stato fatto questo backup..."
+
+#: schedule_functions.php:69
+msgid "Restore Call Detail Report"
+msgstr "Riprstina i Rapporti Chiamate"
+
+#: schedule_functions.php:69
+msgid ""
+"Restore the Call Detail Records from this backup set.  NOTE! This will "
+"DELETE ALL CALL RECORDS that have been saved since this backup set.."
+msgstr "Ripristina tutti i Rapporti Chiamate da questo set di backup. NOTA! Questo comporterà la CANCELLAZIONE DI TUTTI RAPPORTI CHIAMATE fino al momento in cui è stato fatto questo backup..."
+
+#: schedule_functions.php:74
+msgid "ERROR its not a BACKUP SET file"
+msgstr "ERRORE questo non è un file SET di BACKUP"
+
+#: schedule_functions.php:309
+msgid "Schedule Name:"
+msgstr "Nome pianificazione:"
+
+#: schedule_functions.php:309
+msgid "Give this Backup Schedule a brief name to help you identify it."
+msgstr "Dare un nome breve alla pianificazione per una facile identificazione."
+
+#: schedule_functions.php:314
+msgid "VoiceMail"
+msgstr "Casella Vocale"
+
+#: schedule_functions.php:314
+msgid ""
+"Backup the System VoiceMail Boxes... CAUTION: Could result in large file"
+msgstr "Esegue il Backup delle Caselle Vocali... ATTENZIONE: può generare file di grandi dimensioni"
+
+#: schedule_functions.php:316 schedule_functions.php:318
+#: schedule_functions.php:324 schedule_functions.php:326
+#: schedule_functions.php:332 schedule_functions.php:334
+#: schedule_functions.php:340 schedule_functions.php:342
+#: schedule_functions.php:348 schedule_functions.php:350
+msgid "yes"
+msgstr "Sì"
+
+#: schedule_functions.php:316 schedule_functions.php:318
+#: schedule_functions.php:324 schedule_functions.php:326
+#: schedule_functions.php:332 schedule_functions.php:334
+#: schedule_functions.php:340 schedule_functions.php:342
+#: schedule_functions.php:348 schedule_functions.php:350
+msgid "no"
+msgstr "No"
+
+#: schedule_functions.php:322
+msgid "System Recordings"
+msgstr "Registrazioni di Sistema"
+
+#: schedule_functions.php:322
+msgid ""
+"Backup the System Recordings (AutoAttendent, Music On Hold, System "
+"Recordings)"
+msgstr "Esegue il Backup delle Registrazioni di Sistema (IVR, Musica di Attesa e Registrazioni di Sistema)"
+
+#: schedule_functions.php:330
+msgid "System Configuration"
+msgstr "Configurazione di Sistema"
+
+#: schedule_functions.php:330
+msgid ""
+"Backup the System Configurations (Database, etc files, SQL Database, astdb)"
+msgstr "Esegue il Backup della Configurazione di Sistema (Database, file etc, Database SQL e astdb)"
+
+#: schedule_functions.php:338
+msgid "CDR"
+msgstr "CDR"
+
+#: schedule_functions.php:338
+msgid "Backup the System Call Detail Reporting (HTML and Database)"
+msgstr "Esegue il Backup dei Rapporti Chiamate (CDR - HTML e Database)"
+
+#: schedule_functions.php:346
+msgid "Operator Panel"
+msgstr "Pannello Operatore:"
+
+#: schedule_functions.php:346
+msgid "Backup the Operator Panel (HTML and Database)"
+msgstr "Esegue il Backup del Pannello Operatore (HTML e Database)"
+
+#: schedule_functions.php:397 schedule_functions.php:401
+#: schedule_functions.php:426 schedule_functions.php:430
+#: schedule_functions.php:455 schedule_functions.php:459
+msgid "All"
+msgstr "Tutto"
+
+#: schedule_functions.php:398 schedule_functions.php:402
+#: schedule_functions.php:427 schedule_functions.php:431
+#: schedule_functions.php:456 schedule_functions.php:460
+msgid "Selected"
+msgstr "Selezionato"
+
+#: schedule_functions.php:435
+msgid "January"
+msgstr "Gennaio"
+
+#: schedule_functions.php:436
+msgid "February"
+msgstr "Febbraio"
+
+#: schedule_functions.php:437
+msgid "March"
+msgstr "Marzo"
+
+#: schedule_functions.php:438
+msgid "April"
+msgstr "Aprile"
+
+#: schedule_functions.php:439
+msgid "May"
+msgstr "Maggio"
+
+#: schedule_functions.php:440
+msgid "June"
+msgstr "Giugno"
+
+#: schedule_functions.php:441
+msgid "July"
+msgstr "Luglio"
+
+#: schedule_functions.php:442
+msgid "August"
+msgstr "Agosto"
+
+#: schedule_functions.php:443
+msgid "September"
+msgstr "Settembre"
+
+#: schedule_functions.php:444
+msgid "October"
+msgstr "Ottobre"
+
+#: schedule_functions.php:445
+msgid "November"
+msgstr "Novembre"
+
+#: schedule_functions.php:446
+msgid "December"
+msgstr "Dicembre"
+
+#: schedule_functions.php:464
+msgid "Monday"
+msgstr "Lunedì"
+
+#: schedule_functions.php:465
+msgid "Tuesday"
+msgstr "Martedì"
+
+#: schedule_functions.php:466
+msgid "Wednesday"
+msgstr "Mercoledì"
+
+#: schedule_functions.php:467
+msgid "Thursday"
+msgstr "Giovedì"
+
+#: schedule_functions.php:468
+msgid "Friday"
+msgstr "Venerdì"
+
+#: schedule_functions.php:469
+msgid "Saturday"
+msgstr "Sabato"
+
+#: schedule_functions.php:470
+msgid "Sunday"
+msgstr "Domenica"
+
+#: schedule_functions.php:478
+msgid "Run Backup"
+msgstr "Esegui Backup"
+
+#: schedule_functions.php:480
+msgid "Follow Schedule Below"
+msgstr "Segui Pianificazione sottostante"
+
+#: schedule_functions.php:481
+msgid "Now"
+msgstr "Adesso"
+
+#: schedule_functions.php:482
+msgid "Daily (at midnight)"
+msgstr "Giornalmente (a mezzanotte)"
+
+#: schedule_functions.php:483
+msgid "Weekly (on Sunday)"
+msgstr "Settimanalmente (di Domenica)"
+
+#: schedule_functions.php:484
+msgid "Monthly (on the 1st)"
+msgstr "Mensilmente (il primo del mese)"
+
+#: schedule_functions.php:485
+msgid "Yearly (on 1st Jan)"
+msgstr "Annualmente (il primo Gennaio)"
+
+#: schedule_functions.php:510
+msgid "Minutes"
+msgstr "Minuti"
+
+#: schedule_functions.php:510
+msgid "Hours"
+msgstr "Ore"
+
+#: schedule_functions.php:510
+msgid "Days"
+msgstr "Giorni"
+
+#: schedule_functions.php:510
+msgid "Months"
+msgstr "Mesi"
+
+#: schedule_functions.php:510
+msgid "Weekdays"
+msgstr "Giorni della settimana"
+
+msgid "Submit Changes"
+msgstr "Applica Cambiamenti"

Modified: freepbx-modules/trunk/modules/backup/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/backup/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/backup/module.xml (original)
+++ freepbx-modules/trunk/modules/backup/module.xml Sun May 18 19:52:05 2008
@@ -1,7 +1,7 @@
 <module>
 	<rawname>backup</rawname>
 	<name>Backup &amp; Restore</name>
-	<version>2.1.4.8</version>
+	<version>2.4.1</version>
 	<type>tool</type>
 	<category>System Administration</category>
 	<menuitems>
@@ -11,6 +11,8 @@
 		<module>core</module>
 	</depends>
 	<changelog>
+		*2.4.1* #2269 clear several of the astdb objects before restore, and other bug fixes
+		*2.4.0* bumbed for 2.4 and italian tranlations
 		*2.1.4.8* #2323 allow remote MySQL database
 		*2.1.4.7* #2267 restoreadtb restore values with spaces
 		*2.1.4.6* bump for rc1 (and really chcek in uninstall fix)
@@ -31,6 +33,6 @@
 		*2.0* Now backs up and restores astdb, which was causing problems with phone configurations.
 		*1.2* Potential fix for restore issues, clean up some warnings
 	</changelog>
-	<location>release/2.3/backup-2.1.4.7.tgz</location>
-	<md5sum>24d33b6ee299d6c184d8237f6cae476b</md5sum>
+	<location>release/2.4/backup-2.4.0.tgz</location>
+	<md5sum>3bfc3f7e46d9da8f0c6626921a160d7a</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/backup/schedule_functions.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/backup/schedule_functions.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/backup/schedule_functions.php (original)
+++ freepbx-modules/trunk/modules/backup/schedule_functions.php Sun May 18 19:52:05 2008
@@ -16,6 +16,7 @@
 {
 	global $type;
 	global $asterisk_conf;
+	global $amp_conf;
         if (is_dir($dir)) {
         	if (($file!=".") && ($file!="..") && ($file!="")){
                 	echo "<li><a class=\"info\" href=\"javascript:decision('Are you sure you want to delete this File Set?','config.php?type=$type&display=$display&action=deletedataset&dir=$dir')\">";
@@ -25,7 +26,7 @@
                 if ($dh = opendir($dir)){
                         while (($file = readdir($dh)) !== false)
                         {
-                                if (($file!=".") && ($file!="..") && ($dir==$asterisk_conf['astvarlibdir']."/backups/"))
+                                if (($file!=".") && ($file!="..") && ($dir==$amp_conf['ASTVARLIBDIR']."/backups/"))
                                         echo "<li><a href=\"config.php?type=$type&display=$display&action=restore&dir=$dir/$file\">$file</a><br></li>";
                                 else if (($file!=".") && ($file!="..") )
                                         echo "<li><a href=\"config.php?type=$type&display=$display&action=restore&dir=$dir/$file&file=$file\">$file</a><br></li>";
@@ -82,11 +83,11 @@
 	if($filetype=="ALL") {
 		$Message="Restored All Files in BackupSet";
 		$fileholder=substr($file, 0,-7);
-		exec('/bin/rm -rf /tmp/ampbackups.$fileholder');
+		exec("/bin/rm -rf /tmp/ampbackups.$fileholder");
 
 		// First restore voicemial (for some reason if you do it all at once these don't get restored
 		//
-		exec('/bin/rm -rf '.$asterisk_conf['astspooldir'].'/voicemail');
+		exec('/bin/rm -rf '.$amp_conf['ASTSPOOLDIR'].'/voicemail');
 		$tar_cmd="tar -PxvOz -f \"$dir\" /tmp/ampbackups.$fileholder/voicemail.tar.gz | tar -Pxvz";
 		exec($tar_cmd);
 
@@ -104,57 +105,64 @@
 		$tar_cmd="tar -Pxvz -f \"$dir\" /tmp/ampbackups.$fileholder/asterisk.sql /tmp/ampbackups.$fileholder/asteriskcdr.sql /tmp/ampbackups.$fileholder/astdb.dump";
 		exec($tar_cmd);
 
-		$sql_cmd="mysql -u $amp_conf[AMPDBUSER] -p$amp_conf[AMPDBPASS] < /tmp/ampbackups.$fileholder/asterisk.sql";
+		$sql_cmd="mysql -u ".$amp_conf['AMPDBUSER']." -p".$amp_conf['AMPDBPASS']." < /tmp/ampbackups.$fileholder/asterisk.sql";
 		exec($sql_cmd);
-		$sql_cmd="mysql -u $amp_conf[AMPDBUSER] -p$amp_conf[AMPDBPASS] < /tmp/ampbackups.$fileholder/asteriskcdr.sql";
+		$sql_cmd="mysql -u ".$amp_conf['AMPDBUSER']." -p".$amp_conf['AMPDBPASS']." < /tmp/ampbackups.$fileholder/asteriskcdr.sql";
 		exec($sql_cmd);
-		exec($asterisk_conf['astvarlibdir']."/bin/restoreastdb.php $fileholder");
-		exec('/bin/rm -rf /tmp/ampbackups.$fileholder');
+		exec($amp_conf['AMPBIN']."/restoreastdb.php $fileholder");
+		exec("/bin/rm -rf /tmp/ampbackups.$fileholder");
+		/*
+		$fh = fopen("/tmp/backup.log","w");
+		fwrite($fh,"RET is: $RETCODE Just deleted file\n");
+		fwrite($fh,"OUTPUT: %s\n",print_r($OUTPUT,true));
+		fclose($fh);
+		*/
+
 	} else if($filetype=="VoiceMail") {
 		$Message="Restored VoiceMail";
 		$fileholder=substr($file, 0,-7);
-		exec('/bin/rm -rf /tmp/ampbackups.$fileholder');
-		exec('/bin/rm -rf '.$asterisk_conf['astspooldir'].'/voicemail');
+		exec("/bin/rm -rf /tmp/ampbackups.$fileholder");
+		exec('/bin/rm -rf '.$amp_conf['ASTSPOOLDIR'].'/voicemail');
 		$tar_cmd="tar -PxvOz -f \"$dir\" /tmp/ampbackups.$fileholder/voicemail.tar.gz | tar -Pxvz";
 		exec($tar_cmd);
-		exec('/bin/rm -rf /tmp/ampbackups.$fileholder');
+		exec("/bin/rm -rf /tmp/ampbackups.$fileholder");
 	} else if($filetype=="Recordings") {
 		$Message="Restored System Recordings";
 		$fileholder=substr($file, 0,-7);
-		exec('/bin/rm -rf /tmp/ampbackups.$fileholder');
+		exec("/bin/rm -rf /tmp/ampbackups.$fileholder");
 		$tar_cmd="tar -PxvOz -f \"$dir\" /tmp/ampbackups.$fileholder/recordings.tar.gz | tar -Pxvz";
 		exec($tar_cmd);
-		exec('/bin/rm -rf /tmp/ampbackups.$fileholder');
+		exec("/bin/rm -rf /tmp/ampbackups.$fileholder");
 	} else if($filetype=="Configurations"){
 		$Message="Restored System Configuration";
 		$fileholder=substr($file, 0,-7);
-		exec('/bin/rm -rf /tmp/ampbackups.$fileholder');
+		exec("/bin/rm -rf /tmp/ampbackups.$fileholder");
 		$tar_cmd="tar -PxvOz -f \"$dir\" /tmp/ampbackups.$fileholder/configurations.tar.gz | tar -Pxvz";
 		exec($tar_cmd);
 		$tar_cmd="tar -Pxvz -f \"$dir\" /tmp/ampbackups.$fileholder/asterisk.sql /tmp/ampbackups.$fileholder/astdb.dump";
 		exec($tar_cmd);
-		$sql_cmd="mysql -u $amp_conf[AMPDBUSER] -p$amp_conf[AMPDBPASS] < /tmp/ampbackups.$fileholder/asterisk.sql";
+		$sql_cmd="mysql -u ".$amp_conf['AMPDBUSER']." -p".$amp_conf['AMPDBPASS']." < /tmp/ampbackups.$fileholder/asterisk.sql";
 		exec($sql_cmd);
-		exec($asterisk_conf['astvarlibdir']."/bin/restoreastdb.php $fileholder");
-		exec('/bin/rm -rf /tmp/ampbackups.$fileholder');
+		exec($amp_conf['AMPBIN']."/restoreastdb.php $fileholder");
+		exec("/bin/rm -rf /tmp/ampbackups.$fileholder");
 	} else if($filetype=="FOP"){
 		$Message="Restored Operator Panel";
 		$fileholder=substr($file, 0,-7);
-		exec('/bin/rm -rf /tmp/ampbackups.$fileholder');
+		exec("/bin/rm -rf /tmp/ampbackups.$fileholder");
 		$tar_cmd="tar -PxvOz -f \"$dir\" /tmp/ampbackups.$fileholder/fop.tar.gz | tar -Pxvz";
 		exec($tar_cmd);
-		exec('/bin/rm -rf /tmp/ampbackups.$fileholder');
+		exec("/bin/rm -rf /tmp/ampbackups.$fileholder");
 	} else if($filetype=="CDR"){
 		$Message="Restored CDR logs";
 		$fileholder=substr($file, 0,-7);
-		exec('/bin/rm -rf /tmp/ampbackups.$fileholder');
+		exec("/bin/rm -rf /tmp/ampbackups.$fileholder");
 		$tar_cmd="tar -PxvOz -f \"$dir\" /tmp/ampbackups.$fileholder/cdr.tar.gz | tar -Pxvz";
 		exec($tar_cmd);
 		$tar_cmd="tar -Pxvz -f \"$dir\" /tmp/ampbackups.$fileholder/asteriskcdr.sql";
 		exec($tar_cmd);
-		$sql_cmd="mysql -u $amp_conf[AMPDBUSER] -p$amp_conf[AMPDBPASS] < /tmp/ampbackups.$fileholder/asteriskcdr.sql";
+		$sql_cmd="mysql -u ".$amp_conf['AMPDBUSER']." -p".$amp_conf['AMPDBPASS']." < /tmp/ampbackups.$fileholder/asteriskcdr.sql";
 		exec($sql_cmd);
-		exec('/bin/rm -rf /tmp/ampbackups.$fileholder');
+		exec("/bin/rm -rf /tmp/ampbackups.$fileholder");
 	}
 	 return ($Message);
 }

Modified: freepbx-modules/trunk/modules/blacklist/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/blacklist/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/blacklist/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/blacklist/functions.inc.php Sun May 18 19:52:05 2008
@@ -5,6 +5,7 @@
 }
 function blacklist_get_config($engine) {
         global $ext;
+        global $version;
         switch($engine) {
                 case "asterisk":
 
@@ -13,8 +14,12 @@
 
 		      $id = "app-blacklist-check";
 		      $c = "s";
-                      $ext->add($id, $c, '', new ext_lookupblacklist(''));
-                      $ext->add($id, $c, '', new ext_gotoif('$["${LOOKUPBLSTATUS}"="FOUND"]', 'blacklisted'));
+                      if (version_compare($version, "1.6", "ge")) {
+                             $ext->add($id, $c, '', new ext_gotoif('$["${BLACKLIST()}"="1"]', 'blacklisted'));
+                      } else {
+                             $ext->add($id, $c, '', new ext_lookupblacklist(''));
+                             $ext->add($id, $c, '', new ext_gotoif('$["${LOOKUPBLSTATUS}"="FOUND"]', 'blacklisted'));
+                      }
                       $ext->add($id, $c, '', new ext_return(''));
                       $ext->add($id, $c, 'blacklisted', new ext_answer(''));
                       $ext->add($id, $c, '', new ext_wait(1));
@@ -55,18 +60,18 @@
 	$c = "s";
 	$ext->add($id, $c, '', new ext_answer);
 	$ext->add($id, $c, '', new ext_wait(1));
-	$ext->add($id, $c, '', new ext_Playback('enter-num-blacklist'));
+	$ext->add($id, $c, '', new ext_playback('enter-num-blacklist'));
 	$ext->add($id, $c, '', new ext_digittimeout(5));
 	$ext->add($id, $c, '', new ext_responsetimeout(60));
 	$ext->add($id, $c, '', new ext_read('blacknr', 'then-press-pound'));
 	$ext->add($id, $c, '', new ext_saydigits('${blacknr}'));
-	$ext->add($id, $c, '', new ext_Playback('if-correct-press&digits/1'));
+	$ext->add($id, $c, '', new ext_playback('if-correct-press&digits/1'));
 	$ext->add($id, $c, '', new ext_noop('Waiting for input'));
 	$ext->add($id, $c, 'end', new ext_waitexten(60));
-	$ext->add($id, $c, '', new ext_Playback('sorry-youre-having-problems&goodbye'));
+	$ext->add($id, $c, '', new ext_playback('sorry-youre-having-problems&goodbye'));
 	$c = "1";
 	$ext->add($id, $c, '', new ext_set('DB(blacklist/${blacknr})', 1));
-	$ext->add($id, $c, '', new ext_Playback('num-was-successfully&added'));
+	$ext->add($id, $c, '', new ext_playback('num-was-successfully&added'));
 	$ext->add($id, $c, '', new ext_wait(1));
 	$ext->add($id, $c, '', new ext_hangup);
 }
@@ -80,18 +85,18 @@
 	$c = "s";
 	$ext->add($id, $c, '', new ext_answer);
 	$ext->add($id, $c, '', new ext_wait(1));
-	$ext->add($id, $c, '', new ext_Playback('entr-num-rmv-blklist'));
+	$ext->add($id, $c, '', new ext_playback('entr-num-rmv-blklist'));
 	$ext->add($id, $c, '', new ext_digittimeout(5));
 	$ext->add($id, $c, '', new ext_responsetimeout(60));
 	$ext->add($id, $c, '', new ext_read('blacknr', 'then-press-pound'));
 	$ext->add($id, $c, '', new ext_saydigits('${blacknr}'));
-	$ext->add($id, $c, '', new ext_Playback('if-correct-press&digits/1'));
+	$ext->add($id, $c, '', new ext_playback('if-correct-press&digits/1'));
 	$ext->add($id, $c, '', new ext_noop('Waiting for input'));
 	$ext->add($id, $c, 'end', new ext_waitexten(60));
-	$ext->add($id, $c, '', new ext_Playback('sorry-youre-having-problems&goodbye'));
+	$ext->add($id, $c, '', new ext_playback('sorry-youre-having-problems&goodbye'));
 	$c = "1";
  	$ext->add($id, $c, '', new ext_dbdel('blacklist/${blacknr}'));
- 	$ext->add($id, $c, '', new ext_Playback('num-was-successfully&removed'));
+ 	$ext->add($id, $c, '', new ext_playback('num-was-successfully&removed'));
  	$ext->add($id, $c, '', new ext_wait(1));
  	$ext->add($id, $c, '', new ext_hangup);
 }
@@ -111,17 +116,17 @@
 	$ext->add($id, $c, '', new ext_saydigits('${lastcaller}'));
 	$ext->add($id, $c, '', new ext_setvar('TIMEOUT(digit)', '3'));
 	$ext->add($id, $c, '', new ext_setvar('TIMEOUT(response)', '7'));
-	$ext->add($id, $c, '', new ext_Playback('if-correct-press&digits/1'));
+	$ext->add($id, $c, '', new ext_playback('if-correct-press&digits/1'));
 	$ext->add($id, $c, '', new ext_goto('end'));
 	$ext->add($id, $c, 'noinfo', new ext_playback('unidentified-no-callback'));
 	$ext->add($id, $c, '', new ext_hangup);
 	$ext->add($id, $c, '', new ext_noop('Waiting for input'));
 	$ext->add($id, $c, 'end', new ext_waitexten(60));
-	$ext->add($id, $c, '', new ext_Playback('sorry-youre-having-problems&goodbye'));
+	$ext->add($id, $c, '', new ext_playback('sorry-youre-having-problems&goodbye'));
 	$c = "1";
 	$ext->add($id, $c, '', new ext_set('DB(blacklist/${lastcaller})', 1));
-	$ext->add($id, $c, '', new ext_Playback('num-was-successfully'));
-	$ext->add($id, $c, '', new ext_Playback('added'));
+	$ext->add($id, $c, '', new ext_playback('num-was-successfully'));
+	$ext->add($id, $c, '', new ext_playback('added'));
 	$ext->add($id, $c, '', new ext_wait(1));
 	$ext->add($id, $c, '', new ext_hangup);
 }

Added: freepbx-modules/trunk/modules/blacklist/i18n/it_IT/LC_MESSAGES/blacklist.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/blacklist/i18n/it_IT/LC_MESSAGES/blacklist.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/blacklist/i18n/it_IT/LC_MESSAGES/blacklist.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/blacklist/i18n/it_IT/LC_MESSAGES/blacklist.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/blacklist/i18n/it_IT/LC_MESSAGES/blacklist.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/blacklist/i18n/it_IT/LC_MESSAGES/blacklist.po (added)
+++ freepbx-modules/trunk/modules/blacklist/i18n/it_IT/LC_MESSAGES/blacklist.po Sun May 18 19:52:05 2008
@@ -1,0 +1,56 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-01-23 17:47+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: Italian <LL at li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: page.blacklist.php:54
+msgid "Blacklist entry"
+msgstr "Voce Blacklist"
+
+#: page.blacklist.php:54
+msgid "deleted"
+msgstr "eliminata"
+
+#: page.blacklist.php:62
+msgid "Blacklist entries"
+msgstr "Voci in Blacklist"
+
+#: page.blacklist.php:66
+msgid "Number"
+msgstr "Numero"
+
+#: page.blacklist.php:78
+msgid "Delete"
+msgstr "Elimina"
+
+#: page.blacklist.php:80
+msgid "Edit"
+msgstr "Modifica"
+
+#: page.blacklist.php:96
+msgid "Add or replace entry"
+msgstr "Aggiungi o sostituisci voce"
+
+#: page.blacklist.php:99
+msgid "Number:"
+msgstr "Numero:"
+
+#: page.blacklist.php:100
+msgid "Enter the number you want to block"
+msgstr "Inserire il numero da bloccare"
+
+msgid "Submit Changes"
+msgstr "Applica"

Modified: freepbx-modules/trunk/modules/blacklist/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/blacklist/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/blacklist/module.xml (original)
+++ freepbx-modules/trunk/modules/blacklist/module.xml Sun May 18 19:52:05 2008
@@ -1,13 +1,15 @@
 <module>
 	<rawname>blacklist</rawname>
 	<name>Blacklist</name>
-	<version>1.1.3.6</version>
+	<version>2.4.0</version>
 	<type>setup</type>
 	<category>Inbound Call Control</category>
 	<menuitems>
 		<blacklist needsenginedb="yes">Blacklist</blacklist>
 	</menuitems>
 	<changelog>
+		*2.4.0* minor fixes, it translations, bumped for 2.4
+		*1.1.4* #2416 Enable Asterisk 1.6+ support
 		*1.1.3.6* #2455 allow + and other valid dial digits
 		*1.1.3.5* changed categories
 		*1.1.3.4* bump for rc1
@@ -19,6 +21,6 @@
 		*1.1.1* Add he_IL translation
 		*1.1* First 2.2 release. Fix minor warnings.
 	</changelog>
-	<location>release/2.3/blacklist-1.1.3.5.tgz</location>
-	<md5sum>cf4242b07391e0f6c4557ac7ed16557d</md5sum>
+	<location>release/2.4/blacklist-1.1.4.tgz</location>
+	<md5sum>58d7dca61dd39ab25460c50f4c45c11f</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/callback/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/callback/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/callback/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/callback/functions.inc.php Sun May 18 19:52:05 2008
@@ -13,6 +13,30 @@
 		return $extens;
 	} else {
 		return null;
+	}
+}
+
+function callback_getdest($exten) {
+	return array('callback,'.$exten.',1');
+}
+
+function callback_getdestinfo($dest) {
+	global $active_modules;
+
+	if (substr(trim($dest),0,9) == 'callback,') {
+		$exten = explode(',',$dest);
+		$exten = $exten[1];
+		$thisexten = callback_get($exten);
+		if (empty($thisexten)) {
+			return array();
+		} else {
+			//$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup';
+			return array('description' => 'Callback : '.$thisexten['description'],
+			             'edit_url' => 'config.php?display=callback&itemid='.urlencode($exten),
+								  );
+		}
+	} else {
+		return false;
 	}
 }
 

Modified: freepbx-modules/trunk/modules/callback/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/callback/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/callback/module.xml (original)
+++ freepbx-modules/trunk/modules/callback/module.xml Sun May 18 19:52:05 2008
@@ -1,13 +1,15 @@
 <module>
 	<rawname>callback</rawname>
 	<name>Callback</name>
-	<version>1.4.2.3</version>
+	<version>2.4.0.1</version>
 	<type>setup</type>
 	<category>Internal Options &amp; Configuration</category>
 	<menuitems>
 		<callback>Callback</callback>
 	</menuitems>
 	<changelog>
+	*2.4.0.1* add 2.4.0 dependency
+	*2.4.0* extension/destination registry, it translations
 	*1.4.2.3* changed categories
 	*1.4.2.2* bump for rc1
 	*1.4.2.1* changed freePBX to FreePBX
@@ -18,6 +20,9 @@
 	*1.3* Fixed UI errors for new 2.2 look.
 	*1.2* First 2.2 release
 	</changelog>
-	<location>release/2.3/callback-1.4.2.2.tgz</location>
-	<md5sum>c09ac8e91976cd082f52c89513ffd217</md5sum>
+	<depends>
+		<version>2.4.0</version>
+	</depends>
+	<location>release/2.4/callback-2.4.0.tgz</location>
+	<md5sum>c7a564689fc671c0dcd0819c4d6ef29e</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/callback/page.callback.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/callback/page.callback.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/callback/page.callback.php (original)
+++ freepbx-modules/trunk/modules/callback/page.callback.php Sun May 18 19:52:05 2008
@@ -82,7 +82,17 @@
 	
 	<p><?php echo ($itemid ? '' : _("A callback will hang up on the caller and then call them back, directing them to the selected destination. This is useful for reducing mobile phone charges as well as other applications. Outbound calls will proceed according to the dial patterns in Outbound Routes.")); ?></p>
 
-<?php		if ($itemid){  echo $delButton; 	} ?>
+<?php		if ($itemid) {
+					echo $delButton; 	
+					$usage_list = framework_display_destination_usage(callback_getdest($itemid));
+					if (!empty($usage_list)) {
+?>
+						<a href="#" class="info"><?php echo $usage_list['text']?>:<span><?php echo $usage_list['tooltip']?></span></a>
+<?php
+					}
+				}
+?>
+
 
 <form autocomplete="off" name="edit" action="<?php $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return edit_onsubmit();">
 	<input type="hidden" name="display" value="<?php echo $dispnum?>">

Modified: freepbx-modules/trunk/modules/callforward/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/callforward/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/callforward/module.xml (original)
+++ freepbx-modules/trunk/modules/callforward/module.xml Sun May 18 19:52:05 2008
@@ -1,8 +1,9 @@
 <module>
 	<rawname>callforward</rawname>
 	<name>Call Forward</name>
-	<version>1.1.2</version>
+	<version>2.4.0</version>
 	<changelog>
+		*2.4.0* bumped for 2.4
 		*1.1.2* #2321 fixed CF AMPUSER(number) issue, syntax problem
 		*1.1.1.2* changed categories
 		*1.1.1.1* bump for rc1
@@ -11,6 +12,6 @@
 	</changelog>
 	<type>setup</type>
 	<category>Internal Options &amp; Configuration</category>
-	<location>release/2.3/callforward-1.1.1.2.tgz</location>
-	<md5sum>83b552d1c530cbe2f7d6c0d5d892c85b</md5sum>
+	<location>release/2.3/callforward-1.1.2.tgz</location>
+	<md5sum>dbdfab9a6a87a454228aa0e59963346d</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/callwaiting/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/callwaiting/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/callwaiting/module.xml (original)
+++ freepbx-modules/trunk/modules/callwaiting/module.xml Sun May 18 19:52:05 2008
@@ -1,8 +1,9 @@
 <module>
 	<rawname>callwaiting</rawname>
 	<name>Call Waiting</name>
-	<version>1.1.2.2</version>
+	<version>2.4.0</version>
 	<changelog>
+	*2.4.0* bumped for 2.4
 	*1.1.2.2* changed categories
 	*1.1.2.1* bump for rc1
 	*1.1.2* changed ${CALLERID(number)} to ${AMPUSER} to accomodate CID number masquerading
@@ -12,6 +13,6 @@
 	<type>setup</type>
 	<category>Internal Options &amp; Configuration</category>
 	<description>Provides an option to turn on/off call waiting</description>
-	<location>release/2.3/callwaiting-1.1.2.1.tgz</location>
-	<md5sum>4c2f2ec4b40c94c3d0ec913191c4d1b1</md5sum>
+	<location>release/2.3/callwaiting-1.1.2.2.tgz</location>
+	<md5sum>dbc37e546480ab54359fa2bf16c15748</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/cidlookup/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/cidlookup/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/cidlookup/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/cidlookup/functions.inc.php Sun May 18 19:52:05 2008
@@ -49,20 +49,20 @@
 		return;
 	switch ($request['action'])	{
 		case 'addIncoming':
-			$results = sql(sprintf('INSERT INTO cidlookup_incoming (cidlookup_id, extension, cidnum, channel) VALUES ("%d", "%s", "%s", "%s")', 
-				$request['cidlookup_id'], $request['extension'], $request['cidnum'], $request['channel']));
+			$results = sql(sprintf('INSERT INTO cidlookup_incoming (cidlookup_id, extension, cidnum) VALUES ("%d", "%s", "%s")', 
+				$request['cidlookup_id'], $request['extension'], $request['cidnum']));
 		break;
 		case 'delIncoming':
-			$extarray = explode('/', $request['extdisplay'], 3);
-			$results = sql(sprintf("DELETE FROM cidlookup_incoming WHERE extension = '%s' AND cidnum = '%s' AND channel = '%s'",
-				$extarray[0], $extarray[1], $extarray[2]));
+			$extarray = explode('/', $request['extdisplay'], 2);
+			$results = sql(sprintf("DELETE FROM cidlookup_incoming WHERE extension = '%s' AND cidnum = '%s'",
+				$extarray[0], $extarray[1]));
 		break;
 		case 'edtIncoming':	// deleting and adding as in core module
-			$extarray = explode('/', $request['extdisplay'], 3);
-			$results = sql(sprintf("DELETE FROM cidlookup_incoming WHERE extension = '%s' AND cidnum = '%s' AND channel = '%s'",
-				$extarray[0], $extarray[1], $extarray[2]));
-			$results = sql(sprintf('INSERT INTO cidlookup_incoming (cidlookup_id, extension, cidnum, channel) VALUES ("%d", "%s", "%s", "%s")', 
-				$request['cidlookup_id'], $request['extension'], $request['cidnum'], $request['channel']));
+			$extarray = explode('/', $request['extdisplay'], 2);
+			$results = sql(sprintf("DELETE FROM cidlookup_incoming WHERE extension = '%s' AND cidnum = '%s'",
+				$extarray[0], $extarray[1]));
+			$results = sql(sprintf('INSERT INTO cidlookup_incoming (cidlookup_id, extension, cidnum) VALUES ("%d", "%s", "%s")', 
+				$request['cidlookup_id'], $request['extension'], $request['cidnum']));
 		break;
 	}
 }
@@ -82,15 +82,11 @@
 						// Code from modules/core/functions.inc.php core_get_config inbound routes
 						$exten = $item['extension'];
 						$cidnum = $item['cidnum'];
-						$channel = $item['channel'];
 						
 						$exten = (empty($exten)?"s":$exten);
 						$exten = $exten.(empty($cidnum)?"":"/".$cidnum); //if a CID num is defined, add it
 
-						if (empty($channel))
-							$context = "ext-did";
-						else 
-							$context = "macro-from-zaptel-{$channel}";
+						$context = "ext-did";
 
 						$ext->splice($context, $exten, 1, new ext_gosub('1', 'cidlookup_'.$item['cidlookup_id'], 'cidlookup'));
 					
@@ -210,9 +206,9 @@
 
 
 function cidlookup_did_get($did){
-	$extarray = explode('/', $did, 3);
-	if(count($extarray) == 3)	{ // differentiate beetween '//' (Any did / any cid and '' empty string)
-		$sql = sprintf("SELECT cidlookup_id FROM cidlookup_incoming WHERE extension = '%s' AND cidnum = '%s' AND channel = '%s'", $extarray[0], $extarray[1], $extarray[2]);
+	$extarray = explode('/', $did, 2);
+	if(count($extarray) == 2)	{ // differentiate beetween '//' (Any did / any cid and '' empty string)
+		$sql = sprintf("SELECT cidlookup_id FROM cidlookup_incoming WHERE extension = '%s' AND cidnum = '%s'", $extarray[0], $extarray[1]);
 		$result = sql($sql, "getRow", DB_FETCHMODE_ASSOC);
 		if(is_array($result)){
 			return $result['cidlookup_id'];

Added: freepbx-modules/trunk/modules/cidlookup/i18n/it_IT/LC_MESSAGES/cidlookup.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/cidlookup/i18n/it_IT/LC_MESSAGES/cidlookup.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/cidlookup/i18n/it_IT/LC_MESSAGES/cidlookup.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/cidlookup/i18n/it_IT/LC_MESSAGES/cidlookup.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/cidlookup/i18n/it_IT/LC_MESSAGES/cidlookup.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/cidlookup/i18n/it_IT/LC_MESSAGES/cidlookup.po (added)
+++ freepbx-modules/trunk/modules/cidlookup/i18n/it_IT/LC_MESSAGES/cidlookup.po Sun May 18 19:52:05 2008
@@ -1,0 +1,200 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-01-23 18:34+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: Italian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: functions.inc.php:19
+msgid "CID Lookup Source"
+msgstr "Sorgente Risoluzione CID"
+
+#: functions.inc.php:23
+msgid "Source"
+msgstr "Sorgente"
+
+#: functions.inc.php:23
+msgid "Sources can be added in Caller Name Lookup Sources section"
+msgstr "Le sorgenti possono essere aggiunte nella sezione Risoluzione Nome Chiamante"
+
+#: functions.inc.php:233
+msgid "None"
+msgstr "Nessuna"
+
+#: page.cidlookup.php:50
+msgid "Add CID Lookup Source"
+msgstr "Aggiungi Sorgente Risoluzione CID"
+
+#: page.cidlookup.php:64
+msgid "CID Lookup source"
+msgstr "Sorgente Risoluzione CID"
+
+#: page.cidlookup.php:64
+msgid "deleted"
+msgstr "eliminato"
+
+#: page.cidlookup.php:79
+msgid "Delete CID Lookup source"
+msgstr "Elimina sorgente Risoluzione CID"
+
+#: page.cidlookup.php:84
+msgid "Source:"
+msgstr "Sorgente:"
+
+#: page.cidlookup.php:84 page.cidlookup.php:95
+msgid "Add Source"
+msgstr "Aggiungi Sorgente"
+
+#: page.cidlookup.php:86
+msgid ""
+"A Lookup Source let you specify a source for resolving numeric caller IDs of "
+"incoming calls, you can then link an Inbound route to a specific CID source. "
+"This way you will have more detailed CDR reports with informations taken "
+"directly from your CRM. You can also install the phonebook module to have a "
+"small number <-> name association. Pay attention, name lookup may slow down "
+"your PBX"
+msgstr "Da qui è possibile specificare una sorgente per la risoluzione del Numero Identificativo Chiamante nelle chiamate in entrata; successivamente si potrà creare un collegamento nelle Rotte in Entrata ad una delle sorgenti qui specificate. In questo modo si avranno le informazioni sui clienti prese direttamente dal proprio CRM e visualizzabili nei Rapporti Chiamate. Si può installare anche il modulo Rubrica che permette di associare in maniera veloce il numero di telefono al nome in Rubrica. Stare molto attenti però, la Risoluzione dei nomi potrebbe rallentare il PBX."
+
+#: page.cidlookup.php:95
+msgid "Edit Source"
+msgstr "Modifica Sorgente"
+
+#: page.cidlookup.php:102
+msgid "Source Description:"
+msgstr "Descrizione Sorgente:"
+
+#: page.cidlookup.php:102
+msgid "Enter a description for this source."
+msgstr "Immettere una descrizione per questa sorgente."
+
+#: page.cidlookup.php:106
+msgid "Source type:"
+msgstr "Tipo sorgente:"
+
+#: page.cidlookup.php:106
+msgid ""
+"Enter the source type, you can choose beetwen:<ul><li>Internal: use astdb as "
+"lookup source, use phonebook module to populate it</li><li>ENUM: Use DNS to "
+"lookup caller names, it uses ENUM lookup zones as configured in enum.conf</"
+"li><li>HTTP: It executes an HTTP GET passing the caller number as argument "
+"to retrieve the correct name</li><li>MySQL: It queryes a MySQL database to "
+"retrieve caller name</li></ul>"
+msgstr "Selezionare il tipo di sorgente, si può scegliere tra:<ul><li>Interna: utilizza astdb come sorgente e il modulo rubrica per l'inserimento</li><li>ENUM: utilizza il sistema DNS come sorgente di risoluzione e le zone ENUM come configurate in enum.conf</li><li>HTTP: esegue un GET HTTP passando il numero di telefono come argomento per risolvere il nome</li><li>MySQL esegue una query ad un database MySQL per la risoluzione dei nomi</li></ul>"
+
+#: page.cidlookup.php:118
+msgid "Cache results:"
+msgstr "Salva risultati:"
+
+#: page.cidlookup.php:118
+msgid ""
+"Decide wether or not cache the results to astDB; it will overwrite present "
+"values. It does not affect Internal source behaviour"
+msgstr "Decide se salvare o no i dati in astDB; questo comporterà la sovrascrittura di eventuali dati già presenti. Questo non influisce sul comportamento della sorgente Interna."
+
+#: page.cidlookup.php:126
+msgid "HTTP"
+msgstr "HTTP"
+
+#: page.cidlookup.php:129 page.cidlookup.php:168
+msgid "Host:"
+msgstr "Host:"
+
+#: page.cidlookup.php:129
+msgid "Host name or IP address"
+msgstr "Nome host o Indirizzo IP"
+
+#: page.cidlookup.php:134
+msgid "Port:"
+msgstr "Porta:"
+
+#: page.cidlookup.php:134
+msgid "Port HTTP server is listening at (default 80)"
+msgstr "Porta HTTP di ascolto (predefinita 80)"
+
+#: page.cidlookup.php:139 page.cidlookup.php:181
+msgid "Username:"
+msgstr "Nome utente:"
+
+#: page.cidlookup.php:139
+msgid "Username to use in HTTP authentication"
+msgstr "Il Nome utente utilizzato nell'autenticazione HTTP"
+
+#: page.cidlookup.php:144 page.cidlookup.php:185
+msgid "Password:"
+msgstr "Password:"
+
+#: page.cidlookup.php:144
+msgid "Password to use in HTTP authentication"
+msgstr "La password utilizzata nell'autenticazione HTTP"
+
+#: page.cidlookup.php:149
+msgid "Path:"
+msgstr "Percorso:"
+
+#: page.cidlookup.php:149
+msgid "Path of the file to GET<br/>e.g.: /cidlookup.php"
+msgstr "Il percorso del file GET<br/>e.s.: /cidlookup.php"
+
+#: page.cidlookup.php:154 page.cidlookup.php:176
+msgid "Query:"
+msgstr "Query:"
+
+#: page.cidlookup.php:154
+msgid ""
+"Query string, special token '[NUMBER]' will be replaced with caller "
+"number<br/>e.g.: number=[NUMBER]&source=crm"
+msgstr "Query, il campo speciale '[NUMBER]' sarà sostituito dal numero di telefono<br/>e.s.: number=[NUMBER]&source=crm"
+
+#: page.cidlookup.php:165
+msgid "MySQL"
+msgstr "MySQL"
+
+#: page.cidlookup.php:168
+msgid "MySQL Host"
+msgstr "Host MySQL"
+
+#: page.cidlookup.php:172
+msgid "Database:"
+msgstr "Database:"
+
+#: page.cidlookup.php:172
+msgid "Database name"
+msgstr "Nome Database"
+
+#: page.cidlookup.php:176
+msgid ""
+"Query, special token '[NUMBER]' will be replaced with caller number<br/>e."
+"g.: SELECT name FROM phonebook WHERE number LIKE '%[NUMBER]%'"
+msgstr "Query, il campo speciale '[NUMBER]' sarà sostituito dal numero di telefono<br/>e.s.: SELECT name FROM phonebook WHERE number LIKE '%[NUMBER]%'"
+
+#: page.cidlookup.php:181
+msgid "MySQL Username"
+msgstr "Nome utente MySQL"
+
+#: page.cidlookup.php:185
+msgid "MySQL Password"
+msgstr "Password MySQL"
+
+#: page.cidlookup.php:196
+msgid "SugarCRM"
+msgstr "SugarCRM"
+
+msgid "Submit Changes"
+msgstr "Applica"
+
+msgid "Not yet implemented"
+msgstr "Non ancora implementato"
+
+msgid "Internal"
+msgstr "Interno"

Modified: freepbx-modules/trunk/modules/cidlookup/install.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/cidlookup/install.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/cidlookup/install.php (original)
+++ freepbx-modules/trunk/modules/cidlookup/install.php Sun May 18 19:52:05 2008
@@ -2,6 +2,18 @@
 
 global $db;
 global $amp_conf;
+
+if (! function_exists("out")) {
+	function out($text) {
+		echo $text."<br />";
+	}
+}
+
+if (! function_exists("outn")) {
+	function outn($text) {
+		echo $text;
+	}
+}
 
 $autoincrement = (($amp_conf["AMPDBENGINE"] == "sqlite") || ($amp_conf["AMPDBENGINE"] == "sqlite3")) ? "AUTOINCREMENT":"AUTO_INCREMENT";
 
@@ -33,8 +45,7 @@
 $sql = "CREATE TABLE IF NOT EXISTS cidlookup_incoming (
 	cidlookup_id INT NOT NULL,
 	extension VARCHAR(50),
-	cidnum VARCHAR(30),
-	channel VARCHAR(30)
+	cidnum VARCHAR(30)
 );";
 $check = $db->query($sql);
 if (DB::IsError($check)) {
@@ -64,6 +75,29 @@
 	}
 }
 
+outn("Migrating channel routing to Zap DID routing..");
+$sql = "SELECT channel FROM cidlookup_incoming";
+$check = $db->query($sql);
+if (!DB::IsError($check)) {
+	$chan_prefix = 'zapchan';
+	$sql = "UPDATE cidlookup_incoming SET extension=CONCAT('$chan_prefix',channel), channel='' WHERE channel != ''";
+	$results = $db->query($sql);
+	if (DB::IsError($results)) { 
+ 		out("FATAL: failed to transform old routes: ".$results->getMessage());
+	} else {
+		out("OK");
+		outn("Removing deprecated channel field from incoming..");
+		$sql = "ALTER TABLE cidlookup_incoming DROP channel";
+		$results = $db->query($sql);
+		if (DB::IsError($results)) { 
+ 			out("ERROR: failed: ".$results->getMessage());
+		} else {
+			out("OK");
+		}
+	}
+} else {
+	out("Not Needed");
+}
 
 ?>
 

Modified: freepbx-modules/trunk/modules/cidlookup/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/cidlookup/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/cidlookup/module.xml (original)
+++ freepbx-modules/trunk/modules/cidlookup/module.xml Sun May 18 19:52:05 2008
@@ -1,7 +1,7 @@
 <module>
 	<rawname>cidlookup</rawname>
 	<name>Caller ID Lookup</name>
-	<version>1.2.1.3</version>
+	<version>2.4.0.1</version>
 	<description>Allows Caller ID Lookup of incoming calls against different sources (MySQL, HTTP, ENUM, Phonebook Module)</description>
 	<type>setup</type>
 	<category>Inbound Call Control</category>
@@ -11,9 +11,11 @@
 	<depends>
 		<engine>asterisk 1.2</engine>
 	</depends>
-	<location>release/2.3/cidlookup-1.2.1.2.tgz</location>
-	<md5sum>3c633027d46dbd51e66c67401839af77</md5sum>
+	<location>release/2.4/cidlookup-2.4.0.tgz</location>
+	<md5sum>9a8abe97ebe61961ab53d7c378557ab5</md5sum>
 	<changelog>
+		*2.4.0.1* #2541 migrate from channel routing and re-enable functionality
+		*2.4.0* it translations, bump for 2.4
 		*1.2.1.3* #2172 deprecated use of |, changed categories
 		*1.2.1.2* bump for rc1
 		*1.2.1.1* shorten menu name

Modified: freepbx-modules/trunk/modules/conferences/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/conferences/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/conferences/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/conferences/functions.inc.php Sun May 18 19:52:05 2008
@@ -1,4 +1,4 @@
-<?php /* $Id: functions.inc.php 5208 2007-11-04 17:19:18Z p_lindheimer $ */
+<?php /* $Id: functions.inc.php 5280 2007-11-25 08:05:56Z p_lindheimer $ */
 
 // extend extensions class.
 // This example is about as simple as it gets
@@ -38,6 +38,29 @@
 	}
 }
 
+function conferences_getdest($exten) {
+	return array('ext-meetme,'.$exten.',1');
+}
+
+function conferences_getdestinfo($dest) {
+	global $active_modules;
+
+	if (substr(trim($dest),0,11) == 'ext-meetme,') {
+		$exten = explode(',',$dest);
+		$exten = $exten[1];
+		$thisexten = conferences_get($exten);
+		if (empty($thisexten)) {
+			return array();
+		} else {
+			//$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup';
+			return array('description' => 'Conference Room '.$exten.': '.$thisexten['description'],
+			             'edit_url' => 'config.php?display=conferences&extdisplay='.urlencode($exten),
+								  );
+		}
+	} else {
+		return false;
+	}
+}
 
 /* 	Generates dialplan for conferences
 	We call this with retrieve_conf
@@ -124,6 +147,27 @@
 	}
 }
 
+function conferences_check_extensions($exten=true) {
+	$extenlist = array();
+	if (is_array($exten) && empty($exten)) {
+		return $extenlist;
+	}
+	$sql = "SELECT exten, description FROM meetme ";
+	if (is_array($exten)) {
+		$sql .= "WHERE exten in ('".implode("','",$exten)."')";
+	}
+	$sql .= " ORDER BY exten";
+	$results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
+
+	foreach ($results as $result) {
+		$thisexten = $result['exten'];
+		$extenlist[$thisexten]['description'] = _("Conference: ").$result['description'];
+		$extenlist[$thisexten]['status'] = 'INUSE';
+		$extenlist[$thisexten]['edit_url'] = 'config.php?display=conferences&extdisplay='.urlencode($thisexten);
+	}
+	return $extenlist;
+}
+
 //get the existing meetme extensions
 function conferences_list() {
 	$results = sql("SELECT exten,description FROM meetme ORDER BY exten","getAll",DB_FETCHMODE_ASSOC);
@@ -152,6 +196,7 @@
 }
 
 function conferences_add($account,$name,$userpin,$adminpin,$options,$joinmsg=null){
+	global $active_modules;
 	$results = sql("INSERT INTO meetme (exten,description,userpin,adminpin,options,joinmsg) values (\"$account\",\"$name\",\"$userpin\",\"$adminpin\",\"$options\",\"$joinmsg\")");
 }
 ?>

Added: freepbx-modules/trunk/modules/conferences/i18n/it_IT/LC_MESSAGES/conferences.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/conferences/i18n/it_IT/LC_MESSAGES/conferences.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/conferences/i18n/it_IT/LC_MESSAGES/conferences.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/conferences/i18n/it_IT/LC_MESSAGES/conferences.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/conferences/i18n/it_IT/LC_MESSAGES/conferences.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/conferences/i18n/it_IT/LC_MESSAGES/conferences.po (added)
+++ freepbx-modules/trunk/modules/conferences/i18n/it_IT/LC_MESSAGES/conferences.po Sun May 18 19:52:05 2008
@@ -1,0 +1,175 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-01-25 22:30+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: Italian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: page.conferences.php:22
+msgid "Warning! Extension"
+msgstr "Attenzione!"
+
+#: page.conferences.php:22
+msgid "is not allowed for your account."
+msgstr "Non hai i permessi."
+
+#: page.conferences.php:56 page.conferences.php:87 page.conferences.php:94
+msgid "Add Conference"
+msgstr "Aggiungi Conferenza"
+
+#: page.conferences.php:70
+msgid "Conference"
+msgstr "Conferenza"
+
+#: page.conferences.php:70
+msgid "deleted"
+msgstr "eliminata"
+
+#: page.conferences.php:84
+msgid "Conference:"
+msgstr "Conferenza:"
+
+#: page.conferences.php:85
+msgid "Delete Conference"
+msgstr "Elimina Conferenza"
+
+#: page.conferences.php:94
+msgid "Edit Conference"
+msgstr "Modifica Conferenza"
+
+#: page.conferences.php:99
+msgid "conference number:"
+msgstr "Conferenza numero:"
+
+#: page.conferences.php:99
+msgid "Use this number to dial into the conference."
+msgstr "Utilizzare questo numero per entrare nella conferenza."
+
+#: page.conferences.php:104
+msgid "conference name:"
+msgstr "Conferenza nome:"
+
+#: page.conferences.php:104
+msgid "Give this conference a brief name to help you identify it."
+msgstr "Dare alla conferenza un nome breve per una facile identificazione."
+
+#: page.conferences.php:108
+msgid "user PIN:"
+msgstr "PIN utente:"
+
+#: page.conferences.php:108
+msgid ""
+"You can require callers to enter a password before they can enter this "
+"conference.<br><br>This setting is optional.<br><br>If either PIN is "
+"entered, the user will be prompted to enter a PIN."
+msgstr "Si può richiedere ai chiamanti di digitare una password prima di entrare in conferenza.<br><br>Questa impostazione è opzionale.<br><br>Se nessun PIN è stato inserito il sistema richiederà di digitarlo."
+
+#: page.conferences.php:112
+msgid "admin PIN:"
+msgstr "PIN amministratore:"
+
+#: page.conferences.php:112
+msgid ""
+"Enter a PIN number for the admin user.<br><br>This setting is optional "
+"unless the 'leader wait' option is in use, then this PIN will identify the "
+"leader."
+msgstr "Inserire il numero PIN per l'utente amministratore.<br><br>Questa impostazione è opzionale fino a quando non si seleziona 'Attendere amministratore' che lo indentificherà tramite questo PIN."
+
+#: page.conferences.php:121
+msgid "Conference Options"
+msgstr "Opzioni Conferenza"
+
+#: page.conferences.php:124 page.conferences.php:142
+msgid "join message:"
+msgstr "Messaggio di ingresso:"
+
+#: page.conferences.php:124
+msgid ""
+"Message to be played to the caller before joining the conference.<br><br>To "
+"add additional recordings please use the \"System Recordings\" MENU to the "
+"left"
+msgstr "Selezionare il messaggio da riprodurre ai chiamanti prima di entrate in conferenza.<br><br>Bisogna installare e attivare il modulo \"Registrazioni di Sistema\" prima di modificare questa opzione."
+
+#: page.conferences.php:130
+msgid "None"
+msgstr "Nessuno"
+
+#: page.conferences.php:142
+msgid ""
+"Message to be played to the caller before joining the conference.<br><br>You "
+"must install and enable the \"Systems Recordings\" Module to edit this option"
+msgstr "Selezionare il messaggio da riprodurre ai chiamanti prima di entrate in conferenza.<br><br>Bisogna installare e attivare il modulo \"Registrazioni di Sistema\" prima di modificare questa opzione."
+
+#: page.conferences.php:152
+msgid "leader wait:"
+msgstr "Attendere l'amministratore:"
+
+#: page.conferences.php:152
+msgid ""
+"wait until the conference leader (admin user) arrives before starting the "
+"conference"
+msgstr "Attende l'arrivo dell'amministratore prima di iniziare la conferenza"
+
+#: page.conferences.php:157 page.conferences.php:169 page.conferences.php:181
+#: page.conferences.php:193 page.conferences.php:205 page.conferences.php:217
+msgid "No"
+msgstr "No"
+
+#: page.conferences.php:158 page.conferences.php:170 page.conferences.php:182
+#: page.conferences.php:194 page.conferences.php:206 page.conferences.php:218
+msgid "Yes"
+msgstr "Si"
+
+#: page.conferences.php:164
+msgid "quiet mode:"
+msgstr "Modalità silenziosa:"
+
+#: page.conferences.php:164
+msgid "quiet mode (do not play enter/leave sounds)"
+msgstr "Attiva la modalità silenziosa, non riproduce i suoni quando si entra o esce dalla conferenza"
+
+#: page.conferences.php:176
+msgid "user count:"
+msgstr "Conteggio utente:"
+
+#: page.conferences.php:176
+msgid "announce user(s) count on joining conference"
+msgstr "Annuncia il conteggio degli utenti quando entrano in conferenza"
+
+#: page.conferences.php:188
+msgid "user join/leave:"
+msgstr "Ingresso/uscita utenti:"
+
+#: page.conferences.php:188
+msgid "announce user join/leave"
+msgstr "Annucia l'ingresso/uscita degli utenti"
+
+#: page.conferences.php:200
+msgid "music on hold:"
+msgstr "Musica di Attesa"
+
+#: page.conferences.php:200
+msgid "enable music on hold when the conference has a single caller"
+msgstr "Attiva la Musica di Attesa quando c'è solo un utente nella conferenza"
+
+#: page.conferences.php:212
+msgid "allow menu:"
+msgstr "Permetti menu:"
+
+#: page.conferences.php:212
+msgid "present menu (user or admin) when '*' is received ('send' to menu)"
+msgstr "Presenta il menu (utente o amministratore) quando si preme '*' ('invia' al menu)"
+
+msgid "Submit Changes"
+msgstr "Applica"

Modified: freepbx-modules/trunk/modules/conferences/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/conferences/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/conferences/module.xml (original)
+++ freepbx-modules/trunk/modules/conferences/module.xml Sun May 18 19:52:05 2008
@@ -1,11 +1,13 @@
 <module>
 	<rawname>conferences</rawname>
 	<name>Conferences</name>
-	<version>1.2.2</version>
+	<version>2.4.0.1</version>
 	<type>setup</type>
 	<category>Internal Options &amp; Configuration</category>
 	<description>Allow creation of conference rooms (meet-me) where multiple people can talk together.</description>
 	<changelog>
+		*2.4.0.1* added depends on 2.4.0
+		*2.4.0* #2158 add recording option, add support for Extension and Destination Registries, it translations
 		*1.2.2* don't ask for name confirmation when recording names on Asterisk 1.3 (new option I replaces i)
 		*1.2.1.3* move Macro(user-callerid) to be called with each conf to accomodate future language settings
 		*1.2.1.2* add call to Macro(user-callerid) to get proper CID in Meetme Conference
@@ -16,9 +18,12 @@
 		*1.1.1* Updated for 2.2.0RC1
 		*1.1* First release for FreePBX 2.2 - Fixed compatibility issue with new UI
 	</changelog>
+	<depends>
+		<version>2.4.0</version>
+	</depends>
 	<menuitems>
 		<conferences>Conferences</conferences>
 	</menuitems>
-	<location>release/2.3/conferences-1.2.1.3.tgz</location>
-	<md5sum>1e7b8b1f9832b1f1cc54455f8bc953c3</md5sum>
+	<location>release/2.4/conferences-2.4.0.tgz</location>
+	<md5sum>11bbe8b3984fa45640e614801bf1200e</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/conferences/page.conferences.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/conferences/page.conferences.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/conferences/page.conferences.php (original)
+++ freepbx-modules/trunk/modules/conferences/page.conferences.php Sun May 18 19:52:05 2008
@@ -1,4 +1,4 @@
-<?php /* $Id: page.conferences.php 3204 2006-11-27 06:30:26Z gregmac $ */
+<?php /* $Id: page.conferences.php 5309 2007-11-28 02:43:06Z p_lindheimer $ */
 //Copyright (C) 2004 Coalescent Systems Inc. (info at coalescentsystems.ca)
 //
 //This program is free software; you can redistribute it and/or
@@ -25,9 +25,15 @@
 	//if submitting form, update database
 	switch ($action) {
 		case "add":
-			conferences_add($_REQUEST['account'],$_REQUEST['name'],$_REQUEST['userpin'],$_REQUEST['adminpin'],$_REQUEST['options'],$_REQUEST['joinmsg']);
-			needreload();
-			redirect_standard();
+
+			$conflict_url = array();
+			$usage_arr = framework_check_extension_usage($account);
+			if (!empty($usage_arr)) {
+				$conflict_url = framework_display_extension_usage_alert($usage_arr);
+			} elseif (conferences_add($_REQUEST['account'],$_REQUEST['name'],$_REQUEST['userpin'],$_REQUEST['adminpin'],$_REQUEST['options'],$_REQUEST['joinmsg']) !== false) {
+				needreload();
+				redirect_standard();
+			}
 		break;
 		case "delete":
 			conferences_del($extdisplay);
@@ -78,14 +84,25 @@
 
 	$delURL = $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'].'&action=delete';
 ?>
-
-	
 <?php		if ($extdisplay){ ?>
 	<h2><?php echo _("Conference:")." ". $extdisplay; ?></h2>
-	<p><a href="<?php echo $delURL ?>"><?php echo _("Delete Conference")?> <?php echo $extdisplay; ?></a></p>
+	<a href="<?php echo $delURL ?>"><?php echo _("Delete Conference")?> <?php echo $extdisplay; ?></a><br />
+<?php
+					$usage_list = framework_display_destination_usage(conferences_getdest($extdisplay));
+					if (!empty($usage_list)) {
+?>
+						<a href="#" class="info"><?php echo $usage_list['text']?>:<span><?php echo $usage_list['tooltip']?></span></a>
+<?php
+					}
+?>
+
 <?php		} else { ?>
 	<h2><?php echo _("Add Conference"); ?></h2>
 <?php		}
+				if (!empty($conflict_url)) {
+					echo "<h5>"._("Conflicting Extensions")."</h5>";
+					echo implode('<br .>',$conflict_url);
+				}
 ?>
 	<form autocomplete="off" name="editMM" action="<?php $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return checkConf();">
 	<input type="hidden" name="display" value="<?php echo $dispnum?>">
@@ -96,20 +113,20 @@
 <?php		if ($extdisplay){ ?>
 		<input type="hidden" name="account" value="<?php echo $extdisplay; ?>">
 <?php		} else { ?>
-		<td><a href="#" class="info"><?php echo _("conference number:")?><span><?php echo _("Use this number to dial into the conference.")?></span></a></td>
+		<td><a href="#" class="info"><?php echo _("Conference Number:")?><span><?php echo _("Use this number to dial into the conference.")?></span></a></td>
 		<td><input type="text" name="account" value=""></td>
 <?php		} ?>
 	</tr>
 	<tr>
-		<td><a href="#" class="info"><?php echo _("conference name:")?><span><?php echo _("Give this conference a brief name to help you identify it.")?></span></a></td>
+		<td><a href="#" class="info"><?php echo _("Conference Name:")?><span><?php echo _("Give this conference a brief name to help you identify it.")?></span></a></td>
 		<td><input type="text" name="name" value="<?php echo (isset($description) ? $description : ''); ?>"></td>
 	</tr>
 	<tr>
-		<td><a href="#" class="info"><?php echo _("user PIN:")?><span><?php echo _("You can require callers to enter a password before they can enter this conference.<br><br>This setting is optional.<br><br>If either PIN is entered, the user will be prompted to enter a PIN.")?></span></a></td>
+		<td><a href="#" class="info"><?php echo _("User PIN:")?><span><?php echo _("You can require callers to enter a password before they can enter this conference.<br><br>This setting is optional.<br><br>If either PIN is entered, the user will be prompted to enter a PIN.")?></span></a></td>
 		<td><input size="8" type="text" name="userpin" value="<?php echo (isset($userpin) ? $userpin : ''); ?>"></td>
 	</tr>
 	<tr>
-		<td><a href="#" class="info"><?php echo _("admin PIN:")?><span><?php echo _("Enter a PIN number for the admin user.<br><br>This setting is optional unless the 'leader wait' option is in use, then this PIN will identify the leader.")?></span></a></td>
+		<td><a href="#" class="info"><?php echo _("Admin PIN:")?><span><?php echo _("Enter a PIN number for the admin user.<br><br>This setting is optional unless the 'leader wait' option is in use, then this PIN will identify the leader.")?></span></a></td>
 		<td><input size="8" type="text" name="adminpin" value="<?php echo (isset($adminpin) ? $adminpin : ''); ?>"></td>
 	</tr>
 
@@ -121,7 +138,7 @@
 	<tr><td colspan="2"><br><h5><?php echo _("Conference Options")?><hr></h5></td></tr>
 <?php if(function_exists('recordings_list')) { //only include if recordings is enabled?>
 	<tr>
-		<td><a href="#" class="info"><?php echo _("join message:")?><span><?php echo _("Message to be played to the caller before joining the conference.<br><br>To add additional recordings please use the \"System Recordings\" MENU to the left")?></span></a></td>
+		<td><a href="#" class="info"><?php echo _("Join Message:")?><span><?php echo _("Message to be played to the caller before joining the conference.<br><br>To add additional recordings please use the \"System Recordings\" MENU to the left")?></span></a></td>
 		<td>
 			<select name="joinmsg"/>
 			<?php
@@ -139,7 +156,7 @@
 	</tr>
 <?php }	else { ?>
 	<tr>
-		<td><a href="#" class="info"><?php echo _("join message:")?><span><?php echo _("Message to be played to the caller before joining the conference.<br><br>You must install and enable the \"Systems Recordings\" Module to edit this option")?></span></a></td>
+		<td><a href="#" class="info"><?php echo _("Join Message:")?><span><?php echo _("Message to be played to the caller before joining the conference.<br><br>You must install and enable the \"Systems Recordings\" Module to edit this option")?></span></a></td>
 		<td>
 			<?php
 				$default = (isset($joinmsg) ? $joinmsg : '');
@@ -149,7 +166,7 @@
 	</tr>
 <?php } ?>
 	<tr>
-		<td><a href="#" class="info"><?php echo _("leader wait:")?><span><?php echo _("wait until the conference leader (admin user) arrives before starting the conference")?></span></a></td>
+		<td><a href="#" class="info"><?php echo _("Leader Wait:")?><span><?php echo _("wait until the conference leader (admin user) arrives before starting the conference")?></span></a></td>
 		<td>
 			<select name="opt#w">
 			<?php
@@ -161,7 +178,7 @@
 		</td>
 	</tr>
 	<tr>
-		<td><a href="#" class="info"><?php echo _("quiet mode:")?><span><?php echo _("quiet mode (do not play enter/leave sounds)")?></span></a></td>
+		<td><a href="#" class="info"><?php echo _("Quiet Mode:")?><span><?php echo _("quiet mode (do not play enter/leave sounds)")?></span></a></td>
 		<td>
 			<select name="opt#q">
 			<?php
@@ -173,7 +190,7 @@
 		</td>
 	</tr>
 	<tr>
-		<td><a href="#" class="info"><?php echo _("user count:")?><span><?php echo _("announce user(s) count on joining conference")?></span></a></td>
+		<td><a href="#" class="info"><?php echo _("User Count:")?><span><?php echo _("announce user(s) count on joining conference")?></span></a></td>
 		<td>
 			<select name="opt#c">
 			<?php
@@ -185,7 +202,7 @@
 		</td>
 	</tr>
 	<tr>
-		<td><a href="#" class="info"><?php echo _("user join/leave:")?><span><?php echo _("announce user join/leave")?></span></a></td>
+		<td><a href="#" class="info"><?php echo _("User join/leave:")?><span><?php echo _("announce user join/leave")?></span></a></td>
 		<td>
 			<select name="opt#i">
 			<?php
@@ -197,7 +214,7 @@
 		</td>
 	</tr>
 	<tr>
-		<td><a href="#" class="info"><?php echo _("music on hold:")?><span><?php echo _("enable music on hold when the conference has a single caller")?></span></a></td>
+		<td><a href="#" class="info"><?php echo _("Music on Hold:")?><span><?php echo _("enable music on hold when the conference has a single caller")?></span></a></td>
 		<td>
 			<select name="opt#M">
 			<?php
@@ -209,7 +226,7 @@
 		</td>
 	</tr>
 	<tr>
-		<td><a href="#" class="info"><?php echo _("allow menu:")?><span><?php echo _("present menu (user or admin) when '*' is received ('send' to menu)")?></span></a></td>
+		<td><a href="#" class="info"><?php echo _("Allow Menu:")?><span><?php echo _("present menu (user or admin) when '*' is received ('send' to menu)")?></span></a></td>
 		<td>
 			<select name="opt#s">
 			<?php
@@ -221,7 +238,19 @@
 		</td>
 	</tr>
 
-	
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Record Conference:")?><span><?php echo _("record the conference call")?></span></a></td>
+		<td>
+			<select name="opt#r">
+				<?php
+				$optselect = strpos($options, "r");
+				echo '<option value=""' . ($optselect === false ? ' SELECTED' : '') . '>'._("No") . '</option>';
+ 				echo '<option value="r"'. ($optselect !== false ? ' SELECTED' : '') . '>'._("Yes"). '</option>';
+				?>
+			</select>
+		</td>
+	</tr>
+
 	<tr>
 		<td colspan="2"><br><h6><input name="Submit" type="submit" value="<?php echo _("Submit Changes")?>"></h6></td>		
 	</tr>

Modified: freepbx-modules/trunk/modules/core/agi-bin/dialparties.agi
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/core/agi-bin/dialparties.agi?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/core/agi-bin/dialparties.agi (original)
+++ freepbx-modules/trunk/modules/core/agi-bin/dialparties.agi Sun May 18 19:52:05 2008
@@ -48,6 +48,10 @@
 $ampmgruser  = get_var( $AGI, "AMPMGRUSER" );
 $ampmgrpass  = get_var( $AGI, "AMPMGRPASS" );
 $cwinusebusy = get_var( $AGI, "CWINUSEBUSY" );
+$ast_version = get_var( $AGI, "ASTVERSION" );
+
+$cwignore    = get_var( $AGI, "CWIGNORE" );
+$cwignore    = strtoupper(trim($cwignore));
 
 $astman = new AGI_AsteriskManager( );	
 if (!$astman->connect("127.0.0.1", $ampmgruser , $ampmgrpass)) {
@@ -72,6 +76,7 @@
 $timer		= get_var( $AGI, "ARG1" );
 $dialopts	= get_var( $AGI, "ARG2" );
 $rgmethod	= get_var( $AGI, "RingGroupMethod" );
+$rgmethod = trim($rgmethod);
 
 $alertinfo = get_var( $AGI, "ALERT_INFO" );
 if ($alertinfo) {
@@ -86,30 +91,31 @@
 	$AGI->exec_sipaddheader($fields[0], $fields[1]);
 }
 
-/* TODO: this does not work but should, moved to macro-dial for now
- *
-$mohclass = get_var( $AGI, "MOHCLASS" );
-if ($mohclass) {
-	debug("Setting MoH Class:  $mohclass", 4);
-	$AGI->set_music(true, $mohclass);						
-}
- */
-
 $pr_dialstatus	= get_var( $AGI, "PR_DIALSTATUS" );
 
 $fmgrp  = get_var( $AGI, "FMGRP" );
 $nodest	= get_var( $AGI, "NODEST" );
-if (empty($nodest))	$nodest	= '';
+if (empty($nodest)) {
+	$nodest	= '';
+}
 
 $ringgroup_index	= get_var( $AGI, "RINGGROUP_INDEX" );
 $use_confirmation	= get_var( $AGI, "USE_CONFIRMATION" );
-if (empty($use_confirmation))	$use_confirmation = "FALSE";
+if (empty($use_confirmation)) {
+	$use_confirmation = "FALSE";
+}
 debug("USE_CONFIRMATION:  '$use_confirmation'", 5);
 debug("RINGGROUP_INDEX:   '$ringgroup_index'", 5);
 
-if (empty($timer))	$timer		= 0;
-if (empty($dialopts))	$dialopts	= "";
-if (empty($rgmethod))	$rgmethod	= "none";
+if (empty($timer)) {
+	$timer		= 0;
+}
+if (empty($dialopts)) {	
+	$dialopts	= "";
+}
+if (empty($rgmethod)) {
+	$rgmethod	= "none";
+}
 
 debug("Methodology of ring is  '$rgmethod'", 1);
 
@@ -145,7 +151,7 @@
 // Keep this code after the matermode check above, since they will at least get mastermode
 // if they set a -prim mode in one of the others
 //
-if ( ($use_confirmation != "FALSE") && (trim($rgmethod) != "ringall") && (trim($rgmethod) != "ringallv2") ) {
+if ( ($use_confirmation != "FALSE") && ($rgmethod != "ringall") && ($rgmethod != "ringallv2") && ($rgmethod != "hunt") ) {
 	debug("Unsupported RingMethod: '$rgmethod' resetting to ringall", 1);
 	$rgmethod	= "ringall";
 }
@@ -202,7 +208,7 @@
 			array_unshift($ext,$fmgrp);
 		}
 	}	else {
-		debug("extension not in group list, ringging only during perring time",4);
+		debug("extension not in group list, ringging only during prering time",4);
 		$fmgrp_realprering = $fmgrp_prering;
 		array_unshift($ext,$fmgrp);
 	}
@@ -218,9 +224,9 @@
 // If call forward is enabled, we use chan_local
 // Hacky. We should be using an associative array, shouldn't we?
 $count = 0;
-foreach( $ext as $k) {
-	$cf  = $AGI->database_get('CF',$k);
-	$cf  = $cf['data'];
+foreach ($ext as $k) {
+	$cf = $AGI->database_get('CF',$k);
+	$cf = $cf['data'];
 	if (strlen($cf)) {
 		// append a hash sign so we can send out on chan_local below.
 		$ext[$count] = $cf.'#';  
@@ -300,8 +306,19 @@
 	if ($dndprimary == 0) {
 		// TODO what are these comments...? do we need to remove them...?
 		$extnum    = $k;
-		$exthascw  = $AGI->database_get('CW', $extnum);// ? 1 : 0;
-		$exthascw  = $exthascw['data']? 1:0;
+
+		// CWIGNORE is sent down the channel when all extensions should be treated as if they do not have
+		// call waiting enabled. This is used primarily by Queue type setups (sometimes Ring Groups) when
+		// you want to assure that calls go on to the next agent if the current one is on the phone instead
+		// of ringing their line constantly.
+		//
+		if ($cwignore) {
+			$exthascw  = 0;
+		} else {
+			$exthascw  = $AGI->database_get('CW', $extnum);// ? 1 : 0;
+			$exthascw  = $exthascw['data']? 1:0;
+		}
+
 		$extcfb    = $AGI->database_get('CFB', $extnum);//? 1 : 0;
 		$extcfb    = $extcfb['data'];
 		$exthascfb = (strlen($extcfb) > 0) ? 1 : 0;
@@ -441,10 +458,18 @@
 	}
 } // end foreach ( $ext as $k )
 
+$dial_filtered = implode('-',array_keys($dsarray));
+$AGI->set_variable('FILTERED_DIAL',$dial_filtered);
+debug("Filtered ARG3: $dial_filtered", 3);
+
 $dshunt		= '';
 $loops		= 0;
 $myhuntmember	= "";
 
+/** Here we setup the Channel Variables that are used to do the dialing, in all cases you will have:
+ *  ${HuntMembers} set to the number of phones to ring
+ *  ${HuntMemberN} set to the dial pattern that should be dialed. (N is 0, 1, 2 etc.)
+ */
 if (($rgmethod == "hunt") || ($rgmethod == "memoryhunt") || ($rgmethod == "firstavailable") || ($rgmethod == "firstnotonphone")) {
 	if ($cidnum) {
 		$AGI->set_variable('CALLTRACE_HUNT',$cidnum);
@@ -557,24 +582,32 @@
 if (!strlen($ds)) {
 	$AGI->noop('');
 } else {
+	// Asterisk 1.6 uses , instead of | and 1.4 can't recieve a , in the ds.
+	//
+	if (version_compare($ast_version, "1.6", "ge")) { 
+		$ds_seperator = ',';
+	} else {
+		$ds_seperator = '|';
+	}
+	
 	if (($rgmethod == "hunt") || ($rgmethod == "memoryhunt") || ($rgmethod == "firstavailable") || ($rgmethod == "firstnotonphone")) {
-		$ds = '|';
+		$ds = $ds_seperator;
 		if ($timer) {
 			$ds .= $timer;
 		}
-		$ds .= '|' . $dialopts; // pound to transfer, provide ringing
+		$ds .= $ds_seperator . $dialopts; // pound to transfer, provide ringing
 		$AGI->set_variable('ds',$ds);
 		$AGI->set_variable("HuntMembers",$loops);
-		$AGI->set_priority(20); // dial command is at priority 20 where dialplan handles calling a ringgroup with strategy of "hunt" or "MemoryHunt"
+		$AGI->set_priority("huntdial"); // dial command was at priority 20 where dialplan handles calling a ringgroup with strategy of "hunt" or "MemoryHunt"
 	} else {
-		$ds .= '|';
+		$ds .= $ds_seperator;
 		if ($timer) {
 			$ds .= $timer;
 			if (trim($use_confirmation) != "FALSE") {
 				$AGI->set_variable('__RT',$timer);
 			}
 		}
-		$ds .= '|' . $dialopts; // pound to transfer, provide ringing
+		$ds .= $ds_seperator . $dialopts; // pound to transfer, provide ringing
 		if (trim($use_confirmation) != "FALSE") {
 			$AGI->set_variable('__RG_IDX',$ringgroup_index);
 			if ( isset($cidnum) && is_numeric($cidnum) ) {
@@ -584,7 +617,7 @@
 			}
 		}
 		$AGI->set_variable('ds',$ds);
-		$AGI->set_priority(10); // dial command is at priority 10
+		$AGI->set_priority("normdial"); // dial command was at priority 10
 	}
 }
 

Modified: freepbx-modules/trunk/modules/core/agi-bin/fixlocalprefix
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/core/agi-bin/fixlocalprefix?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/core/agi-bin/fixlocalprefix (original)
+++ freepbx-modules/trunk/modules/core/agi-bin/fixlocalprefix Sun May 18 19:52:05 2008
@@ -147,14 +147,14 @@
 
 	$agi->verbose('Using pattern '.$regex, 4);
 	// attempt to grab the pieces of the pattern
-	if (preg_match('/^(([0-9XNZwW#*\.\[\]\-]+)\|)?(([0-9XNZwW#*\.\[\]\-]+)\+)?([0-9XNZwW#*\.\[\]\-]+)$/', $regex, $matches)) {
+	if (preg_match('/^(([0-9XNZwW#*\.\[\]\-]+)\|)?(([0-9XNZwW#*\.\[\]\-]+)\+)?([0-9XNZwW#*\.\[\]\-]*)$/', $regex, $matches)) {
 		// one of NXXXXXX, 613|NXXXXXX   1+NXXXXXX    613|1+NXXXXXX,  
 		// matches[2] = drop (eg 613),  matches[4] = prefix (eg 1),  matches[5] = rest of number (eg NXXXXX)
 		
 		$drop = $matches[2];
 		$prefix = $matches[4];
 		$static = $matches[5];
-	} else if (preg_match('/^(([0-9XNZwW#*\.\[\]\-]+)\+)?(([0-9XNZwW#*\.\[\]\-]+)\|)?([0-9XNZwW#*\.\[\]\-]+)$/', $regex, $matches)) {
+	} else if (preg_match('/^(([0-9XNZwW#*\.\[\]\-]+)\+)?(([0-9XNZwW#*\.\[\]\-]+)\|)?([0-9XNZwW#*\.\[\]\-]*)$/', $regex, $matches)) {
 		// one of NXXXXXX,  613|NXXXXXX   1+NXXXXXX    1+613|NXXXXXX
 		// matches[2] = prefix (eg 1),  matches[4] = drop (eg 613),  matches[5] = rest of number (eg NXXXXX)
 		

Added: freepbx-modules/trunk/modules/core/agi-bin/user_login_out.agi
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/core/agi-bin/user_login_out.agi?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/core/agi-bin/user_login_out.agi (added)
+++ freepbx-modules/trunk/modules/core/agi-bin/user_login_out.agi Sun May 18 19:52:05 2008
@@ -1,0 +1,345 @@
+#!/usr/bin/php -q
+<?php
+
+	require_once "phpagi.php";
+	require_once "phpagi-asmanager.php";
+
+	/* Usage:
+	 *
+	 * AGI(user_login_out.agi,login|logout,[user])
+	 *
+	 * ARG1: action
+	 * ARG2: device
+	 * ARG3: user
+	 *
+	 * login:
+	 * Login the requested user and set hints appropriately as well as adjust
+	 * hints on any previous user that was logged in.
+	 *
+	 * logout:
+	 * Logout the current user and set hints appropriately for that user
+	 * as well as logging in the default user (if applicable) and set hints
+	 * accordingly
+	 */
+	
+	$agi = new AGI();
+
+	// get manager credentials out of the channel
+	//
+	$ampmgruser   = get_var( "AMPMGRUSER" );
+	$ampmgrpass   = get_var( "AMPMGRPASS" );
+	$astspooldir  = get_var( "ASTSPOOLDIR" );
+	/*
+	$ampmgruser  = 'admin';
+	$ampmgrpass  = 'amp111';
+	*/
+	$astman = new AGI_AsteriskManager( );	
+	if (!$astman->connect("127.0.0.1", $ampmgruser , $ampmgrpass)) {
+		exit (1);
+	}
+
+	$action      = get_action();
+	$this_device = get_this_device();
+
+	switch ($action) {
+		case 'login':
+		case 'logon':
+			$new_user = get_login_user();
+			debug("Logging in user $new_user to device $this_device");
+			user_login($this_device, $new_user);
+			break;
+		case 'logout':
+			debug("Logging out current user from device $this_device");
+			user_logout($this_device);
+			break;
+		default:
+			debug("Got unknown action: $action, exiting");
+	}
+	exit;
+
+	/*
+exten => s,n,System(rm -f ${ASTSPOOLDIR}/voicemail/device/${CALLERID(number)})
+exten => s,n,System(/bin/ln -s ${ASTSPOOLDIR}/voicemail/${DB(AMPUSER/${AMPUSER}/voicemail)}/${AMPUSER}/ ${ASTSPOOLDIR}/voicemail/device/${CALLERID(number)})
+*/
+
+
+	// Get the requested action (login or logout)
+	//
+	function get_action() {
+		global $argv;
+		return strtolower(trim($argv['1']));
+		//return get_var('ARG1');
+	}
+
+	// Get the device passed in (basically CID)
+	//
+	function get_this_device() {
+		global $argv;
+		return trim($argv['2']);
+		//return get_var('ARG2');
+	}
+
+	// Get the user to login to a device
+	//
+	function get_login_user() {
+		global $argv;
+		return trim($argv['3']);
+		//return get_var('ARG3');
+	}
+
+	// Login a new user to a device. If there is a current user
+	// log them out first.
+	//
+	function user_login($this_device, $new_user) {
+		debug("user_login: this_device: $this_device, new_user: $new_user",8);
+
+		$current_user = get_logged_in_user($this_device);
+		if ($current_user != $new_user) {
+			if ($current_user != '') {
+				debug("Logging out current user $current_user from device $this_device so $new_user can login",5);
+				remove_user($this_device);
+			}
+			insert_user($new_user, $this_device);
+		} else {
+			debug("User $new_user is already logged into device $this_device",5);
+		}
+	}
+
+	// Logout the current user. If device has a default user, log
+	// them in.
+	//
+	function user_logout($this_device) {
+		debug("user_logout: this_device: $this_device",8);
+
+		$current_user = get_logged_in_user($this_device);
+		$default_user = get_default_user($this_device);
+
+		debug("current_user: $current_user, default_user: $default_user",8);
+
+		if ($current_user != $default_user) {
+			remove_user($this_device);
+			if ($default_user != '') {
+				debug("Logging in default user $default_user to device $this_device",5);
+				insert_user($default_user, $this_device);
+			}
+		}
+	}
+
+	// Insert a specificed user into a specified device and then
+	// update the hint for that user to reflect the new device(s)
+	// and update the voicemial link
+	//
+	function insert_user($user, $device) {
+		debug("insert_user: user: $user, device: $device",8);
+		global $agi;
+		global $astspooldir;
+
+		set_device_user($device, $user);
+		$previous_devices = get_devices($user);
+		$new_devices = insert_device($previous_devices,$device);
+		debug("insert_user: Setting user $user to devices $new_devices",5);
+		set_user_devices($user, $new_devices);
+		set_hint($user, $new_devices);
+		$vmcontext = get_voicemail_context($user);
+		if ($vmcontext != 'novm') {
+			exec("/bin/ln -s {$astspooldir}/voicemail/{$vmcontext}/{$user}/ {$astspooldir}/voicemail/device/$device", $output, $ret);
+			if ($ret) {
+				debug("Got Return code: $ret trying to: /bin/ln -s {$astspooldir}/voicemail/{$vmcontext}/{$user}/ {$astspooldir}/voicemail/device/$device",5);
+			}
+		}
+	}
+
+	// Remove the current user from a device and then update
+	// the hint of that current user to reflect their current devices
+	//
+	function remove_user($device) {
+		debug("remove_user: device: $device",8);
+		global $agi;
+		global $astspooldir;
+
+		$current_user = get_user($device);
+		if ($current_user != '') {
+			$current_devices = get_devices($current_user);
+			$new_devices = remove_device($current_devices,$device);
+			debug("remove_user: Setting user $current_user to devices $new_devices",5);
+			set_user_devices($current_user, $new_devices);
+			set_hint($current_user, $new_devices);
+			exec("/bin/rm -f {$astspooldir}/voicemail/device/$device",$output, $ret);
+			if ($ret) {
+				debug("Got Return code: $ret trying to remove: {$astspooldir}/voicemail/device/$device",5);
+			}
+			set_device_user($device, 'none');
+		}
+	}
+
+	// Set the hint for a user based on the devices in their AMPUSER object
+	//
+	function set_hint($user, $devices) {
+		debug("set_hint: user: $user, devices: $devices",8);
+		global $astman;
+		global $agi;
+
+		if ($devices) {
+			$dial_string = get_dial_string($devices);
+			debug("Setting user $user hint to $dial_string",5);
+			$response = $astman->send_request('Command',array('Command'=>"add extension {$user},hint,{$dial_string} into ext-local replace"));
+		} else {
+			debug("Removing hint for user $user",5);
+			$response = $astman->send_request('Command',array('Command'=>"remove extension {$user}@ext-local hint"));
+		}
+	}
+
+	// Get the actual technology dialstrings from the DEVICE objects (used
+	// to create proper hints)
+	//
+	function get_dial_string($devices) {
+		debug("get_dial_string: devices: $devices",8);
+		global $agi;
+
+		$device_array = explode( '&', $devices );
+		foreach ($device_array as $adevice) {
+			$dds = $agi->database_get('DEVICE',$adevice.'/dial');
+			$dialstring .= $dds['data'].'&';
+		}
+		return trim($dialstring," &");
+	}
+
+	// Insert a new device into a devices string and return the new string
+	//
+	function insert_device($devices, $new_device) {
+		debug("insert_device: devices: $devices, new_device: $new_device",8);
+
+		// We could just append it but this assures no bugs duplicate the device
+		//
+		if (trim($new_device) != '') {
+			$device_arr = explode('&',$devices);
+			$device_arr[] = $new_device;
+			$device_arr = array_unique($device_arr);
+			return implode('&',$device_arr);
+		} else {
+			return $devices;
+		}
+	}
+
+	// Remove a new device from a devices string and return the new string
+	//
+	function remove_device($devices, $remove_device) {
+		debug("remove_device: devices: $devices, remove_device: $remove_device",8);
+
+		$device_arr = explode('&',$devices);
+		$device_arr_hash = array_flip($device_arr);
+		unset($device_arr_hash[$remove_device]);
+		$new_device_arr = array_flip($device_arr_hash);
+		$new_devices  = implode('&', $new_device_arr);
+		return $new_devices;
+	}
+
+	// Get the currently logged in user of a device returning blank
+	// in no logins
+	//
+	function get_logged_in_user($device) {
+		debug("get_logged_in_user: device: $device",8);
+		global $agi;
+
+		$user = $agi->database_get('DEVICE',$device.'/user');
+		if ($user['result'] == 1 && trim($user['data']) != 'none') {
+			debug("get_logged_in_user: got user: ".$user['data'],8);
+			return trim($user['data']);
+		}
+		return '';
+	}
+
+	// Get the designated default user for the device or blank if none
+	//
+	function get_default_user($device) {
+		debug("get_default_user: device: $device",8);
+		global $agi;
+
+		$default_user = $agi->database_get('DEVICE',$device.'/default_user');
+		if ($default_user['result'] == 1 && trim($default_user['data']) != 'none') {
+			return trim($default_user['data']);
+		}
+		return '';
+	}
+
+	// Get the list of current devices for this user
+	//
+	function get_devices($user) {
+		debug("get_devices: user: $user", 8);
+		global $agi;
+
+		$devices = $agi->database_get('AMPUSER',$user.'/device');
+		if ($devices['result'] == 1) {
+			debug("get_devices: got: ".$devices['data'], 8);
+			return trim($devices['data']);
+		}
+		return '';
+	}
+
+	// Get the voicemail context for this user
+	//
+	function get_voicemail_context($user) {
+		debug("get_voicemail_context: user: $user", 8);
+		global $agi;
+
+		$devices = $agi->database_get('AMPUSER',$user.'/voicemail');
+		if ($devices['result'] == 1) {
+			return trim($devices['data']);
+		}
+		return 'novm';
+	}
+
+	// Get the user currently associated with this device or blank if none
+	//
+	function get_user($device) {
+		debug("get_user: device: $device", 8);
+		global $agi;
+
+		$user = $agi->database_get('DEVICE',$device.'/user');
+		if ($user['result'] == 1 && trim($user['data']) != 'none') {
+			debug("get_user: got: ".$user['data'], 8);
+			return trim($user['data']);
+		}
+		debug("get_user: no user found", 8);
+		return '';
+	}
+
+	// Inserts device info into AMPUSER object for specificed user
+	//
+	function set_user_devices($user, $devices) {
+		debug("set_user_devices: user: $user,  devices: $devices", 8);
+		global $agi;
+		if (empty($devices)) {
+			debug("No more devices associated with $user, deletting /device key", 8);
+			$agi->database_del('AMPUSER',$user.'/device');
+		} else {
+			debug("set_user_devices: assigning $devices to $user /device key", 8);
+			$agi->database_put('AMPUSER',$user.'/device',$devices);
+		}
+	}
+
+	// Inserts user into DEVICE object for specified device
+	//
+	function set_device_user($device, $user) {
+		debug("set_device_user: device: $device,  user: $user", 8);
+		global $agi;
+		$agi->database_put('DEVICE',$device.'/user',$user);
+	}
+
+	// Get a channel variable
+	//
+	function get_var($value) {
+		global $agi;
+
+		$r = $agi->get_variable( $value );
+		if ($r['result'] == 1) {
+			$result = $r['data'];
+			return trim($result);
+		}
+		return '';
+	}
+
+	function debug($string, $level=3) {
+		global $agi;
+		$agi->verbose($string, $level);
+	}

Propchange: freepbx-modules/trunk/modules/core/agi-bin/user_login_out.agi
------------------------------------------------------------------------------
    svn:executable = *

Modified: freepbx-modules/trunk/modules/core/etc/extensions.conf
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/core/etc/extensions.conf?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/core/etc/extensions.conf (original)
+++ freepbx-modules/trunk/modules/core/etc/extensions.conf Sun May 18 19:52:05 2008
@@ -1,6 +1,10 @@
+; do not edit this file, this is an auto-generated file by freepbx
+; all modifications must be done from the web gui
+
 ; FreePBX
 ; Copyright (C) 2004 Coalescent Systems Inc (Canada)
 ; Copyright (C) 2006 Why Pay More 4 Less Pty Ltd (Australia)
+; Copyright (C) 2007 Astrogen LLC (USA)
 ; Released under the GNU GPL Licence version 2.
 
 ; dialparties.agi (http://www.sprackett.com/asterisk/)
@@ -34,8 +38,8 @@
 [from-pstn]
 include => from-pstn-custom                     ; create this context in extensions_custom.conf to include customizations
 include => ext-did
+include => from-did-direct		; MODIFICATOIN (PL) for findmefollow if enabled, should be bofore ext-local
 include => ext-did-catchall		; THIS MUST COME AFTER ext-did
-include => from-did-direct		; MODIFICATOIN (PL) for findmefollow if enabled, should be bofore ext-local
 exten => fax,1,Goto(ext-fax,in_fax,1)
 
 ; MODIFICATION (PL) 
@@ -62,40 +66,46 @@
 ;  Macro(dial,$DIAL_TIMER,$DIAL_OPTIONS,$EXT1,$EXT2,$EXT3,...)
 [macro-dial]
 exten => s,1,GotoIf($["${MOHCLASS}" = ""]?dial)
-exten => s,2,SetMusicOnHold(${MOHCLASS})
-exten => s,3(dial),AGI(dialparties.agi)
-exten => s,4,NoOp(Returned from dialparties with no extensions to call and DIALSTATUS: ${DIALSTATUS})
-
-exten => s,10,Dial(${ds})                               ; dialparties will set the priority to 10 if $ds is not null
-exten => s,11,Set(DIALSTATUS=${IF($["${DIALSTATUS_CW}"!="" ]?${DIALSTATUS_CW}:${DIALSTATUS})})
-
-exten => s,20,NoOp(Returned from dialparties with hunt groups to dial )
-exten => s,21,Set(HuntLoop=0)
-exten => s,22,GotoIf($[${HuntMembers} >= 1]?30 )  ; if this is from rg-group, don't strip prefix
-exten => s,23,NoOp(Returning there are no members left in the hunt group to ring)
-
-exten => s,30,Set(HuntMember=HuntMember${HuntLoop})
-exten => s,31,GotoIf($[$["${CALLTRACE_HUNT}" != "" ] & $["${RingGroupMethod}" = "hunt" ]]?32:35 )  ; Set CAll Trace for Hunt member we are going to call
-exten => s,32,Set(CT_EXTEN=${CUT(ARG3,,$[${HuntLoop} + 1])})
-exten => s,33,Set(DB(CALLTRACE/${CT_EXTEN})=${CALLTRACE_HUNT})
-exten => s,34,Goto(s,42)
-
-exten => s,35,GotoIf($[$["${CALLTRACE_HUNT}" != "" ] & $["${RingGroupMethod}" = "memoryhunt" ]]?36:50 )  ;Set Call Trace for each hunt member we are going to call "Memory groups have multiple members to set CALL TRACE For hence the loop
-exten => s,36,Set(CTLoop=0)
-exten => s,37,GotoIf($[${CTLoop} > ${HuntLoop}]?42 )  ; if this is from rg-group, don't strip prefix
-exten => s,38,Set(CT_EXTEN=${CUT(ARG3,,$[${CTLoop} + 1])})
-exten => s,39,Set(DB(CALLTRACE/${CT_EXTEN})=${CALLTRACE_HUNT})
-exten => s,40,Set(CTLoop=$[1 + ${CTLoop}])
-exten => s,41,Goto(s,37)
+exten => s,n,SetMusicOnHold(${MOHCLASS})
+exten => s,n(dial),AGI(dialparties.agi)
+exten => s,n,NoOp(Returned from dialparties with no extensions to call and DIALSTATUS: ${DIALSTATUS})
+
+exten => s,n+2(normdial),Dial(${ds})                               ; dialparties will set the priority to 10 if $ds is not null
+exten => s,n,Set(DIALSTATUS=${IF($["${DIALSTATUS_CW}"!="" ]?${DIALSTATUS_CW}:${DIALSTATUS})})
+
+exten => s,20(huntdial),NoOp(Returned from dialparties with hunt groups to dial )
+exten => s,n,Set(HuntLoop=0)
+exten => s,n(a22),GotoIf($[${HuntMembers} >= 1]?a30)  ; if this is from rg-group, don't strip prefix
+exten => s,n,NoOp(Returning there are no members left in the hunt group to ring)
+
+; dialparties.agi has setup the dialstring for each hunt member in a variable labeled HuntMember0, HuntMember1 etc for each iteration
+; and The total number in HuntMembers. So for each iteration, we will update the CALLTRACE Data.
+;
+exten => s,n+2(a30),Set(HuntMember=HuntMember${HuntLoop})
+exten => s,n,GotoIf($[$["${CALLTRACE_HUNT}" != "" ] & $["${RingGroupMethod}" = "hunt" ]]?a32:a35)
+exten => s,n(a32),Set(CT_EXTEN=${CUT(FILTERED_DIAL,,$[${HuntLoop} + 1])})
+exten => s,n,Set(DB(CALLTRACE/${CT_EXTEN})=${CALLTRACE_HUNT})
+exten => s,n,Goto(s,a42)
+
+;Set Call Trace for each hunt member we are going to call "Memory groups have multiple members to set CALL TRACE For hence the loop
+;
+exten => s,n(a35),GotoIf($[$["${CALLTRACE_HUNT}" != "" ] & $["${RingGroupMethod}" = "memoryhunt" ]]?a36:a50)  
+exten => s,n(a36),Set(CTLoop=0)
+exten => s,n(a37),GotoIf($[${CTLoop} > ${HuntLoop}]?a42)  ; if this is from rg-group, don't strip prefix
+exten => s,n,Set(CT_EXTEN=${CUT(FILTERED_DIAL,,$[${CTLoop} + 1])})
+exten => s,n,Set(DB(CALLTRACE/${CT_EXTEN})=${CALLTRACE_HUNT})
+exten => s,n,Set(CTLoop=$[1 + ${CTLoop}])
+exten => s,n,Goto(s,a37)
         
-exten => s,42,Dial(${${HuntMember}}${ds} ) ; dialparties will set the priority to 20 if $ds is not null and its a hunt group
-exten => s,43,Set(HuntLoop=$[1 + ${HuntLoop}])
-exten => s,44,GotoIf($[$[$["foo${RingGroupMethod}" != "foofirstavailable"] & $["foo${RingGroupMethod}" != "foofirstnotonphone"]] | $["foo${DialStatus}" = "fooBUSY"]]?46)
-exten => s,45,Set(HuntMembers=0)
-exten => s,46,Set(HuntMembers=$[${HuntMembers} - 1])
-exten => s,47,Goto(s,22)
-exten => s,50,DBdel(CALLTRACE/${CT_EXTEN})
-exten => s,51,Goto(s,42)
+exten => s,n(a42),Dial(${${HuntMember}}${ds})
+exten => s,n,Set(HuntLoop=$[1 + ${HuntLoop}])
+exten => s,n,GotoIf($[$[$["foo${RingGroupMethod}" != "foofirstavailable"] & $["foo${RingGroupMethod}" != "foofirstnotonphone"]] | $["foo${DialStatus}" = "fooBUSY"]]?a46)
+exten => s,n,Set(HuntMembers=0)
+exten => s,n(a46),Set(HuntMembers=$[${HuntMembers} - 1])
+exten => s,n,Goto(s,a22)
+
+exten => s,n(a50),DBdel(CALLTRACE/${CT_EXTEN})
+exten => s,n,Goto(s,a42)
 
 ; make sure hungup calls go here so that proper cleanup occurs from call confirmed calls and the like
 ;
@@ -266,6 +276,7 @@
 [macro-vm]
 ; ARG1 - extension
 ; ARG2 - DIRECTDIAL/BUSY
+; ARG3 - RETURN makes macro return, otherwise hangup
 exten => s,1,Macro(user-callerid,SKIPTTL)
 exten => s,n,Set(VMGAIN=${IF($["foo${VM_GAIN}"!="foo"]?"g(${VM_GAIN})":"")})
 ;
@@ -455,13 +466,18 @@
 exten => adef,n,Hangup
 
 exten => exit-FAILED,1,Playback(im-sorry&an-error-has-occured)
+exten => exit-FAILED,n,GotoIf($["${ARG3}" = "RETURN"]?exit-RETURN,1)
 exten => exit-FAILED,n,Hangup()
 
-exten => exit-SUCCESS,1,Playback(goodbye)
+exten => exit-SUCCESS,1,GotoIf($["${ARG3}" = "RETURN"]?exit-RETURN,1)
+exten => exit-SUCCESS,n,Playback(goodbye)
 exten => exit-SUCCESS,n,Hangup()
 
-exten => exit-USEREXIT,1,Playback(goodbye)
+exten => exit-USEREXIT,1,GotoIf($["${ARG3}" = "RETURN"]?exit-RETURN,1)
+exten => exit-USEREXIT,n,Playback(goodbye)
 exten => exit-USEREXIT,n,Hangup()
+
+exten => exit-RETURN,1,Noop(Returning From Voicemail because macro)
 
 exten => t,1,Hangup()
 ;------------------------------------------------------------------------
@@ -642,170 +658,6 @@
 ;                    if set to "BYPASS" then this trunk will be skipped
 ;
 
-
-; dialout using a trunk, using pattern matching (don't strip any prefix)
-; arg1 = trunk number, arg2 = number, arg3 = route password
-;
-; MODIFIED (PL)
-;
-; Modified both Dial() commands to include the new TRUNK_OPTIONS from the general
-; screen of AMP
-;
-[macro-dialout-trunk]
-exten => s,1,Set(DIAL_TRUNK=${ARG1})
-exten => s,n,Set(DIAL_NUMBER=${ARG2})
-exten => s,n,Set(ROUTE_PASSWD=${ARG3})
-
-exten => s,n,GotoIf($["${ROUTE_PASSWD}" = ""]?noauth) ; arg3 is pattern password
-exten => s,n(auth),Authenticate(${ROUTE_PASSWD})
-exten => s,n(noauth),GotoIf($["x${OUTDISABLE_${ARG1}}" = "xon"]?disabletrunk,1)
-
-; If NODEST is set, clear it. No point in remembering since dialout-trunk will just end in the
-; bit bucket. But if answered by an outside line with transfer capability, we want NODEST to be
-; clear so a subsequent transfer to an internal extension works and goes to voicmail or other
-; destinations.
-;
-exten => s,n,Set(_NODEST=)
-
-exten => s,n,Set(DIAL_TRUNK_OPTIONS=${DIAL_OPTIONS}) // will be reset to TRUNK_OPTIONS if not intra-company
-exten => s,n,Set(GROUP()=OUT_${DIAL_TRUNK})
-exten => s,n,Macro(user-callerid,SKIPTTL)
-exten => s,n,Macro(record-enable,${CALLERID(number)},OUT)
-exten => s,n,GotoIf($["${INTRACOMPANYROUTE}" = "YES"]?skipoutcid) ;Set to YES if treated like internal
-exten => s,n,Set(DIAL_TRUNK_OPTIONS=${TRUNK_OPTIONS})
-exten => s,n,Macro(outbound-callerid,${DIAL_TRUNK})
-exten => s,n(skipoutcid),GotoIf($["${OUTMAXCHANS_${DIAL_TRUNK}}foo" = "foo"]?nomax)
-exten => s,n(checkmax),GotoIf($[ ${GROUP_COUNT(OUT_${DIAL_TRUNK})} > ${OUTMAXCHANS_${DIAL_TRUNK}} ]?chanfull)
-exten => s,n(nomax),AGI(fixlocalprefix) ; this sets DIAL_NUMBER to the proper dial string for this trunk
-exten => s,n,Set(OUTNUM=${OUTPREFIX_${DIAL_TRUNK}}${DIAL_NUMBER}) ; OUTNUM is the final dial number
-exten => s,n,Set(custom=${CUT(OUT_${DIAL_TRUNK},:,1)}) ; Custom trunks are prefixed with "AMP:"
-
-; Back to normal processing, whether intracompany or not.
-; But add the macro-setmusic if we don't want music on this outbound call
-;
-exten => s,n,GotoIf($[$["${MOHCLASS}" = "default"] | $["foo${MOHCLASS}" = "foo"]]?gocall) ; Set to YES if we should pump silence
-exten => s,n,Set(DIAL_TRUNK_OPTIONS=M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS}) 	; set MoH or off
-
-; This macro call will always be blank and is provided as a hook for customization required prior to making a call
-; such as adding SIP header information or other requirements. All the channel variables from above are present
-;
-exten => s,n(gocall),Macro(dialout-trunk-predial-hook)
-exten => s,n,GotoIf($["${PREDIAL_HOOK_RET}" = "BYPASS"]?bypass,1)
-
-exten => s,n,GotoIf($["${custom}" = "AMP"]?customtrunk)
-exten => s,n,Dial(${OUT_${DIAL_TRUNK}}/${OUTNUM},300,${DIAL_TRUNK_OPTIONS}) ; Regular Trunk Dial
-exten => s,n,Goto(s-${DIALSTATUS},1)
-exten => s,n(customtrunk),Set(pre_num=${CUT(OUT_${DIAL_TRUNK},$,1)})
-exten => s,n,Set(the_num=${CUT(OUT_${DIAL_TRUNK},$,2)}) ; this is where we expect to find string OUTNUM
-exten => s,n,Set(post_num=${CUT(OUT_${DIAL_TRUNK},$,3)})
-exten => s,n,GotoIf($["${the_num}" = "OUTNUM"]?outnum:skipoutnum) ; if we didn't find "OUTNUM", then skip to Dial
-exten => s,n(outnum),Set(the_num=${OUTNUM}) ; replace "OUTNUM" with the actual number to dial
-exten => s,n(skipoutnum),Dial(${pre_num:4}${the_num}${post_num},300,${DIAL_TRUNK_OPTIONS})
-exten => s,n,Goto(s-${DIALSTATUS},1)
-
-exten => s,n(chanfull),Noop(max channels used up)
-
-exten => s-BUSY,1,NoOp(Dial failed due to trunk reporting BUSY - giving up)
-exten => s-BUSY,n,Playtones(busy)
-exten => s-BUSY,n,Busy(20)
-
-exten => s-NOANSWER,1,NoOp(Dial failed due to trunk reporting NOANSWER - giving up)
-exten => s-NOANSWER,n,Playtones(congestion)
-exten => s-NOANSWER,n,Congestion(20)
-
-exten => s-CANCEL,1,NoOp(Dial failed due to trunk reporting CANCEL - giving up)
-exten => s-CANCEL,n,Playtones(congestion)
-exten => s-CANCEL,n,Congestion(20)
-
-exten => _s-.,1,GotoIf($["x${OUTFAIL_${ARG1}}" = "x"]?noreport)
-exten => _s-.,n,AGI(${OUTFAIL_${ARG1}})
-exten => _s-.,n(noreport),Noop(TRUNK Dial failed due to ${DIALSTATUS} - failing through to other trunks)
-
-exten => disabletrunk,1,Noop(TRUNK: ${OUT_${DIAL_TRUNK}} DISABLED - falling through to next trunk)
-exten => bypass,1,Noop(TRUNK: ${OUT_${DIAL_TRUNK}} BYPASSING because dialout-trunk-predial-hook)
-
-exten => h,1,Macro(hangupcall)
-
-; Adds a dynamic agent/member to a Queue
-; Prompts for call-back number - in not entered, uses CIDNum
-[macro-agent-add]
-exten => s,1,Wait(1)
-exten => s,n,Macro(user-callerid,SKIPTTL)
-exten => s,n(a3),Read(CALLBACKNUM,agent-user)  	; get callback number from user
-exten => s,n,GotoIf($["${CALLBACKNUM}" != ""]?a7)	; if user just pressed # or timed out, use cidnum
-exten => s,n(a5),Set(CALLBACKNUM=${AMPUSER})
-exten => s,n,ExecIf($["${CALLBACKNUM}" = ""],Set,CALLBACKNUM=${CALLERID(number)})
-exten => s,n,GotoIf($["${CALLBACKNUM}" = ""]?a3)	; if still no number, start over
-exten => s,n(a7),GotoIf($["${CALLBACKNUM}" = "${ARG1}"]?invalid)	; Error, they put in the queue number
-exten => s,n,ExecIf($["${ARG2}" != ""],Authenticate,${ARG2})
-exten => s,n(a9),AddQueueMember(${ARG1},Local/${CALLBACKNUM}@from-internal/n)	; using chan_local allows us to have agents over trunks
-exten => s,n,UserEvent(Agentlogin,Agent: ${CALLBACKNUM})
-exten => s,n,Wait(1)
-exten => s,n,Playback(agent-loginok&with&extension)
-exten => s,n,SayDigits(${CALLBACKNUM})
-exten => s,n,Hangup()
-exten => s,n+1(invalid),Playback(pbx-invalid)
-exten => s,n,Goto(a3)
-
-
-; Removes a dynamic agent/member from a Queue
-; Prompts for call-back number - in not entered, uses CIDNum
-[macro-agent-del]
-exten => s,1,Wait(1)
-exten => s,n,Macro(user-callerid,SKIPTTL)
-exten => s,n(a3),Read(CALLBACKNUM,agent-user)  	; get callback number from user
-exten => s,n,GotoIf($["${CALLBACKNUM}" = ""]?a5:a7)	; if user just pressed # or timed out, use cidnum
-exten => s,n(a5),Set(CALLBACKNUM=${AMPUSER})
-exten => s,n,ExecIf($["${CALLBACKNUM}" = ""],Set,CALLBACKNUM=${CALLERID(number)})
-exten => s,n,GotoIf($["${CALLBACKNUM}" = ""]?a3)	; if still no number, start over
-exten => s,n(a7),RemoveQueueMember(${ARG1},Local/${CALLBACKNUM}@from-internal/n)
-exten => s,n,UserEvent(RefreshQueue)
-exten => s,n,Wait(1)
-exten => s,n,Playback(agent-loggedoff)
-exten => s,n,Hangup()
-
-; arg1 = trunk number, arg2 = number
-[macro-dialout-enum]
-; Re-written to use enumlookup.agi
-exten => s,1,GotoIf($["${ARG3}" != ""]?PASSWD:NOPASSWD); arg3 is pattern password 
-exten => s,n(PASSWD),Authenticate(${ARG3}) 
-exten => s,n(NOPASSWD),Macro(user-callerid,SKIPTTL) 
-exten => s,n,Macro(record-enable,${CALLERID(number)},OUT)
-exten => s,n,Macro(outbound-callerid,${ARG1})
-exten => s,n,Set(GROUP()=OUT_${ARG1})
-exten => s,n,GotoIf($["${OUTMAXCHANS_${ARG1}}foo" = "foo"]?nomax)
-exten => s,n,GotoIf($[ ${GROUP_COUNT(OUT_${ARG1})} > ${OUTMAXCHANS_${ARG1}} ]?nochans)
-exten => s,n(nomax),Set(DIAL_NUMBER=${ARG2})
-exten => s,n,Set(DIAL_TRUNK=${ARG1})
-exten => s,n,AGI(fixlocalprefix)  ; this sets DIAL_NUMBER to the proper dial string for this trunk
-; Replacement for asterisk's ENUMLOOKUP function
-exten => s,n,AGI(enumlookup.agi)
-; Now we have the variable DIALARR set to a list of URI's that can be called, in order of priority
-; Loop through them trying them in order.
-exten => s,n(dialloop),GotoIf($["foo${DIALARR}"="foo"]?end)
-exten => s,n,Set(TRYDIAL=${CUT(DIALARR,%,1)})
-exten => s,n,Set(DIALARR=${CUT(DIALARR,%,2-)})
-exten => s,n,Dial(${TRYDIAL})
-exten => s,n,NoOp(Dial exited in macro-enum-dialout with ${DIALSTATUS})
-
-; Now, if we're still here, that means the Dial failed for some reason. 
-; If it's CONGESTION or CHANUNAVAIL we want to try again on a different
-; different channel. If there's no more left, the dialloop tag will exit.
-exten => s,n,GotoIf($[ $[ "${DIALSTATUS}" = "CHANUNAVAIL" ] | $[ "${DIALSTATUS}" = "CONGESTION" ] ]?dialloop)
-
-; If we're here, then it's BUSY or NOANSWER or something and well, deal with it.
-exten => s,n(dialfailed),Goto(s-${DIALSTATUS},1)
-
-; Here are the exit points for the macro.
-
-exten => s,n(nochans),NoOp(max channels used up)
-
-exten => s,n(end),NoOp(Exiting macro-dialout-enum)
-
-exten => s-BUSY,1,NoOp(Trunk is reporting BUSY)
-exten => s-BUSY,2,Busy(20)
-
-exten => _s-.,1,NoOp(Dial failed due to ${DIALSTATUS})
 
 [macro-record-enable]
 exten => s,1,GotoIf($[${LEN(${BLINDTRANSFER})} > 0]?2:4)
@@ -857,185 +709,54 @@
 
 [macro-user-logon]
 ; check device type
+;
 exten => s,1,Set(DEVICETYPE=${DB(DEVICE/${CALLERID(number)}/type)})
-exten => s,2,GotoIf($["${DEVICETYPE}" = "fixed"]?s-FIXED,1)
+exten => s,n,GotoIf($["${DEVICETYPE}" = "fixed"]?s-FIXED,1)
 ; get user's extension
-exten => s,3,Set(AMPUSER=${ARG1})
-exten => s,4,GotoIf($["${AMPUSER}" = ""]?5:9)
-exten => s,5,Playback(please-enter-your)
-exten => s,6,Playback(extension)
-exten => s,7,Read(AMPUSER,then-press-pound)
+;
+exten => s,n,Set(AMPUSER=${ARG1})
+exten => s,n,GotoIf($["${AMPUSER}" != ""]?gotpass)
+exten => s,n,Playback(please-enter-your&extension)
+exten => s,n,Read(AMPUSER,then-press-pound)
 ; get user's password and authenticate
-exten => s,8,Wait(1)
-exten => s,9,Set(AMPUSERPASS=${DB(AMPUSER/${AMPUSER}/password)})
-exten => s,10,GotoIf($[${LEN(${AMPUSERPASS})} = 0]?s-NOPASSWORD,1)
+;
+exten => s,n(gotpass),Set(AMPUSERPASS=${DB(AMPUSER/${AMPUSER}/password)})
+exten => s,n,GotoIf($[${LEN(${AMPUSERPASS})} = 0]?s-NOPASSWORD,1)
 ; do not continue if the user has already logged onto this device
-exten => s,11,Set(DEVICEUSER=${DB(DEVICE/${CALLERID(number)}/user)})
-exten => s,12,GotoIf($["${DEVICEUSER}" = "${AMPUSER}"]?s-ALREADYLOGGEDON,1)
-exten => s,13,Authenticate(${AMPUSERPASS})
-; devices can only be mapped to one user - loggoff anyone else who is here
-exten => s,14,Macro(user-logoff)
-; map user to device
-exten => s,15,Set(AMPUSERDEVICES=${DB(AMPUSER/${AMPUSER}/device)})
-exten => s,16,GotoIf($[${LEN(${AMPUSERDEVICES})} = 0]?18) 
-exten => s,17,Set(AMPUSERDEVICES=${AMPUSERDEVICES}&)
-exten => s,18,Set(AMPUSERDEVICES=${AMPUSERDEVICES}${CALLERID(number)})
-exten => s,19,Set(DB(AMPUSER/${AMPUSER}/device)=${AMPUSERDEVICES})
-; map device to user
-exten => s,20,Set(DB(DEVICE/${CALLERID(number)}/user)=${AMPUSER})
-; create symlink from dummy device mailbox to user's mailbox
-exten => s,21,System(/bin/ln -s ${ASTSPOOLDIR}/voicemail/default/${AMPUSER}/ ${ASTSPOOLDIR}/voicemail/device/${CALLERID(number)})
+;
+exten => s,n,Set(DEVICEUSER=${DB(DEVICE/${CALLERID(number)}/user)})
+exten => s,n,GotoIf($["${DEVICEUSER}" = "${AMPUSER}"]?s-ALREADYLOGGEDON,1)
+exten => s,n,Authenticate(${AMPUSERPASS})
+exten => s,n,DeadAGI(user_login_out.agi,login,${CALLERID(number)},${AMPUSER})
+exten => s,n,Playback(vm-goodbye)
 
 exten => s-FIXED,1,NoOp(Device is FIXED and cannot be logged into)
-exten => s-FIXED,2,Playback(ha/phone)
-exten => s-FIXED,3,SayDigits(${CALLERID(number)})
-exten => s-FIXED,4,Playback(is-curntly-unavail)
-exten => s-FIXED,5,Playback(vm-goodbye)
-exten => s-FIXED,6,Hangup ;TODO should play msg indicated device cannot be logged into 
+exten => s-FIXED,n,Playback(ha/phone)
+exten => s-FIXED,n,SayDigits(${CALLERID(number)})
+exten => s-FIXED,n,Playback(is-curntly-unavail&vm-goodbye)
+exten => s-FIXED,n,Hangup ;TODO should play msg indicated device cannot be logged into 
 
 exten => s-ALREADYLOGGEDON,1,NoOp(This device has already been logged into by this user)
-exten => s-ALREADYLOGGEDON,2,Playback(vm-goodbye)
-exten => s-ALREADYLOGGEDON,3,Hangup ;TODO should play msg indicated device is already logged into 
+exten => s-ALREADYLOGGEDON,n,Playback(vm-goodbye)
+exten => s-ALREADYLOGGEDON,n,Hangup ;TODO should play msg indicated device is already logged into 
 
 exten => s-NOPASSWORD,1,NoOp(This extension does not exist or no password is set)
-exten => s-NOPASSWORD,2,Playback(an-error-has-occured)
-exten => s-NOPASSWORD,3,Playback(vm-goodbye)
-exten => s-NOPASSWORD,4,Hangup ;TODO should play msg indicated device is already logged into 
+exten => s-NOPASSWORD,n,Playback(an-error-has-occured&vm-goodbye)
+exten => s-NOPASSWORD,n,Hangup ;TODO should play msg indicated device is already logged into 
 
 [macro-user-logoff]
 ; check device type
+;
 exten => s,1,Set(DEVICETYPE=${DB(DEVICE/${CALLERID(number)}/type)})
-exten => s,2,GotoIf($["${DEVICETYPE}" = "fixed"]?s-FIXED,1)
-; remove entry from user's DEVICE key
-; delete the symlink to user's voicemail box
-exten => s,3,System(rm -f ${ASTSPOOLDIR}/voicemail/device/${CALLERID(number)})
-exten => s,4,Set(DEVAMPUSER=${DB(DEVICE/${CALLERID(number)}/user)})
-exten => s,5,Set(AMPUSERDEVICES=${DB(AMPUSER/${DEVAMPUSER}/device)})
-exten => s,6,AGI(list-item-remove.php,${AMPUSERDEVICES},${CALLERID(number)},AMPUSERDEVICES,&)
-; reset user -> device mapping
-; users can log onto multiple devices, need to just remove device from value
-exten => s,7,Set(DB(AMPUSER/${DEVAMPUSER}/device)=${AMPUSERDEVICES})
-; reset device -> user mapping
-exten => s,8,Set(DEFAULTUSER=${DB(DEVICE/${CALLERID(number)}/default_user)})
-exten => s,9,Set(DB(DEVICE/${CALLERID(number)}/user)=${IF($["${DEFAULTUSER}"=""]?none:${DEFAULTUSER})})
-exten => s,10,Playback(vm-goodbye)
+exten => s,n,GotoIf($["${DEVICETYPE}" = "fixed"]?s-FIXED,1)
+exten => s,n,DeadAGI(user_login_out.agi,logout,${CALLERID(number)})
+exten => s,n(done),Playback(vm-goodbye)
 
 exten => s-FIXED,1,NoOp(Device is FIXED and cannot be logged out of)
-exten => s-FIXED,2,Playback(an-error-has-occured)
-exten => s-FIXED,3,Playback(vm-goodbye)
-exten => s-FIXED,4,Hangup ;TODO should play msg indicated device cannot be logged into 
-
-[macro-systemrecording]
-exten => s,1,Goto(${ARG1},1)
-
-exten => dorecord,1,Record(/tmp/${AMPUSER}-ivrrecording:wav)
-exten => dorecord,n,Wait(1)
-exten => dorecord,n,Goto(confmenu,1)
-
-exten => docheck,1,Playback(/tmp/${AMPUSER}-ivrrecording)
-exten => docheck,n,Wait(1)
-exten => docheck,n,Goto(confmenu,1)
-
-exten => confmenu,1,Background(to-listen-to-it&press-1&to-rerecord-it&press-star,m,${LANGUAGE},macro-systemrecording)
-exten => confmenu,n,Read(RECRESULT,,1,,,4)
-exten => confmenu,n,GotoIf($["x${RECRESULT}"="x*"]?dorecord,1)
-exten => confmenu,n,GotoIf($["x${RECRESULT}"="x1"]?docheck,1)
-exten => confmenu,n,Goto(1)
-
-exten => 1,1,Goto(docheck,1)
-exten => *,1,Goto(dorecord,1)
-
-exten => t,1,Playback(goodbye)
-exten => t,n,Hangup
-
-exten => i,1,Playback(pm-invalid-option)
-exten => i,n,Goto(confmenu,1)
-
-exten => h,1,Hangup
-
-
-;
-; ############################################################################
-; CallerID Handling
-; ############################################################################
-
-;sets the callerid of the device to that of the logged in user
-;
-; ${AMPUSER} is set upon return to the real user despite any aliasing that may
-; have been set as a result of the AMPUSER/<nnn>/cidnum field. This is used by
-; features like DND, CF, etc. to set the proper structure on aliased instructions
-;
-[macro-user-callerid]
-exten => s,1,Noop(user-callerid: ${CALLERID(name)} ${CALLERID(number)})
-
-; make sure AMPUSER is set if it doesn't get set below
-;
-exten => s,n,Set(AMPUSER=${IF($["foo${AMPUSER}" = "foo"]?${CALLERID(number)}:${AMPUSER})})
-exten => s,n,GotoIf($["${CHANNEL:0:5}" = "Local"]?report) 
-exten => s,n,GotoIf($["${REALCALLERIDNUM:1:2}" != ""]?start)
-exten => s,n,Set(REALCALLERIDNUM=${CALLERID(number)})
-exten => s,n(start),NoOp(REALCALLERIDNUM is ${REALCALLERIDNUM})
-exten => s,n,Set(AMPUSER=${DB(DEVICE/${REALCALLERIDNUM}/user)})
-exten => s,n,Set(AMPUSERCIDNAME=${DB(AMPUSER/${AMPUSER}/cidname)})
-exten => s,n,GotoIf($["x${AMPUSERCIDNAME:1:2}" = "x"]?report) 
-
-; user may masquerade as a different user internally, so set the internal cid as indicated
-; but keep the REALCALLERID which is used to determine their true identify and lookup info
-; during outbound calls.
-;
-exten => s,n,Set(AMPUSERCID=${IF($["${DB_EXISTS(AMPUSER/${AMPUSER}/cidnum)}" = "1"]?${DB_RESULT}:${AMPUSER})})
-exten => s,n,Set(CALLERID(all)="${AMPUSERCIDNAME}" <${AMPUSERCID}>)
-exten => s,n,Set(REALCALLERIDNUM=${DB(DEVICE/${REALCALLERIDNUM}/user)})
-exten => s,n(report),Noop(TTL: ${TTL} ARG1: ${ARG1})
-exten => s,n,GotoIf($[ "${ARG1}" = "SKIPTTL" ]?continue)
-exten => s,n(report2),Set(__TTL=${IF($["foo${TTL}" = "foo"]?64:$[ ${TTL} - 1 ])})
-exten => s,n,GotoIf($[ ${TTL} > 0 ]?continue)
-exten => s,n,Wait(${RINGTIMER}) ; wait for a while, to give it a chance to be picked up by voicemail
-exten => s,n,Answer()
-exten => s,n,Wait(2)
-exten => s,n,Playback(im-sorry&an-error-has-occured&with&call-forwarding)
-exten => s,n,Macro(hangupcall)
-exten => s,n,Congestion()
-exten => s,n(continue),NoOp(Using CallerID ${CALLERID(all)})
-exten => h,1,Macro(hangupcall)
-
-; overrides callerid out trunks
-; arg1 is trunk
-; macro-user-callerid should be called _before_ using this macro
-[macro-outbound-callerid]
-; Keep the original CallerID number, for failover to the next trunk.
-exten => s,1,GotoIf($["${REALCALLERIDNUM:1:2}" != ""]?start)
-exten => s,n,Set(REALCALLERIDNUM=${CALLERID(number)})
-exten => s,n(start),NoOp(REALCALLERIDNUM is ${REALCALLERIDNUM})
-
-; If this came through a ringgroup or CF, then we want to retain original CID unless
-; OUTKEEPCID_${trunknum} is set.
-;
-exten => s,n,GotoIf($["${KEEPCID}" != "TRUE"]?normcid) ;Set to TRUE if coming from ringgroups, CF, etc.
-exten => s,n,GotoIf($["x${OUTKEEPCID_${ARG1}}" = "xon"]?normcid)
-exten => s,n,GotoIf($["foo${REALCALLERIDNUM}" = "foo"]?normcid) ;if not set to anything, go through normal processing
-exten => s,n,Set(USEROUTCID=${REALCALLERIDNUM})
-
-; We now have to make sure the CID is valid. If we find an AMPUSER with the same CID, we assume it is an internal 
-; call (would be quite a conincidence if not) and go through the normal processing to get that CID. If a device 
-; is set for this CID, then it must be internal 
-; 
-exten => s,n,GotoIf($["foo${DB(AMPUSER/${REALCALLERIDNUM}/device)}" = "foo"]?bypass:normcid) 
-
-exten => s,n(normcid),Set(USEROUTCID=${DB(AMPUSER/${REALCALLERIDNUM}/outboundcid)})
-exten => s,n(bypass),Set(EMERGENCYCID=${DB(DEVICE/${REALCALLERIDNUM}/emergency_cid)})
-exten => s,n,Set(TRUNKOUTCID=${OUTCID_${ARG1}})
-exten => s,n,GotoIf($["${EMERGENCYROUTE:1:2}" = ""]?trunkcid) ; check EMERGENCY ROUTE
-exten => s,n,GotoIf($["${EMERGENCYCID:1:2}" = ""]?trunkcid) ; empty EMERGENCY CID, so default back to trunk
-exten => s,n,Set(CALLERID(all)=${EMERGENCYCID}) ; emergency cid for device
-exten => s,n,Goto(report)
-exten => s,n(trunkcid),GotoIf($["${TRUNKOUTCID:1:2}" = ""]?usercid)  ;check for CID override for trunk (global var)
-exten => s,n,Set(CALLERID(all)=${TRUNKOUTCID})
-exten => s,n(usercid),GotoIf($["${USEROUTCID:1:2}" = ""]?report) ; check CID override for extension
-exten => s,n,Set(CALLERID(all)=${USEROUTCID})
-exten => s,n,GotoIf($["x${CALLERID(name)}"!="xhidden"]?report:hidecid) ; check CID blocking for extension
-exten => s,n(hidecid),SetCallerPres(prohib_passed_screen) ; Only works with ISDN (T1/E1/BRI)
-exten => s,n(report),NoOp(CallerID set to ${CALLERID(all)})
+exten => s-FIXED,n,Playback(an-error-has-occured&vm-goodbye)
+exten => s-FIXED,n,Hangup ;TODO should play msg indicated device cannot be logged into 
+
+
 
 ; Privacy Manager Macro makes sure that any calls that don't pass the privacy manager are presented
 ; with congestion since there have been observed cases of the call continuing if not stopped with a 
@@ -1262,6 +983,7 @@
 ;------------------------------------------------------------------------
 [macro-auto-confirm]
 exten => s,1,Set(__MACRO_RESULT=)
+exten => s,n,Set(__CWIGNORE=)
 exten => s,n,DBDel(${BLKVM_OVERRIDE})
 exten => s,n,DBDel(RG/${ARG1}/${UNIQCHAN})
 
@@ -1275,6 +997,7 @@
 ;------------------------------------------------------------------------
 [macro-auto-blkvm]
 exten => s,1,Set(__MACRO_RESULT=)
+exten => s,n,Set(__CWIGNORE=)
 exten => s,n,DBDel(${BLKVM_OVERRIDE})
 
 ;------------------------------------------------------------------------

Modified: freepbx-modules/trunk/modules/core/etc/iax.conf
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/core/etc/iax.conf?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/core/etc/iax.conf (original)
+++ freepbx-modules/trunk/modules/core/etc/iax.conf Sun May 18 19:52:05 2008
@@ -1,15 +1,16 @@
+; do not edit this file, this is an auto-generated file by freepbx
+; all modifications must be done from the web gui
+
 [general]
-bindport = 4569           ; Port to bind to (IAX is 4569)
-bindaddr = 0.0.0.0    ; Address to bind to (all addresses on machine)
-disallow=all
-allow=ulaw
-allow=alaw
-allow=gsm
-mailboxdetail=yes
 
+; These will all be included in the [general] context
+#include iax_general_additional.conf
 #include iax_general_custom.conf
 #include iax_registrations_custom.conf
 #include iax_registrations.conf
+
+; These should all be expected to come after the [general] context
+;
 #include iax_custom.conf
 #include iax_additional.conf
 #include iax_custom_post.conf

Modified: freepbx-modules/trunk/modules/core/etc/sip.conf
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/core/etc/sip.conf?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/core/etc/sip.conf (original)
+++ freepbx-modules/trunk/modules/core/etc/sip.conf Sun May 18 19:52:05 2008
@@ -1,29 +1,8 @@
-; Note: If your SIP devices are behind a NAT and your Asterisk
-;  server isn't, try adding "nat=1" to each peer definition to
-;  solve translation problems.
+; do not edit this file, this is an auto-generated file by freepbx
+; all modifications must be done from the web gui
 
 [general]
-#include sip_general_additional.conf
-
-bindport = 5060           ; Port to bind to (SIP is 5060)
-bindaddr = 0.0.0.0    ; Address to bind to (all addresses on machine)
-disallow=all
-allow=ulaw
-allow=alaw
-; If you need to answer unauthenticated calls, you should change this
-; next line to 'from-trunk', rather than 'from-sip-external'.
-; You'll know this is happening if when you call in you get a message
-; saying "The number you have dialed is not in service. Please check the
-; number and try again."
-context = from-sip-external ; Send unknown SIP callers to this context
-callerid = Unknown
-tos=0x68
-
-; Reported as required for Asterisk 1.4
-notifyringing=yes
-notifyhold=yes
-limitonpeers=yes
-
+;
 ; enable and force the sip jitterbuffer. If these settings are desired
 ; they should be set in the sip_general_custom.conf file as this file
 ; will get overwritten during reloads and upgrades.
@@ -31,12 +10,16 @@
 ; jbenable=yes
 ; jbforce=yes
 
-; #, in this configuration file, is NOT A COMMENT. This is exactly
-; how it should be.
+; These will all be included in the [general] context
+;
+#include sip_general_additional.conf
 #include sip_general_custom.conf
 #include sip_nat.conf
 #include sip_registrations_custom.conf
 #include sip_registrations.conf
+
+; These should all be expected to come after the [general] context
+;
 #include sip_custom.conf
 #include sip_additional.conf
 #include sip_custom_post.conf

Modified: freepbx-modules/trunk/modules/core/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/core/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/core/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/core/functions.inc.php Sun May 18 19:52:05 2008
@@ -1,4 +1,408 @@
 <?php
+
+class core_conf {
+	var $_sip_general    = array();
+	var $_iax_general    = array();
+	var $_featuregeneral = array();
+	var $_featuremap     = array();
+	var $_applicationmap = array();
+	// return an array of filenames to write
+	function get_filename() {
+		$files = array(
+			'sip_additional.conf',
+			'sip_registrations.conf',
+			'iax_additional.conf',
+			'iax_registrations.conf',
+			'zapata_additional.conf',
+			'sip_general_additional.conf',
+			'iax_general_additional.conf',
+			'features_general_additional.conf',
+			'features_applicationmap_additional.conf',
+			'features_featuremap_additional.conf',
+			);
+		return $files;
+	}
+	
+	// return the output that goes in each of the files
+	function generateConf($file) {
+		global $version;
+
+		switch ($file) {
+			case 'sip_general_additional.conf':
+				return $this->generate_sip_general_additional($version);
+				break;
+			case 'sip_additional.conf':
+				return $this->generate_sip_additional($version);
+				break;
+			case 'sip_registrations.conf':
+				return $this->generate_sip_registrations($version);
+				break;
+			case 'iax_general_additional.conf':
+				return $this->generate_iax_general_additional($version);
+				break;
+			case 'iax_additional.conf':
+				return $this->generate_iax_additional($version);
+				break;
+			case 'iax_registrations.conf':
+				return $this->generate_iax_registrations($version);
+				break;
+			case 'zapata_additional.conf':
+				return $this->generate_zapata_additional($version);
+				break;
+			case 'features_general_additional.conf':
+				return $this->generate_featuregeneral_additional($version);
+				break;
+			case 'features_applicationmap_additional.conf':
+				return $this->generate_applicationmap_additional($version);
+				break;
+			case 'features_featuremap_additional.conf':
+				return $this->generate_featuremap_additional($version);
+				break;
+		}
+	}
+
+	function addSipGeneral($key, $value) {
+		$this->_sip_general[] = array('key' => $key, 'value' => $value);
+	}
+
+	function generate_sip_general_additional($ast_version) {
+		$output = '';
+
+		if (isset($this->_sip_general) && is_array($this->_sip_general)) {
+			foreach ($this->_sip_general as $values) {
+				$output .= $values['key']."=".$values['value']."\n";
+			}
+		}
+		return $output;
+	}
+
+	function addIaxGeneral($key, $value) {
+		$this->_iax_general[] = array('key' => $key, 'value' => $value);
+	}
+
+	function generate_iax_general_additional($ast_version) {
+		$output = '';
+
+		if (isset($this->_iax_general) && is_array($this->_iax_general)) {
+			foreach ($this->_iax_general as $values) {
+				$output .= $values['key']."=".$values['value']."\n";
+			}
+		}
+		return $output;
+	}
+
+	function addFeatureGeneral($key, $value) {
+		$this->_featuregeneral[] = array('key' => $key, 'value' => $value);
+	}
+
+	function generate_featuregeneral_additional($ast_version) {
+		$output = '';
+
+		if (isset($this->_featuregeneral) && is_array($this->_featuregeneral)) {
+			foreach ($this->_featuregeneral as $values) {
+				$output .= $values['key']."=".$values['value']."\n";
+			}
+		}
+		return $output;
+	}
+
+	function addFeatureMap($key, $value) {
+		$this->_featuremap[] = array('key' => $key, 'value' => $value);
+	}
+
+	function generate_featuremap_additional($ast_version) {
+		$output = '';
+
+		if (isset($this->_featuremap) && is_array($this->_featuremap)) {
+			foreach ($this->_featuremap as $values) {
+				$output .= $values['key']."=".$values['value']."\n";
+			}
+		}
+		return $output;
+	}
+
+	function addApplicationMap($key, $value) {
+		$this->_applicationmap[] = array('key' => $key, 'value' => $value);
+	}
+
+	function generate_applicationmap_additional($ast_version) {
+		$output = '';
+
+		if (isset($this->_applicationmap) && is_array($this->_applicationmap)) {
+			foreach ($this->_applicationmap as $values) {
+				$output .= $values['key']."=".$values['value']."\n";
+			}
+		}
+		return $output;
+	}
+
+	function generate_sip_additional($ast_version) {
+		global $db;
+
+		$table_name = "sip";
+		$additional = "";
+		$output = "";
+
+		// Asterisk 1.4 requires call-limit be set for hints to work properly
+		//
+		if (version_compare($ast_version, "1.4", "ge")) { 
+			$call_limit = "call-limit=50\n";
+			$ver12 = false;
+		} else {
+			$call_limit = "";
+			$ver12 = true;
+		}
+
+		$sql = "SELECT keyword,data from $table_name where id=-1 and keyword <> 'account' and flags <> 1";
+		$results = $db->getAll($sql, DB_FETCHMODE_ASSOC);
+		if(DB::IsError($results)) {
+   		die($results->getMessage());
+		}
+		foreach ($results as $result) {
+			if ($ver12) {
+				$additional .= $result['keyword']."=".$result['data']."\n";
+			} else {
+				$option = $result['data'];
+				switch ($result['keyword']) {
+					case 'allow':
+					case 'disallow':
+						if ($option != '')
+							$additional .= $result['keyword']."=$option\n";
+						break;
+					default:
+						$additional .= $result['keyword']."=$option\n";
+				}
+			}
+		}
+
+		$sql = "SELECT data,id from $table_name where keyword='account' and flags <> 1 group by data";
+		$results = $db->getAll($sql, DB_FETCHMODE_ASSOC);
+		if(DB::IsError($results)) {
+   		die($results->getMessage());
+		}
+
+		foreach ($results as $result) {
+			$account = $result['data'];
+			$id = $result['id'];
+			$output .= "[$account]\n";
+	
+			$sql = "SELECT keyword,data from $table_name where id='$id' and keyword <> 'account' and flags <> 1 order by flags, keyword DESC";
+			$results2 = $db->getAll($sql, DB_FETCHMODE_ASSOC);
+			if(DB::IsError($results2)) {
+   			die($results2->getMessage());
+			}
+			foreach ($results2 as $result2) {
+				$options = explode("&", $result2['data']);
+				if ($ver12) {
+					foreach ($options as $option) {
+						$output .= $result2['keyword']."=$option\n";
+					}
+				} else {
+					foreach ($options as $option) {
+						switch ($result2['keyword']) {
+							case 'allow':
+							case 'disallow':
+								if ($option != '')
+									$output .= $result2['keyword']."=$option\n";
+								break;
+							default:
+								$output .= $result2['keyword']."=$option\n";
+						}
+					}
+				}
+			}
+			if ($call_limit && (substr($id,0,4) != "9999" | $id < 99990)) {
+
+				$output .= $call_limit;
+			}
+			$output .= $additional."\n";
+		}
+		return $output;
+	}
+
+	function generate_sip_registrations($ast_version) {
+		global $db;
+
+		$table_name = "sip";
+		$output = "";
+
+		// items with id like 9999999% get put in registrations file
+		//
+		$sql = "SELECT keyword,data from $table_name where id LIKE '9999999%' and keyword <> 'account' and flags <> 1";
+		$results = $db->getAll($sql, DB_FETCHMODE_ASSOC);
+		if(DB::IsError($results)) {
+   		die($results->getMessage());
+		}
+
+		foreach ($results as $result) {
+			$output .= $result['keyword']."=".$result['data']."\n";
+		}
+
+		return $output;
+	}
+
+	function generate_iax_additional($ast_version) {
+		global $db;
+
+		$table_name = "iax";
+		$additional = "";
+		$output = "";
+
+		$ver12 = version_compare($ast_version, '1.4', 'lt');
+
+		$sql = "SELECT keyword,data from $table_name where id=-1 and keyword <> 'account' and flags <> 1";
+		$results = $db->getAll($sql, DB_FETCHMODE_ASSOC);
+		if(DB::IsError($results)) {
+   		die($results->getMessage());
+		}
+		foreach ($results as $result) {
+			if ($ver12) {
+				$additional .= $result['keyword']."=".$result['data']."\n";
+			} else {
+				$option = $result['data'];
+				switch ($result['keyword']) {
+					case 'notransfer':
+						if (strtolower($option) == 'yes') {
+							$additional .= "transfer=no\n";
+						} else if (strtolower($option) == 'no') {
+							$additional .= "transfer=yes\n";
+						} else if (strtolower($option) == 'mediaonly') {
+							$additional .= "transfer=mediaonly\n";
+						} else {
+							$additional .= $result['keyword']."=$option\n";
+						}
+						break;
+					case 'allow':
+					case 'disallow':
+						if ($option != '')
+							$additional .= $result['keyword']."=$option\n";
+						break;
+					default:
+						$additional .= $result['keyword']."=$option\n";
+				}
+			}
+		}
+
+		$sql = "SELECT data,id from $table_name where keyword='account' and flags <> 1 group by data";
+		$results = $db->getAll($sql, DB_FETCHMODE_ASSOC);
+		if(DB::IsError($results)) {
+   		die($results->getMessage());
+		}
+		
+		foreach ($results as $result) {
+			$account = $result['data'];
+			$id = $result['id'];
+			$output .= "[$account]\n";
+	
+			$sql = "SELECT keyword,data from $table_name where id='$id' and keyword <> 'account' and flags <> 1 order by flags, keyword DESC";
+			$results2 = $db->getAll($sql, DB_FETCHMODE_ASSOC);
+			if(DB::IsError($results2)) {
+   			die($results2->getMessage());
+			}	
+			foreach ($results2 as $result2) {
+				$options = explode("&", $result2['data']);
+				if ($ver12) {
+					foreach ($options as $option) {
+						$output .= $result2['keyword']."=$option\n";
+					}
+				} else {
+					foreach ($options as $option) {
+						switch ($result2['keyword']) {
+							case 'notransfer':
+								if (strtolower($option) == 'yes') {
+									$output .= "transfer=no\n";
+								} else if (strtolower($option) == 'no') {
+									$output .= "transfer=yes\n";
+								} else if (strtolower($option) == 'mediaonly') {
+									$output .= "transfer=mediaonly\n";
+								} else {
+									$output .= $result2['keyword']."=$option\n";
+								}
+								break;
+							case 'allow':
+							case 'disallow':
+								if ($option != '')
+									$output .= $result2['keyword']."=$option\n";
+								break;
+							default:
+								$output .= $result2['keyword']."=$option\n";
+						}
+					}
+				}
+			}
+			$output .= $additional."\n";
+		}
+		return $output;
+	}
+
+	function generate_iax_registrations($ast_version) {
+		global $db;
+
+		$table_name = "iax";
+		$output = "";
+
+		// items with id like 9999999% get put in the registration file
+		//
+		$sql = "SELECT keyword,data from $table_name where id LIKE '9999999%' and keyword <> 'account' and flags <> 1";
+		$results = $db->getAll($sql, DB_FETCHMODE_ASSOC);
+		if(DB::IsError($results)) {
+   		die($results->getMessage());
+		}
+
+		foreach ($results as $result) {
+			$output .= $result['keyword']."=".$result['data']."\n";
+		}
+
+		return $output;
+	}
+
+	function generate_zapata_additional($ast_version) {
+		global $db;
+
+		$table_name = "zap";
+
+		$additional = "";
+		$output = '';
+
+		$sql = "SELECT keyword,data from $table_name where id=-1 and keyword <> 'account' and flags <> 1";
+		$results = $db->getAll($sql, DB_FETCHMODE_ASSOC);
+		if(DB::IsError($results)) {
+   		die($results->getMessage());
+		}
+		foreach ($results as $result) {
+			$additional .= $result['keyword']."=".$result['data']."\n";
+		}
+
+		$sql = "SELECT data,id from $table_name where keyword='account' and flags <> 1 group by data";
+		$results = $db->getAll($sql, DB_FETCHMODE_ASSOC);
+		if(DB::IsError($results)) {
+   		die($results->getMessage());
+		}
+
+		foreach ($results as $result) {
+			$account = $result['data'];
+			$id = $result['id'];
+			$output .= ";;;;;;[$account]\n";
+	
+			$sql = "SELECT keyword,data from $table_name where id=$id and keyword <> 'account' and flags <> 1 order by keyword DESC";
+			$results2 = $db->getAll($sql, DB_FETCHMODE_ASSOC);
+			if(DB::IsError($results2)) {
+   			die($results2->getMessage());
+			}
+			$zapchannel="";
+			foreach ($results2 as $result2) {
+				if ($result2['keyword'] == 'channel') {
+					$zapchannel = $result2['data'];
+				} else {
+					$output .= $result2['keyword']."=".$result2['data']."\n";
+				}
+			}
+			$output .= "channel=>$zapchannel\n";
+			$output .= $additional."\n";
+		}
+		return $output;
+	}
+}
 
 // The destinations this module provides
 // returns a associative arrays with keys 'destination' and 'description'
@@ -11,6 +415,7 @@
 	$extens[] = array('destination' => 'app-blackhole,busy,1', 'description' => 'Busy', 'category' => $category);
 	$extens[] = array('destination' => 'app-blackhole,zapateller,1', 'description' => 'Play SIT Tone (Zapateller)', 'category' => $category);
 	$extens[] = array('destination' => 'app-blackhole,musiconhold,1', 'description' => 'Put caller on hold forever', 'category' => $category);
+	$extens[] = array('destination' => 'app-blackhole,ring,1', 'description' => 'Play ringtones to caller until they hangup', 'category' => $category);
 	
 	//get the list of meetmes
 	$results = core_users_list();
@@ -49,9 +454,106 @@
 		return $extens;
 	else
 		return null;
-
-}
-
+}
+
+function core_getdest($exten) {
+	$dests[] = 'from-did-direct,'.$exten.',1';
+	if (!function_exists('voicemail_mailbox_get')) {
+		return $dests;
+	}
+	$box = voicemail_mailbox_get($exten);
+	if ($box == null) {
+		return $dests;
+	}
+	$dests[] = 'ext-local,vmb'.$exten.',1';
+	$dests[] = 'ext-local,vmu'.$exten.',1';
+	$dests[] = 'ext-local,vms'.$exten.',1';
+
+	return $dests;
+}
+
+function core_getdestinfo($dest) {
+	global $active_modules;
+
+	// Check for Extension Number Destinations
+	//
+	if (substr(trim($dest),0,16) == 'from-did-direct,') {
+		$exten = explode(',',$dest);
+		$exten = $exten[1];
+		$thisexten = core_users_get($exten);
+		if (empty($thisexten)) {
+			return array();
+		} else {
+			//$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup';
+			$display = ($amp_conf['AMPEXTENSIONS'] == "deviceanduser")?'users':'extensions';
+			return array('description' => 'User Extension '.$exten.': '.$thisexten['name'],
+			             'edit_url' => "config.php?type=setup&display=$display&extdisplay=".urlencode($exten)."&skip=0",
+								  );
+		}
+
+	// Check for voicemail box destinations
+	//
+	} else if (substr(trim($dest),0,12) == 'ext-local,vm') {
+		$exten = explode(',',$dest);
+		$exten = substr($exten[1],3);
+		if (!function_exists('voicemail_mailbox_get')) {
+			return array();
+		}
+		$thisexten = core_users_get($exten);
+		if (empty($thisexten)) {
+			return array();
+		}
+		$box = voicemail_mailbox_get($exten);
+		if ($box == null) {
+			return array();
+		}
+		$display = ($amp_conf['AMPEXTENSIONS'] == "deviceanduser")?'users':'extensions';
+		return array('description' => 'User Extension '.$exten.': '.$thisexten['name'],
+		             'edit_url' => "config.php?type=setup&display=$display&extdisplay=".urlencode($exten)."&skip=0",
+							  );
+
+	// Check for blackhole Termination Destinations
+	//
+	} else if (substr(trim($dest),0,14) == 'app-blackhole,') {
+		$exten = explode(',',$dest);
+		$exten = $exten[1];
+
+		switch ($exten) {
+			case 'hangup': 
+				$description = 'Hangup';
+				break;
+			case 'congestion': 
+				$description = 'Congestion';
+				break;
+			case 'busy': 
+				$description = 'Busy';
+				break;
+			case 'zapateller': 
+				$description = 'Play SIT Tone (Zapateller)';
+				break;
+			case 'musiconhold': 
+				$description = 'Put caller on hold forever';
+				break;
+			case 'ring': 
+				$description = 'Play ringtones to caller';
+				break;
+			default:
+				$description = false;
+		}
+		if ($description) {
+			return array('description' => 'Core: '.$description,
+		             	 'edit_url' => false,
+							  	 );
+		} else {
+			return array();
+		}
+
+	// None of the above, so not one of ours
+	//
+	} else {
+		return false;
+	}
+}
 /* 	Generates dialplan for "core" components (extensions & inbound routing)
 	We call this with retrieve_conf
 */
@@ -59,11 +561,68 @@
 	global $ext;  // is this the best way to pass this?
 	global $version;  // this is not the best way to pass this, this should be passetd together with $engine
 	global $amp_conf;
+	global $core_conf;
 
 	$modulename = "core";
 	
 	switch($engine) {
 		case "asterisk":
+
+			// Now add to sip_general_addtional.conf
+			//
+			if (isset($core_conf) && is_a($core_conf, "core_conf")) {
+				$core_conf->addSipGeneral('bindport','5060');
+				$core_conf->addSipGeneral('bindaddr','0.0.0.0');
+				$core_conf->addSipGeneral('disallow','all');
+				$core_conf->addSipGeneral('allow','ulaw');
+				$core_conf->addSipGeneral('allow','alaw');
+				$core_conf->addSipGeneral('context','from-sip-external');
+				$core_conf->addSipGeneral('callerid','Unknown');
+				$core_conf->addSipGeneral('notifyringing','yes');
+				if (version_compare($version, '1.4', 'ge')) { 
+					$core_conf->addSipGeneral('notifyhold','yes');
+					$core_conf->addSipGeneral('limitonpeers','yes');
+					$core_conf->addSipGeneral('tos_sip','cs3');    // Recommended setting from doc/ip-tos.txt
+					$core_conf->addSipGeneral('tos_audio','ef');   // Recommended setting from doc/ip-tos.txt
+					$core_conf->addSipGeneral('tos_video','af41'); // Recommended setting from doc/ip-tos.txt
+				} else {
+					$core_conf->addSipGeneral('tos','0x68'); // This really doesn't do anything with astersk not running as root
+				}
+				$core_conf->addIaxGeneral('bindport','4569');
+				$core_conf->addIaxGeneral('bindaddr','0.0.0.0');
+				$core_conf->addIaxGeneral('disallow','all');
+				$core_conf->addIaxGeneral('allow','ulaw');
+				$core_conf->addIaxGeneral('allow','alaw');
+				$core_conf->addIaxGeneral('allow','gsm');
+				$core_conf->addIaxGeneral('mailboxdetail','yes');
+				if (version_compare($version, '1.4', 'ge')) {
+					$core_conf->addIaxGeneral('tos','ef'); // Recommended setting from doc/ip-tos.txt
+				}
+
+				$fcc = new featurecode($modulename, 'blindxfer');
+				$code = $fcc->getCodeActive();
+				unset($fcc);
+				if ($code != '') {
+					$core_conf->addFeatureMap('blindxfer',$code);
+				}
+
+				$fcc = new featurecode($modulename, 'atxfer');
+				$code = $fcc->getCodeActive();
+				unset($fcc);
+				if ($code != '') {
+					$core_conf->addFeatureMap('atxfer',$code);
+				}
+
+				$fcc = new featurecode($modulename, 'automon');
+				$code = $fcc->getCodeActive();
+				unset($fcc);
+				if ($code != '') {
+					$core_conf->addFeatureMap('automon',$code);
+				}
+
+				$core_conf->addFeatureMap('disconnect','**');
+			}
+
 			// FeatureCodes
 			$fcc = new featurecode($modulename, 'userlogon');
 			$fc_userlogon = $fcc->getCodeActive();
@@ -172,29 +731,15 @@
 				$catchall = false;
 				$catchall_context='ext-did-catchall';
 				foreach($didlist as $item) {
-					$did = core_did_get($item['extension'],$item['cidnum'],$item['channel']);
+					$did = core_did_get($item['extension'],$item['cidnum']);
 					$exten = $did['extension'];
 					$cidnum = $did['cidnum'];
-					$channel = $did['channel'];
 
 					$exten = (empty($exten)?"s":$exten);
 					$exten = $exten.(empty($cidnum)?"":"/".$cidnum); //if a CID num is defined, add it
 
-					if (empty($channel))
-						$context = "ext-did";
-					else {
-						$context = "macro-from-zaptel-{$channel}";
-						if (!isset($zapchan[$channel])) {
-							// create the macro-from-zaptel-$chan context and load up the
-							// startup settings
-							$ext->add($context, 'fax', '', new ext_goto('1','in_fax','ext-fax'));
-							$ext->add($context, 's', '', new ext_noop('Entering '.$context.' with DID = ${DID}'));
-							$zapchan[$channel] = "unfinished";
-						}
-					}
-
-					// Start inbound processing. Unneeded line to be possibly overridden by something in 
-					// extensions_custom.conf
+					$context = "ext-did";
+
 					$ext->add($context, $exten, '', new ext_setvar('__FROM_DID','${EXTEN}'));
 					// always set callerID name
 					$ext->add($context, $exten, '', new ext_gotoif('$[ "${CALLERID(name)}" != "" ] ','cidok'));
@@ -212,12 +757,13 @@
 					}
 
 					if ($exten == "s" && $context == "ext-did") {  
-						//if the exten is s, then also make a catchall for undefined DIDs if it's not a zaptel route
-						$catchaccount = "_X.".(empty($cidnum)?"":"/".$cidnum);
-						if ($catchaccount == "_X.") 
+						//if the exten is s, then also make a catchall for undefined DIDs
+						$catchaccount = "_.".(empty($cidnum)?"":"/".$cidnum);
+						if ($catchaccount =="_." && ! $catchall) {
 							$catchall = true;
-						$ext->add($catchall_context, $catchaccount, '', new ext_NoOp('Catch-All DID Match - Found ${EXTEN} - You probably want a DID for this.'));
-						$ext->add($catchall_context, $catchaccount, '', new ext_goto('1','s','ext-did'));
+							$ext->add($catchall_context, $catchaccount, '', new ext_NoOp('Catch-All DID Match - Found ${EXTEN} - You probably want a DID for this.'));
+							$ext->add($catchall_context, $catchaccount, '', new ext_goto('1','s','ext-did'));
+						}
 					}
 					
 					if ($item['faxexten'] != "default") {
@@ -254,27 +800,6 @@
 						$ext->add($context, $exten, '', new ext_setvar('CALLERID(name)','${RGPREFIX}${CALLERID(name)}'));
 					}
 					
-					// If we're doing a zaptel route, now we need to do the gotos ONLY IF it's the first time round.
-					// Except for the fact that this doesn't work. Not at all. Dial returns -1 and hangs up the 
-					// call. This is fixed in 1.4 with TryExec(), but until then, we can't match on zap
-					// _and_ anything else.  When we decide to say 'Only 1.4!' then we can reenable this
-					// and use TryExec(Goto..) and then check ${TRYSTATUS} for FAILED or SUCCESS. I didn't
-					// bother actually writing that, as the syntax may change.
-					//if (isset($zapchan[$channel]) && $zapchan[$channel] == "unfinished") {
-					//	$ext->add($context, 's', '', new ext_gotoif('$[ "${DID}" = "s" ]', 'nos', 'sok'));
-					//	$ext->add($context, 's', 'nos', new ext_noop('Skipping ${DID} because it is s'));
-					//	$ext->add($context, 's', '', new ext_goto("trycid"));
-					//	$ext->add($context, 's', 'sok', new ext_noop('Trying ${DID}'));
-					//	$ext->add($context, 's', '', new ext_goto("1", '${DID}'));
-					//	$ext->add($context, 's', 'trycid', new ext_gotoif('$[ "${CALLERID(num)}" = "" ]', 'nocid', 'cidok'));
-					//	$ext->add($context, 's', 'nocid', new ext_noop('Skipping empty CallerID Num'));
-					//	$ext->add($context, 's', '', new ext_goto("end"));
-					//	$ext->add($context, 's', 'cidok', new ext_noop('Trying ${DID}/${CALLERID(num)}'));
-					//	$ext->add($context, 's', '', new ext_goto("1", '${DID}/${CALLERID(num)}'));
-					//	$ext->add($context, 's', 'end', new ext_noop('End of macro init'));
-						// Now set $zapchan[$channel] so we don't do this again
-						$zapchan[$channel] = "set";
-					//}
 					//the goto destination
 					// destination field in 'incoming' database is backwards from what ext_goto expects
 					$goto_context = strtok($did['destination'],',');
@@ -367,9 +892,28 @@
 				}
 			}
 
-			
+			// Now create macro-from-zaptel-nnn for each defined channel to route it to the DID routing
+			// Send it to from-trunk so it is handled as other dids would be handled.
+			//
+			foreach (core_zapchandids_list() as $row) {
+				$channel = $row['channel'];
+				$did     = $row['did'];
+
+				$zap_context = "macro-from-zaptel-{$channel}";
+				$ext->add($zap_context, 's', '', new ext_noop('Entering '.$zap_context.' with DID = ${DID} and setting to: '.$did));
+				$ext->add($zap_context, 's', '', new ext_setvar('__FROM_DID',$did));
+				$ext->add($zap_context, 's', '', new ext_goto('1',$did,'from-trunk'));
+			}
+
 			/* user extensions */
 			$ext->addInclude('from-internal-additional','ext-local');
+
+			// If running in Dynamic mode, this will insert the hints through an Asterisk #exec call.
+			// which require "execincludes=yes" to be set in the [options] section of asterisk.conf
+			//
+			if ($amp_conf['DYNAMICHINTS']) {
+				$ext->addExec('ext-local',$amp_conf['AMPBIN'].'/generate_hints.php');
+			}
 			$userlist = core_users_list();
 			if (is_array($userlist)) {
 				foreach($userlist as $item) {
@@ -393,11 +937,29 @@
 						$ext->add('ext-local', 'vms'.$exten['extension'], '', new ext_hangup(''));
 					}
 						
-					$hint = core_hint_get($exten['extension']);
-					if (!empty($hint))
-						$ext->addHint('ext-local', $exten['extension'], $hint);
+					// Create the hints if running in normal mode
+					//
+					if (!$amp_conf['DYNAMICHINTS']) {
+						$hint = core_hint_get($exten['extension']);
+						if (!empty($hint)) {
+							$ext->addHint('ext-local', $exten['extension'], $hint);
+						}
+					}
 					if ($exten['sipname']) {
 						$ext->add('ext-local', $exten['sipname'], '', new ext_goto('1',$item[0],'from-internal'));
+					}
+					// Now make a special context for the IVR inclusions of local extension dialing so that
+					// when people use the Queues breakout ability, and break out to someone's extensions, voicemail
+					// works.
+					//
+					$ivr_context = 'from-did-direct-ivr';
+					$ext->add($ivr_context, $exten['extension'],'', new ext_execif('$["${BLKVM_OVERRIDE}" != ""]','dbDel','${BLKVM_OVERRIDE}'));
+					$ext->add($ivr_context, $exten['extension'],'', new ext_setvar('__NODEST', ''));
+					$ext->add($ivr_context, $exten['extension'],'', new ext_goto('1',$exten['extension'],'from-did-direct'));
+					if($vm != "novm") {
+						$ext->add($ivr_context, '${VM_PREFIX}'.$exten['extension'],'', new ext_execif('$["${BLKVM_OVERRIDE}" != ""]','dbDel','${BLKVM_OVERRIDE}'));
+						$ext->add($ivr_context, '${VM_PREFIX}'.$exten['extension'],'', new ext_setvar('__NODEST', ''));
+						$ext->add($ivr_context, '${VM_PREFIX}'.$exten['extension'],'', new ext_macro('vm',"$vm,DIRECTDIAL"));
 					}
 				}
 			}
@@ -416,9 +978,14 @@
 						case 'IAX2':
 						case 'SIP':
 							$trunkgroup = $trunkprops['globalvar'];
-							$trunkcontext  = "from-trunk-".$trunkprops['name'];
+							$trunkcontext  = "from-trunk-".strtolower($trunkprops['tech'])."-".$trunkprops['name'];
 							$ext->add($trunkcontext, '_.', '', new ext_setvar('GROUP()',$trunkgroup));
 							$ext->add($trunkcontext, '_.', '', new ext_goto('1','${EXTEN}','from-trunk'));
+							break;
+						case 'DUNDI':
+							$macro_name = 'macro-dundi-'.substr($trunkprops['globalvar'],4);
+							$ext->addSwitch($macro_name,'DUNDI/'.$trunkprops['name']);
+							$ext->add($macro_name, 's', '', new ext_goto('1','${ARG1}'));
 							break;
 						default:
 					}
@@ -471,7 +1038,9 @@
 					out("Added to globals: $global = $value");
 				}
 			}
-			
+			// Put the asterisk version in a global for agi etc.
+			$ext->addGlobal('ASTVERSION', $version);
+
 			/* outbound routes */
 			// modules should use their own table for storage (and module_get_config() to add dialplan)
 			// modules should NOT use the extension table to store anything!
@@ -483,6 +1052,7 @@
 				$ext->addInclude('outbound-allroutes',$outrt['application']);
 				$sql = "SELECT * FROM extensions where context = '".$outrt['application']."' ORDER BY extension, CAST(priority AS UNSIGNED) ASC";
 				$thisrt = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
+				$lastexten = false;
 				foreach($thisrt as $exten) {
 					//if emergencyroute, then set channel var
 					if(strpos($exten['args'],"EMERGENCYROUTE") !== false)
@@ -492,14 +1062,28 @@
 					// Don't set MOHCLASS if already set, threre may be a feature code that overrode it
 					if(strpos($exten['args'],"MOHCLASS") !== false)
 						$ext->add($outrt['application'], $exten['extension'], '', new ext_setvar("MOHCLASS", '${IF($["x${MOHCLASS}"="x"]?'.substr($exten['args'],9).':${MOHCLASS})}' ));
-					if(strpos($exten['args'],"dialout-trunk") !== false)
+					if(strpos($exten['args'],"dialout-trunk") !== false || strpos($exten['args'],"dialout-enum") !== false || strpos($exten['args'],"dialout-dundi") !== false) {
+						if ($exten['extension'] !== $lastexten) {
+
+							// If NODEST is set, clear it. No point in remembering since dialout-trunk will just end in the
+							// bit bucket. But if answered by an outside line with transfer capability, we want NODEST to be
+							// clear so a subsequent transfer to an internal extension works and goes to voicmail or other
+							// destinations.
+							//
+							// Then do one call to user-callerid and record-enable instead of each time as in the past
+							//
+							$ext->add($outrt['application'], $exten['extension'], '', new ext_macro('user-callerid,SKIPTTL'));
+							$ext->add($outrt['application'], $exten['extension'], '', new ext_setvar("_NODEST",""));
+							$ext->add($outrt['application'], $exten['extension'], '', new ext_macro('record-enable,${AMPUSER},OUT'));
+							$lastexten = $exten['extension'];
+						}
 						$ext->add($outrt['application'], $exten['extension'], '', new ext_macro($exten['args']));
-					if(strpos($exten['args'],"dialout-enum") !== false)
-						$ext->add($outrt['application'], $exten['extension'], '', new ext_macro($exten['args']));
+					}
 					if(strpos($exten['args'],"outisbusy") !== false)
 						$ext->add($outrt['application'], $exten['extension'], '', new ext_macro("outisbusy"));
 				}
 			}
+
 			general_generate_indications();
 
 			// "blackhole" destinations
@@ -527,6 +1111,12 @@
 			$ext->add('app-blackhole', 'busy', '', new ext_playtones('busy'));
 			$ext->add('app-blackhole', 'busy', '', new ext_busy());
 			$ext->add('app-blackhole', 'busy', '', new ext_hangup());
+
+			$ext->add('app-blackhole', 'ring', '', new ext_noop('Blackhole Dest: Ring'));
+			$ext->add('app-blackhole', 'ring', '', new ext_answer());
+			$ext->add('app-blackhole', 'ring', '', new ext_playtones('ring'));
+			$ext->add('app-blackhole', 'ring', '', new ext_wait(300));
+			$ext->add('app-blackhole', 'ring', '', new ext_hangup());
 
 			if ($amp_conf['AMPBADNUMBER'] !== false) {
 				$context = 'bad-number';
@@ -549,19 +1139,373 @@
 				$ext->add($context, $exten, '', new ext_hangup());
 			}
 
+			$context = 'macro-dialout-trunk';
+			$exten = 's';
+			
+			/*
+			 * dialout using a trunk, using pattern matching (don't strip any prefix)
+			 * arg1 = trunk number, arg2 = number, arg3 = route password
+			 *
+			 * MODIFIED (PL)
+			 *
+			 * Modified both Dial() commands to include the new TRUNK_OPTIONS from the general
+			 * screen of AMP
+			 */
+			$ext->add($context, $exten, '', new ext_set('DIAL_TRUNK', '${ARG1}'));
+			$ext->add($context, $exten, '', new ext_execif('$[$["${ARG3}" != ""] & $["${DB(AMPUSER/${AMPUSER}/pinless)}" != "NOPASSWD"]]', 'Authenticate', '${ARG3}'));
+			$ext->add($context, $exten, '', new ext_gotoif('$["x${OUTDISABLE_${DIAL_TRUNK}}" = "xon"]', 'disabletrunk,1'));
+			$ext->add($context, $exten, '', new ext_set('DIAL_NUMBER', '${ARG2}')); // fixlocalprefix depends on this
+			$ext->add($context, $exten, '', new ext_set('DIAL_TRUNK_OPTIONS', '${DIAL_OPTIONS}')); // will be reset to TRUNK_OPTIONS if not intra-company
+			$ext->add($context, $exten, '', new ext_set('GROUP()', 'OUT_${DIAL_TRUNK}'));
+			$ext->add($context, $exten, '', new ext_gotoif('$["${OUTMAXCHANS_${DIAL_TRUNK}}foo" = "foo"]', 'nomax'));
+			$ext->add($context, $exten, '', new ext_gotoif('$[ ${GROUP_COUNT(OUT_${DIAL_TRUNK})} > ${OUTMAXCHANS_${DIAL_TRUNK}} ]', 'chanfull'));
+			$ext->add($context, $exten, 'nomax', new ext_gotoif('$["${INTRACOMPANYROUTE}" = "YES"]', 'skipoutcid'));  // Set to YES if treated like internal
+			$ext->add($context, $exten, '', new ext_set('DIAL_TRUNK_OPTIONS', '${TRUNK_OPTIONS}'));
+			$ext->add($context, $exten, '', new ext_macro('outbound-callerid', '${DIAL_TRUNK}'));
+			$ext->add($context, $exten, 'skipoutcid', new ext_agi('fixlocalprefix'));  // this sets DIAL_NUMBER to the proper dial string for this trunk
+			$ext->add($context, $exten, '', new ext_set('OUTNUM', '${OUTPREFIX_${DIAL_TRUNK}}${DIAL_NUMBER}'));  // OUTNUM is the final dial number
+			$ext->add($context, $exten, '', new ext_set('custom', '${CUT(OUT_${DIAL_TRUNK},:,1)}'));  // Custom trunks are prefixed with "AMP:"
+		
+			// Back to normal processing, whether intracompany or not.
+			// But add the macro-setmusic if we don't want music on this outbound call
+			$ext->add($context, $exten, '', new ext_gotoif('$[$["${MOHCLASS}" = "default"] | $["foo${MOHCLASS}" = "foo"]]', 'gocall'));  // Set to YES if we should pump silence
+			$ext->add($context, $exten, '', new ext_set('DIAL_TRUNK_OPTIONS', 'M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS}'));  // set MoH or off
+		
+			// This macro call will always be blank and is provided as a hook for customization required prior to making a call
+			// such as adding SIP header information or other requirements. All the channel variables from above are present
+			
+			$ext->add($context, $exten, 'gocall', new ext_macro('dialout-trunk-predial-hook'));
+			$ext->add($context, $exten, '', new ext_gotoif('$["${PREDIAL_HOOK_RET}" = "BYPASS"]', 'bypass,1'));
+		
+			$ext->add($context, $exten, '', new ext_gotoif('$["${custom}" = "AMP"]', 'customtrunk'));
+			$ext->add($context, $exten, '', new ext_dial('${OUT_${DIAL_TRUNK}}/${OUTNUM}', '300,${DIAL_TRUNK_OPTIONS}'));  // Regular Trunk Dial
+			$ext->add($context, $exten, '', new ext_goto(1, 's-${DIALSTATUS}'));
+			
+			$ext->add($context, $exten, 'customtrunk', new ext_set('pre_num', '${CUT(OUT_${DIAL_TRUNK},$,1)}'));
+			$ext->add($context, $exten, '', new ext_set('the_num', '${CUT(OUT_${DIAL_TRUNK},$,2)}'));  // this is where we expect to find string OUTNUM
+			$ext->add($context, $exten, '', new ext_set('post_num', '${CUT(OUT_${DIAL_TRUNK},$,3)}'));
+			$ext->add($context, $exten, '', new ext_gotoif('$["${the_num}" = "OUTNUM"]', 'outnum', 'skipoutnum'));  // if we didn't find "OUTNUM", then skip to Dial
+			$ext->add($context, $exten, 'outnum', new ext_set('the_num', '${OUTNUM}'));  // replace "OUTNUM" with the actual number to dial
+			$ext->add($context, $exten, 'skipoutnum', new ext_dial('${pre_num:4}${the_num}${post_num}', '300,${DIAL_TRUNK_OPTIONS}'));
+			$ext->add($context, $exten, '', new ext_goto(1, 's-${DIALSTATUS}'));
+			
+			$ext->add($context, $exten, 'chanfull', new ext_noop('max channels used up'));
+		
+			$exten = 's-BUSY';
+			$ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting BUSY - giving up'));
+			$ext->add($context, $exten, '', new ext_playtones('busy'));
+			$ext->add($context, $exten, '', new ext_busy(20));
+		
+			$exten = 's-NOANSWER';
+			$ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting NOANSWER - giving up'));
+			$ext->add($context, $exten, '', new ext_playtones('congestion'));
+			$ext->add($context, $exten, '', new ext_congestion(20));
+		
+			$exten = 's-CANCEL';
+			$ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting CANCEL - giving up'));
+			$ext->add($context, $exten, '', new ext_playtones('congestion'));
+			$ext->add($context, $exten, '', new ext_congestion(20));
+		
+			$exten = '_s-.';
+			$ext->add($context, $exten, '', new ext_gotoif('$["x${OUTFAIL_${ARG1}}" = "x"]', 'noreport'));
+			$ext->add($context, $exten, '', new ext_agi('${OUTFAIL_${ARG1}}'));
+			$ext->add($context, $exten, 'noreport', new ext_noop('TRUNK Dial failed due to ${DIALSTATUS} - failing through to other trunks'));
+			
+			$ext->add($context, 'disabletrunk', '', new ext_noop('TRUNK: ${OUT_${DIAL_TRUNK}} DISABLED - falling through to next trunk'));
+			$ext->add($context, 'bypass', '', new ext_noop('TRUNK: ${OUT_${DIAL_TRUNK}} BYPASSING because dialout-trunk-predial-hook'));
+		
+			$ext->add($context, 'h', '', new ext_macro('hangupcall'));
+
+
+
+
+			$context = 'macro-dialout-dundi';
+			$exten = 's';
+			
+			/*
+			 * Dialout Dundi Trunk
+			 */
+			$ext->add($context, $exten, '', new ext_set('DIAL_TRUNK', '${ARG1}'));
+			$ext->add($context, $exten, '', new ext_execif('$[$["${ARG3}" != ""] & $["${DB(AMPUSER/${AMPUSER}/pinless)}" != "NOPASSWD"]]', 'Authenticate', '${ARG3}'));
+			$ext->add($context, $exten, '', new ext_gotoif('$["x${OUTDISABLE_${DIAL_TRUNK}}" = "xon"]', 'disabletrunk,1'));
+			$ext->add($context, $exten, '', new ext_set('DIAL_NUMBER', '${ARG2}')); // fixlocalprefix depends on this
+			$ext->add($context, $exten, '', new ext_set('DIAL_TRUNK_OPTIONS', '${DIAL_OPTIONS}')); // will be reset to TRUNK_OPTIONS if not intra-company
+			$ext->add($context, $exten, '', new ext_set('GROUP()', 'OUT_${DIAL_TRUNK}'));
+			$ext->add($context, $exten, '', new ext_gotoif('$["${OUTMAXCHANS_${DIAL_TRUNK}}foo" = "foo"]', 'nomax'));
+			$ext->add($context, $exten, '', new ext_gotoif('$[ ${GROUP_COUNT(OUT_${DIAL_TRUNK})} > ${OUTMAXCHANS_${DIAL_TRUNK}} ]', 'chanfull'));
+			$ext->add($context, $exten, 'nomax', new ext_gotoif('$["${INTRACOMPANYROUTE}" = "YES"]', 'skipoutcid'));  // Set to YES if treated like internal
+			$ext->add($context, $exten, '', new ext_set('DIAL_TRUNK_OPTIONS', '${TRUNK_OPTIONS}'));
+			$ext->add($context, $exten, '', new ext_macro('outbound-callerid', '${DIAL_TRUNK}'));
+			$ext->add($context, $exten, 'skipoutcid', new ext_agi('fixlocalprefix'));  // this sets DIAL_NUMBER to the proper dial string for this trunk
+			$ext->add($context, $exten, '', new ext_set('OUTNUM', '${OUTPREFIX_${DIAL_TRUNK}}${DIAL_NUMBER}'));  // OUTNUM is the final dial number
+
+			// Back to normal processing, whether intracompany or not.
+			// But add the macro-setmusic if we don't want music on this outbound call
+			$ext->add($context, $exten, '', new ext_gotoif('$[$["${MOHCLASS}" = "default"] | $["foo${MOHCLASS}" = "foo"]]', 'gocall'));  // Set to YES if we should pump silence
+			$ext->add($context, $exten, '', new ext_set('DIAL_TRUNK_OPTIONS', 'M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS}'));  // set MoH or off
+		
+			// This macro call will always be blank and is provided as a hook for customization required prior to making a call
+			// such as adding SIP header information or other requirements. All the channel variables from above are present
+			
+			$ext->add($context, $exten, 'gocall', new ext_macro('dialout-dundi-predial-hook'));
+			$ext->add($context, $exten, '', new ext_gotoif('$["${PREDIAL_HOOK_RET}" = "BYPASS"]', 'bypass,1'));
+		
+			$ext->add($context, $exten, '', new ext_gotoif('$["${custom}" = "AMP"]', 'customtrunk'));
+
+			$ext->add($context, $exten, '', new ext_macro('dundi-${DIAL_TRUNK}','${OUTNUM}'));
+			$ext->add($context, $exten, '', new ext_goto(1, 's-${DIALSTATUS}'));
+			
+			$ext->add($context, $exten, 'chanfull', new ext_noop('max channels used up'));
+		
+			$exten = 's-BUSY';
+			$ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting BUSY - giving up'));
+			$ext->add($context, $exten, '', new ext_playtones('busy'));
+			$ext->add($context, $exten, '', new ext_busy(20));
+		
+			$exten = 's-NOANSWER';
+			$ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting NOANSWER - giving up'));
+			$ext->add($context, $exten, '', new ext_playtones('congestion'));
+			$ext->add($context, $exten, '', new ext_congestion(20));
+		
+			$exten = 's-CANCEL';
+			$ext->add($context, $exten, '', new ext_noop('Dial failed due to trunk reporting CANCEL - giving up'));
+			$ext->add($context, $exten, '', new ext_playtones('congestion'));
+			$ext->add($context, $exten, '', new ext_congestion(20));
+		
+			$exten = '_s-.';
+			$ext->add($context, $exten, '', new ext_gotoif('$["x${OUTFAIL_${ARG1}}" = "x"]', 'noreport'));
+			$ext->add($context, $exten, '', new ext_agi('${OUTFAIL_${ARG1}}'));
+			$ext->add($context, $exten, 'noreport', new ext_noop('TRUNK Dial failed due to ${DIALSTATUS} - failing through to other trunks'));
+			
+			$ext->add($context, 'disabletrunk', '', new ext_noop('TRUNK: ${OUT_${DIAL_TRUNK}} DISABLED - falling through to next trunk'));
+			$ext->add($context, 'bypass', '', new ext_noop('TRUNK: ${OUT_${DIAL_TRUNK}} BYPASSING because dialout-dundi-predial-hook'));
+		
+			$ext->add($context, 'h', '', new ext_macro('hangupcall'));
+
+
+
+			/*
+			 * sets the callerid of the device to that of the logged in user
+			 *
+			 * ${AMPUSER} is set upon return to the real user despite any aliasing that may
+			 * have been set as a result of the AMPUSER/<nnn>/cidnum field. This is used by
+			 * features like DND, CF, etc. to set the proper structure on aliased instructions 
+			 */
+			$context = 'macro-user-callerid';
+			$exten = 's';
+			
+			$ext->add($context, $exten, '', new ext_noop('user-callerid: ${CALLERID(name)} ${CALLERID(number)}'));
+							
+			// make sure AMPUSER is set if it doesn't get set below			
+			$ext->add($context, $exten, '', new ext_set('AMPUSER', '${IF($["foo${AMPUSER}" = "foo"]?${CALLERID(number)}:${AMPUSER})}'));
+			$ext->add($context, $exten, '', new ext_gotoif('$["${CHANNEL:0:5}" = "Local"]', 'report'));
+			$ext->add($context, $exten, '', new ext_execif('$["${REALCALLERIDNUM:1:2}" = ""]', 'Set', 'REALCALLERIDNUM=${CALLERID(number)}'));
+			$ext->add($context, $exten, 'start', new ext_noop('REALCALLERIDNUM is ${REALCALLERIDNUM}'));
+			$ext->add($context, $exten, '', new ext_set('AMPUSER', '${DB(DEVICE/${REALCALLERIDNUM}/user)}'));
+			$ext->add($context, $exten, '', new ext_set('AMPUSERCIDNAME', '${DB(AMPUSER/${AMPUSER}/cidname)}'));
+			$ext->add($context, $exten, '', new ext_gotoif('$["x${AMPUSERCIDNAME:1:2}" = "x"]', 'report'));
+
+			// user may masquerade as a different user internally, so set the internal cid as indicated
+			// but keep the REALCALLERID which is used to determine their true identify and lookup info
+			// during outbound calls.
+			$ext->add($context, $exten, '', new ext_set('AMPUSERCID', '${IF($["${DB_EXISTS(AMPUSER/${AMPUSER}/cidnum)}" = "1"]?${DB_RESULT}:${AMPUSER})}'));
+			$ext->add($context, $exten, '', new ext_set('CALLERID(all)', '"${AMPUSERCIDNAME}" <${AMPUSERCID}>'));
+			$ext->add($context, $exten, '', new ext_set('REALCALLERIDNUM', '${DB(DEVICE/${REALCALLERIDNUM}/user)}'));
+			if (version_compare($version, "1.4", "ge")) { 
+				$ext->add($context, $exten, '', new ext_execif('$["${DB(AMPUSER/${AMPUSER}/language)}" != ""]', 'Set', 'CHANNEL(language)=${DB(AMPUSER/${AMPUSER}/language)}'));
+			} else {
+				$ext->add($context, $exten, '', new ext_execif('$["${DB(AMPUSER/${AMPUSER}/language)}" != ""]', 'Set', 'LANGUAGE()=${DB(AMPUSER/${AMPUSER}/language)}'));
+			}
+			$ext->add($context, $exten, 'report', new ext_noop('TTL: ${TTL} ARG1: ${ARG1}'));
+			$ext->add($context, $exten, '', new ext_gotoif('$[ "${ARG1}" = "SKIPTTL" ]', 'continue'));
+			$ext->add($context, $exten, 'report2', new ext_set('__TTL', '${IF($["foo${TTL}" = "foo"]?64:$[ ${TTL} - 1 ])}'));
+			$ext->add($context, $exten, '', new ext_gotoif('$[ ${TTL} > 0 ]', 'continue'));
+			$ext->add($context, $exten, '', new ext_wait('${RINGTIMER}'));  // wait for a while, to give it a chance to be picked up by voicemail
+			$ext->add($context, $exten, '', new ext_answer());
+			$ext->add($context, $exten, '', new ext_wait('2'));
+			$ext->add($context, $exten, '', new ext_playback('im-sorry&an-error-has-occured&with&call-forwarding'));
+			$ext->add($context, $exten, '', new ext_macro('hangupcall'));
+			$ext->add($context, $exten, '', new ext_congestion(20));
+			$ext->add($context, $exten, 'continue', new ext_noop('Using CallerID ${CALLERID(all)}'));
+			$ext->add($context, 'h', '', new ext_macro('hangupcall'));
+			
+			/*
+			 * arg1 = trunk number, arg2 = number
+			 * 
+			 * Re-written to use enumlookup.agi
+			 */
+	
+			$context = 'macro-dialout-enum';
+			$exten = 's';
+	
+			$ext->add($context, $exten, '', new ext_execif('$[$["${ARG3}" != ""] & $["${DB(AMPUSER/${AMPUSER}/pinless)}" != "NOPASSWD"]]', 'Authenticate', '${ARG3}'));
+			$ext->add($context, $exten, '', new ext_macro('outbound-callerid', '${ARG1}'));
+			$ext->add($context, $exten, '', new ext_set('GROUP()', 'OUT_${ARG1}'));
+			$ext->add($context, $exten, '', new ext_gotoif('$["${OUTMAXCHANS_${ARG1}}foo" = "foo"]', 'nomax'));
+			$ext->add($context, $exten, '', new ext_gotoif('$[ ${GROUP_COUNT(OUT_${ARG1})} > ${OUTMAXCHANS_${ARG1}} ]', 'nochans'));
+			$ext->add($context, $exten, 'nomax', new ext_set('DIAL_NUMBER', '${ARG2}'));
+			$ext->add($context, $exten, '', new ext_set('DIAL_TRUNK', '${ARG1}'));
+			$ext->add($context, $exten, '', new ext_agi('fixlocalprefix'));  // this sets DIAL_NUMBER to the proper dial string for this trunk
+			//  Replacement for asterisk's ENUMLOOKUP function
+			$ext->add($context, $exten, '', new ext_agi('enumlookup.agi'));
+			// Now we have the variable DIALARR set to a list of URI's that can be called, in order of priority
+			// Loop through them trying them in order.
+			$ext->add($context, $exten, 'dialloop', new ext_gotoif('$["foo${DIALARR}"="foo"]', 'end'));
+			$ext->add($context, $exten, '', new ext_set('TRYDIAL', '${CUT(DIALARR,%,1)}'));
+			$ext->add($context, $exten, '', new ext_set('DIALARR', '${CUT(DIALARR,%,2-)}'));
+			$ext->add($context, $exten, '', new ext_dial('${TRYDIAL}', ''));
+			$ext->add($context, $exten, '', new ext_noop('Dial exited in macro-enum-dialout with ${DIALSTATUS}'));
+			// Now, if we're still here, that means the Dial failed for some reason. 
+			// If it's CONGESTION or CHANUNAVAIL we want to try again on a different
+			// different channel. If there's no more left, the dialloop tag will exit.
+			$ext->add($context, $exten, '', new ext_gotoif('$[ $[ "${DIALSTATUS}" = "CHANUNAVAIL" ] | $[ "${DIALSTATUS}" = "CONGESTION" ] ]', 'dialloop'));
+			// If we're here, then it's BUSY or NOANSWER or something and well, deal with it.
+			$ext->add($context, $exten, 'dialfailed', new ext_goto(1, 's-${DIALSTATUS}'));
+			// Here are the exit points for the macro.
+			$ext->add($context, $exten, 'nochans', new ext_noop('max channels used up'));
+			$ext->add($context, $exten, 'end', new ext_noop('Exiting macro-dialout-enum'));
+			$ext->add($context, 's-BUSY', '', new ext_noop('Trunk is reporting BUSY'));
+			$ext->add($context, 's-BUSY', '', new ext_busy(20));
+			$ext->add($context, '_s-.', '', new ext_noop('Dial failed due to ${DIALSTATUS}'));			
+			
+			/*
+			 * overrides callerid out trunks
+			 * arg1 is trunk
+			 * macro-user-callerid should be called _before_ using this macro
+			 */
+
+			$context = 'macro-outbound-callerid';
+			$exten = 's';
+			
+			// Keep the original CallerID number, for failover to the next trunk.
+			$ext->add($context, $exten, '', new ext_gotoif('$["${REALCALLERIDNUM:1:2}" != ""]', 'start'));
+			$ext->add($context, $exten, '', new ext_set('REALCALLERIDNUM', '${CALLERID(number)}'));
+			$ext->add($context, $exten, 'start', new ext_noop('REALCALLERIDNUM is ${REALCALLERIDNUM}'));
+
+			// If this came through a ringgroup or CF, then we want to retain original CID unless
+			// OUTKEEPCID_${trunknum} is set.
+			// Save then CIDNAME while it is still intact in case we end up sending out this same CID
+			$ext->add($context, $exten, '', new ext_gotoif('$["${KEEPCID}" != "TRUE"]', 'normcid'));  // Set to TRUE if coming from ringgroups, CF, etc.
+			$ext->add($context, $exten, '', new ext_gotoif('$["x${OUTKEEPCID_${ARG1}}" = "xon"]', 'normcid'));
+			$ext->add($context, $exten, '', new ext_gotoif('$["foo${REALCALLERIDNUM}" = "foo"]', 'normcid'));  // if not set to anything, go through normal processing
+			$ext->add($context, $exten, '', new ext_set('USEROUTCID', '${REALCALLERIDNUM}'));
+			//$ext->add($context, $exten, '', new ext_set('REALCALLERIDNAME', '${CALLERID(name)}'));
+
+			// We now have to make sure the CID is valid. If we find an AMPUSER with the same CID, we assume it is an internal 
+			// call (would be quite a conincidence if not) and go through the normal processing to get that CID. If a device 
+			// is set for this CID, then it must be internal 
+			// If we end up using USEROUTCID at the end, it may still be the REALCALLERIDNUM we saved above. That is determined
+			// if the two are equal, AND there is no CALLERID(name) present since it has been removed by the CALLERID(all)=${USEROUTCID}
+			// setting. If this is the case, then we put the orignal name back in to send out. Although the CNAME is not honored by most
+			// carriers, there are cases where it is so this preserves that information to be used by those carriers who do honor it.
+			$ext->add($context, $exten, '', new ext_gotoif('$["foo${DB(AMPUSER/${REALCALLERIDNUM}/device)}" = "foo"]', 'bypass', 'normcid'));
+
+			$ext->add($context, $exten, 'normcid', new ext_set('USEROUTCID', '${DB(AMPUSER/${REALCALLERIDNUM}/outboundcid)}'));
+			$ext->add($context, $exten, 'bypass', new ext_set('EMERGENCYCID', '${DB(DEVICE/${REALCALLERIDNUM}/emergency_cid)}'));
+			$ext->add($context, $exten, '', new ext_set('TRUNKOUTCID', '${OUTCID_${ARG1}}'));
+			$ext->add($context, $exten, '', new ext_gotoif('$["${EMERGENCYROUTE:1:2}" = ""]', 'trunkcid'));  // check EMERGENCY ROUTE
+			$ext->add($context, $exten, '', new ext_gotoif('$["${EMERGENCYCID:1:2}" = ""]', 'trunkcid'));  // empty EMERGENCY CID, so default back to trunk
+			$ext->add($context, $exten, '', new ext_set('CALLERID(all)', '${EMERGENCYCID}'));  // emergency cid for device
+			$ext->add($context, $exten, '', new ext_goto('report'));
+			$ext->add($context, $exten, 'trunkcid', new ext_gotoif('$["${TRUNKOUTCID:1:2}" = ""]', 'usercid'));  // check for CID override for trunk (global var)
+			$ext->add($context, $exten, '', new ext_set('CALLERID(all)', '${TRUNKOUTCID}'));
+			$ext->add($context, $exten, 'usercid', new ext_gotoif('$["${USEROUTCID:1:2}" = ""]', 'report'));  // check CID override for extension
+			$ext->add($context, $exten, '', new ext_set('CALLERID(all)', '${USEROUTCID}'));
+			//$ext->add($context, $exten, '', new ext_gotoif('$["x${CALLERID(name)}"!="xhidden"]', 'checkname', 'hidecid'));  // check CID blocking for extension
+			$ext->add($context, $exten, '', new ext_gotoif('$["x${CALLERID(name)}"!="xhidden"]', 'report', 'hidecid'));  // check CID blocking for extension
+			$ext->add($context, $exten, 'hidecid', new ext_setcallerpres('prohib_passed_screen'));  // Only works with ISDN (T1/E1/BRI)
+			//$ext->add($context, $exten, 'checkname', new ext_execif('$[ $[ "${CALLERID(number)}" = "${REALCALLERIDNUM}" ] & $[ "${CALLERID(name)}" = "" ] ]', 'Set', 'CALLERID(name)=${REALCALLERIDNAME}'));
+			$ext->add($context, $exten, 'report', new ext_noop('CallerID set to ${CALLERID(all)}'));			
+
+			
+			/*
+			 * Adds a dynamic agent/member to a Queue
+			 * Prompts for call-back number - in not entered, uses CIDNum
+			 */
+
+			$context = 'macro-agent-add';
+			$exten = 's';
+			
+			$ext->add($context, $exten, '', new ext_wait(1));
+			$ext->add($context, $exten, '', new ext_macro('user-callerid', 'SKIPTTL'));
+			$ext->add($context, $exten, 'a3', new ext_read('CALLBACKNUM', 'agent-user'));  // get callback number from user
+			$ext->add($context, $exten, '', new ext_gotoif('$["${CALLBACKNUM}" != ""]', 'a7'));  // if user just pressed # or timed out, use cidnum
+			$ext->add($context, $exten, 'a5', new ext_set('CALLBACKNUM', '${AMPUSER}'));
+			$ext->add($context, $exten, '', new ext_execif('$["${CALLBACKNUM}" = ""]', 'Set', 'CALLBACKNUM=${CALLERID(number)}'));
+			$ext->add($context, $exten, '', new ext_gotoif('$["${CALLBACKNUM}" = ""]', 'a3'));  // if still no number, start over
+			$ext->add($context, $exten, 'a7', new ext_gotoif('$["${CALLBACKNUM}" = "${ARG1}"]', 'invalid'));  // Error, they put in the queue number
+			$ext->add($context, $exten, '', new ext_execif('$["${ARG2}" != ""]', 'Authenticate', '${ARG2}'));
+			$ext->add($context, $exten, 'a9', new ext_addqueuemember('${ARG1}', 'Local/${CALLBACKNUM}@from-internal/n'));  // using chan_local allows us to have agents over trunks
+			$ext->add($context, $exten, '', new ext_userevent('Agentlogin', 'Agent: ${CALLBACKNUM}'));
+			$ext->add($context, $exten, '', new ext_wait(1));
+			$ext->add($context, $exten, '', new ext_playback('agent-loginok&with&extension'));
+			$ext->add($context, $exten, '', new ext_saydigits('${CALLBACKNUM}'));
+			$ext->add($context, $exten, '', new ext_hangup());
+			$ext->add($context, $exten, '', new ext_macroexit());
+			$ext->add($context, $exten, 'invalid', new ext_playback('pbx-invalid'));
+			$ext->add($context, $exten, '', new ext_goto('a3'));
+
+			/*
+			 * Removes a dynamic agent/member from a Queue
+			 * Prompts for call-back number - in not entered, uses CIDNum 
+			 */
+
+			$context = 'macro-agent-del';
+			
+			$ext->add($context, $exten, '', new ext_wait(1));
+			$ext->add($context, $exten, '', new ext_macro('user-callerid', 'SKIPTTL'));
+			$ext->add($context, $exten, 'a3', new ext_read('CALLBACKNUM', 'agent-user'));  // get callback number from user
+			$ext->add($context, $exten, '', new ext_gotoif('$["${CALLBACKNUM}" = ""]', 'a5', 'a7'));  // if user just pressed # or timed out, use cidnum
+			$ext->add($context, $exten, 'a5', new ext_set('CALLBACKNUM', '${AMPUSER}'));
+			$ext->add($context, $exten, '', new ext_execif('$["${CALLBACKNUM}" = ""]', 'Set', 'CALLBACKNUM=${CALLERID(number)}'));
+			$ext->add($context, $exten, '', new ext_gotoif('$["${CALLBACKNUM}" = ""]', 'a3'));  // if still no number, start over
+			$ext->add($context, $exten, 'a7', new ext_removequeuemember('${ARG1}', 'Local/${CALLBACKNUM}@from-internal/n'));
+			$ext->add($context, $exten, '', new ext_userevent('RefreshQueue'));
+			$ext->add($context, $exten, '', new ext_wait(1));
+			$ext->add($context, $exten, '', new ext_playback('agent-loggedoff'));
+			$ext->add($context, $exten, '', new ext_hangup());
+
+			$context = 'macro-systemrecording';
+			
+			$ext->add($context, 's', '', new ext_goto(1, '${ARG1}'));
+			
+			$exten = 'dorecord';
+			
+			$ext->add($context, $exten, '', new ext_record('/tmp/${AMPUSER}-ivrrecording:wav'));
+			$ext->add($context, $exten, '', new ext_wait(1));
+			$ext->add($context, $exten, '', new ext_goto(1, 'confmenu'));
+
+			$exten = 'docheck';
+			
+			$ext->add($context, $exten, '', new ext_playback('/tmp/${AMPUSER}-ivrrecording'));
+			$ext->add($context, $exten, '', new ext_wait(1));
+			$ext->add($context, $exten, '', new ext_goto(1, 'confmenu'));
+
+			$exten = 'confmenu';
+			if (version_compare($version, "1.4", "ge")) { 
+				$ext->add($context, $exten, '', new ext_background('to-listen-to-it&press-1&to-rerecord-it&press-star,m,${CHANNEL(language)},macro-systemrecording'));
+			} else {
+				$ext->add($context, $exten, '', new ext_background('to-listen-to-it&press-1&to-rerecord-it&press-star,m,${LANGUAGE},macro-systemrecording'));
+			}
+			$ext->add($context, $exten, '', new ext_read('RECRESULT', '', 1, '', '', 4));
+			$ext->add($context, $exten, '', new ext_gotoif('$["x${RECRESULT}"="x*"]', 'dorecord,1'));
+			$ext->add($context, $exten, '', new ext_gotoif('$["x${RECRESULT}"="x1"]', 'docheck,1'));
+			$ext->add($context, $exten, '', new ext_goto(1));
+			
+			$ext->add($context, '1', '', new ext_goto(1, 'docheck'));
+			$ext->add($context, '*', '', new ext_goto(1, 'dorecord'));
+			
+			$ext->add($context, 't', '', new ext_playback('goodbye'));
+			$ext->add($context, 't', '', new ext_hangup());
+			
+			$ext->add($context, 'i', '', new ext_playback('pm-invalid-option'));
+			$ext->add($context, 'i', '', new ext_goto(1, 'confmenu'));
+
+			$ext->add($context, 'h', '', new ext_hangup());
+			
 		break;
 	}
 }
-
-
-
-
-
-
-
-
-
-
 
 /* begin page.ampusers.php functions */
 
@@ -611,34 +1555,31 @@
 	return sql($sql,"getAll",DB_FETCHMODE_ASSOC);
 }
 
-function core_did_get($extension="",$cidnum="",$channel=""){
-	$sql = "SELECT * FROM incoming WHERE cidnum = \"$cidnum\" AND extension = \"$extension\" AND channel = \"$channel\"";
+function core_did_get($extension="",$cidnum=""){
+	$sql = "SELECT * FROM incoming WHERE cidnum = \"$cidnum\" AND extension = \"$extension\"";
 	return sql($sql,"getRow",DB_FETCHMODE_ASSOC);
 }
 
-function core_did_del($extension,$cidnum, $channel){
-	$sql="DELETE FROM incoming WHERE cidnum = \"$cidnum\" AND extension = \"$extension\" AND channel = \"$channel\"";
+function core_did_del($extension,$cidnum){
+	$sql="DELETE FROM incoming WHERE cidnum = \"$cidnum\" AND extension = \"$extension\"";
 	sql($sql);
 }
 
-function core_did_edit($old_extension,$old_cidnum, $old_channel, $incoming){
+function core_did_edit($old_extension,$old_cidnum, $incoming){
 
 	$old_extension = addslashes(trim($old_extension));
 	$old_cidnum = addslashes(trim($old_cidnum));
-	$old_channel = addslashes(trim($old_channel));
 
 	$incoming['extension'] = trim($incoming['extension']);
 	$incoming['cidnum'] = trim($incoming['cidnum']);
-	$incoming['channel'] = trim($incoming['channel']);
 
 	$extension = addslashes($incoming['extension']);
 	$cidnum = addslashes($incoming['cidnum']);
-	$channel = addslashes($incoming['channel']);
 
 	// if did or cid changed, then check to make sure that this pair is not already being used.
 	//
 	if (($extension != $old_extension) || ($cidnum != $old_cidnum)) {
-		$existing=core_did_get($extension,$cidnum,$channel);
+		$existing=core_did_get($extension,$cidnum);
 		if (empty($existing) && (trim($cidnum) == "")) {
 			$existing_directdid = core_users_directdid_get($extension);
 		} else {
@@ -649,7 +1590,7 @@
 	}
 
 	if (empty($existing) && empty($existing_directdid)) {
-		core_did_del($old_extension,$old_cidnum,$old_channel);
+		core_did_del($old_extension,$old_cidnum);
 		core_did_add($incoming);
 		return true;
 	} else {
@@ -667,7 +1608,7 @@
 
 	// Check to make sure the did is not being used elsewhere
 	//
-	$existing=core_did_get($extension,$cidnum,$channel);
+	$existing=core_did_get($extension,$cidnum);
 	if (empty($existing) && (trim($cidnum) == "")) {
 		$existing_directdid = core_users_directdid_get($extension);
 	} else {
@@ -676,7 +1617,7 @@
 
 	if (empty($existing) && empty($existing_directdid)) {
 		$destination=${$goto0.'0'};
-		$sql="INSERT INTO incoming (cidnum,extension,destination,faxexten,faxemail,answer,wait,privacyman,alertinfo, channel, ringing, mohclass, description, grppre) values ('$cidnum','$extension','$destination','$faxexten','$faxemail','$answer','$wait','$privacyman','$alertinfo', '$channel', '$ringing', '$mohclass', '$description', '$grppre')";
+		$sql="INSERT INTO incoming (cidnum,extension,destination,faxexten,faxemail,answer,wait,privacyman,alertinfo, ringing, mohclass, description, grppre) values ('$cidnum','$extension','$destination','$faxexten','$faxemail','$answer','$wait','$privacyman','$alertinfo', '$ringing', '$mohclass', '$description', '$grppre')";
 		sql($sql);
 		return true;
 	} else {
@@ -804,7 +1745,7 @@
 		$astman->database_put("DEVICE",$id."/dial",$dial);
 		$astman->database_put("DEVICE",$id."/type",$devicetype);
 		$astman->database_put("DEVICE",$id."/default_user",$user);
-		if(!empty($emergency_cid)) {
+		if($emergency_cid != '') {
 			$astman->database_put("DEVICE",$id."/emergency_cid","\"".$emergency_cid."\"");
 		}
 
@@ -944,6 +1885,10 @@
 			$astman->database_put("DEVICE",$id."/dial",$dial);
 			$astman->database_put("DEVICE",$id."/type",$devicetype);
 			$astman->database_put("DEVICE",$id."/user",$user);		
+			$astman->database_put("DEVICE",$id."/default_user",$user);
+			if(trim($emergency_cid) != '') {
+				$astman->database_put("DEVICE",$id."/emergency_cid","\"".$emergency_cid."\"");
+			}
 			// If a user is selected, add this device to the user
 			if ($user != "none") {
 					$existingdevices = $astman->database_get("AMPUSER",$user."/device");
@@ -1246,10 +2191,20 @@
 
 
 function core_hint_get($account){
-	//determine what devices this user is associated with
-	$sql = "SELECT dial from devices where user = '{$account}'";
+	global $astman;
+
+	// We should always check the AMPUSER in case they logged into a device
+	// but we will fall back to the old methond if $astman not open although
+	// I'm pretty sure everything else will puke anyhow if not running
+	//
+	if ($astman) {
+		$device=$astman->database_get("AMPUSER",$account."/device");
+		$device_arr = explode('&',$device);
+		$sql = "SELECT dial from devices where id in ('".implode("','",$device_arr)."')";
+	} else {
+		$sql = "SELECT dial from devices where user = '{$account}'";
+	}
 	$results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
-	//print_r($results);
 	
 	//create an array of strings
 	if (is_array($results)){
@@ -1284,7 +2239,7 @@
 	//only allow extensions that are within administrator's allowed range
 	foreach($results as $result){
 		if (checkRange($result[0])){
-			$extens[] = array($result[0],$result[1]);
+			$extens[] = array($result[0],$result[1],$result[2]);
 		}
 	}
 	
@@ -1296,6 +2251,58 @@
 	}
 }
 
+function core_check_extensions($exten=true) {
+	global $amp_conf;
+
+	$extenlist = array();
+	if (is_array($exten) && empty($exten)) {
+		return $extenlist;
+	}
+	$sql = "SELECT extension, name FROM users ";
+	if (is_array($exten)) {
+		$sql .= "WHERE extension in ('".implode("','",$exten)."')";
+	}
+	$sql .= " ORDER BY extension";
+	$results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
+
+	foreach ($results as $result) {
+		$thisexten = $result['extension'];
+		$extenlist[$thisexten]['description'] = _("User Extension: ").$result['name'];
+		$extenlist[$thisexten]['status'] = 'INUSE';
+		$display = ($amp_conf['AMPEXTENSIONS'] == "deviceanduser")?'users':'extensions';
+		$extenlist[$thisexten]['edit_url'] = "config.php?type=setup&display=$display&extdisplay=".urlencode($thisexten)."&skip=0";
+	}
+	return $extenlist;
+}
+
+function core_check_destinations($dest=true) {
+	global $active_modules;
+
+	$destlist = array();
+	if (is_array($dest) && empty($dest)) {
+		return $destlist;
+	}
+	$sql = "SELECT extension, cidnum, description, destination FROM incoming ";
+	if ($dest !== true) {
+		$sql .= "WHERE destination in ('".implode("','",$dest)."')";
+	}
+	$sql .= "ORDER BY extension, cidnum";
+	$results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
+
+	//$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup';
+
+	foreach ($results as $result) {
+		$thisdest = $result['destination'];
+		$thisid   = $result['extension'].'/'.$result['cidnum'];
+		$destlist[] = array(
+			'dest' => $thisdest,
+			'description' => 'Inbound Route: '.$result['description'].' ('.$thisid.')',
+			'edit_url' => 'config.php?display=did&extdisplay='.urlencode($thisid),
+		);
+	}
+	return $destlist;
+}
+
 function core_sipname_check($sipname, $extension) {
 	global $db;
 	if (!isset($sipname) || trim($sipname)=='')
@@ -1313,7 +2320,7 @@
 		return true;
 }
 
-function core_users_add($vars) {
+function core_users_add($vars, $editmode=false) {
 	extract($vars);
 	
 	global $db;
@@ -1342,7 +2349,7 @@
 	//
 	$directdid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", trim($directdid));
 	if (trim($directdid) != "") {
-		$existing=core_did_get($directdid,"","");
+		$existing=core_did_get($directdid,"");
 		$existing_directdid = empty($existing)?core_users_directdid_get($directdid):$existing;
 		if (!empty($existing) || !empty($existing_directdid)) {
 			if (!empty($existing)) {
@@ -1440,7 +2447,9 @@
 		$astman->database_put("AMPUSER",$extension."/cidname",isset($name)?"\"".$name."\"":'');
 		$astman->database_put("AMPUSER",$extension."/cidnum",$cid_masquerade);
 		$astman->database_put("AMPUSER",$extension."/voicemail","\"".isset($voicemail)?$voicemail:''."\"");
-		$astman->database_put("AMPUSER",$extension."/device","\"".((isset($device))?$device:'')."\"");
+		if (!$editmode) {
+			$astman->database_put("AMPUSER",$extension."/device","\"".((isset($device))?$device:'')."\"");
+		}
 
 		if (trim($callwaiting) == 'enabled') {
 			$astman->database_put("CW",$extension,"\"ENABLED\"");
@@ -1470,17 +2479,11 @@
 
 				$mode="unavail";
 				$astman->database_put("AMPUSER", "$extension/vmx/$mode/state", "$unavail_mode");
-				$astman->database_put("AMPUSER", "$extension/vmx/$mode/repeat", "$repeat");
-				$astman->database_put("AMPUSER", "$extension/vmx/$mode/timeout", "$timeout");
 				$astman->database_put("AMPUSER", "$extension/vmx/$mode/vmxopts/timeout", "$vmxopts_timeout");
-				$astman->database_put("AMPUSER", "$extension/vmx/$mode/loops", "$loops");
 
 				$mode="busy";
 				$astman->database_put("AMPUSER", "$extension/vmx/$mode/state", "$busy_mode");
-				$astman->database_put("AMPUSER", "$extension/vmx/$mode/repeat", "$repeat");
-				$astman->database_put("AMPUSER", "$extension/vmx/$mode/timeout", "$timeout");
 				$astman->database_put("AMPUSER", "$extension/vmx/$mode/vmxopts/timeout", "$vmxopts_timeout");
-				$astman->database_put("AMPUSER", "$extension/vmx/$mode/loops", "$loops");
 				
 			}
 		} else {
@@ -1505,6 +2508,9 @@
 	$results = $db->getRow($sql,DB_FETCHMODE_ASSOC);
 	if(DB::IsError($results)) {
 		die_freepbx($results->getMessage().$sql);
+	}
+	if (empty($results)) {
+		return $results;
 	}
 	
 	//explode recording vars
@@ -1531,7 +2537,7 @@
 	return $results;
 }
 
-function core_users_del($extension){
+function core_users_del($extension, $editmode=false){
 	global $db;
 	global $amp_conf;
 	global $astman;
@@ -1544,7 +2550,7 @@
 	}
 
 	//delete details to astdb
-	if ($astman) {
+	if ($astman && !$editmode) {
 		$astman->database_del("AMPUSER",$extension."/password");
 		$astman->database_del("AMPUSER",$extension."/ringtimer");
 		$astman->database_del("AMPUSER",$extension."/noanswer");
@@ -1554,8 +2560,6 @@
 		$astman->database_del("AMPUSER",$extension."/cidnum");
 		$astman->database_del("AMPUSER",$extension."/voicemail");
 		$astman->database_del("AMPUSER",$extension."/device");
-	} else {
-		fatal("Cannot connect to Asterisk Manager with ".$amp_conf["AMPMGRUSER"]."/".$amp_conf["AMPMGRPASS"]);
 	}
 }
 
@@ -1605,7 +2609,7 @@
 	// clean and check the did to make sure it is not being used by another extension or in did routing
 	//
 	if (trim($directdid) != "") {
-		$existing=core_did_get($directdid,"","");
+		$existing=core_did_get($directdid,"");
 		$existing_directdid = empty($existing)?core_users_directdid_get($directdid):$existing;
 		if (!empty($existing) || (!empty($existing_directdid) && $existing_directdid['extension'] != $extension)) {
 			if (!empty($existing)) {
@@ -1619,8 +2623,8 @@
 
 	//delete and re-add
 	if (core_sipname_check($vars['sipname'],$extension)) {
-		core_users_del($extension);
-		core_users_add($vars);
+		core_users_del($extension, true);
+		core_users_add($vars, true);
 	}
 	return true;
 	
@@ -1632,6 +2636,80 @@
 }
 
 
+
+function core_zapchandids_add($description, $channel, $did) {
+	global $db;
+
+
+	if (!ctype_digit(trim($channel)) || trim($channel) == '') {
+		echo "<script>javascript:alert('"._('Invalid Channel Number, must be numeric and not blank')."')</script>";
+		return false;
+	}
+	if (trim($did) == '') {
+		echo "<script>javascript:alert('"._('Invalid DID, must be a non-blank DID')."')</script>";
+		return false;
+	}
+
+	$description = q($description);
+	$channel     = q($channel);
+	$did         = q($did);
+
+	$sql = "INSERT INTO zapchandids (channel, description, did) VALUES ($channel, $description, $did)";
+	$results = $db->query($sql);
+	if (DB::IsError($results)) {
+		if ($results->getCode() == DB_ERROR_ALREADY_EXISTS) {
+			echo "<script>javascript:alert('"._("Error Duplicate Channel Entry")."')</script>";
+			return false;
+		} else {
+			die_freepbx($results->getMessage()."<br><br>".$sql);
+		}
+	}
+	return true;
+}
+
+function core_zapchandids_edit($description, $channel, $did) {
+	global $db;
+
+	$description = q($description);
+	$channel     = q($channel);
+	$did         = q($did);
+
+	$sql = "UPDATE zapchandids SET description = $description, did = $did WHERE channel = $channel";
+	$results = $db->query($sql);
+	if (DB::IsError($results)) {
+		die_freepbx($results->getMessage()."<br><br>".$sql);
+	}
+	return true;
+}
+
+function core_zapchandids_delete($channel) {
+	global $db;
+
+	$channel     = q($channel);
+
+	$sql = "DELETE FROM zapchandids WHERE channel = $channel";
+	$results = $db->query($sql);
+	if (DB::IsError($results)) {
+		die_freepbx($results->getMessage()."<br><br>".$sql);
+	}
+	return true;
+}
+
+function core_zapchandids_list() {
+	global $db;
+
+	$sql = "SELECT * FROM zapchandids ORDER BY channel";
+	return sql($sql,"getAll",DB_FETCHMODE_ASSOC);
+}
+
+function core_zapchandids_get($channel) {
+	global $db;
+
+	$channel     = q($channel);
+
+	$sql = "SELECT * FROM zapchandids WHERE channel = $channel";
+	return sql($sql,"getRow",DB_FETCHMODE_ASSOC);
+}
 
 /* end page.users.php functions */
 
@@ -1783,10 +2861,13 @@
 				$confitem[$key]=$value;
 		}
 	}
+	// rember 1=disabled so we start at 2 (1 + the first 1)
+	$seq = 1;
 	foreach($confitem as $k=>$v) {
-		$dbconfitem[]=array($k,$v);
-	}
-	$compiled = $db->prepare("INSERT INTO $table (id, keyword, data, flags) values ('9999$trunknum',?,?,'$disable_flag')");
+		$seq = ($disable_flag == 1) ? 1 : $seq+1;
+		$dbconfitem[]=array($k,$v,$seq);
+	}
+	$compiled = $db->prepare("INSERT INTO $table (id, keyword, data, flags) values ('9999$trunknum',?,?,?)");
 	$result = $db->executeMultiple($compiled,$dbconfitem);
 	if(DB::IsError($result)) {
 		die_freepbx($result->getMessage()."<br><br>INSERT INTO $table (id, keyword, data, flags) values ('9999$trunknum',?,?,'$disable_flag')");	
@@ -1857,7 +2938,7 @@
 
 		foreach ($unique_trunks as $trunk) {
 			list($tech,$name) = explode('/',$trunk[1]);
-			$trunkinfo[$name] = array(
+			$trunkinfo[$trunk[1]] = array(
 				'name' => $name,
 				'tech' => $tech,
 				'globalvar' => $trunk[0], // ick
@@ -1987,7 +3068,7 @@
 	
 	if ($tech == "zap") return ""; // zap has no details
 	
-	$results = sql("SELECT keyword,data FROM $tech WHERE id = '9999$trunknum' ORDER BY id","getAll");
+	$results = sql("SELECT keyword,data FROM $tech WHERE id = '9999$trunknum' ORDER BY flags, keyword DESC","getAll");
 	
 	foreach ($results as $result) {
 		if ($result[0] != 'account') {
@@ -2005,7 +3086,7 @@
 	$tech = core_trunks_getTrunkTech($trunknum);
 	if ($tech == "zap") return ""; // zap has no account
 	
-	$results = sql("SELECT keyword,data FROM $tech WHERE id = '99999$trunknum' ORDER BY id","getAll");
+	$results = sql("SELECT keyword,data FROM $tech WHERE id = '99999$trunknum'","getAll");
 
 	foreach ($results as $result) {
 		if ($result[0] == 'account') {
@@ -2023,7 +3104,7 @@
 	
 	if ($tech == "zap") return ""; // zap has no details
 	
-	$results = sql("SELECT keyword,data FROM $tech WHERE id = '99999$trunknum' ORDER BY id","getAll");
+	$results = sql("SELECT keyword,data FROM $tech WHERE id = '99999$trunknum' ORDER BY flags, keyword DESC","getAll");
 
 	foreach ($results as $result) {
 		if ($result[0] != 'account') {
@@ -2063,9 +3144,9 @@
 	global $amp_conf;
 
 	if ($amp_conf["AMPDBENGINE"] == "sqlite3")
-		$sql_code = "SELECT DISTINCT              context, priority FROM extensions WHERE context LIKE 'outrt-%' AND (args LIKE 'dialout-trunk,".$trunknum.",%' OR args LIKE 'dialout-enum,".$trunknum.",%') ORDER BY context";
+		$sql_code = "SELECT DISTINCT              context, priority FROM extensions WHERE context LIKE 'outrt-%' AND (args LIKE 'dialout-trunk,".$trunknum.",%' OR args LIKE 'dialout-enum,".$trunknum.",%' OR args LIKE 'dialout-dundi,".$trunknum.",%') ORDER BY context";
 	else
-		$sql_code = "SELECT DISTINCT SUBSTRING(context,7), priority FROM extensions WHERE context LIKE 'outrt-%' AND (args LIKE 'dialout-trunk,".$trunknum.",%' OR args LIKE 'dialout-enum,".$trunknum.",%') ORDER BY context";
+		$sql_code = "SELECT DISTINCT SUBSTRING(context,7), priority FROM extensions WHERE context LIKE 'outrt-%' AND (args LIKE 'dialout-trunk,".$trunknum.",%' OR args LIKE 'dialout-enum,".$trunknum.",%' OR args LIKE 'dialout-dundi,".$trunknum.",%') ORDER BY context";
 
 	$results = sql( $sql_code, "getAll" );
 
@@ -2401,10 +3482,13 @@
 			else
 				$pass_str = "";
 
-			if ($trunktech[$trunk] == "ENUM")
+			if ($trunktech[$trunk] == "ENUM") {
 				$sql .= "'dialout-enum,".substr($trunk,4).",\${".$exten."},".$pass_str."'"; // cut off OUT_ from $trunk
-			else
+			} else if ($trunktech[$trunk] == "DUNDI") {
+				$sql .= "'dialout-dundi,".substr($trunk,4).",\${".$exten."},".$pass_str."'"; // cut off OUT_ from $trunk
+			} else {
 				$sql .= "'dialout-trunk,".substr($trunk,4).",\${".$exten."},".$pass_str."'"; // cut off OUT_ from $trunk
+			}
 			$sql .= ")";
 			
 			$result = $db->query($sql);
@@ -2519,7 +3603,7 @@
 //get unique outbound route patterns for a given context
 function core_routing_getroutepatterns($route) {
 	global $db;
-	$sql = "SELECT extension, args FROM extensions WHERE context = 'outrt-".$route."' AND (args LIKE 'dialout-trunk%' OR args LIKE'dialout-enum%') ORDER BY extension ";
+	$sql = "SELECT extension, args FROM extensions WHERE context = 'outrt-".$route."' AND (args LIKE 'dialout-trunk%' OR args LIKE 'dialout-enum%' OR args LIKE 'dialout-dundi%') ORDER BY extension ";
 	$results = $db->getAll($sql);
 	if(DB::IsError($results)) {
 		die_freepbx($results->getMessage());
@@ -2547,7 +3631,7 @@
 //get unique outbound route trunks for a given context
 function core_routing_getroutetrunks($route) {
 	global $db;
-	$sql = "SELECT DISTINCT args FROM extensions WHERE context = 'outrt-".$route."' AND (args LIKE 'dialout-trunk,%' OR args LIKE 'dialout-enum,%') ORDER BY CAST(priority as UNSIGNED) ";
+	$sql = "SELECT DISTINCT args FROM extensions WHERE context = 'outrt-".$route."' AND (args LIKE 'dialout-trunk,%' OR args LIKE 'dialout-enum,%' OR args LIKE 'dialout-dundi,%') ORDER BY CAST(priority as UNSIGNED) ";
 	$results = $db->getAll($sql);
 	if(DB::IsError($results)) {
 		die_freepbx($results->getMessage());
@@ -2565,6 +3649,10 @@
 			if (!in_array("OUT_".$matches[1], $trunks)) {
 				$trunks[] = "OUT_".$matches[1];
 			}
+		} else if (preg_match('/^dialout-dundi,(\d+)/', $row[0], $matches)) {
+			if (!in_array("OUT_".$matches[1], $trunks)) {
+				$trunks[] = "OUT_".$matches[1];
+			}
 		}
 	}
 	return $trunks;
@@ -2574,7 +3662,7 @@
 //get password for this route
 function core_routing_getroutepassword($route) {
 	global $db;
-	$sql = "SELECT DISTINCT args FROM extensions WHERE context = 'outrt-".$route."' AND (args LIKE 'dialout-trunk,%' OR args LIKE 'dialout-enum,%') ORDER BY CAST(priority as UNSIGNED) ";
+	$sql = "SELECT DISTINCT args FROM extensions WHERE context = 'outrt-".$route."' AND (args LIKE 'dialout-trunk,%' OR args LIKE 'dialout-enum,%' OR args LIKE 'dialout-dundi,%') ORDER BY CAST(priority as UNSIGNED) ";
 	$results = $db->getOne($sql);
 	if(DB::IsError($results)) {
 		die_freepbx($results->getMessage());
@@ -2656,6 +3744,7 @@
  array ( "name" => "Finland",  "iso" => "fi", "conf" => "ringcadence = 1000,4000\ndial = 425\nbusy = 425/300,0/300\nring = 425/1000,0/4000\ncongestion = 425/200,0/200\ncallwaiting = 425/150,0/150,425/150,0/8000\ndialrecall = 425/650,0/25\nrecord = 1400/500,0/15000\ninfo = 950/650,0/325,950/325,0/30,1400/1300,0/2600\nstutter = 425/650,0/25\n"),
  array ( "name" => "France",  "iso" => "fr", "conf" => "ringcadence = 1500,3500\ndial = 440\nbusy = 440/500,0/500\nring = 440/1500,0/3500\ncongestion = 440/250,0/250\ncallwait = 440/300,0/10000\ndialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440\nrecord = 1400/500,0/15000\ninfo = !950/330,!1400/330,!1800/330\nstutter = !440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,440\n"),
  array ( "name" => "Greece",  "iso" => "gr", "conf" => "ringcadence = 1000,4000\ndial = 425/200,0/300,425/700,0/800\nbusy = 425/300,0/300\nring = 425/1000,0/4000\ncongestion = 425/200,0/200\ncallwaiting = 425/150,0/150,425/150,0/8000\ndialrecall = 425/650,0/25\nrecord = 1400/400,0/15000\ninfo = !950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0\nstutter = 425/650,0/25\n"),
+array ( "name" => "Hong Kong", "iso" => "hk", "conf" => "ringcadence = 400,200,400,3000\ndial = 350+440\nbusy = 480+620/500,0/500\nring = 440+480/400,0/200,440+480/400,0/3000\ncongestion = 480+620/250,0/250\ncallwaiting = 440/300,0/10000\ndialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440\nrecord = 1400/500,0/15000\ninfo = !950/330,!1400/330,!1800/330,0\nstutter = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440\n"),
  array ( "name" => "Hungary",  "iso" => "hu", "conf" => "ringcadence = 1250,3750\ndial = 425\nbusy = 425/300,0/300\nring = 425/1250,0/3750\ncongestion = 425/300,0/300\ncallwaiting = 425/40,0/1960\ndialrecall = 425+450\nrecord = 1400/400,0/15000\ninfo = !950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0\nstutter = 350+375+400\n"),
  array ( "name" => "India",  "iso" => "in", "conf" => "ringcadence = 400,200,400,2000\ndial = 400*25\nbusy = 400/750,0/750\nring = 400*25/400,0/200,400*25/400,0/2000\ncongestion = 400/250,0/250\ncallwaiting = 400/200,0/100,400/200,0/7500\ndialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440\nrecord = 1400/500,0/15000\ninfo = !950/330,!1400/330,!1800/330,0/1000\nstutter = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440\n"),
  array ( "name" => "Israel",  "iso" => "il", "conf" => "ringcadence = 1000,3000\ndial = 414\nbusy = 414/500,0/500\nring = 414/1000,0/3000\ncongestion = 414/250,0/250\ncallwaiting = 414/100,0/100,414/100,0/100,414/600,0/3000 \ndialrecall = !414/100,!0/100,!414/100,!0/100,!414/100,!0/100,414\nrecord = 1400/500,0/15000\ninfo = 1000/330,1400/330,1800/330,0/1000\nstutter = !414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,414 \n"),
@@ -2804,17 +3893,34 @@
 		$delURL = $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'].'&action=del';
 	
 		if ( is_string($extdisplay) ) {	
-			$extenInfo=core_users_get($extdisplay);
-			extract($extenInfo);
+
+			if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) {
+				$extenInfo=core_users_get($extdisplay);
+				extract($extenInfo);
+			}
 			if (isset($deviceInfo) && is_array($deviceInfo))
 				extract($deviceInfo);
 	
 			if ( $display == 'extensions' ) {
 				$currentcomponent->addguielem('_top', new gui_pageheading('title', _("Extension").": $extdisplay", false), 0);
-				$currentcomponent->addguielem('_top', new gui_link('del', _("Delete Extension")." $extdisplay", $delURL, true, false), 0);
+				if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) {
+					$currentcomponent->addguielem('_top', new gui_link('del', _("Delete Extension")." $extdisplay", $delURL, true, false), 0);
+
+					$usage_list = framework_display_destination_usage(core_getdest($extdisplay));
+					if (!empty($usage_list)) {
+						$currentcomponent->addguielem('_top', new gui_link_label('dests', $usage_list['text'], $usage_list['tooltip'], true), 0);
+					}
+				}
 			} else {
 				$currentcomponent->addguielem('_top', new gui_pageheading('title', _("User").": $extdisplay", false), 0);
-				$currentcomponent->addguielem('_top', new gui_link('del', _("Delete User")." $extdisplay", $delURL, true, false), 0);
+				if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) {
+					$currentcomponent->addguielem('_top', new gui_link('del', _("Delete User")." $extdisplay", $delURL, true, false), 0);
+
+					$usage_list = framework_display_destination_usage(core_getdest($extdisplay));
+					if (!empty($usage_list)) {
+						$currentcomponent->addguielem('_top', new gui_link_label('dests', $usage_list['text'], $usage_list['tooltip'], true), 0);
+					}
+				}
 			}
 
 		} elseif ( $display != 'extensions' ) {
@@ -2844,27 +3950,27 @@
 		if ( $extdisplay ) {
 			$currentcomponent->addguielem($section, new gui_hidden('extension', $extdisplay), 2);
 		} else {
-			$currentcomponent->addguielem($section, new gui_textbox('extension', $extdisplay, 'User Extension', 'The extension number to dial to reach this user.', '!isInteger()', $msgInvalidExtNum, false), 3);
+			$currentcomponent->addguielem($section, new gui_textbox('extension', $extdisplay, 'User Extension', _("The extension number to dial to reach this user."), '!isInteger()', $msgInvalidExtNum, false), 3);
 		}
 		if ( $display != 'extensions' ) {
 			$currentcomponent->addguielem($section, new gui_password('password', $password, 'User Password', _("A user will enter this password when logging onto a device.").' '.$fc_logon.' '._("logs into a device.").' '.$fc_logoff.' '._("logs out of a device."), '!isInteger() && !isWhitespace()', $msgInvalidExtPwd, true));
 			// extra JS function check required for blank password warning -- call last in the onsubmit() function
 			$currentcomponent->addjsfunc('onsubmit()', "\treturn checkBlankUserPwd();\n", 9);
 		}
-		$currentcomponent->addguielem($section, new gui_textbox('name', $name, 'Display Name', 'The caller id name for calls from this user will be set to this name. Only enter the name, NOT the number.', '!isCallerID()', $msgInvalidDispName, false));
+		$currentcomponent->addguielem($section, new gui_textbox('name', $name, 'Display Name', _("The caller id name for calls from this user will be set to this name. Only enter the name, NOT the number."), '!isCallerID()', $msgInvalidDispName, false));
 		$cid_masquerade = (trim($cid_masquerade) == $extdisplay)?"":$cid_masquerade;
-		$currentcomponent->addguielem($section, new gui_textbox('cid_masquerade', $cid_masquerade, 'CID Num Alias', 'The CID Number to use for internal calls, if different from the extension number. This is used to masquerade as a different user. A common example is a team of support people who would like their internal callerid to display the general support number (a ringgroup or queue). There will be no effect on external calls.', '!isWhitespace() && !isInteger()', $msgInvalidCidNum, false));
-		$currentcomponent->addguielem($section, new gui_textbox('sipname', $sipname, 'SIP Alias', "If you want to support direct sip dialing of users internally or through anonymous sip calls, you can supply a friendly name that can be used in addition to the users extension to call them."));
+		$currentcomponent->addguielem($section, new gui_textbox('cid_masquerade', $cid_masquerade, 'CID Num Alias', _("The CID Number to use for internal calls, if different from the extension number. This is used to masquerade as a different user. A common example is a team of support people who would like their internal callerid to display the general support number (a ringgroup or queue). There will be no effect on external calls."), '!isWhitespace() && !isInteger()', $msgInvalidCidNum, false));
+		$currentcomponent->addguielem($section, new gui_textbox('sipname', $sipname, 'SIP Alias', _("If you want to support direct sip dialing of users internally or through anonymous sip calls, you can supply a friendly name that can be used in addition to the users extension to call them.")));
 		
 		$section = 'Extension Options';
-		$currentcomponent->addguielem($section, new gui_textbox('directdid', $directdid, 'Direct DID', "The direct DID that is associated with this extension. The DID should be in the same format as provided by the provider (e.g. full number, 4 digits for 10x4, etc).<br><br>Format should be: <b>XXXXXXXXXX</b><br><br>Leave this field blank to disable the direct DID feature for this extension. All non-numeric characters will be stripped."), 3);
-		$currentcomponent->addguielem($section, new gui_textbox('didalert', $didalert, 'DID Alert Info', "Alert Info can be used for distinctive ring on SIP phones. Set this value to the desired Alert Info to be sent to the phone when this DID is called. Leave blank to use default values. Will have no effect if no Direct DID is set"));
+		$currentcomponent->addguielem($section, new gui_textbox('directdid', $directdid, 'Direct DID', _("The direct DID that is associated with this extension. The DID should be in the same format as provided by the provider (e.g. full number, 4 digits for 10x4, etc).<br><br>Format should be: <b>XXXXXXXXXX</b><br><br>Leave this field blank to disable the direct DID feature for this extension. All non-numeric characters will be stripped.")), 3);
+		$currentcomponent->addguielem($section, new gui_textbox('didalert', $didalert, 'DID Alert Info', _("Alert Info can be used for distinctive ring on SIP phones. Set this value to the desired Alert Info to be sent to the phone when this DID is called. Leave blank to use default values. Will have no effect if no Direct DID is set")));
 		if (function_exists('music_list')) {
-		    $currentcomponent->addguielem($section, new gui_selectbox('mohclass', $currentcomponent->getoptlist('mohclass'), $mohclass, 'Music on Hold', "Set the MoH class that will be used for calls that come in on this Direct DID. For example, choose a type appropriate for a originating country which may have announcements in their language. Only effects MoH class when the call came in from the Direct DID.", false));
-		}
-		$currentcomponent->addguielem($section, new gui_textbox('outboundcid', $outboundcid, 'Outbound CID', "Overrides the caller id when dialing out a trunk. Any setting here will override the common outbound caller id set in the Trunks admin.<br><br>Format: <b>\"caller name\" &lt;#######&gt;</b><br><br>Leave this field blank to disable the outbound callerid feature for this user.", '!isCallerID()', $msgInvalidOutboundCID, true));
+		    $currentcomponent->addguielem($section, new gui_selectbox('mohclass', $currentcomponent->getoptlist('mohclass'), $mohclass, 'Music on Hold', _("Set the MoH class that will be used for calls that come in on this Direct DID. For example, choose a type appropriate for a originating country which may have announcements in their language. Only effects MoH class when the call came in from the Direct DID."), false));
+		}
+		$currentcomponent->addguielem($section, new gui_textbox('outboundcid', $outboundcid, 'Outbound CID', _("Overrides the caller id when dialing out a trunk. Any setting here will override the common outbound caller id set in the Trunks admin.<br><br>Format: <b>\"caller name\" &lt;#######&gt;</b><br><br>Leave this field blank to disable the outbound callerid feature for this user."), '!isCallerID()', $msgInvalidOutboundCID, true));
 		$ringtimer = (isset($ringtimer) ? $ringtimer : '0');
-		$currentcomponent->addguielem($section, new gui_selectbox('ringtimer', $currentcomponent->getoptlist('ringtime'), $ringtimer, 'Ring Time', "Number of seconds to ring prior to going to voicemail. Default will use the value set in the General Tab. If no voicemail is configured this will be ignored.", false));
+		$currentcomponent->addguielem($section, new gui_selectbox('ringtimer', $currentcomponent->getoptlist('ringtime'), $ringtimer, 'Ring Time', _("Number of seconds to ring prior to going to voicemail. Default will use the value set in the General Tab. If no voicemail is configured this will be ignored."), false));
 		if (!isset($callwaiting)) {
 			if ($amp_conf['ENABLECW']) {
 				$callwaiting = 'enabled';
@@ -2872,22 +3978,22 @@
 				$callwaiting = 'disabled';
 			}
 		}
-		$currentcomponent->addguielem($section, new gui_selectbox('callwaiting', $currentcomponent->getoptlist('callwaiting'), $callwaiting, 'Call Waiting', "Set the initial/current Call Waiting state for this user's extension", false));
+		$currentcomponent->addguielem($section, new gui_selectbox('callwaiting', $currentcomponent->getoptlist('callwaiting'), $callwaiting, 'Call Waiting', _("Set the initial/current Call Waiting state for this user's extension"), false));
 
 		$section = 'Recording Options';
-		$currentcomponent->addguielem($section, new gui_selectbox('record_in', $currentcomponent->getoptlist('recordoptions'), $record_in, 'Record Incoming', "Record all inbound calls received at this extension.", false));
-		$currentcomponent->addguielem($section, new gui_selectbox('record_out', $currentcomponent->getoptlist('recordoptions'), $record_out, 'Record Outgoing', "Record all outbound calls received at this extension.", false));
+		$currentcomponent->addguielem($section, new gui_selectbox('record_in', $currentcomponent->getoptlist('recordoptions'), $record_in, 'Record Incoming', _("Record all inbound calls received at this extension."), false));
+		$currentcomponent->addguielem($section, new gui_selectbox('record_out', $currentcomponent->getoptlist('recordoptions'), $record_out, 'Record Outgoing', _("Record all outbound calls received at this extension."), false));
 
 		$section = 'Fax Handling';
 		$wait = (isset($wait) ? $wait : '0');
-		$currentcomponent->addguielem($section, new gui_selectbox('faxexten', $currentcomponent->getoptlist('faxdestoptions'), $faxexten, 'Fax Extension', "Select 'system' to have the system receive and email faxes.<br><br>The FreePBX default is defined in General Settings.", false), 4);
-		$currentcomponent->addguielem($section, new gui_textbox('faxemail', $faxemail, 'Fax Email', "Email address is used if 'system' has been chosen for the fax extension above.<br><br>Leave this blank to use the FreePBX default in General Settings"));
-		$currentcomponent->addguielem($section, new gui_selectbox('answer', $currentcomponent->getoptlist('faxdetecttype'), $answer, 'Fax Detection Type', "Selecting Zaptel or NVFax will immediately answer the call and play ringing tones to the caller for the number of seconds in Pause below. Use NVFax on SIP or IAX trunks.", false));
-		$currentcomponent->addguielem($section, new gui_textbox('wait', $wait, 'Pause after answer', 'The number of seconds we should wait after performing an Immediate Answer. The primary purpose of this is to pause and listen for a fax tone before allowing the call to proceed.', '!isInteger()', $msgInvalidPause, false));
+		$currentcomponent->addguielem($section, new gui_selectbox('faxexten', $currentcomponent->getoptlist('faxdestoptions'), $faxexten, 'Fax Extension', _("Select 'system' to have the system receive and email faxes.<br><br>The FreePBX default is defined in General Settings."), false), 4);
+		$currentcomponent->addguielem($section, new gui_textbox('faxemail', $faxemail, 'Fax Email', _("Email address is used if 'system' has been chosen for the fax extension above.<br><br>Leave this blank to use the FreePBX default in General Settings")));
+		$currentcomponent->addguielem($section, new gui_selectbox('answer', $currentcomponent->getoptlist('faxdetecttype'), $answer, 'Fax Detection Type', _("Selecting Zaptel or NVFax will immediately answer the call and play ringing tones to the caller for the number of seconds in Pause below. Use NVFax on SIP or IAX trunks."), false));
+		$currentcomponent->addguielem($section, new gui_textbox('wait', $wait, 'Pause after answer', _("The number of seconds we should wait after performing an Immediate Answer. The primary purpose of this is to pause and listen for a fax tone before allowing the call to proceed."), '!isInteger()', $msgInvalidPause, false));
 
 		$section = 'Privacy';
 		$privacyman = (isset($privacyman) ? $privacyman : '0');
-		$currentcomponent->addguielem($section, new gui_selectbox('privacyman', $currentcomponent->getoptlist('privyn'), $privacyman, 'Privacy Manager', "If no Caller ID is sent, Privacy Manager will asks the caller to enter their 10 digit phone number. The caller is given 3 attempts.", false), 4);
+		$currentcomponent->addguielem($section, new gui_selectbox('privacyman', $currentcomponent->getoptlist('privyn'), $privacyman, 'Privacy Manager', _("If no Caller ID is sent, Privacy Manager will asks the caller to enter their 10 digit phone number. The caller is given 3 attempts."), false), 4);
 
 	}
 }
@@ -2913,11 +4019,24 @@
 		if (!isset($action)) $action = null;
 		switch ($action) {
 			case "add":
-				if (core_users_add($_REQUEST)) {
+				$conflict_url = array();
+				$usage_arr = framework_check_extension_usage($_REQUEST['extension']);
+				if (!empty($usage_arr)) {
+					$GLOBALS['abort'] = true;
+					$conflict_url = framework_display_extension_usage_alert($usage_arr,true);
+					global $currentcomponent;
+					$id=0;
+					foreach ($conflict_url as $edit_link) {
+						$currentcomponent->addguielem('_top', new gui_link('conflict'.$i++, $edit_link['label'], $edit_link['url']));
+					}
+				} elseif (core_users_add($_REQUEST)) {
 					needreload();
 					redirect_standard_continue();
 				} else {
 					// really bad hack - but if core_users_add fails, want to stop core_devices_add
+					// Comment, this does not help everywhere. Other hooks functions can hook before
+					// this like voicemail!
+					//
 					$GLOBALS['abort'] = true;
 				}
 			break;
@@ -3128,13 +4247,13 @@
 			} else { // Adding
 				$currentcomponent->addguielem($section, new gui_textbox('deviceid', $extdisplay, 'Device ID', 'Give your device a unique integer ID.  The device will use this ID to authenicate to the system.', '!isInteger()', $msgInvalidDevID, false));
 			}
-			$currentcomponent->addguielem($section, new gui_textbox('description', $devinfo_description, 'Description', 'The caller id name for this device will be set to this description until it is logged into.', '!isAlphanumeric() || isWhitespace()', $msgInvalidDevDesc, false));
-			$currentcomponent->addguielem($section, new gui_textbox('emergency_cid', $devinfo_emergency_cid, 'Emergency CID', 'This caller id will always be set when dialing out an Outbound Route flagged as Emergency.  The Emergency CID overrides all other caller id settings.', '!isCallerID()', $msgInvalidEmergCID));
+			$currentcomponent->addguielem($section, new gui_textbox('description', $devinfo_description, 'Description', _("The caller id name for this device will be set to this description until it is logged into."), '!isAlphanumeric() || isWhitespace()', $msgInvalidDevDesc, false));
+			$currentcomponent->addguielem($section, new gui_textbox('emergency_cid', $devinfo_emergency_cid, 'Emergency CID', _("This caller id will always be set when dialing out an Outbound Route flagged as Emergency.  The Emergency CID overrides all other caller id settings."), '!isCallerID()', $msgInvalidEmergCID));
 			$currentcomponent->addguielem($section, new gui_selectbox('devicetype', $currentcomponent->getoptlist('devicetypelist'), $devinfo_devicetype, 'Device Type', _("Devices can be fixed or adhoc. Fixed devices are always associated to the same extension/user. Adhoc devices can be logged into and logged out of by users.").' '.$fc_logon.' '._("logs into a device.").' '.$fc_logoff.' '._("logs out of a device."), false));
-			$currentcomponent->addguielem($section, new gui_selectbox('deviceuser', $currentcomponent->getoptlist('deviceuserlist'), $devinfo_user, 'Default User', 'Fixed devices will always mapped to this user.  Adhoc devices will be mapped to this user by default.<br><br>If selecting "New User", a new User Extension of the same Device ID will be set as the Default User.', false));
+			$currentcomponent->addguielem($section, new gui_selectbox('deviceuser', $currentcomponent->getoptlist('deviceuserlist'), $devinfo_user, 'Default User', _("Fixed devices will always mapped to this user.  Adhoc devices will be mapped to this user by default.<br><br>If selecting 'New User', a new User Extension of the same Device ID will be set as the Default User."), false));
 		} else {
 			$section = 'Extension Options';
-			$currentcomponent->addguielem($section, new gui_textbox('emergency_cid', $devinfo_emergency_cid, 'Emergency CID', 'This caller id will always be set when dialing out an Outbound Route flagged as Emergency.  The Emergency CID overrides all other caller id settings.', '!isCallerID()', $msgInvalidEmergCID));
+			$currentcomponent->addguielem($section, new gui_textbox('emergency_cid', $devinfo_emergency_cid, 'Emergency CID', _("This caller id will always be set when dialing out an Outbound Route flagged as Emergency.  The Emergency CID overrides all other caller id settings."), '!isCallerID()', $msgInvalidEmergCID));
 		}
 		$currentcomponent->addguielem($section, new gui_hidden('tech', $devinfo_tech));
 		$currentcomponent->addguielem($section, new gui_hidden('hardware', $devinfo_hardware));

Modified: freepbx-modules/trunk/modules/core/install.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/core/install.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/core/install.php (original)
+++ freepbx-modules/trunk/modules/core/install.php Sun May 18 19:52:05 2008
@@ -42,4 +42,22 @@
 $fcc->update();
 unset($fcc);
 
+$fcc = new featurecode('core', 'blindxfer');
+$fcc->setDescription('In-Call Asterisk Blind Transfer');
+$fcc->setDefault('##');
+$fcc->update();
+unset($fcc);
+
+$fcc = new featurecode('core', 'atxfer');
+$fcc->setDescription('In-Call Asterisk Attended Transfer');
+$fcc->setDefault('*2');
+$fcc->update();
+unset($fcc);
+
+$fcc = new featurecode('core', 'automon');
+$fcc->setDescription('In-Call Asterisk Toggle Call Recording');
+$fcc->setDefault('*1');
+$fcc->update();
+unset($fcc);
+
 ?>

Modified: freepbx-modules/trunk/modules/core/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/core/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/core/module.xml (original)
+++ freepbx-modules/trunk/modules/core/module.xml Sun May 18 19:52:05 2008
@@ -3,14 +3,24 @@
 	<type>setup</type>
 	<category>Basic</category>
 	<name>Core</name>
-	<version>2.3.1.4</version>
+	<version>2.4.0.1</version>
 	<candisable>no</candisable>
 	<canuninstall>no</canuninstall>
 	<changelog>
-		*2.3.1.4* #2607 fix display problems with custom trunks starting with A, M or P
-		*2.3.1.3* added info to update checking tooltip providing info of what is transmitted
-		*2.3.1.2* #2526 dialout-trunk-predial-hook not always called, block queue login using queue number and fix to use AMPUSER
-		*2.3.1.1* #2459, #2565, #2467, #2357, #2359, #2411, #2402, #1697, #2470, #1974, #2493 - Fixed major that allowed blank/invalid users/devices/extensions
+		*2.4.0.1* #2693 fix DID editing creating new DID route introduced from #2664 fix
+		*2.4.0.0* #2664, #2591, #2629 - first 2.4 final release
+		*2.4.0rc1.0* #2574, #2644, #2650, #2648 and bump to rc1
+		*2.4.0beta2.4* #2631 fix firstonphone, firstavailable ring strategies
+		*2.4.0beta2.3* #2626 logout user in devicesanduser mode not logging out if no default user set
+		*2.4.0beta2.2* revert #2919, #2607, #2578, #2620, #2560, #2621, #2560, add RETURN option to macro-vm, added DUNDi trunk type
+		*2.4.0beta2.1* #2576 fix macro-dial to hand dialparties returning with no numbers to dial
+		*2.4.0beta2.0* #2568 move features.conf to core and add support in core_conf class, add tooltip details to onlne update checking
+		*2.4.0beta1.2* #2556, #2554 move macros to auto-generation: dialout-trunk, user-callerid, dialout-enum, outbound-callerid, agent-add, agent-del
+		*2.4.0beta1.1* moved all sip.conf and iax.conf settings into _general_additional.conf files for auto-generation, fixes to Zap Channel DIDs validation
+		*2.4.0beta1.0* addition of zapchandids page and removal of Channel in inbound routes, Extension/Destination Registry support, Adhoc Device
+		               and login/out improvments. Added ringing to Terminate Call Destinations,  #2493, #1974, #2470, #1697, #2357, #2393 pinless dialing
+									 #2299 1.6 dialparties support, #2221, #2303, add callconfirmation option to hunt strategy, #2526, core_conf class
+		*2.4.0alpha1.0* #2191, #2410, #2459, #2465; streamline dialout-trunk/outbound route repetition, add language support to macro-user-callerid
 		*2.3.1.0* #2372, #2384, #2408, remove double menu items (modules admin, dashboard), add macro-dialout-trunk-predial-hook
 		*2.3.0.3* #2308 FROM_DID to use ${EXTEN}, #2381 add iax_general_custom.conf, #2375 localization fixes
 		*2.3.0.2* #2330 allow '_' in route name changes, fix missing global variable.
@@ -46,7 +56,7 @@
 		*1.2* Core modules code when part of framework
 	</changelog>
 	<depends>
-		<version>2.3.0beta2</version>
+		<version>2.4.0</version>
 	</depends>
 	<requirements>
 		<file>/usr/sbin/asterisk</file>
@@ -56,12 +66,13 @@
 		<users needsenginedb="yes">Users</users>
 		<devices needsenginedb="yes">Devices</devices>
 		<did category="Inbound Call Control" sort="-5">Inbound Routes</did>
+		<zapchandids category="Inbound Call Control" sort="-5">Zap Channel DIDs</zapchandids>
 		<routing>Outbound Routes</routing>
 		<trunks>Trunks</trunks>
 		<general>General Settings</general>
 		<ampusers>Administrators</ampusers>
 		<wiki type="tool" category="Support" sort="5" href="http://freepbx.org" target="_blank" access="all">FreePBX Support</wiki>
 	</menuitems>
-	<location>release/2.3/core-2.3.1.3.tgz</location>
-	<md5sum>03c8da3700d767dcb917229c589a1981</md5sum>
+	<location>release/2.4/core-2.4.0.0.tgz</location>
+	<md5sum>1f3c3e65613f329ef3746d3419188758</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/core/page.ampusers.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/core/page.ampusers.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/core/page.ampusers.php (original)
+++ freepbx-modules/trunk/modules/core/page.ampusers.php Sun May 18 19:52:05 2008
@@ -1,4 +1,4 @@
-<?php /* $Id: page.ampusers.php 5071 2007-09-20 04:05:05Z gregmac $ */
+<?php /* $Id: page.ampusers.php 5323 2007-11-30 22:21:59Z p_lindheimer $ */
 // routing.php Copyright (C) 2004 Greg MacLellan (greg at mtechsolutions.ca)
 // Asterisk Management Portal Copyright (C) 2004 Coalescent Systems Inc. (info at coalescentsystems.ca)
 //
@@ -202,7 +202,7 @@
 			<tr>
 				<td valign="top">
 					<a href=# class="info"><?php echo _("Admin Access<span>Select the Admin Sections this user should have access to.</span>")?></a>: 
-				</td><td>&nbsp;
+				</td><td>
 					<select multiple name="sections[]">
 					<option />
 <?php 

Modified: freepbx-modules/trunk/modules/core/page.did.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/core/page.did.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/core/page.did.php (original)
+++ freepbx-modules/trunk/modules/core/page.did.php Sun May 18 19:52:05 2008
@@ -1,4 +1,4 @@
-<?php /* $Id: page.did.php 4905 2007-08-21 04:41:29Z p_lindheimer $ */
+<?php /* $Id: page.did.php 5716 2008-02-20 18:16:12Z p_lindheimer $ */
 //Copyright (C) 2004 Coalescent Systems Inc. (info at coalescentsystems.ca)
 //
 //This program is free software; you can redistribute it and/or
@@ -10,37 +10,42 @@
 //but WITHOUT ANY WARRANTY; without even the implied warranty of
 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 //GNU General Public License for more details.
-	
+
 $action = isset($_REQUEST['action'])?$_REQUEST['action']:'';
 $extdisplay= isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:'';
+$old_extdisplay = $extdisplay;
 $dispnum = 'did'; //used for switch on config.php
 $account = isset($_REQUEST['account'])?$_REQUEST['account']:'';
 $goto = isset($_REQUEST['goto0'])?$_REQUEST['goto0']:'';
 $ringing = isset($_REQUEST['ringing'])?$_REQUEST['ringing']:'';
 $description = isset($_REQUEST['description'])?$_REQUEST['description']:'';
 
+if (isset($_REQUEST['extension']) && isset($_REQUEST['cidnum'])) {
+	$extdisplay = $_REQUEST['extension']."/".$_REQUEST['cidnum'];
+}
+
 //update db if submiting form
 switch ($action) {
 	case 'addIncoming':
 		//create variables from request
 		extract($_REQUEST);
-		//add details to teh 'incoming' table
+		//add details to the 'incoming' table
 		if (core_did_add($_REQUEST)) {
 			needreload();
-			redirect_standard();
+			redirect_standard('extdisplay', 'extension', 'cidnum');
 		}
 	break;
 	case 'delIncoming':
-		$extarray=explode('/',$extdisplay,3);
-		core_did_del($extarray[0],$extarray[1],$extarray[2]);
+		$extarray=explode('/',$extdisplay,2);
+		core_did_del($extarray[0],$extarray[1]);
 		needreload();
 		redirect_standard();
 	break;
 	case 'edtIncoming':
-		$extarray=explode('/',$extdisplay,3);
-		if (core_did_edit($extarray[0],$extarray[1],$extarray[2],$_REQUEST)) {
+		$extarray=explode('/',$old_extdisplay,2);
+		if (core_did_edit($extarray[0],$extarray[1],$_REQUEST)) {
 			needreload();
-			redirect_standard('extdisplay');
+			redirect_standard('extdisplay', 'extension', 'cidnum');
 		}
 	break;
 }
@@ -58,12 +63,8 @@
 	foreach ($inroutes as $inroute) {
 		$displaydid = ( empty($inroute['extension'])? _("any DID") : $inroute['extension'] );
  		$displaycid = ( empty($inroute['cidnum'])? _("any CID") : $inroute['cidnum'] );
-		$zapchan = ( strlen($inroute['channel'])? "Zaptel Channel {$inroute['channel']}" : "" );
 		$desc = ( empty($inroute['description'])? "" : $inroute['description']."<br />" );
-		if ($zapchan != "") 
-			echo "\t<li><a ".($extdisplay==$inroute['extension']."/".$inroute['cidnum']."/".$inroute['channel'] ? 'class="current"':'')." href=\"config.php?display=".urlencode($dispnum)."&amp;extdisplay=".urlencode($inroute['extension'])."/".urlencode($inroute['cidnum'])."/".urlencode($inroute['channel'])."\">{$desc} {$zapchan} </a></li>\n";
-		else
-			echo "\t<li><a ".($extdisplay==$inroute['extension']."/".$inroute['cidnum']."/".$inroute['channel'] ? 'class="current"':'')." href=\"config.php?display=".urlencode($dispnum)."&amp;extdisplay=".urlencode($inroute['extension'])."/".urlencode($inroute['cidnum'])."/".urlencode($inroute['channel'])."\">{$desc} {$displaydid} / {$displaycid} </a></li>\n";
+		echo "\t<li><a ".($extdisplay==$inroute['extension']."/".$inroute['cidnum'] ? 'class="current"':'')." href=\"config.php?display=".urlencode($dispnum)."&amp;extdisplay=".urlencode($inroute['extension'])."/".urlencode($inroute['cidnum'])."\">{$desc} {$displaydid} / {$displaycid} </a></li>\n";
 	}
 }
 ?>
@@ -72,7 +73,6 @@
 
 <div class="content">
 <?php 
-	
 	if ($action == 'delIncoming') {
 		echo '<br><h3>Route '.$extdisplay.' '._("deleted").'!</h3><br><br><br><br><br><br><br><br>';
 	} else {
@@ -80,12 +80,12 @@
 ?>
 <?php if ($extdisplay) {	
 	//create variables for the selected route's settings
-	$extarray=explode('/',$extdisplay,3);
-	$ininfo=core_did_get($extarray[0],$extarray[1],$extarray[2]);
+	$extarray=explode('/',$extdisplay,2);
+	$ininfo=core_did_get($extarray[0],$extarray[1]);
 	if (is_array($ininfo)) extract($ininfo);
 ?>
 		<h2><?php echo _("Route")?>: <?php echo !empty($description)?$description:$extdisplay; ?></h2>
-		<p><a href="<?php echo $delURL ?>"><?php echo _("Delete Route")?> <?php echo !empty($description)?$description:$extdisplay ?></a></p>
+		<a href="<?php echo $delURL ?>"><?php echo _("Delete Route")?> <?php echo !empty($description)?$description:$extdisplay ?></a>
 <?php } else { ?>
 		<h2><?php echo _("Add Incoming Route")?></h2>
 <?php } ?>
@@ -107,20 +107,12 @@
 			<td><a href="#" class="info"><?php echo _("Caller ID Number")?><span><?php echo _('Define the Caller ID Number to be matched on incoming calls.<br><br>Leave this field blank to match any or no CID info.')?></span></a>:</td>
 			<td><input type="text" name="cidnum" value="<?php echo htmlspecialchars(isset($cidnum)?$cidnum:'') ?>"></td>
 		</tr>
-		<tr><td><h4><?php echo _("OR"); ?></h4></td></tr>
-		<tr>
-			<td><a href="#" class="info"><?php echo _("Zaptel Channel")?><span><?php echo _('Match calls that come in on this specific Zaptel channel number. zapata.conf must have "context=from-zaptel" rather than context="from-pstn" to use this feature')?></span></a>:</td>
-			<td><input type="text" name="channel" value="<?php echo htmlspecialchars(isset($channel)?$channel:''); ?>"></td>
-		</tr>
-		<tr>
-			<td><br></td>
-		</tr>
 		<tr><td colspan="2"><h5><?php echo _("Fax Handling")?><hr></h5></td></tr>
 		<tr>
 			<td>
 				<a class="info" href="#"><?php echo _("Fax Extension")?><span><?php echo _("Select 'system' to have the system receive and email faxes.<br><br>The FreePBX default is defined in General Settings.")?></span></a>:
 			</td>
-			<td>&nbsp;
+			<td>
 				<select name="faxexten">
 <?php 
 // Cleaning up warnings. I should do this a better way.
@@ -162,7 +154,7 @@
 		</tr>
 		<tr>
 			<td><a href="#" class="info"><?php echo _("Fax Detection Type")?><span><?php echo _('Selecting Zaptel or NVFax will immediately answer the call and play ringing tones to the caller for the number of seconds in Pause below. Use NVFax on SIP or IAX trunks.')?></span></a>:</td>
-			<td>&nbsp;
+			<td>
 				<select name="answer">
 					<option value="0" <?php  echo ($answer == '0' ? 'SELECTED' : '')?>><?php echo _("None")?>
 					<option value="1" <?php  echo ($answer == '1' ? 'SELECTED' : '')?>><?php echo _("Zaptel")?>
@@ -171,16 +163,14 @@
 			</td>
 		</tr>
 		<tr>
-			<td><a href="#" class="info"><?php echo _("Pause after answer")?><span><?php echo _('The number of seconds we should wait after performing an Immediate Answer. The primary purpose of this is to pause and listen for a fax tone before allowing the call to proceed.')?></span></a>:</td>
+			<td><a href="#" class="info"><?php echo _("Pause After Answer")?><span><?php echo _('The number of seconds we should wait after performing an Immediate Answer. The primary purpose of this is to pause and listen for a fax tone before allowing the call to proceed.')?></span></a>:</td>
 			<td><input type="text" name="wait" size="3" value="<?php echo isset($wait)?$wait:'' ?>"></td>
-		</tr>
-		<tr>
-			<td><br></td>
 		</tr>
 <?php
 if (!isset($privacyman))
 	$privacyman = '0';
 ?>
+
 		<tr><td colspan="2"><h5><?php echo _("Privacy")?><hr></h5></td></tr>
 		<tr>
 			<td><a href="#" class="info"><?php echo _("Privacy Manager")?><span><?php echo _('If no Caller ID is sent, Privacy Manager will asks the caller to enter their 10 digit phone number. The caller is given 3 attempts.')?></span></a>:</td>
@@ -191,14 +181,8 @@
 				</select>
 			</td>
 		</tr>
-		<tr>
-			<td><br></td>
-		</tr>		
 		
 		<tr><td colspan="2"><h5><?php echo _("Options")?><hr></h5></td></tr>
-
-
-
 		<tr>
 			<td><a href="#" class="info"><?php echo _("Alert Info")?><span><?php echo _('ALERT_INFO can be used for distinctive ring with SIP devices.')?></span></a>:</td>
 			<td><input type="text" name="alertinfo" size="10" value="<?php echo ($alertinfo)?$alertinfo:'' ?>"></td>
@@ -211,7 +195,7 @@
 		<tr>
 			<td><a href="#" class="info"><?php echo _("Music On Hold?")?><span><?php echo _("Set the MoH class that will be used for calls that come in on this route. For example, choose a type appropriate for routes coming in from a country which may have announcements in their language.")?></span></a></td>
 			<td>
-				&nbsp;&nbsp;<select name="mohclass"/>
+				<select name="mohclass"/>
 				<?php
 					$tresults = music_list($amp_conf['ASTVARLIBDIR']."/mohmp3");
 					$cur = (isset($mohclass) && $mohclass != "" ? $mohclass : 'default');
@@ -230,30 +214,20 @@
 			<td><a href="#" class="info"><?php echo _("Signal RINGING")?><span><?php echo _('Some devices or providers require RINGING to be sent before ANSWER. You\'ll notice this happening if you can send calls directly to a phone, but if you send it to an IVR, it won\'t connect the call.')?></span></a>:</td>
 			<td><input type="checkbox" name="ringing" value="CHECKED" <?php echo $ringing ?> /></td>
 		</tr>
-
-
 <?php
 	// implementation of module hook
 	// object was initialized in config.php
 	echo $module_hook->hookHtml;
 ?>
-
-		<tr>
-			<td><br></td>
-		</tr>		
-		
 		<tr><td colspan="2"><h5><?php echo _("Set Destination")?><hr></h5></td></tr>
-		
 <?php 
 //draw goto selects
 echo drawselects(isset($destination)?$destination:null,0);
 ?>
-		
-		<tr>
-		<td colspan="2"><br><h6>
-			<input name="Submit" type="submit" value="<?php echo _("Submit")?>">
-		</h6></td>		
-		
+		<tr>
+			<td colspan="2">
+				<h6><input name="Submit" type="submit" value="<?php echo _("Submit")?>"></h6>
+			</td>		
 		</tr>
 		</table>
 <script language="javascript">
@@ -266,7 +240,6 @@
 function editGRP_onsubmit() {
 	var msgInvalidDIDNumb = "<?php echo _('Please enter a valid DID Number'); ?>";
 	var msgInvalidCIDNum = "<?php echo _('Please enter a valid Caller ID Number'); ?>";
-	var msgCidDidWithZaptel = "<?php echo _('DID number and CID number MUST be blank when used with zaptel channel routing'); ?>";
 	var msgInvalidFaxEmail = "<?php echo _('Please enter a valid Fax Email or leave it empty to use the default'); ?>";
 	var msgInvalidPause = "<?php echo _('Please enter a valid number for Pause after answer'); ?>";
 	var msgConfirmDIDCIDBlank = "<?php echo _('Leaving the DID Number AND the Caller ID Number empty will match all incoming calls received not routed using any other defined Incoming Route.\n\nAre you sure?'); ?>";
@@ -299,12 +272,6 @@
 	if (!validateDestinations(theForm,1,true))
 		return false;
 	
-	if (theForm.extension.value != ""  && theForm.channel.value != "" ) {
-		return warnInvalid(theForm.extension, msgCidDidWithZaptel);
-	}
-	if (theForm.cidnum.value != ""  && theForm.channel.value != "" ) {
-		return warnInvalid(theForm.cidnum, msgCidDidWithZaptel);
-	}
 	// warning about 'any DID / any CID'
 	if (theForm.extension.value == "" && theForm.cidnum.value == "" && theForm.channel.value == "" ) {
 		if (!confirm(msgConfirmDIDCIDBlank))
@@ -322,11 +289,5 @@
 		</form>
 <?php 		
 	} //end if action == delGRP
-	
-
-?>
-
-
-
-
-
+
+?>

Modified: freepbx-modules/trunk/modules/core/page.routing.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/core/page.routing.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/core/page.routing.php (original)
+++ freepbx-modules/trunk/modules/core/page.routing.php Sun May 18 19:52:05 2008
@@ -1,4 +1,4 @@
-<?php /* $Id: page.routing.php 5576 2008-01-12 19:12:26Z p_lindheimer $ */
+<?php /* $Id: page.routing.php 5572 2008-01-12 16:48:07Z pnlarsson $ */
 // routing.php Copyright (C) 2004 Greg MacLellan (greg at mtechsolutions.ca)
 // routing.php <trunk & roting priority additions> Copyright (C) 2005 Ron Hartmann (rhartmann at vercomsystems.com)
 // Asterisk Management Portal Copyright (C) 2004 Coalescent Systems Inc. (info at coalescentsystems.ca)
@@ -330,7 +330,7 @@
 		<tr>
 			<td><a href="#" class="info"><?php echo _("Music On Hold?")?><span><?php echo _("You can choose which music category to use. For example, choose a type appropriate for a destination country which may have announcements in the appropriate language.")?></span></a></td>
 			<td>
-				&nbsp;&nbsp;<select name="mohsilence"/>
+				<select name="mohsilence"/>
 				<?php
 					$tresults = music_list($amp_conf['ASTVARLIBDIR']."/mohmp3");
 					$cur = (isset($mohsilence) && $mohsilence != "" ? $mohsilence : 'default');
@@ -346,7 +346,6 @@
 <?php } ?>
 		<tr>
 			<td colspan="2">
-				<br>
 				<a href=# class="info"><?php echo _("Dial Patterns")?><span><?php echo _("A Dial Pattern is a unique set of digits that will select this trunk. Enter one dial pattern per line.")?><br><br><b><?php echo _("Rules:")?></b><br>
    <strong>X</strong>&nbsp;&nbsp;&nbsp; <?php echo _("matches any digit from 0-9")?><br>
    <strong>Z</strong>&nbsp;&nbsp;&nbsp; <?php echo _("matches any digit from 1-9")?><br>
@@ -354,7 +353,7 @@
    <strong>[1237-9]</strong>&nbsp;   <?php echo _("matches any digit or letter in the brackets (in this example, 1,2,3,7,8,9)")?><br>
    <strong>.</strong>&nbsp;&nbsp;&nbsp; <?php echo _("wildcard, matches one or more characters")?> <br>
    <strong>|</strong>&nbsp;&nbsp;&nbsp; <?php echo _("seperates a dialing prefix from the number (for example, 9|NXXXXXX would match when some dialed \"95551234\" but would only pass \"5551234\" to the trunks)")?>
-				</span></a><br><br>
+				</span></a>
 			</td>
 		</tr>
 <?php  /* old code for using textboxes -- replaced by textarea code
@@ -489,8 +488,7 @@
 		</tr>
 		<tr>
 			<td colspan="2">
-			<br><br>
-				<a href=# class="info"><?php echo _("Trunk Sequence")?><span><?php echo _("The Trunk Sequence controls the order of trunks that will be used when the above Dial Patterns are matched. <br><br>For Dial Patterns that match long distance numbers, for example, you'd want to pick the cheapest routes for long distance (ie, VoIP trunks first) followed by more expensive routes (POTS lines).")?><br></span></a><br><br>
+				<a href=# class="info"><?php echo _("Trunk Sequence")?><span><?php echo _("The Trunk Sequence controls the order of trunks that will be used when the above Dial Patterns are matched. <br><br>For Dial Patterns that match long distance numbers, for example, you'd want to pick the cheapest routes for long distance (ie, VoIP trunks first) followed by more expensive routes (POTS lines).")?><br></span></a>
 			</td>
 		</tr>
 		<input type="hidden" id="repotrunkdirection" name="repotrunkdirection" value="">
@@ -578,7 +576,6 @@
 <?php endif; // if $extdisplay ?>
 		<tr>
 			<td colspan="2">
-			<br>
 				<h6><input name="Submit" type="submit" value="<?php echo _("Submit Changes")?>">
 				</h6>
 			</td>

Modified: freepbx-modules/trunk/modules/core/page.trunks.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/core/page.trunks.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/core/page.trunks.php (original)
+++ freepbx-modules/trunk/modules/core/page.trunks.php Sun May 18 19:52:05 2008
@@ -1,4 +1,4 @@
-<?php /* $Id: page.trunks.php 5576 2008-01-12 19:12:26Z p_lindheimer $ */
+<?php /* $Id: page.trunks.php 5615 2008-01-26 19:50:13Z p_lindheimer $ */
 // routing.php Copyright (C) 2004 Greg MacLellan (greg at mtechsolutions.ca)
 // Asterisk Management Portal Copyright (C) 2004 Coalescent Systems Inc. (info at coalescentsystems.ca)
 //
@@ -11,7 +11,6 @@
 //but WITHOUT ANY WARRANTY; without even the implied warranty of
 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 //GNU General Public License for more details.
-
 
 
 $display='trunks'; 
@@ -172,8 +171,6 @@
 	break;
 }
 	
-
-	
 //get all rows from globals
 $sql = "SELECT * FROM globals";
 $globals = $db->getAll($sql);
@@ -197,7 +194,7 @@
 $tresults = core_trunks_list();
 
 foreach ($tresults as $tresult) {
-	$background = ($tresult[2] == 'on')?'#DDD':'#FFF';
+	$background = ($tresult[2] == 'on')?'#DDD':'';
 	echo "\t<li><a ".($extdisplay==$tresult[0] ? 'class="current"':'')." href=\"config.php?display=".urlencode($display)."&amp;extdisplay=".urlencode($tresult[0])."\" title=\"".urlencode($tresult[1])."\" style=\"background: $background;\" >"._("Trunk")." ".substr(str_replace('AMP:', '', $tresult[1]),0,15)."</a></li>\n";
 }
 
@@ -217,6 +214,7 @@
 	<a href="<?php echo $_SERVER['PHP_SELF'].'?display='.urlencode($display); ?>&amp;tech=SIP"><?php echo _("Add SIP Trunk")?></a><br><br>
 	<a href="<?php echo $_SERVER['PHP_SELF'].'?display='.urlencode($display); ?>&amp;tech=ENUM"><?php echo _("Add ENUM Trunk")?></a><br><br>
 	<a href="<?php echo $_SERVER['PHP_SELF'].'?display='.urlencode($display); ?>&amp;tech=CUSTOM"><?php echo _("Add Custom Trunk")?></a><br><br>
+	<a href="<?php echo $_SERVER['PHP_SELF'].'?display='.urlencode($display); ?>&amp;tech=DUNDI"><?php echo _("Add DUNDi Trunk")?></a><br><br>
 <?php 
 } else {
 	if ($extdisplay) {
@@ -231,6 +229,7 @@
 		$failtrunk = isset(${"OUTFAIL_".$trunknum})?${"OUTFAIL_".$trunknum}:'';
 		$failtrunk_enable = ($failtrunk == "")?'':'CHECKED';
 		$disabletrunk = isset(${"OUTDISABLE_".$trunknum})?${"OUTDISABLE_".$trunknum}:'';
+
 		
 		if ($tech!="enum") {
 	
@@ -238,7 +237,7 @@
 				$channelid = core_trunks_getTrunkTrunkName($trunknum); 
 			}
 
-			if ($tech!="custom") {  // custom trunks will not have user/peer details in database table
+			if ($tech!="custom" && $tech!="dundi") {  // custom trunks will not have user/peer details in database table
 				// load from db
 				if (!isset($peerdetails)) {	
 					$peerdetails = core_trunks_getTrunkPeerDetails($trunknum);
@@ -269,7 +268,7 @@
 			}
 			unset($temp);
 		}
-		
+
 		echo "<h2>".sprintf(_("Edit %s Trunk"),strtoupper($tech))."</h2>";
 ?>
 		<p><a title="<?php echo $channelid ?>" href="config.php?display=<?php echo urlencode($display) ?>&amp;extdisplay=<?php echo urlencode($extdisplay) ?>&amp;action=deltrunk"><?php echo _("Delete Trunk")?> <?php  echo substr($channelid,0,20); ?></a></p>
@@ -289,7 +288,6 @@
 			echo _("This trunk will not be able to be used for outbound calls until a route is setup that uses it. Click on <b>Outbound Routes</b> to setup routing.");
 			echo "</span></a>";
 		}
-		echo "<br><br>";
 
 	} else {
 		// set defaults
@@ -314,7 +312,22 @@
 		$areacode = "";
 	
 		echo "<h2>".sprintf("Add %s Trunk",strtoupper($tech))."</h2>";
+
 	} 
+switch ($tech) {
+	case 'dundi':
+		$helptext = _('FreePBX offers limited support for DUNDi trunks and additional manual configuration is required. The trunk name should correspond to the [mappings] section of the remote dundi.conf systems. For example, you may have a mapping on the remote system, and corresponding configurations in dundi.conf locally, that looks as follows:<br /><br />[mappings]<br />priv => dundi-extens,0,IAX2,priv:${SECRET}@218.23.42.26/${NUMBER},noparital<br /><br />In this example, you would create this trunk and name it priv. You would then create the corresponding IAX2 trunk with proper settings to work with DUNDi. This can be done by making an IAX2 trunk in FreePBX or by using the iax_custom.conf file.<br />The dundi-extens context in this example must be created in extensions_custom.conf. This can simply include contexts such as ext-local, ext-intercom-users, ext-paging and so forth to provide access to the corresponding extensions and features provided by these various contexts and generated by FreePBX.');
+		break;
+	default:
+		$helptext = '';
+}
+if ($helptext != '') {
+	if ($extdisplay) {
+		echo "<br /><br />";
+	}
+	echo $helptext;
+}
+		
 ?>
 	
 		<form name="trunkEdit" action="config.php" method="post" onsubmit="return trunkEdit_onsubmit('<?php echo ($extdisplay ? "edittrunk" : "addtrunk") ?>');">
@@ -346,11 +359,11 @@
 <?php
 	if ($tech == "sip" || substr($tech,0,3) == "iax") {
 ?>
-					<a href=# class="info"><?php echo _("Maximum channels")?><span><?php echo sprintf(_("Controls the maximum number of outbound channels (simultaneous calls) that can be used on this trunk. To count inbound calls against this maximum, use the auto-generated context: %s as the inbound trunk's context. (see extensions_additional.conf) Leave blank to specify no maximum."),((isset($channelid) && trim($channelid)!="")?"from-trunk-$channelid":"from-trunk-[trunkname]"))?></span></a>: 
+					<a href=# class="info"><?php echo _("Maximum Channels")?><span><?php echo sprintf(_("Controls the maximum number of outbound channels (simultaneous calls) that can be used on this trunk. To count inbound calls against this maximum, use the auto-generated context: %s as the inbound trunk's context. (see extensions_additional.conf) Leave blank to specify no maximum."),((isset($channelid) && trim($channelid)!="")?"from-trunk-$tech-$channelid":"from-trunk-[trunkname]"))?></span></a>: 
 <?php
 	} else {
 ?>
-					<a href=# class="info"><?php echo _("Maximum channels")?><span><?php echo _("Controls the maximum number of outbound channels (simultaneous calls) that can be used on this trunk. Inbound calls are not counted against the maximum. Leave blank to specify no maximum.")?></span></a>: 
+					<a href=# class="info"><?php echo _("Maximum Channels")?><span><?php echo _("Controls the maximum number of outbound channels (simultaneous calls) that can be used on this trunk. Inbound calls are not counted against the maximum. Leave blank to specify no maximum.")?></span></a>: 
 <?php
 	}
 ?>
@@ -378,7 +391,7 @@
 
 			<tr>
 				<td colspan="2">
-					<br><h4><?php echo _("Outgoing Dial Rules")?></h4>
+					<h4><?php echo _("Outgoing Dial Rules")?></h4>
 				</td>
 			</tr>
 			<tr>
@@ -393,7 +406,7 @@
 	<strong>+</strong>&nbsp;&nbsp;&nbsp; <?php echo _("adds a dialing prefix from the number (for example, 1613+NXXXXXX would match when some dialed \"5551234\" and would pass \"16135551234\" to the trunk)")?><br /><br />
 	<?php echo _("You can also use both + and |, for example: 01+0|1ZXXXXXXXXX would match \"016065551234\" and dial it as \"0116065551234\" Note that the order does not matter, eg. 0|01+1ZXXXXXXXXX does the same thing."); ?>
 					</span></a>:
-				</td><td valign="top">&nbsp;
+				</td><td valign="top">
 					<textarea id="dialrules" cols="20" rows="<?php  
 						if (is_array($dialrules)) {
 							$rows = count($dialrules)+1; 
@@ -407,12 +420,12 @@
 			</tr>
 			<tr>
 				<td>
-					<a href=# class="info"><?php echo _("Dial rules wizards")?><span>
+					<a href=# class="info"><?php echo _("Dial Rules Wizards")?><span>
 					<strong><?php echo _("Always dial with prefix")?></strong> <?php echo _("is useful for VoIP trunks, where if a number is dialed as \"5551234\", it can be converted to \"16135551234\".")?><br>
 					<strong><?php echo _("Remove prefix from local numbers")?></strong> <?php echo _("is useful for ZAP trunks, where if a local number is dialed as \"6135551234\", it can be converted to \"555-1234\".")?><br>
 					<strong><?php echo _("Lookup numbers for local trunk")?></strong> <?php echo _("This looks up your local number on www.localcallingguide.com (NA-only), and sets up so you can dial either 7 or 10 digits (regardless of what your PSTN is) on a local trunk (where you have to dial 1+areacode for long distance, but only 5551234 (7-digit dialing) or 6135551234 (10-digit dialing) for local calls")?><br>
 					</span></a>:
-				</td><td valign="top">&nbsp;&nbsp;<select id="autopop" name="autopop" onChange="changeAutoPop(); ">
+				</td><td valign="top"><select id="autopop" name="autopop" onChange="changeAutoPop(); ">
 						<option value="" SELECTED><?php echo _("(pick one)")?></option>
 						<option value="always"><?php echo _("Always dial with prefix")?></option>
 						<option value="remove"><?php echo _("Remove prefix from local numbers")?></option>
@@ -631,7 +644,7 @@
 			<?php if ($tech != "enum") { ?>
 			<tr>
 				<td colspan="2">
-					<br><h4><?php echo _("Outgoing Settings")?></h4>
+					<h4><?php echo _("Outgoing Settings")?></h4>
 				</td>
 			</tr>
 			<?php } ?>
@@ -664,6 +677,18 @@
 				</tr>	
 	<?php
 		break;
+		case "dundi":
+	?>
+				<tr>
+					<td>
+						<a href=# class="info"><?php echo _("DUNDi Mapping")?><span><?php echo _("This is the name of the DUNDi mapping as defined in the [mappings] section of remote dundi.conf peers. This corresponds to the 'include' section of the peer details in the local dundi.conf file. This requires manual configuration of DUNDi to use this trunk.")?></span></a>: 
+					</td><td>
+						<input type="text" size="35" maxlength="46" name="channelid" value="<?php echo htmlspecialchars($channelid) ?>"/>
+						<input type="hidden" size="14" name="usercontext" value="notneeded"/>
+					</td>
+				</tr>	
+	<?php
+		break;
 		default:
 	?>
 				<tr>
@@ -675,7 +700,7 @@
 				</tr>
 				<tr>
 					<td colspan="2">
-						<a href=# class="info"><?php echo _("PEER Details")?><span><br><?php echo _("Modify the default PEER connection parameters for your VoIP provider.<br><br>You may need to add to the default lines listed below, depending on your provider.")?><br><br></span></a>: 
+					<a href=# class="info"><?php echo _("PEER Details")?><span><br><?php echo _("Modify the default PEER connection parameters for your VoIP provider.<br><br>You may need to add to the default lines listed below, depending on your provider.<br /><br />WARNING: Oreder is important as it will be retained. For example, if you use the \"allow/deny\" directives make sure deny comes first.")?><br><br></span></a>: 
 					</td>
 				</tr>
 				<tr>
@@ -685,7 +710,7 @@
 				</tr>
 				<tr>
 					<td colspan="2">
-						<br><h4><?php echo _("Incoming Settings")?></h4>
+						<h4><?php echo _("Incoming Settings")?></h4>
 					</td>
 				</tr>
 				<tr>
@@ -697,7 +722,8 @@
 				</tr>
 				<tr>
 					<td colspan="2">
-						<a href=# class="info"><?php echo _("USER Details")?><span><br><?php echo _("Modify the default USER connection parameters for your VoIP provider.")?><br><br><?php echo _("You may need to add to the default lines listed below, depending on your provider.")?><br><br></span></a>: 
+					<a href=# class="info"><?php echo _("USER Details")?><span><br><?php echo _("Modify the default USER connection parameters for your VoIP provider.")?><br><br><?php echo _("You may need to add to the default lines listed below, depending on your provider..<br /><br />WARNING: Oreder is important as it will be retained. For example, if you use the \"allow/deny\" directives make sure deny 
+				comes first.")?><br><br></span></a>: 
 					</td>
 				</tr>
 				<tr>
@@ -707,7 +733,7 @@
 				</tr>
 				<tr>
 					<td colspan="2">
-						<br><h4><?php echo _("Registration")?></h4>
+						<h4><?php echo _("Registration")?></h4>
 					</td>
 				</tr>
 				<tr>
@@ -767,14 +793,14 @@
 	if (!isDialIdentifierSpecial(theForm.dialoutprefix.value))
 		return warnInvalid(theForm.dialoutprefix, msgInvalidOutboundDialPrefix);
 	
-	<?php if ($tech != "enum" && $tech != "custom") { ?>
+	<?php if ($tech != "enum" && $tech != "custom" && $tech != "dundi") { ?>
 	defaultEmptyOK = true;
 	if (isEmpty(theForm.channelid.value) || isWhitespace(theForm.channelid.value))
 		return warnInvalid(theForm.channelid, msgInvalidTrunkName);
 	
 	if (theForm.channelid.value == theForm.usercontext.value)
 		return warnInvalid(theForm.usercontext, msgInvalidTrunkAndUserSame);
-	<?php } else if ($tech == "custom") { ?> 
+	<?php } else if ($tech == "custom" || $tech == "dundi") { ?> 
 	if (isEmpty(theForm.channelid.value) || isWhitespace(theForm.channelid.value)) 
 		return warnInvalid(theForm.channelid, msgInvalidChannelName); 
 

Added: freepbx-modules/trunk/modules/core/page.zapchandids.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/core/page.zapchandids.php?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/core/page.zapchandids.php (added)
+++ freepbx-modules/trunk/modules/core/page.zapchandids.php Sun May 18 19:52:05 2008
@@ -1,0 +1,157 @@
+<?php 
+/** Zap Channel DIDs display for FreePBX 2.4
+ * Copyright 2006 Philippe Lindheimer - Astrogen LLC
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * 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 General Public License for more details.
+ */
+
+$display = 'zapchandids';
+$type = isset($_REQUEST['type']) ? $_REQUEST['type'] :  'setup';
+$action = isset($_REQUEST['action']) ? $_REQUEST['action'] :  '';
+if (isset($_REQUEST['delete'])) $action = 'delete'; 
+
+
+$extdisplay  = isset($_REQUEST['extdisplay']) ? $_REQUEST['extdisplay'] : '';
+$channel     = isset($_REQUEST['channel']) ? $_REQUEST['channel'] :  false;
+$description = isset($_REQUEST['description']) ? $_REQUEST['description'] :  '';
+$did         = isset($_REQUEST['did']) ? $_REQUEST['did'] :  '';
+
+switch ($action) {
+	case 'add':
+		if (core_zapchandids_add($description, $channel, $did)) {
+			needreload();
+			redirect_standard();
+		}
+	break;
+	case 'edit':
+		if (core_zapchandids_edit($description, $channel, $did)) {
+			needreload();
+			redirect_standard('extdisplay');
+		}
+	break;
+	case 'delete':
+		core_zapchandids_delete($channel);
+		needreload();
+		redirect_standard();
+	break;
+}
+
+
+?> 
+</div>
+
+<div class="rnav"><ul>
+<?php 
+
+echo '<li><a href="config.php?display='.$display.'&type='.$type.'">'._('Add Channel').'</a></li>';
+
+foreach (core_zapchandids_list() as $row) {
+	echo '<li><a href="config.php?display='.$display.'&type='.$type.'&extdisplay='.$row['channel'].'" class="">'.$row['channel'].': '.$row['description'].'</a></li>';
+}
+
+?>
+</ul></div>
+
+<div class="content">
+
+<?php
+
+if ($extdisplay != '') {
+	// load
+	$row = core_zapchandids_get($extdisplay);
+	
+	$description = $row['description'];
+	$channel     = $row['channel'];
+	$did         = $row['did'];
+
+	echo "<h2>"._("Edit Zap Channel: ").$channel."</h2>";
+} else {
+	echo "<h2>"._("Add Zap Channel")."</h2>";
+}
+
+$helptext = _("Zap Channel DIDs allow you to assign a DID to specific Zap Channels. You can supply the same DID to multiple channels. This would be a common scenario if you have multiple POTS lines that are on a hunt group from your provider. You MUST assign the channel's context to from-zaptel for these settings to have effect. It will be a line that looks like:<br /><br />context = from-zaptel<br /><br />in your zapata.conf configuration effecting the specified channel(s). Once you have assigned DIDs you can use standard Inbound Routes with the specified DIDs to route your calls.");
+echo "<p>".$helptext."</p>\n";
+?>
+<form name="editZapchandid" action="<?php  $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return checkZapchandid(editZapchandid);">
+	<input type="hidden" name="extdisplay" value="<?php echo $extdisplay; ?>">
+	<input type="hidden" name="channel" value="<?php echo $extdisplay; ?>">
+	<input type="hidden" name="action" value="<?php echo ($extdisplay != '' ? 'edit' : 'add'); ?>">
+	<table>
+	<tr><td colspan="2"><h5><?php  echo ($extdisplay != '' ? _("Edit Channel").": ".$extdisplay : _("Add Channel")) ?><hr></h5></td></tr>
+<?php
+	if ($extdisplay == '') {
+?>
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Channel")?>:<span><?php echo _("The Zap Channel number to map to a DID")?></span></a></td>
+		<td><input size="5" type="text" name="channel" value="<?php  echo $channel; ?>"></td>
+	</tr>
+<?php
+	}
+?>
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Description")?>:<span><?php echo _("A useful description describing this channel")?></span></a></td>
+		<td><input size="40" type="text" name="description" value="<?php  echo $description; ?>"></td>
+	</tr>
+	<tr>
+		<td><a href="#" class="info"><?php echo _("DID")?>:<span><?php echo _("The DID that this channel represents. The incoming call on this channel will be treated as if it came in with this DID and can be managed with Inbound Routing on DIDs")?></span></a></td>
+		<td><input size="40" type="text" name="did" value="<?php echo $did; ?>" /></td>
+	</tr>
+
+	<tr>
+		<td colspan="2"><br><input name="Submit" type="submit" value="<?php echo _("Submit Changes")?>">
+			<?php if ($extdisplay != '') { echo '&nbsp;<input name="delete" type="submit" onclick="actionDelete=true;" value="'._("Delete").'">'; } ?>
+		</td>		
+
+	</tr>
+	</table>
+</form>
+			
+			
+<script language="javascript">
+<!--
+
+var actionDelete = false;
+
+function checkZapchandid(theForm) {
+	var msgInvalidChannel = "<?php echo _('Invalid Channel Number, must be numeric and not blank'); ?>";
+	var msgInvalidDID = "<?php echo _('Invalid DID, must be a non-blank DID'); ?>";
+	var msgConfirmDIDNonStd = "<?php echo _('DID information is normally just an incoming telephone number.\n\nYou have entered a non standard DID pattern.\n\nAre you sure this is correct?'); ?>";
+	var msgConfirmConvertDID = "<?php echo _('You appear to be using a converted DID in the form of zapchanNN that was automatically generated during an upgrade. You should consider assigning the DID that is normally associated with this channel to take full advantage of the inbound routing abilities. Changing the DID here will require you to make changes in the Inbound Routes tab. Do you want to continue?'); ?>";
+
+
+	// If deleting we don't care what is in the elements
+	if (actionDelete) {
+		actionDelete = false;
+		return true;
+	}
+	// form validation
+
+	defaultEmptyOK = false;
+	if (!isInteger(theForm.channel.value)) {
+		return warnInvalid(theForm.channel, msgInvalidChannel);
+	}
+	if (isEmpty(theForm.did.value)) {
+		return warnInvalid(theForm.did, msgInvalidDID);
+	}
+	if (theForm.did.value.substring(0,7) == "zapchan") {
+		if (!confirm(msgConfirmConvertDID)) {
+			return false;
+		}
+
+	} else if (!isDialpattern(theForm.did.value)) {
+		if (!confirm(msgConfirmDIDNonStd)) {
+			return false;
+		}
+	}
+
+	return true;
+}
+//-->
+</script>

Added: freepbx-modules/trunk/modules/customappsreg/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/customappsreg/functions.inc.php?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/customappsreg/functions.inc.php (added)
+++ freepbx-modules/trunk/modules/customappsreg/functions.inc.php Sun May 18 19:52:05 2008
@@ -1,0 +1,232 @@
+<?php
+
+function customappsreg_destinations() {
+	// return an associative array with destination and description
+	foreach (customappsreg_customdests_list() as $row) {
+		$extens[] = array('destination' => $row['custom_dest'], 'description' => $row['description']);
+	}
+	return $extens;
+}
+
+/** the 'exten' is the same as the destination for this module
+ */
+function customappsreg_customdests_getdest($exten) {
+	return array($exten);
+}
+
+/** If this is ours, we return it, otherwise we return false
+ *  We use just use customappsreg and not the display because it
+ *  is a per-module routine
+ */
+function customappsreg_getdestinfo($dest) {
+	global $active_modules;
+
+  $thisexten = customappsreg_customdests_get($dest);
+	if (empty($thisexten)) {
+		return false;
+	} else {
+		$type = isset($active_modules['customappsreg']['type'])?$active_modules['customappsreg']['type']:'tool';
+		return array('description' => 'Custom Destination: '.$thisexten['description'],
+		             'edit_url' => 'config.php?display=customdests&type='.$type.'&extdisplay='.urlencode($dest),
+							  );
+	}
+}
+
+function customappsreg_check_extensions($exten=true) {
+	global $active_modules;
+
+	$extenlist = array();
+	if (is_array($exten) && empty($exten)) {
+		return $extenlist;
+	}
+	$sql = "SELECT custom_exten, description FROM custom_extensions ";
+	if (is_array($exten)) {
+		$sql .= "WHERE custom_exten in ('".implode("','",$exten)."')";
+	}
+	$results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
+
+	$type = isset($active_modules['customappsreg']['type'])?$active_modules['customappsreg']['type']:'tool';
+
+	foreach ($results as $result) {
+		$thisexten = $result['custom_exten'];
+		$extenlist[$thisexten]['description'] = _("Custom Extension: ").$result['description'];
+		$extenlist[$thisexten]['status'] = 'INUSE';
+		$extenlist[$thisexten]['edit_url'] = 'config.php?display=customextens&extdisplay='.urlencode($thisexten);
+	}
+	return $extenlist;
+}
+
+function customappsreg_customdests_list() {
+	global $db;
+	$sql = "SELECT custom_dest, description, notes FROM custom_destinations ORDER BY description";
+	$results = $db->getAll($sql, DB_FETCHMODE_ASSOC);
+	if(DB::IsError($results)) {
+		die_freepbx($results->getMessage()."<br><br>Error selecting from custom_destinations");	
+	}
+	return $results;
+}
+
+function customappsreg_customextens_list() {
+	global $db;
+	$sql = "SELECT custom_exten, description, notes FROM custom_extensions ORDER BY custom_exten";
+	$results = $db->getAll($sql, DB_FETCHMODE_ASSOC);
+	if(DB::IsError($results)) {
+		die_freepbx($results->getMessage()."<br><br>Error selecting from custom_extensions");	
+	}
+	return $results;
+}
+
+function customappsreg_customdests_get($custom_dest) {
+	global $db;
+	$sql = "SELECT custom_dest, description, notes FROM custom_destinations WHERE custom_dest = ".q($custom_dest);
+	$row = $db->getRow($sql, DB_FETCHMODE_ASSOC);
+	if(DB::IsError($row)) {
+		die_freepbx($row->getMessage()."<br><br>Error selecting row from custom_destinations");	
+	}
+	return $row;
+}
+
+function customappsreg_customextens_get($custom_exten) {
+	global $db;
+	$sql = "SELECT custom_exten, description, notes FROM custom_extensions WHERE custom_exten = ".q($custom_exten);
+	$row = $db->getRow($sql, DB_FETCHMODE_ASSOC);
+	if(DB::IsError($row)) {
+		die_freepbx($row->getMessage()."<br><br>Error selecting row from custom_extensions");	
+	}
+	return $row;
+}
+
+function customappsreg_customdests_add($custom_dest, $description, $notes) {
+	global $db;
+
+	if (!ereg("[^,]+,[^,]+,[^,]+",$custom_dest)) {
+		echo "<script>javascript:alert('"._('Invalid Destination, must not be blank, must be formatted as: context,exten,pri')."')</script>";
+		return false;
+	}
+	if (trim($description) == '') {
+		echo "<script>javascript:alert('"._('Invalid description specified, must not be blank')."')</script>";
+		return false;
+	}
+	$usage_list = framework_identify_destinations($custom_dest, $module_hash=false);
+	if (!empty($usage_list[$custom_dest])) {
+		echo "<script>javascript:alert('"._('DUPLICATE Destination: This destination is already in use')."')</script>";
+		return false;
+	}
+
+	$custom_dest = q($custom_dest);
+	$description = q($description);
+	$notes       = q($notes);
+	$sql = "INSERT INTO custom_destinations (custom_dest, description, notes) VALUES ($custom_dest, $description, $notes)";
+	$results = $db->query($sql);
+	if (DB::IsError($results)) {
+		if ($results->getCode() == DB_ERROR_ALREADY_EXISTS) {
+			echo "<script>javascript:alert('"._('DUPLICATE Destination: This destination is in use or potentially used by another module')."')</script>";
+			return false;
+		} else {
+			die_freepbx($results->getMessage()."<br><br>".$sql);
+		}
+	}
+	return true;
+}
+
+function customappsreg_customextens_add($custom_exten, $description, $notes) {
+	global $db;
+
+	if ($custom_exten == '') {
+		echo "<script>javascript:alert('"._('Invalid Extension, must not be blank')."')</script>";
+		return false;
+	}
+	if (trim($description) == '') {
+		echo "<script>javascript:alert('"._('Invalid description specified, must not be blank')."')</script>";
+		return false;
+	}
+
+	$custom_exten = q($custom_exten);
+	$description  = q($description);
+	$notes        = q($notes);
+	$sql = "INSERT INTO custom_extensions (custom_exten, description, notes) VALUES ($custom_exten, $description, $notes)";
+	$results = $db->query($sql);
+	if (DB::IsError($results)) {
+		if ($results->getCode() == DB_ERROR_ALREADY_EXISTS) {
+			echo "<script>javascript:alert('"._('DUPLICATE Extension: This extension already in use')."')</script>";
+			return false;
+		} else {
+			die_freepbx($results->getMessage()."<br><br>".$sql);
+		}
+	}
+	return true;
+}
+
+function customappsreg_customdests_delete($custom_dest) {
+	global $db;
+
+	$sql = "DELETE FROM custom_destinations WHERE custom_dest = ".q($custom_dest);
+	$result = $db->query($sql);
+	if(DB::IsError($result)) {
+		die_freepbx($result->getMessage().$sql);
+	}
+}
+
+function customappsreg_customextens_delete($custom_exten) {
+	global $db;
+
+	$sql = "DELETE FROM custom_extensions WHERE custom_exten = ".q($custom_exten);
+	$result = $db->query($sql);
+	if(DB::IsError($result)) {
+		die_freepbx($result->getMessage().$sql);
+	}
+}
+
+function customappsreg_customdests_edit($old_custom_dest, $custom_dest,  $description, $notes) { 
+	global $db;
+
+	if ($old_custom_dest != $custom_dest) {
+		$usage_list = framework_identify_destinations($custom_dest, $module_hash=false);
+		if (!empty($usage_list[$custom_dest])) {
+			echo "<script>javascript:alert('"._('DUPLICATE Destination: This destination is in use or potentially used by another module')."')</script>";
+			return false;
+		}
+	}
+
+	$sql = "UPDATE custom_destinations SET ".
+		"custom_dest = ".q($custom_dest).", ".
+		"description = ".q($description).", ".
+		"notes = ".q($notes)." ".
+		"WHERE custom_dest = ".q($old_custom_dest);
+	$result = $db->query($sql);
+	if(DB::IsError($result)) {
+		die_freepbx($result->getMessage().$sql);
+	}
+}
+
+function customappsreg_customextens_edit($old_custom_exten, $custom_exten,  $description, $notes) { 
+	global $db;
+
+	$sql = "UPDATE custom_extensions SET ".
+		"custom_exten = ".q($custom_exten).", ".
+		"description = ".q($description).", ".
+		"notes = ".q($notes)." ".
+		"WHERE custom_exten = ".q($old_custom_exten);
+	$result = $db->query($sql);
+	if(DB::IsError($result)) {
+		die_freepbx($result->getMessage().$sql);
+	}
+}
+
+function customappsreg_customdests_getunknown() {
+
+	$results = array();
+
+	$my_probs = framework_list_problem_destinations($my_hash, false);
+
+	if (!empty($my_probs)) {
+		foreach ($my_probs as $problem) {
+			if ($problem['status'] == 'CUSTOM') {
+				$results[] = $problem['dest'];
+			}
+		}
+	}
+	return array_unique($results);
+}
+
+?>

Added: freepbx-modules/trunk/modules/customappsreg/install.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/customappsreg/install.php?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/customappsreg/install.php (added)
+++ freepbx-modules/trunk/modules/customappsreg/install.php Sun May 18 19:52:05 2008
@@ -1,0 +1,33 @@
+<?php
+
+global $db;
+
+$sql = "
+	CREATE TABLE IF NOT EXISTS `custom_destinations` (
+		`custom_dest` varchar(80) NOT NULL default '',
+		`description` varchar(40) NOT NULL default '',
+		`notes` varchar(255) NOT NULL default '',
+		PRIMARY KEY  (`custom_dest`)
+	)";
+
+$check = $db->query($sql);
+if(DB::IsError($check)) {
+	die_freepbx("Can not create custom_destinations table\n");
+}
+
+
+$sql = "
+	CREATE TABLE IF NOT EXISTS `custom_extensions` 
+	(
+		`custom_exten` varchar(80) NOT NULL default '',
+		`description` varchar(40) NOT NULL default '',
+		`notes` varchar(255) NOT NULL default '',
+		PRIMARY KEY  (`custom_exten`)
+	)";
+
+$check = $db->query($sql);
+if(DB::IsError($check)) {
+	die_freepbx("Can not create custom_extensions table\n");
+}
+
+?>

Added: freepbx-modules/trunk/modules/customappsreg/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/customappsreg/module.xml?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/customappsreg/module.xml (added)
+++ freepbx-modules/trunk/modules/customappsreg/module.xml Sun May 18 19:52:05 2008
@@ -1,0 +1,26 @@
+<module>
+	<rawname>customappsreg</rawname>
+	<name>Custom Applications</name>
+	<version>2.4.0.4</version>
+	<type>tool</type>
+	<category>System Administration</category>
+	<description>
+		Registry to add custom extensions and destinations that may be created and used so that the Extensions and Destinations Registry can include these.
+	</description>
+	<menuitems>
+		<customextens>Custom Extensions</customextens>
+		<customdests>Custom Destinations</customdests>
+	</menuitems>
+	<changelog>
+		*2.4.0.4* #2700 block editing of destination field when once other modules are using it
+		*2.4.0.3* added depends on 2.4.0
+		*2.4.0.2* #2558 can't edit/del custom extension
+		*2.4.0.1* Fix typo in install script, non-existent primary key
+		*2.4.0* First release of module
+	</changelog>
+	<depends>
+		<version>2.4.0</version>
+	</depends>
+	<location>release/2.4/customappsreg-2.4.0.3.tgz</location>
+	<md5sum>e8747f9839adcc852aaf6597339314ff</md5sum>
+</module>

Added: freepbx-modules/trunk/modules/customappsreg/page.customdests.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/customappsreg/page.customdests.php?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/customappsreg/page.customdests.php (added)
+++ freepbx-modules/trunk/modules/customappsreg/page.customdests.php Sun May 18 19:52:05 2008
@@ -1,0 +1,209 @@
+<?php 
+/** Custom Destinations Display for FreePBX 2.4
+ * Copyright 2006 Philippe Lindheimer - Astrogen LLC
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * 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 General Public License for more details.
+ */
+
+$display = 'customdests';
+
+$type   = isset($_REQUEST['type']) ? $_REQUEST['type'] : 'tool';
+$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
+if (isset($_REQUEST['delete'])) $action = 'delete'; 
+
+$old_custom_dest = isset($_REQUEST['old_custom_dest']) ? $_REQUEST['old_custom_dest'] :  '';
+$custom_dest     = isset($_REQUEST['extdisplay']) ? $_REQUEST['extdisplay'] :  '';
+$description     = isset($_REQUEST['description']) ? $_REQUEST['description'] :  '';
+$notes           = isset($_REQUEST['notes']) ? $_REQUEST['notes'] :  '';
+
+switch ($action) {
+	case 'add':
+		if (customappsreg_customdests_add($custom_dest, $description, $notes)) {
+			needreload();
+			redirect_standard();
+		} else {
+			$custom_dest='';
+		}
+	break;
+	case 'edit':
+		if (customappsreg_customdests_edit($old_custom_dest, $custom_dest, $description, $notes)) {
+			needreload();
+			redirect_standard('extdisplay');
+		}
+	break;
+	case 'delete':
+		customappsreg_customdests_delete($custom_dest);
+		needreload();
+		redirect_standard();
+	break;
+}
+
+?> 
+</div>
+
+<div class="rnav"><ul>
+<?php 
+
+echo '<li><a href="config.php?display='.$display.'&amp;type='.$type.'">'._('Add Custom Destination').'</a></li>';
+
+foreach (customappsreg_customdests_list() as $row) {
+	$descr = $row['description'] != '' ? $row['description'] : '('.$row['custom_dest'].')';
+	echo '<li><a href="config.php?display='.$display.'&amp;type='.$type.'&amp;extdisplay='.$row['custom_dest'].'" class="">'.$descr.'</a></li>';
+}
+
+?>
+</ul></div>
+
+<div class="content">
+
+<?php
+
+if ($custom_dest != '') {
+	// load
+	$usage_list = framework_display_destination_usage(customappsreg_customdests_getdest($custom_dest));
+
+	$row = customappsreg_customdests_get($custom_dest);
+	
+	$description = $row['description'];
+	$notes       = $row['notes'];
+
+	$disp_description = $row['description'] != '' ? $row['description'] : '('.$row['custom_dest'].')';
+	echo "<h2>"._("Edit: ")."$disp_description"."</h2>";
+} else {
+	echo "<h2>"._("Add Custom Destination")."</h2>";
+}
+
+$helptext = _("Custom Destinations allows you to register your custom destinations that point to custom dialplans and will also 'publish' these destinations as available destinations to other modules. This is an advanced feature and should only be used by knowledgable users. If you are getting warnings or errors in the noticication panel about CUSTOM destinations that are correct, you should include them here. The 'Unknown Destinations' chooser will allow you to choose and insert any such destinations that the registry is not aware of into the Custom Destination field.");
+echo $helptext;
+?>
+
+<form name="editCustomDest" action="<?php  $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return checkCustomDest(editCustomDest);">
+	<input type="hidden" name="extdisplay" value="<?php echo $custom_dest; ?>">
+	<input type="hidden" name="old_custom_dest" value="<?php echo $custom_dest; ?>">
+	<input type="hidden" name="action" value="<?php echo ($custom_dest != '' ? 'edit' : 'add'); ?>">
+	<table>
+	<tr><td colspan="2"><h5><?php  echo ($custom_dest ? _("Edit Custom Destination") : _("Add Custom Destination")) ?><hr></h5></td></tr>
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Custom Destination")?>:
+			<span>
+				<?php 
+				echo _("This is the Custom Destination to be published. It should be formatted exactly as you would put it in a goto statement, with context, exten, priority all included. An example might look like:<br />mycustom-app,s,1");
+				if (!empty($usage_list)) {
+					echo "<br />"._("READONLY WARNING: Because this destination is being used by other module objects it can not be edited. You must remove those dependencies in order to edit this destination, or create a new destination to use");
+				}
+				?>
+			</span></a></td>
+	<?php
+	if (!empty($usage_list)) {
+	?>
+		<td><b><?php echo $custom_dest; ?></b></td>
+	<?php
+	} else {
+	?>
+		<td><input size="30" type="text" name="extdisplay" id="extdisplay" value="<?php  echo $custom_dest; ?>"></td>
+	<?php
+	}
+	?>
+	</tr>
+
+	<?php
+	if (empty($usage_list)) {
+	?>
+	<tr>
+		<td>
+		<a href=# class="info"><?php echo _("Destination Quick Pick")?>
+			<span>
+				<?php echo _("Choose un-identified destinations on your system to add to the Custom Destinaion Registry. This will insert the chosen entry into the Custom Destination box above.")?>
+			</span>
+		</a>
+		</td>
+		<td>
+			<select onChange="insertDest();" id="insdest">
+				<option value=""><?php echo _("(pick destination)")?></option>
+	<?php
+				$results = customappsreg_customdests_getunknown();
+				foreach ($results as $thisdest) {
+					echo "<option value='$thisdest'>$thisdest</option>\n";
+				}
+	?>
+			</select>
+		</td>
+	</tr>
+	<?php
+	}
+	?>
+
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Description")?>:<span><?php echo _("Brief Description that will be published to modules when showing destinations. Example: My Weather App")?></span></a></td>
+		<td><input size="30" type="text" name="description" value="<?php  echo $description; ?>"></td>
+	</tr>
+	<tr>
+		<td valign="top"><a href="#" class="info"><?php echo _("Notes")?>:<span><?php echo _("More detailed notes about this destination to help document it. This field is not used elsewhere.")?></span></a></td>
+		<td><textarea name="notes" cols="23" rows="6"><?php echo $notes; ?></textarea></td> 
+	</tr>
+
+	<tr>
+		<td colspan="2"><br><input name="Submit" type="submit" value="<?php echo _("Submit Changes")?>">
+		<?php if ($custom_dest != '') { echo '&nbsp;<input name="delete" type="submit" value="'._("Delete").'">'; } ?>
+		</td>		
+
+		<?php
+		if ($custom_dest != '') {
+			if (!empty($usage_list)) {
+			?>
+				<tr><td colspan="2">
+				<a href="#" class="info"><?php echo $usage_list['text']?>:<span><?php echo $usage_list['tooltip']?></span></a>
+				</td></tr>
+			<?php
+			}
+		}
+		?>
+	</tr>
+	</table>
+	</form>
+			
+<script language="javascript">
+<!--
+
+function insertDest() {
+
+	dest = document.getElementById('insdest').value;
+	customDest=document.getElementById('extdisplay');
+
+	if (dest != '') {
+		customDest.value = dest;
+	}
+
+	// reset element
+	document.getElementById('insdest').value = '';
+}
+
+function checkCustomDest(theForm) {
+
+	var msgInvalidCustomDest = "<?php echo _('Invalid Destination, must not be blank, must be formatted as: context,exten,pri'); ?>";
+	var msgInvalidDescription = "<?php echo _('Invalid description specified, must not be blank'); ?>";
+
+	// Make sure the custom dest is in the form "context,exten,pri"
+	var re = /[^,]+,[^,]+,[^,]+/;
+
+	// form validation
+	defaultEmptyOK = false;	
+
+	if (isEmpty(theForm.extdisplay.value) || !re.test(theForm.extdisplay.value)) {
+		return warnInvalid(theForm.extdisplay, msgInvalidCustomDest);
+	}
+	if (isEmpty(theForm.description.value)) {
+		return warnInvalid(theForm.description, msgInvalidDescription);
+	}
+
+	return true;
+}
+//-->
+</script>

Added: freepbx-modules/trunk/modules/customappsreg/page.customextens.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/customappsreg/page.customextens.php?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/customappsreg/page.customextens.php (added)
+++ freepbx-modules/trunk/modules/customappsreg/page.customextens.php Sun May 18 19:52:05 2008
@@ -1,0 +1,155 @@
+<?php 
+/** Custom Extensions Display for FreePBX 2.4
+ * Copyright 2006 Philippe Lindheimer - Astrogen LLC
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * 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 General Public License for more details.
+ */
+
+$display = 'customextens';
+
+$type   = isset($_REQUEST['type']) ? $_REQUEST['type'] : 'tool';
+$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
+if (isset($_REQUEST['delete'])) $action = 'delete'; 
+
+$old_custom_exten = isset($_REQUEST['old_custom_exten']) ? $_REQUEST['old_custom_exten'] :  '';
+$custom_exten     = isset($_REQUEST['extdisplay']) ? $_REQUEST['extdisplay'] :  '';
+$description     = isset($_REQUEST['description']) ? $_REQUEST['description'] :  '';
+$notes           = isset($_REQUEST['notes']) ? $_REQUEST['notes'] :  '';
+
+switch ($action) {
+	case 'add':
+		$conflict_url = array();
+		$usage_arr = framework_check_extension_usage($custom_exten);
+		if (!empty($usage_arr)) {
+			$conflict_url = framework_display_extension_usage_alert($usage_arr);
+			$custom_exten='';
+		} else {
+			if (customappsreg_customextens_add($custom_exten, $description, $notes)) {
+				needreload();
+				redirect_standard();
+			} else {
+				$custom_exten='';
+			}
+		}
+	break;
+	case 'edit':
+		$conflict_url = array();
+		if ($old_custom_exten != $custom_exten) {
+			$usage_arr = framework_check_extension_usage($custom_exten);
+			if (!empty($usage_arr)) {
+				$conflict_url = framework_display_extension_usage_alert($usage_arr);
+			}
+		}
+		if (empty($conflict_url)) {
+			if (customappsreg_customextens_edit($old_custom_exten, $custom_exten, $description, $notes)) {
+				needreload();
+				redirect_standard('extdisplay');
+			}
+		}
+	break;
+	case 'delete':
+		customappsreg_customextens_delete($custom_exten);
+		needreload();
+		redirect_standard();
+	break;
+}
+
+?> 
+</div>
+
+<div class="rnav"><ul>
+<?php 
+
+echo '<li><a href="config.php?display='.$display.'&amp;type='.$type.'">'._('Add Custom Extension').'</a></li>';
+
+foreach (customappsreg_customextens_list() as $row) {
+	$descr = $row['description'] != '' ? $row['description'] : '('.$row['custom_exten'].')';
+	echo '<li><a href="config.php?display='.$display.'&amp;type='.$type.'&amp;extdisplay='.$row['custom_exten'].'" class="">'.$descr.'</a></li>';
+}
+
+?>
+</ul></div>
+
+<div class="content">
+
+<?php
+
+if ($custom_exten != '') {
+	// load
+	$row = customappsreg_customextens_get($custom_exten);
+	
+	$description = $row['description'];
+	$notes       = $row['notes'];
+
+	$disp_description = $row['description'] != '' ? '('.$row['custom_exten'].') '.$row['description'] : '('.$row['custom_exten'].')';
+	echo "<h2>"._("Edit: ")."$disp_description"."</h2>";
+} else {
+	echo "<h2>"._("Add Custom Extension")."</h2>";
+}
+
+$helptext = _("Custom Extensions provides you with a facility to register any custom extenions or feature codes that you have created in a custom file and FreePBX doesn't otherwise know about them. This allows the Extension Registry to be aware of your own extensions so that it can detect conflicts or report back information about your custom extensions to other modules that may make use of the information. You should not put extensions that you create in the Misc Apps Module as those are not custom.");
+echo $helptext;
+
+if (!empty($conflict_url)) {
+	echo "<h5>"._("Conflicting Extensions")."</h5>";
+	echo implode('<br .>',$conflict_url);
+}
+?>
+
+<form name="editCustomExten" action="<?php  $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return checkCustomExten(editCustomExten);">
+	<input type="hidden" name="extdisplay" value="<?php echo $custom_exten; ?>">
+	<input type="hidden" name="old_custom_exten" value="<?php echo $custom_exten; ?>">
+	<input type="hidden" name="action" value="<?php echo ($custom_exten != '' ? 'edit' : 'add'); ?>">
+	<table>
+	<tr><td colspan="2"><h5><?php  echo ($custom_exten ? _("Edit Custom Extension") : _("Add Custom Extension")) ?><hr></h5></td></tr>
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Custom Extension")?>:<span><?php echo _("This is the Extension or Feature Code you are using in your dialplan that you want the FreePBX Extension Registry to be aware of.")?></span></a></td>
+		<td><input size="10" type="text" name="extdisplay" id="extdisplay" value="<?php  echo $custom_exten; ?>"></td>
+	</tr>
+
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Description")?>:<span><?php echo _("Brief description that will be published in the Extension Registry about this extension")?></span></a></td>
+		<td><input size="30" type="text" name="description" value="<?php  echo $description; ?>"></td>
+	</tr>
+	<tr>
+		<td valign="top"><a href="#" class="info"><?php echo _("Notes")?>:<span><?php echo _("More detailed notes about this extension to help document it. This field is not used elsewhere.")?></span></a></td>
+		<td><textarea name="notes" cols="23" rows="6"><?php echo $notes; ?></textarea></td> 
+	</tr>
+
+	<tr>
+		<td colspan="2"><br><input name="Submit" type="submit" value="<?php echo _("Submit Changes")?>">
+		<?php if ($custom_exten != '') { echo '&nbsp;<input name="delete" type="submit" value="'._("Delete").'">'; } ?>
+		</td>		
+	</tr>
+	</table>
+	</form>
+			
+<script language="javascript">
+<!--
+
+function checkCustomExten(theForm) {
+
+	var msgInvalidCustomExten = "<?php echo _('Invalid Extension, must not be blank'); ?>";
+	var msgInvalidDescription = "<?php echo _('Invalid description specified, must not be blank'); ?>";
+
+	// form validation
+	defaultEmptyOK = false;	
+
+	if (isEmpty(theForm.extdisplay.value)) {
+		return warnInvalid(theForm.extdisplay, msgInvalidCustomExten);
+	}
+	if (isEmpty(theForm.description.value)) {
+		return warnInvalid(theForm.description, msgInvalidDescription);
+	}
+
+	return true;
+}
+//-->
+</script>

Added: freepbx-modules/trunk/modules/customappsreg/uninstall.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/customappsreg/uninstall.php?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/customappsreg/uninstall.php (added)
+++ freepbx-modules/trunk/modules/customappsreg/uninstall.php Sun May 18 19:52:05 2008
@@ -1,0 +1,13 @@
+<?php
+
+global $db;
+
+echo "dropping table custom_destinations..";
+sql("DROP TABLE IF EXISTS `custom_destinations`");
+echo "done<br>\n";
+
+echo "dropping table custom_extensions..";
+sql("DROP TABLE IF EXISTS `custom_extensions`");
+echo "done<br>\n";
+
+?>

Added: freepbx-modules/trunk/modules/customerdb/i18n/it_IT/LC_MESSAGES/customerdb.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/customerdb/i18n/it_IT/LC_MESSAGES/customerdb.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/customerdb/i18n/it_IT/LC_MESSAGES/customerdb.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/customerdb/i18n/it_IT/LC_MESSAGES/customerdb.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/customerdb/i18n/it_IT/LC_MESSAGES/customerdb.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/customerdb/i18n/it_IT/LC_MESSAGES/customerdb.po (added)
+++ freepbx-modules/trunk/modules/customerdb/i18n/it_IT/LC_MESSAGES/customerdb.po Sun May 18 19:52:05 2008
@@ -1,0 +1,82 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-01-25 23:17+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: Italian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: page.customerdb.php:82
+msgid "Customer"
+msgstr "Cliente"
+
+#: page.customerdb.php:90
+msgid "deleted"
+msgstr "eliminato"
+
+msgid "Customer DB"
+msgstr "Database Clienti"
+
+msgid "Name"
+msgstr "Nome"
+
+msgid "Address 1"
+msgstr "Indirizzo 1"
+
+msgid "Address 2"
+msgstr "Indirizzo 2"
+
+msgid "City"
+msgstr "Città"
+
+msgid "State"
+msgstr "Stato (USA)"
+
+msgid "Zip/Post Code"
+msgstr "CAP"
+
+msgid "Sip Account"
+msgstr "Account Sip"
+
+msgid "DID Number"
+msgstr "Numero Sel. Passante"
+
+msgid "Device"
+msgstr "Apparato"
+
+msgid "Serial"
+msgstr "Seriale"
+
+msgid "IP Address"
+msgstr "Indirizzo IP"
+
+msgid "Username"
+msgstr "Nome utente"
+
+msgid "Add Customer"
+msgstr "Aggiungi Cliente"
+
+msgid "Add a user"
+msgstr "Aggiungi utente"
+
+msgid "Add"
+msgstr "Aggiungi"
+
+msgid "Delete Customer"
+msgstr "Elimina Cliente"
+
+msgid "Submit Changes"
+msgstr "Invia"
+
+msgid "Edit Customer"
+msgstr "Modifica Cliente"

Modified: freepbx-modules/trunk/modules/customerdb/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/customerdb/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/customerdb/module.xml (original)
+++ freepbx-modules/trunk/modules/customerdb/module.xml Sun May 18 19:52:05 2008
@@ -1,17 +1,18 @@
 <module>
 	<rawname>customerdb</rawname>
 	<name>Customer DB</name>
-	<version>1.2.3.1</version>
+	<version>2.4.0</version>
 	<type>tool</type>
 	<category>Third Party Addon</category>
 	<menuitems>
 		<customerdb>Customer DB</customerdb>
 	</menuitems>
 	<changelog>
+		*2.4.0* it translations, bump for 2.4
 		*1.2.3.1* bump for rc1
 		*1.2.3* Add he_IL translation
 	</changelog>
-	<location>release/2.3/customerdb-1.2.3.tgz</location>
-	<md5sum>7993b668880c3f5287fb44b4909546fb</md5sum>
+	<location>release/2.3/customerdb-1.2.3.1.tgz</location>
+	<md5sum>1e619dee5942828a4dfd7cee9085e5e5</md5sum>
 </module>
 

Modified: freepbx-modules/trunk/modules/dashboard/class.astinfo.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/dashboard/class.astinfo.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/dashboard/class.astinfo.php (original)
+++ freepbx-modules/trunk/modules/dashboard/class.astinfo.php Sun May 18 19:52:05 2008
@@ -2,9 +2,12 @@
 
 class astinfo {
 	var $astman;
+       var $version;
 	
 	function astinfo(&$astman) {
 		$this->astman =& $astman;
+               $arr = engine_getinfo();
+               $this->version = $arr['version'];
 	}
 	
 	function get_channel_totals() {
@@ -16,7 +19,11 @@
 				'total_channels'=>0,
 			);
 		}
-		$response = $this->astman->send_request('Command',array('Command'=>"show channels"));
+		if (version_compare($this->version, "1.6", "ge")) {
+			$response = $this->astman->send_request('Command',array('Command'=>"core show channels"));
+		} else {
+			$response = $this->astman->send_request('Command',array('Command'=>"show channels"));
+		}
 		$astout = explode("\n",$response['data']);
 		
 		$external_calls = 0;
@@ -95,7 +102,7 @@
 				// have an IP address listed, so its online
 				$online = !empty($matches[6]); 
 
-				if (isset($trunks[$matches[2]])) {
+				if (isset($trunks['SIP/'.$matches[2]])) {
 					// this is a trunk
 					//TODO match trunk tech as well? 
 					$return['sip_trunks_'.($online?'online':'offline')]++;
@@ -135,7 +142,7 @@
 				// have an IP address listed, so its online
 				$online = !empty($matches[6]); 
 
-				if (isset($trunks[$matches[2]])) {
+				if (isset($trunks['IAX2/'.$matches[2]])) {
 					// this is a trunk
 					//TODO match trunk tech as well? 
 					$return['iax2_trunks_'.($online?'online':'offline')]++;
@@ -203,7 +210,11 @@
 			return $output;
 		}
 
-		$response = $this->astman->send_request('Command',array('Command'=>"show uptime"));
+		if (version_compare($this->version, "1.6", "ge")) {
+			$response = $this->astman->send_request('Command',array('Command'=>"core show uptime"));
+		} else {
+			$response = $this->astman->send_request('Command',array('Command'=>"show uptime"));
+		}
 		$astout = explode("\n",$response['data']);
 			
 		foreach ($astout as $line) {
@@ -221,7 +232,11 @@
 		if (!$this->astman) {
 			return false;
 		}
-		$response = $this->astman->send_request('Command',array('Command'=>"show version"));
+		if (version_compare($this->version, "1.6", "ge")) {
+			$response = $this->astman->send_request('Command',array('Command'=>"core show version"));
+		} else {
+			$response = $this->astman->send_request('Command',array('Command'=>"show version"));
+		}
 		$astout = explode("\n",$response['data']);
 		
 		if (!preg_match('/^Asterisk /i', $astout[1])) {

Added: freepbx-modules/trunk/modules/dashboard/i18n/it_IT/LC_MESSAGES/dashboard.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/dashboard/i18n/it_IT/LC_MESSAGES/dashboard.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/dashboard/i18n/it_IT/LC_MESSAGES/dashboard.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/dashboard/i18n/it_IT/LC_MESSAGES/dashboard.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/dashboard/i18n/it_IT/LC_MESSAGES/dashboard.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/dashboard/i18n/it_IT/LC_MESSAGES/dashboard.po (added)
+++ freepbx-modules/trunk/modules/dashboard/i18n/it_IT/LC_MESSAGES/dashboard.po Sun May 18 19:52:05 2008
@@ -1,0 +1,202 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-08-12 01:48+0200\n"
+"PO-Revision-Date: 2007-08-12 01:48+0200\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team:\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: page.index.php:98
+msgid "OK"
+msgstr "OK"
+
+#: page.index.php:102
+msgid "Warn"
+msgstr "Attenz"
+
+#: page.index.php:106
+msgid "ERROR"
+msgstr "ERRORE"
+
+#: page.index.php:139 page.index.php:165
+msgid "minutes"
+msgstr "minuti"
+
+#: page.index.php:156
+msgid "week"
+msgstr "settimana"
+
+#: page.index.php:156
+msgid "weeks"
+msgstr "settimane"
+
+#: page.index.php:159
+msgid "days"
+msgstr "giorni"
+
+#: page.index.php:162
+msgid "hour"
+msgstr "ora"
+
+#: page.index.php:162
+msgid "hours"
+msgstr "ore"
+
+#: page.index.php:165
+msgid "minute"
+msgstr "minuti"
+
+#: page.index.php:175
+msgid "System Statistics"
+msgstr "Statistiche di Sistema"
+
+#: page.index.php:176
+msgid "Processor"
+msgstr "Processore"
+
+#: page.index.php:178
+msgid "Load Average"
+msgstr "Carico Medio"
+
+#: page.index.php:179
+msgid "CPU"
+msgstr "CPU"
+
+#: page.index.php:181
+msgid "Memory"
+msgstr "Memoria"
+
+#: page.index.php:184
+msgid "App Memory"
+msgstr "Memoria App"
+
+#: page.index.php:185
+msgid "Swap"
+msgstr "Swap"
+
+#: page.index.php:187
+msgid "Disks"
+msgstr "Dischi"
+
+#: page.index.php:192
+msgid "Networks"
+msgstr "Reti"
+
+#: page.index.php:203
+msgid "receive"
+msgstr "riceve"
+
+#: page.index.php:204
+msgid "transmit"
+msgstr "trasmette"
+
+#: page.index.php:237
+msgid "FreePBX Statistics"
+msgstr "Statistiche FreePBX"
+
+#: page.index.php:243
+msgid "FreePBX Connections"
+msgstr "Connessioni FreePBX"
+
+#: page.index.php:268
+msgid "Uptime"
+msgstr "Tempo di esercizio"
+
+#: page.index.php:298
+msgid "Server Status"
+msgstr "Stato Server"
+
+#: page.index.php:301 page.index.php:303
+msgid "Asterisk"
+msgstr "Asterisk"
+
+#: page.index.php:309 page.index.php:311
+msgid "Manager Proxy"
+msgstr "Proxy Manager"
+
+#: page.index.php:317 page.index.php:321 page.index.php:323
+msgid "Op Panel"
+msgstr "Pannello Op"
+
+#: page.index.php:330 page.index.php:332
+msgid "MySQL"
+msgstr "MySQL"
+
+#: page.index.php:337
+msgid "Web Server"
+msgstr "Server Web"
+
+#: page.index.php:342 page.index.php:344
+msgid "SSH Server"
+msgstr "Server SSH"
+
+#: page.index.php:378
+msgid "FreePBX Notices"
+msgstr "Notifiche FreePBX"
+
+msgid "FreePBX System Status"
+msgstr "Stato Sistema FreePBX"
+
+msgid "System Uptime"
+msgstr "Sistema"
+
+msgid "Asterisk Uptime"
+msgstr "Asterisk"
+
+msgid "Last Reload"
+msgstr "Ultimo ricaricamento"
+
+msgid "Total active calls"
+msgstr "Totale chiamate attive"
+
+msgid "Internal calls"
+msgstr "Chiamate interne"
+
+msgid "External calls"
+msgstr "Chiamate esterne"
+
+msgid "Total active channels"
+msgstr "Totale chiamate attive"
+
+msgid "IP Phones Online"
+msgstr "Telefoni IP Online"
+
+msgid "IP Trunks Online"
+msgstr "Fasci IP Online"
+
+msgid "show new"
+msgstr "visualizza nuovi"
+
+msgid "show all"
+msgstr "visualizza tutti"
+
+msgid "You are using the default SQL password that is widely known, you should set a secure password"
+msgstr "Stai utilizzando la password predefinita di SQL che è largamente conosciuta, dovresti impostare una password sicura"
+
+msgid "Default SQL Password Used"
+msgstr "Password predefinita di SQL usata"
+
+msgid "Default Asterisk Manager Password Used"
+msgstr "Password predefinita del Manager di Asterisk usata"
+
+msgid "You are using the default Asterisk Manager password that is widely known, you should set a secure password"
+msgstr "Stai utilizzando la password predefinita del Manager di Asterisk che è largamente conosciuta, dovresti impostare una password sicura"
+
+msgid "loading..."
+msgstr "caricamento..."
+
+msgid "Update timed out"
+msgstr "Aggiornamento in timeout"
+
+msgid "Added %s ago"
+msgstr "Aggiunto %s fa"

Modified: freepbx-modules/trunk/modules/dashboard/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/dashboard/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/dashboard/module.xml (original)
+++ freepbx-modules/trunk/modules/dashboard/module.xml Sun May 18 19:52:05 2008
@@ -1,7 +1,7 @@
 <module>
 	<rawname>dashboard</rawname>
 	<name>System Dashboard</name>
-	<version>0.3.3.2</version>
+	<version>2.4.0.1</version>
 	<candisable>no</candisable>
 	<canuninstall>no</canuninstall>
 	<type>tool</type>
@@ -17,6 +17,9 @@
 		<version>2.3.0beta2</version>
 	</depends>
 	<changelog>
+		*2.4.0.1* #2620 adjust to new format of core_trunks_list(true)
+		*2.4.0* #2415 1.6 support, #2301, it translation
+		*0.3.3.3* #2365 don't make readonly disk devices red when 100%
 		*0.3.3.2* #2469 fix division my zero in cpu usage
 		*0.3.3.1* Cosmetic fix (#2278 - long mount point paths)
 		*0.3.3* Improved detection of webserver failing, More MySQL detection fixes
@@ -36,6 +39,6 @@
 		*0.2.0* Add real-time updates
 		*0.1.0* Initial release
 	</changelog>
-	<location>release/2.4/dashboard-0.3.3.2.tgz</location>
-	<md5sum>913befd1d633fa4f884ec409db410a71</md5sum>
+	<location>release/2.4/dashboard-2.4.0.tgz</location>
+	<md5sum>cc527832212e789c40f5c1e23091a9ac</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/dashboard/page.index.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/dashboard/page.index.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/dashboard/page.index.php (original)
+++ freepbx-modules/trunk/modules/dashboard/page.index.php Sun May 18 19:52:05 2008
@@ -193,7 +193,7 @@
 	
 	$out .= "<h4>"._("Disks")."</h4>";
 	foreach ($sysinfo->filesystems() as $fs) {
-		$out .= draw_graph($fs["mount"], "GB", number_format($fs["used"]/1024/1024, 2), $fs["size"]/1024/1024);
+		$out .= draw_graph($fs["mount"], "GB", number_format($fs["used"]/1024/1024, 2), number_format($fs["size"]/1024/1024,2), strpos( $fs["options"],"ro" )!==false ? array(0=>"graphok"):null);
 	}
 	
 	$out .= "<h4>"._("Networks")."</h4>";

Modified: freepbx-modules/trunk/modules/daynight/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/daynight/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/daynight/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/daynight/functions.inc.php Sun May 18 19:52:05 2008
@@ -108,6 +108,38 @@
 		return null;
 }
 
+function daynight_getdest($exten) {
+	return array('app-daynight,'.$exten.',1');
+}
+
+function daynight_getdestinfo($dest) {
+	global $active_modules;
+
+	if (substr(trim($dest),0,13) == 'app-daynight,') {
+		$exten = explode(',',$dest);
+		$exten = $exten[1];
+
+		$thisexten = array();
+		$thislist = daynight_list($exten);
+		foreach ($thislist as $item) {
+			if ($item['ext'] == $exten) {
+				$thisexten = $item;
+				break;
+			}
+		}
+		if (empty($thisexten)) {
+			return array();
+		} else {
+			//$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup';
+			return array('description' => 'Day/Night ('.$exten.') : '.$thisexten['dest'],
+			             'edit_url' => 'config.php?display=daynight&itemid='.urlencode($exten).'&action=edit',
+								  );
+		}
+	} else {
+		return false;
+	}
+}
+
 function daynight_get_config($engine) {
 	global $ext;
 
@@ -270,4 +302,48 @@
 
 		return $dmodes;
 }
+
+
+/*
+SELECT s1.ext ext, dest, dmode, s2.description descirption FROM daynight s1 
+INNER JOIN
+    (
+			      SELECT ext, dest description FROM daynight WHERE dmode = 'fc_description') s2 
+						ON s1.ext = s2.ext WHERE dmode in ('day','night')
+						AND dest = '$dest'
+
+Provides: ext, dest, dmode, description
+*/
+function daynight_check_destinations($dest=true) {
+	global $active_modules;
+
+	$destlist = array();
+	if (is_array($dest) && empty($dest)) {
+		return $destlist;
+	}
+	$sql = "
+		SELECT s1.ext ext, dest, dmode, s2.description description FROM daynight s1 
+		INNER JOIN
+    		(
+					SELECT ext, dest description FROM daynight WHERE dmode = 'fc_description') s2 
+					ON s1.ext = s2.ext WHERE dmode in ('day','night') 
+		";
+	if ($dest !== true) {
+		$sql .= "AND dest in ('".implode("','",$dest)."')";
+	}
+	$results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
+
+	//$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup';
+
+	foreach ($results as $result) {
+		$thisdest = $result['dest'];
+		$thisid   = $result['ext'];
+		$destlist[] = array(
+			'dest' => $thisdest,
+			'description' => 'Daynight: '.$result['description'].' ('.$result['dmode'].')',
+			'edit_url' => 'config.php?display=daynight&itemid='.urlencode($thisid).'&action=edit',
+		);
+	}
+	return $destlist;
+}
 ?>

Added: freepbx-modules/trunk/modules/daynight/i18n/it_IT/LC_MESSAGES/daynight.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/daynight/i18n/it_IT/LC_MESSAGES/daynight.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/daynight/i18n/it_IT/LC_MESSAGES/daynight.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/daynight/i18n/it_IT/LC_MESSAGES/daynight.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/daynight/i18n/it_IT/LC_MESSAGES/daynight.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/daynight/i18n/it_IT/LC_MESSAGES/daynight.po (added)
+++ freepbx-modules/trunk/modules/daynight/i18n/it_IT/LC_MESSAGES/daynight.po Sun May 18 19:52:05 2008
@@ -1,0 +1,132 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-08-12 15:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team:\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: page.daynight.php:35
+msgid "Add Day/Night Code"
+msgstr "Aggiungi Servizio Giorno/Notte"
+
+#: page.daynight.php:82
+msgid "Day / Night Mode Control"
+msgstr "Controllo Servizio Giorno/Notte"
+
+#: page.daynight.php:88
+msgid "Delete Day/Night Feature Code:"
+msgstr "Elimina codice Servizio Giorno/Notte"
+
+#: page.daynight.php:103 page.daynight.php:178
+#, c-format
+msgid "Use feature code: %s to toggle DAY/NIGHT mode"
+msgstr "Utilizzare il codice: %s per cambiare il Servizio Giorno/Notte"
+
+#: page.daynight.php:112
+msgid "Day/Night Feature Code Index:"
+msgstr "Indice Codice Servizio Giorno/Notte"
+
+#: page.daynight.php:113
+msgid ""
+"There are a total of 10 Feature code objects, 0-9, each can control a call "
+"flow and be toggled using the day/night feature code plus the index."
+msgstr "Sono disponibili in totale 10 codici, da 0 9, ognuno dei quali puo' controllare un particolare percorso. Si cambia il servizio giorno/notte con il codice più l'indice."
+
+#: page.daynight.php:138
+msgid "Description"
+msgstr "Descrizione"
+
+#: page.daynight.php:143
+msgid "Current Mode:"
+msgstr "Modo Corrente:"
+
+#: page.daynight.php:144
+msgid ""
+"This will change the current state for this Day/Night Mode Control, or set "
+"the intial state when creating a new one."
+msgstr "Questo cambierà lo stato corrente del Servizio Giorno/Notte, oppure imposta lo stato iniziale quando se ne crea uno nuovo."
+
+#: page.daynight.php:155
+msgid "Optional Password"
+msgstr "Password Opzionale"
+
+#: page.daynight.php:169
+msgid "DAY"
+msgstr "GIORNO"
+
+#: page.daynight.php:170
+msgid "NIGHT"
+msgstr "NOTTE"
+
+#: page.daynight.php:215
+msgid "$mode"
+msgstr ""
+
+#: page.daynight.php:215
+msgid "Destination to use when set to $mode mode"
+msgstr "Destinazione da usare se impostato su $mode"
+
+msgid "Voicemail"
+msgstr "Casella Vocale"
+
+msgid "Extensions"
+msgstr "Interni"
+
+msgid "Day Night Mode"
+msgstr "Controllo Giorno Notte"
+
+msgid "Terminate Call"
+msgstr "Termina Chiamata"
+
+msgid "Core"
+msgstr "Sistema"
+
+msgid "Conferences"
+msgstr "Conferenze"
+
+msgid "Phonebook Directory"
+msgstr "Rubrica"
+
+msgid "Queues"
+msgstr "Code"
+
+msgid "Ring Groups"
+msgstr "Gruppi di chiamata"
+
+msgid "Speed dial functions"
+msgstr "Selezione breve"
+
+msgid "Time Conditions"
+msgstr "Condizioni Temporali"
+
+msgid "Custom Contexts"
+msgstr "Contesti Personalizzati"
+
+msgid "Extended Routing"
+msgstr "Rotte specifiche"
+
+msgid "Custom App<span><br>ADVANCED USERS ONLY<br><br>Uses Goto() to send caller to a custom context.<br><br>The context name should start with \"custom-\", and be in the format custom-context,extension,priority. Example entry:<br><br><b>custom-myapp,s,1</b><br><br>The <b>[custom-myapp]</b> context would need to be created and included in extensions_custom.conf</span>"
+msgstr "Applicazione Personalizzata<span>SOLO UTENTI AVANZATI<br>Utilizzare Goto() per inviare la chiamata verso un contesto personalizzato.<br><br>Il nome del contesto deve iniziare per \"custom-\" e deve essere nel formato custom-contesto,extension,priorità. Esempio: <br><br><b>custom-app,s,1</b><br><br><b>Il contesto [custom-app] </b> deve poi essere creato e incluso nel file extensions_custom.conf</span"
+
+msgid "Save"
+msgstr "Salva"
+
+msgid "You can optionally include a password to authenticate before toggling the day/night mode. If left blank anyone can use the feature code will be un-protected"
+msgstr "Come opzione si puo' inserire una password di autenticazione prima di cambiare il servizio giorno/notte. Se il campo rimane vuoto, qualsiasi utente potrà attivare o disattivare il servizio"
+
+msgid "Day"
+msgstr "Giorno"
+
+msgid "Night"
+msgstr "Notte"

Modified: freepbx-modules/trunk/modules/daynight/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/daynight/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/daynight/module.xml (original)
+++ freepbx-modules/trunk/modules/daynight/module.xml Sun May 18 19:52:05 2008
@@ -1,7 +1,7 @@
 <module>
 	<rawname>daynight</rawname>
 	<name>Day Night Mode</name>
-	<version>1.0.2.4</version>
+	<version>2.4.0.1</version>
 	<type>setup</type>
 	<category>Inbound Call Control</category>
 	<description>
@@ -9,6 +9,8 @@
 		that toggles between the two destinations.
 	</description>
 	<changelog>
+		*2.4.0.1* #2591, added depends on 2.4.0
+		*2.4.0* extension/dest registry, it translation
 		*1.0.2.4* #2414 fix other unmatched ) syntax error
 		*1.0.2.3* #2414 fix unmatched ) syntax error
 		*1.0.2.2* bump for rc1
@@ -17,9 +19,12 @@
 		*1.0.1* #2047 got day/night reversed
 		*1.0.0* First release for FreePBX 2.3 
 	</changelog>
+	<depends>
+		<version>2.4.0</version>
+	</depends>
 	<menuitems>
 		<daynight needsenginedb="yes">Day/Night Control</daynight>
 	</menuitems>
-	<location>release/2.3/daynight-1.0.2.3.tgz</location>
-	<md5sum>c8d4405e75c36add2dfff837b60505f5</md5sum>
+	<location>release/2.4/daynight-2.4.0.tgz</location>
+	<md5sum>a02e3f30ec11a27ff4c6ee13f0798475</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/daynight/page.daynight.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/daynight/page.daynight.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/daynight/page.daynight.php (original)
+++ freepbx-modules/trunk/modules/daynight/page.daynight.php Sun May 18 19:52:05 2008
@@ -85,7 +85,15 @@
 	$delURL = $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'].'&action=delete';
 ?>
 <?php		if ($itemid != ""){ ?>
-	<p><a href="<?php echo $delURL ?>"><?php echo _("Delete Day/Night Feature Code:")?> <?php echo $code; ?></a></p>
+	<a href="<?php echo $delURL ?>"><?php echo _("Delete Day/Night Feature Code:")?> <?php echo $code; ?></a><br />
+<?php
+					$usage_list = framework_display_destination_usage(daynight_getdest($itemid));
+					if (!empty($usage_list)) {
+?>
+						<a href="#" class="info"><?php echo $usage_list['text']?>:<span><?php echo $usage_list['tooltip']?></span></a>
+<?php
+					}
+?>
 <?php		} ?>
 
 	<form name="prompt" action="<?php $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return prompt_onsubmit();">
@@ -135,7 +143,7 @@
 		</td>
 	</tr>
 	<tr>
-		<td><a href="#" class="info"><?php echo _("Description")?>:<span><?php echo _('Description for this Day/Night Control')?></span></a></td>
+		<td><a href="#" class="info"><?php echo _("Description")?>:<span><?php echo _("Description for this Day/Night Control")?></span></a></td>
 		<td><input size="40" type="text" name="fc_description" value="<?php  echo $fc_description ?>">
 		</td>
 	</tr>

Modified: freepbx-modules/trunk/modules/dictate/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/dictate/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/dictate/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/dictate/functions.inc.php Sun May 18 19:52:05 2008
@@ -83,14 +83,14 @@
 	// On a 'new' user, 'tech_hardware' is set, and there's no extension. Hook into the page.
 	if ($tech_hardware != null || $pagename == 'users') {
 		dictation_applyhooks();
-		$currentcomponent->addprocessfunc('dictate_configprocess', 5);
+		$currentcomponent->addprocessfunc('dictate_configprocess', 8);
 	} elseif ($action=="add") {
 		// We don't need to display anything on an 'add', but we do need to handle returned data.
-		$currentcomponent->addprocessfunc('dictate_configprocess', 5);
+		$currentcomponent->addprocessfunc('dictate_configprocess', 8);
 	} elseif ($extdisplay != '') {
 		// We're now viewing an extension, so we need to display _and_ process.
 		dictation_applyhooks();
-		$currentcomponent->addprocessfunc('dictate_configprocess', 5);
+		$currentcomponent->addprocessfunc('dictate_configprocess', 8);
 	}
 }
 
@@ -151,7 +151,9 @@
 		$extdisplay = $ext;
 	} 
 	if ($action == "add" || $action == "edit") {
-		dictate_update($extdisplay, $dictenabled, $dictformat, $dictemail);
+		if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) {
+			dictate_update($extdisplay, $dictenabled, $dictformat, $dictemail);
+		}
 	} elseif ($action == "del") {
 		dictate_del($extdisplay);
 	}

Modified: freepbx-modules/trunk/modules/dictate/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/dictate/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/dictate/module.xml (original)
+++ freepbx-modules/trunk/modules/dictate/module.xml Sun May 18 19:52:05 2008
@@ -1,10 +1,11 @@
 <module>
 	<rawname>dictate</rawname>
 	<name>Dictation</name>
-	<version>1.1.2.3</version>
+	<version>2.4.0</version>
 	<type>setup</type>
 	<category>Internal Options &amp; Configuration</category>
 	<changelog>
+		*2.4.0* abort if user/extension conflict and move hook after user/extnesion hook
 		*1.1.2.3* #2312 fix dictate in devicesandusers mode
 		*1.1.2.2* changed categories
 		*1.1.2.1* bump for rc1
@@ -15,6 +16,6 @@
 		*1.0.0* Original Release
 	</changelog>
 	<description>This uses the app_dictate module of Asterisk to let users record dictate into their phones. When complete, the dictations can be emailed to an email address specified in the extension page.</description>
-	<location>release/2.3/dictate-1.1.2.2.tgz</location>
-	<md5sum>81f0b4ecff6a96b6a271122eec532fe0</md5sum>
+	<location>release/2.4/dictate-1.1.2.3.tgz</location>
+	<md5sum>1d9e2eefaced2f884cbf0ed93eb5af9a</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/disa/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/disa/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/disa/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/disa/functions.inc.php Sun May 18 19:52:05 2008
@@ -14,6 +14,30 @@
         } else {
                 return null;
         }
+}
+
+function disa_getdest($exten) {
+	return array('disa,'.$exten.',1');
+}
+
+function disa_getdestinfo($dest) {
+	global $active_modules;
+
+	if (substr(trim($dest),0,5) == 'disa,') {
+		$exten = explode(',',$dest);
+		$exten = $exten[1];
+		$thisexten = disa_get($exten);
+		if (empty($thisexten)) {
+			return array();
+		} else {
+			//$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup';
+			return array('description' => 'DISA : '.$thisexten['displayname'],
+			             'edit_url' => 'config.php?display=disa&itemid='.urlencode($exten),
+								  );
+		}
+	} else {
+		return false;
+	}
 }
 
 // This actually generates the dialplan

Added: freepbx-modules/trunk/modules/disa/i18n/it_IL/LC_MESSAGES/disa.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/disa/i18n/it_IL/LC_MESSAGES/disa.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/disa/i18n/it_IL/LC_MESSAGES/disa.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/disa/i18n/it_IL/LC_MESSAGES/disa.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/disa/i18n/it_IL/LC_MESSAGES/disa.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/disa/i18n/it_IL/LC_MESSAGES/disa.po (added)
+++ freepbx-modules/trunk/modules/disa/i18n/it_IL/LC_MESSAGES/disa.po Sun May 18 19:52:05 2008
@@ -1,0 +1,106 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-01-26 10:40+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: Italian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: page.disa.php:46 page.disa.php:66 page.disa.php:75
+msgid "Add"
+msgstr "Aggiungi"
+
+#: page.disa.php:59
+msgid "deleted"
+msgstr "eliminato"
+
+#: page.disa.php:68
+msgid "Delete"
+msgstr "Elimina"
+
+#: page.disa.php:75
+msgid "Edit"
+msgstr "Modifica"
+
+#: page.disa.php:78
+msgid "name:"
+msgstr "Nome:"
+
+#: page.disa.php:78
+msgid "Give this DISA a brief name to help you identify it."
+msgstr "Dare al DISA un nome breve per una facile identificazione."
+
+#: page.disa.php:83
+msgid "PIN"
+msgstr "PIN"
+
+#: page.disa.php:83
+msgid "The user will be prompted for this number."
+msgstr "All'utente sarà richiesto questo numero."
+
+#: page.disa.php:83
+msgid "If you wish to have multiple PIN's, seperate them with commas"
+msgstr "Si possono anche inserire più PIN, da separare con le virgole"
+
+#: page.disa.php:87
+msgid "Response Timeout"
+msgstr "Timeout Risposta"
+
+#: page.disa.php:87
+msgid ""
+"The maximum amount of time it will wait before hanging up if the user has "
+"dialled an incomplete or invalid number. Default of 10 seconds"
+msgstr "Il tempo massimo di tempo che il sistema attende prima di riagganciare se un utente ha digitato un numero incompleto o sbagliato. Predefinito è 10 secondi."
+
+#: page.disa.php:91
+msgid "Digit Timeout"
+msgstr "Timeout Digitazione"
+
+#: page.disa.php:91
+msgid ""
+"The maximum amount of time permitted between digits when the user is typing "
+"in an extension. Default of 5"
+msgstr "Il tempo massimo tra una digitazione e l'altra. Predefinito è 5 secondi."
+
+#: page.disa.php:95
+msgid "Require Confirmation"
+msgstr "Richiedi Conferma"
+
+#: page.disa.php:95
+msgid ""
+"Require Confirmation before prompting for password. Used when your PSTN "
+"connection appears to answer the call immediately"
+msgstr "Richiede Conferma prima della password. E' utilizzato quando la propria connessione PSTN sembra rispondere immediatamente alla chiamata."
+
+#: page.disa.php:99
+msgid "Caller ID"
+msgstr "ID Chiamante"
+
+#: page.disa.php:99
+msgid ""
+"(Optional) When using this DISA, the users CallerID will be set to this. "
+"Format is \"User Name\" <5551234>"
+msgstr "(Opzionale) Quando viene utilizzato il DISA, l'utente avrà questo ID Chiamante. Il Formato è \"Nome Utente\" <5551234>"
+
+#: page.disa.php:103
+msgid "Context"
+msgstr "Contesto"
+
+#: page.disa.php:103
+msgid ""
+"(Experts Only) Sets the context that calls will originate from. Leave this "
+"as from-internal unless you know what you're doing."
+msgstr "(Solo Esperti) Impostare il contesto da cui partiranno le chiamate. Lasciare questo su 'from-internal' se non si è sicuri."
+
+msgid "Submit Changes"
+msgstr "Invia"

Modified: freepbx-modules/trunk/modules/disa/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/disa/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/disa/module.xml (original)
+++ freepbx-modules/trunk/modules/disa/module.xml Sun May 18 19:52:05 2008
@@ -1,7 +1,7 @@
 <module>
 	<rawname>disa</rawname>
 	<name>DISA</name>
-	<version>2.2.2.3</version>
+	<version>2.4.0.1</version>
 	<type>setup</type>
 	<category>Internal Options &amp; Configuration</category>
 	<menuitems>
@@ -9,12 +9,17 @@
 	</menuitems>
 	<description>DISA Allows you 'Direct Inward System Access'. This gives you the ability to have an option on an IVR that gives you a dial tone, and you're able to dial out from the freePBX machine as if you were connected to a standard extension. It appears as a Destination.</description>
 	<changelog>
-		*2.2.2.3* #2463 Set CID when no pin
+		*2.4.0.1* added depends on 2.4.0
+		*2.4.0* #2463 no password cid fix, extension/dest registry, it translation
+		*2.2.3* #2463 Set CID when no pin, added support for Destination Registry
 		*2.2.2.2* #2172 deprecated use of |, changed category
 		*2.2.2.1* bump for rc1
 		*2.2.2* bump so higher that 2.2 branch
 		*2.2*   First release for FreePBX 2.2 - Fixed compatibility issue with new UI
 	</changelog>
-	<location>release/2.3/disa-2.2.2.2.tgz</location>
-	<md5sum>b0dc8c41a7e727f9c25fb5cfecde7c75</md5sum>
+	<depends>
+		<version>2.4.0</version>
+	</depends>
+	<location>release/2.4/disa-2.4.0.tgz</location>
+	<md5sum>bf233bc1b0075fe0c9ef5b7f2861468c</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/disa/page.disa.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/disa/page.disa.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/disa/page.disa.php (original)
+++ freepbx-modules/trunk/modules/disa/page.disa.php Sun May 18 19:52:05 2008
@@ -65,7 +65,17 @@
 
 	<h2><?php echo ($itemid ? "DISA: ".$thisItem["displayname"]." ($itemid)" : _("Add")." DISA"); ?></h2>
 <?php		if ($itemid){ ?>
-	<p><a href="<?php echo $delURL ?>"><?php echo _("Delete")." DISA"?> <?php echo $thisItem["displayname"]; ?></a></p>
+	<a href="<?php echo $delURL ?>"><?php echo _("Delete")." DISA"?> <?php echo $thisItem["displayname"]; ?></a>
+
+<?php
+					$usage_list = framework_display_destination_usage(disa_getdest($itemid));
+					if (!empty($usage_list)) {
+?>
+						<br /><a href="#" class="info"><?php echo $usage_list['text']?>:<span><?php echo $usage_list['tooltip']?></span></a>
+<?php
+			}
+?>
+
 <?php		} ?>
 	<form autocomplete="off" name="edit" action="<?php $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return edit_onsubmit();">
 	<input type="hidden" name="display" value="<?php echo $dispnum?>">

Modified: freepbx-modules/trunk/modules/donotdisturb/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/donotdisturb/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/donotdisturb/module.xml (original)
+++ freepbx-modules/trunk/modules/donotdisturb/module.xml Sun May 18 19:52:05 2008
@@ -1,8 +1,9 @@
 <module>
 	<rawname>donotdisturb</rawname>
 	<name>Do-Not-Disturb (DND)</name>
-	<version>1.0.2.2</version>
+	<version>2.4.0</version>
 	<changelog>
+		*2.4.0* bunp for 2.4
 		*1.0.2.2* changed category
 		*1.0.2.1* bump for rc1
 		*1.0.2* changed ${CALLERID(number)} to ${AMPUSER} to accomodate CID number masquerading
@@ -10,6 +11,6 @@
 	</changelog>
 	<type>setup</type>
 	<category>Internal Options &amp; Configuration</category>
-	<location>release/2.3/donotdisturb-1.0.2.1.tgz</location>
-	<md5sum>480cd7593b131c61a96147b7fa7cda59</md5sum>
+	<location>release/2.3/donotdisturb-1.0.2.2.tgz</location>
+	<md5sum>e240b22e028592f65f8269d9595563da</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/featurecodeadmin/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/featurecodeadmin/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/featurecodeadmin/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/featurecodeadmin/functions.inc.php Sun May 18 19:52:05 2008
@@ -40,4 +40,25 @@
 
 	needreload();
 }
+
+function featurecodeadmin_check_extensions($exten=true) {
+	$extenlist = array();
+	if (is_array($exten) && empty($exten)) {
+		return $extenlist;
+	}
+	$featurecodes = featurecodes_getAllFeaturesDetailed();
+
+	foreach ($featurecodes as $result) {
+		$thisexten = ($result['customcode'] != '')?$result['customcode']:$result['defaultcode'];
+
+		// Ignore disabled codes, and modules, and any exten not being requested unless all (true)
+		//
+		if (($result['featureenabled'] == 1) && ($result['moduleenabled'] == 1) && ($exten === true || in_array($thisexten, $exten))) {
+			$extenlist[$thisexten]['description'] = _("Featurecode: ").$result['featurename']." (".$result['modulename'].":".$result['featuredescription'].")";
+			$extenlist[$thisexten]['status'] = 'INUSE';
+			$extenlist[$thisexten]['edit_url'] = 'config.php?type=setup&display=featurecodeadmin';
+		}
+	}
+	return $extenlist;
+}
 ?>

Added: freepbx-modules/trunk/modules/featurecodeadmin/i18n/it_IT/LC_MESSAGES/featurecodeadmin.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/featurecodeadmin/i18n/it_IT/LC_MESSAGES/featurecodeadmin.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/featurecodeadmin/i18n/it_IT/LC_MESSAGES/featurecodeadmin.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/featurecodeadmin/i18n/it_IT/LC_MESSAGES/featurecodeadmin.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/featurecodeadmin/i18n/it_IT/LC_MESSAGES/featurecodeadmin.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/featurecodeadmin/i18n/it_IT/LC_MESSAGES/featurecodeadmin.po (added)
+++ freepbx-modules/trunk/modules/featurecodeadmin/i18n/it_IT/LC_MESSAGES/featurecodeadmin.po Sun May 18 19:52:05 2008
@@ -1,0 +1,204 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-01-26 11:07+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: Italian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: page.featurecodeadmin.php:36
+msgid "Feature Code Admin"
+msgstr "Amministrazione Codici Sevizi"
+
+#: page.featurecodeadmin.php:39
+msgid "Use"
+msgstr "Utilizzare"
+
+#: page.featurecodeadmin.php:39
+msgid "Default"
+msgstr "Predefinito"
+
+#: page.featurecodeadmin.php:40
+msgid "Feature"
+msgstr "Servizio"
+
+#: page.featurecodeadmin.php:40
+msgid "Status"
+msgstr "Stato"
+
+#: page.featurecodeadmin.php:62 page.featurecodeadmin.php:85
+msgid "Disabled"
+msgstr "Disattivato"
+
+#: page.featurecodeadmin.php:84
+msgid "Enabled"
+msgstr "Attivato"
+
+msgid "Submit Changes"
+msgstr "Invia"
+
+msgid "Blacklist a number"
+msgstr "Inserisce un numero in Blacklist"
+
+msgid "Blacklist the last caller"
+msgstr "Inserisce l'ultimo chiamante in Blacklist"
+
+msgid "Remove a number from the blacklist"
+msgstr "Rimuove un numero dalla Blacklist"
+
+msgid "Call Forward"
+msgstr "Trasferimento di chiamata"
+
+msgid "Call Forward All Activate"
+msgstr "Attiva Trasferimento di Chiamata Incondizionato"
+
+msgid "Call Forward All Deactivate"
+msgstr "Disattiva Trasferimento di Chiamata Incondizionato"
+
+msgid "Call Forward All Prompting Deactivate"
+msgstr "Disattiva Trasferimento di Chiamata Incondizionato (chiede dettagli)"
+
+msgid "Call Forward Busy Activate"
+msgstr "Attiva Inolro di Chiamata su Occupato"
+
+msgid "Call Forward Busy Deactivate"
+msgstr "Disattiva Trasferimento di Chiamata su Occupato"
+
+msgid "Call Forward Busy Prompting Deactivate"
+msgstr "Disattiva Trasferimento di Chiamata su Occupato (chiede dettagli)"
+
+msgid "Call Forward No Answer/Unavailable Activate"
+msgstr "Attiva Trasferimento su Nessuna Risposta/Non disponibile"
+
+msgid "Call Forward No Answer/Unavailable Deactivate"
+msgstr "Disattiva Trasferimento su Nessuna Risposta/Non disponibile"
+
+msgid "Call Waiting"
+msgstr "Avviso di Chiamata"
+
+msgid "Call Waiting - Activate"
+msgstr "Attiva Avviso di Chiamata"
+
+msgid "Call Waiting - Deactivate"
+msgstr "Disattiva Avviso di Chiamata"
+
+msgid "Core"
+msgstr "Sistema"
+
+msgid "Call Pickup (Can be used with GXP-2000)"
+msgstr "Call Pickup"
+
+msgid "Simulate Incoming Call"
+msgstr "Simulazione chiamata in entrata"
+
+msgid "Simulate Incoming FAX Call"
+msgstr "Simulazione chiamata FAX in entrata"
+
+msgid "User Logoff"
+msgstr "Disconessione Utente"
+
+msgid "User Logon"
+msgstr "Connessione Utente"
+
+msgid "Dictation"
+msgstr "Dettatura"
+
+msgid "Email completed dictation"
+msgstr "Invio Email a Dettatura completata"
+
+msgid "Perform dictation"
+msgstr "Esecuzione Dettatura"
+
+msgid "Do-Not-Disturb (DND)"
+msgstr "Non Disturbare (DND)"
+
+msgid "DND Activate"
+msgstr "Attiva Non Disturbare"
+
+msgid "DND Deactivate"
+msgstr "Disattiva Non Disturbare"
+
+msgid "Info Services"
+msgstr "Servizi di informazione"
+
+msgid "Call Trace"
+msgstr "Ultimi numeri chiamati"
+
+msgid "Directory"
+msgstr "Elenco Telefonico"
+
+msgid "Echo Test"
+msgstr "Test dell'Eco"
+
+msgid "Speak Your Exten Number"
+msgstr "Riproduzione Numero Interno"
+
+msgid "Speaking Clock"
+msgstr "Ora e Data"
+
+msgid "Misc Applications"
+msgstr "Applicazioni Varie"
+
+msgid "Paging and Intercom"
+msgstr "Paging e Intercom"
+
+msgid "Intercom prefix"
+msgstr "Prefisso Intercom"
+
+msgid "User Intercom Allow"
+msgstr "Permetti Intercom"
+
+msgid "User Intercom Disallow"
+msgstr "Non permettere Intercom"
+
+msgid "Phonebook Directory"
+msgstr "Rubrica telefonica"
+
+msgid "Phonebook dial-by-name directory"
+msgstr "Rubrica telefonica (chiama-per-nome)"
+
+msgid "Recordings"
+msgstr "Registrazioni"
+
+msgid "Check Recording"
+msgstr "Controllo registrazione"
+
+msgid "Save Recording"
+msgstr "Registrazione"
+
+msgid "Speed dial functions"
+msgstr "Funzioni Selezione breve"
+
+msgid "Set user speed dial"
+msgstr "Imposta numero in Selezione breve"
+
+msgid "Speeddial prefix"
+msgstr "Prefisso Selezione breve"
+
+msgid  "Voicemail"
+msgstr "Casella Vocale"
+
+msgid "Dial Voicemail"
+msgstr "Menu Casella Vocale"
+
+msgid "My Voicemail"
+msgstr "Menu propria Casella Vocale"
+
+msgid "Please select an extension!"
+msgstr "Selezionare un interno!"
+
+msgid "Day Night Mode"
+msgstr "Servizio Giorno Notte"
+
+msgid "Day/Night Control Toggle"
+msgstr "Codice Servizio Giorno/Notte"

Modified: freepbx-modules/trunk/modules/featurecodeadmin/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/featurecodeadmin/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/featurecodeadmin/module.xml (original)
+++ freepbx-modules/trunk/modules/featurecodeadmin/module.xml Sun May 18 19:52:05 2008
@@ -1,7 +1,7 @@
 <module>
 	<rawname>featurecodeadmin</rawname>
 	<name>Feature Code Admin</name>
-	<version>1.0.5.3</version>
+	<version>2.4.0.1</version>
 	<candisable>no</candisable>
 	<canuninstall>no</canuninstall>
 	<type>setup</type>
@@ -9,8 +9,10 @@
 	<menuitems>
 		<featurecodeadmin>Feature Codes</featurecodeadmin>
 	</menuitems>
-	<location>release/2.3/featurecodeadmin-1.0.5.2.tgz</location>
+	<location>release/2.4/featurecodeadmin-2.4.0.tgz</location>
 	<changelog>
+		*2.4.0.1* added depends on 2.4.0
+		*2.4.0* Extension/dest registry, it translation
 	  *1.0.5.3* changed categories
 	  *1.0.5.2* added canuninstall = no for module admin, bump for rc1
 	  *1.0.5.1* added candisable = no for module admin
@@ -19,5 +21,8 @@
 		*1.0.3* Add he_IL translation
 		*1.0.2* Fix minor font/display issues
 	</changelog>
-	<md5sum>8dbe40b6f108043e995092ae5100b26c</md5sum>
+	<depends>
+		<version>2.4.0</version>
+	</depends>
+	<md5sum>352e556c81c8bf5d208b0ab9e80566fa</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/featurecodeadmin/page.featurecodeadmin.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/featurecodeadmin/page.featurecodeadmin.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/featurecodeadmin/page.featurecodeadmin.php (original)
+++ freepbx-modules/trunk/modules/featurecodeadmin/page.featurecodeadmin.php Sun May 18 19:52:05 2008
@@ -31,7 +31,45 @@
 <div class="content">
 	<form autocomplete="off" name="frmAdmin" action="<?php $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return frmAdmin_onsubmit();">
 	<input type="hidden" name="display" value="<?php echo $dispnum?>">
-  	<input type="hidden" name="action" value="save">
+	<input type="hidden" name="action" value="save">
+
+	<?php
+			$exten_conflict_arr = array();
+			$conflict_url = array();
+			$exten_arr = array();
+			foreach ($featurecodes as $result) {
+				if (($result['featureenabled'] == 1) && ($result['moduleenabled'] == 1)) {
+					$exten_arr[] = ($result['customcode'] != '')?$result['customcode']:$result['defaultcode'];
+				}
+			}
+			$usage_arr = framework_check_extension_usage($exten_arr);
+			unset($usage_arr['featurecodeadmin']);
+			if (!empty($usage_arr)) {
+				$conflict_url = framework_display_extension_usage_alert($usage_arr,false,false);
+			}
+			if (!empty($conflict_url)) {
+				$str = "You have feature code conflicts with extension numbers in other modules. This will result in unexpected and broken behavior.";
+				echo "<script>javascript:alert('$str')</script>";
+      	echo "<h4>"._("Feature Code Conflicts with other Extensions")."</h4>";
+      	echo implode('<br .>',$conflict_url);
+
+				// Create hash of conflicting extensions
+				//
+				foreach ($usage_arr as $module_name => $details) {
+					foreach (array_keys($details) as $exten_conflict) {
+						$exten_conflict_arr[$exten_conflict] = true;
+					}
+				}
+
+				// Now check for conflicts within featurecodes page
+				//
+				$unique_exten_arr = array_unique($exten_arr);
+				$feature_conflict_arr = array_diff_assoc($exten_arr, $unique_exten_arr);
+				foreach ($feature_conflict_arr as $value) {
+					$exten_conflict_arr[$value] = true;
+				}
+      }
+	?>
 	<table>
 	<tr><td colspan="4"><h3><?php echo _("Feature Code Admin"); ?><hr></h3></td></tr>
 	<tr>
@@ -42,14 +80,21 @@
 	<?php 
 	$currentmodule = "(none)";
 	foreach($featurecodes as $item) {
-		$moduledesc = isset($item['moduledescription'])?_($item['moduledescription']):null;
+
+		// change domains to get the translations from each module
+		//
+		bindtextdomain($item['modulename'],"modules/".$item['modulename']."./i18n");
+		$moduledesc = isset($item['moduledescription'])?gettext($item['moduledescription']):null;
+		$featuredesc = gettext($item['featuredescription']);
+		bindtextdomain($dispnum,"modules/".$dispnum."./i18n");
+
 		$moduleena = ($item['moduleenabled'] == 1 ? true : false);
-
-		$featuredesc = _($item['featuredescription']);
 		$featureid = $item['modulename'] . '#' . $item['featurename'];
 		$featureena = ($item['featureenabled'] == 1 ? true : false);
 		$featurecodedefault = (isset($item['defaultcode']) ? $item['defaultcode'] : '');
 		$featurecodecustom = (isset($item['customcode']) ? $item['customcode'] : '');
+
+		$thiscode = ($featurecodecustom != '') ? $featurecodecustom : $featurecodedefault;
 		
 		if ($currentmodule != $moduledesc) {
 			$currentmodule = $moduledesc;
@@ -68,11 +113,24 @@
 		}
 		?> 	
 		<tr>
-			<td> 
-				<?php echo $featuredesc; ?>
+		<?php 
+			if (array_key_exists($thiscode, $exten_conflict_arr)) { 
+				$style = "style='color:red'"; 
+				$background = "style='background:red'"; 
+				$strong = "<strong>";
+				$endstrong = "</strong>";
+			} else {
+				$style = ""; 
+				$background = ""; 
+				$strong = "";
+				$endstrong = "";
+			} 
+		?>
+			<td <?php echo $style ?>> 
+				<?php echo $strong.$featuredesc.$endstrong; ?>
 			</td>
 			<td>
-				<input type="text" name="custom#<?php echo $featureid; ?>" value="<?php echo $featurecodecustom; ?>" size="4">
+				<input type="text" name="custom#<?php echo $featureid; ?>" value="<?php echo $featurecodecustom; ?>" <?php echo $background; ?> size="4">
 			</td>
 			<td align="center">
 				<input type="checkbox" onclick="usedefault_onclick(this);" name="usedefault_<?php echo $featureid; ?>"<?php if ($featurecodecustom == '') echo "checked"; ?>>

Modified: freepbx-modules/trunk/modules/findmefollow/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/findmefollow/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/findmefollow/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/findmefollow/functions.inc.php Sun May 18 19:52:05 2008
@@ -1,26 +1,4 @@
 <?php /* $Id: functions.inc.php 175 2006-10-03 19:12:39Z plindheimer $ */
-
-// The destinations this module provides
-// returns a associative arrays with keys 'destination' and 'description'
-/*
-
-// Remove destinations, use from-did-direct in core for 2.3 and on
-
-function findmefollow_destinations() {
-	//get the list of findmefollow
-	$results = findmefollow_full_list();
-	
-	// return an associative array with destination and description
-	if (isset($results)) {
-		foreach($results as $result){
-				$thisgrp = findmefollow_get(ltrim($result['0']));
-				$extens[] = array('destination' => 'ext-findmefollow,FM'.ltrim($result['0']).',1', 'description' => $thisgrp['grppre'].' <'.ltrim($result['0']).'>');
-		}
-	}
-	
-	return isset($extens)?$extens:null;
-}
-*/
 
 /* 	Generates dialplan for findmefollow
 	We call this with retrieve_conf
@@ -381,4 +359,31 @@
 	}	
 }
 
+function findmefollow_check_destinations($dest=true) {
+	global $active_modules;
+
+	$destlist = array();
+	if (is_array($dest) && empty($dest)) {
+		return $destlist;
+	}
+	$sql = "SELECT grpnum, postdest, name FROM findmefollow INNER JOIN users ON grpnum = extension ";
+	if ($dest !== true) {
+		$sql .= "WHERE postdest in ('".implode("','",$dest)."')";
+	}
+	$results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
+
+	//$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup';
+
+	foreach ($results as $result) {
+		$thisdest = $result['postdest'];
+		$thisid   = $result['grpnum'];
+		$destlist[] = array(
+			'dest' => $thisdest,
+			'description' => 'Follow-Me: '.$thisid.' ('.$result['name'].')',
+			'edit_url' => 'config.php?display=findmefollow&extdisplay=GRP-'.urlencode($thisid),
+		);
+	}
+	return $destlist;
+}
+
 ?>

Added: freepbx-modules/trunk/modules/findmefollow/i18n/it_IL/LC_MESSAGES/findmefollow.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/findmefollow/i18n/it_IL/LC_MESSAGES/findmefollow.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/findmefollow/i18n/it_IL/LC_MESSAGES/findmefollow.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/findmefollow/i18n/it_IL/LC_MESSAGES/findmefollow.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/findmefollow/i18n/it_IL/LC_MESSAGES/findmefollow.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/findmefollow/i18n/it_IL/LC_MESSAGES/findmefollow.po (added)
+++ freepbx-modules/trunk/modules/findmefollow/i18n/it_IL/LC_MESSAGES/findmefollow.po Sun May 18 19:52:05 2008
@@ -1,0 +1,329 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-01-26 12:34+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: Italian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: install.php:66 uninstall.php:30
+msgid "Cannot connect to Asterisk Manager with "
+msgstr "Impossibile connettersi al manager di Asterisk con "
+
+#: page.findmefollow.php:68
+msgid "Warning! Extension"
+msgstr "Attenzione! L'Interno"
+
+#: page.findmefollow.php:68
+msgid "is not allowed for your account"
+msgstr "non possiede i permessi"
+
+#: page.findmefollow.php:107
+msgid "$gresult[1]"
+msgstr ""
+
+#: page.findmefollow.php:118 page.findmefollow.php:121
+#: page.findmefollow.php:150
+msgid "Follow Me"
+msgstr "Seguimi"
+
+#: page.findmefollow.php:121
+msgid "deleted"
+msgstr "Eliminato"
+
+#: page.findmefollow.php:147
+msgid "Delete Entries"
+msgstr "Elimina voci"
+
+#: page.findmefollow.php:172
+msgid "Edit Follow Me"
+msgstr "Modifica Seguimi"
+
+#: page.findmefollow.php:172
+msgid "Add Follow Me"
+msgstr "Aggiungi Seguimi"
+
+#: page.findmefollow.php:180
+msgid "group number"
+msgstr "Numero gruppo"
+
+#: page.findmefollow.php:180
+msgid "The number users will dial to ring extensions in this ring group"
+msgstr ""
+
+#: page.findmefollow.php:186
+msgid "Initial Ring Time:"
+msgstr "Tempo inziale di squillo:"
+
+#: page.findmefollow.php:187
+msgid ""
+"This is the number of seconds to ring the primary extension prior to "
+"proceeding to the follow-me list. The extension can also be included in the "
+"follow-me list. A 0 setting will bypass this."
+msgstr "Questo è il numero di secondi di squillo per l'interno primario prima di far procedere la chiamata nella lista seguimi. L'interno può anche essere incluso nella lista. 0 per passarlo direttamente."
+
+#: page.findmefollow.php:205
+msgid "ring strategy:"
+msgstr "Strategia squillo:"
+
+msgid "rinallv2"
+msgstr ""
+
+msgid "ring primary extension for initial ring time followed by all additional extensions until one answers"
+msgstr "squilla l'interno primario per il tempo iniziale di squillo seguito dagli altri interni fino a quando uno non risponde"
+
+#: page.findmefollow.php:207
+msgid "ringall"
+msgstr ""
+
+#: page.findmefollow.php:207
+msgid "ring all available channels until one answers (default)"
+msgstr "chiama tutti i canali disponibili fino a quando un interno non risponde (predefinito)"
+
+#: page.findmefollow.php:208
+msgid "hunt"
+msgstr ""
+
+#: page.findmefollow.php:208
+msgid "take turns ringing each available extension"
+msgstr "chiama a circolo tutti gli interni disponibili"
+
+#: page.findmefollow.php:209
+msgid "memoryhunt"
+msgstr ""
+
+#: page.findmefollow.php:209
+msgid ""
+"ring first extension in the list, then ring the 1st and 2nd extension, then "
+"ring 1st 2nd and 3rd extension in the list.... etc."
+msgstr "chiama il primo interno della lista, poi il primo e il secondo, poi il primo, il secondo e il terzo... ecc."
+
+#: page.findmefollow.php:210
+msgid "*-prim"
+msgstr ""
+
+#: page.findmefollow.php:210
+msgid ""
+"these modes act as described above. However, if the primary extension (first "
+"in list) is occupied, the other extensions will not be rung. If the primary "
+"is freepbx DND, it won't be run. If the primary is freepbx CF unconditional, "
+"then all will be rung"
+msgstr "queste modalità sono attuate come descritto sopra. Però, se l'interno primario (il primo della lista è occupato, gli altri interni non saranno chiamati. Se il primario ha attivato il Non Disturbare di FreePBX, non andrà avanti. Se il primario è un Trasferimento di Chiamata incondizionato attivato su FreePBX, tutti squilleranno."
+
+#: page.findmefollow.php:226
+msgid "Alert Info"
+msgstr ""
+
+#: page.findmefollow.php:230
+msgid "Confirm Calls"
+msgstr "Conferma Chiamate"
+
+#: page.findmefollow.php:231
+msgid "System Recordings not installed. Option Disabled"
+msgstr "Registrazioni di Sistema non installate. Optione Disabilitata."
+
+#: page.findmefollow.php:237
+msgid "Remote Announce:"
+msgstr "Annuncio Remoto:"
+
+#: page.findmefollow.php:237
+msgid ""
+"Message to be played to the person RECEIVING the call, if 'Confirm Calls' is "
+"enabled.<br><br>To add additional recordings use the \"System Recordings\" "
+"MENU to the left"
+msgstr "Il messaggio da riprodurre alla persona che RICEVE la chiamata, se è stato attivo 'Conferma Chiamate'<br><br>Per aggiungere ulteriori registrazioni utilizzare \"Registrazioni di Sistema\" nel MENU di sinistra"
+
+#: page.findmefollow.php:243 page.findmefollow.php:260
+msgid "Default"
+msgstr "Predefinito"
+
+#: page.findmefollow.php:254
+msgid "Too-Late Announce:"
+msgstr "Annuncio Troppo-Tardi"
+
+#: page.findmefollow.php:254
+msgid ""
+"Message to be played to the person RECEIVING the call, if the call has "
+"already been accepted before they push 1.<br><br>To add additional "
+"recordings use the \"System Recordings\" MENU to the left"
+msgstr "Il messaggio da riprodurre alla persona che RICEVE la chiamata, se la chiamata è già stata accettata prima di premere il tasto.<br><br>Per aggiungere ulteriori registrazioni utilizzare \"Registrazioni di Sistema\" nel MENU di sinistra"
+
+#: page.findmefollow.php:272
+msgid "extension list"
+msgstr "Lista interni"
+
+#: page.findmefollow.php:272
+msgid ""
+"List extensions to ring, one per line.<br><br>You can include an extension "
+"on a remote system, or an external number by suffixing a number with a pound "
+"(#).  ex:  2448089# would dial 2448089 on the appropriate trunk (see "
+"Outbound Routing)."
+msgstr "Inserire gli interni o numeri da chiamare, uno per riga.<br><br>Per includere numeri esterni, inserire cancelletto (#) alla fine del numero. Es.: per chiamare 06123456789 bisgona inserire 006123456789# (se nelle Rotte in uscita è stato inserito lo 0 per le chiamate esterne)."
+
+#: page.findmefollow.php:287
+msgid "CID name prefix"
+msgstr "Prefisso ID Chiamante"
+
+msgid "You can optionally prefix the Caller ID name when ringing extensions in this group. ie: If you prefix with \"Sales:\", a call from John Doe would display as \"Sales:John Doe\" on the extensions that ring."
+msgstr "Come opzione si puo' inserire un prefisso prima dell'identificativo chiamante. Es.: se si inserisce \"Commerciale:\", una chiamata per Mario Rossi sarà visualizzata come \"Commerciale:Mario Rossi\" sul display del telefono che squilla."
+
+#: page.findmefollow.php:293
+msgid "ring time (max 60 sec)"
+msgstr "Tempo di squilli (max 60 sec)"
+
+#: page.findmefollow.php:298 page.findmefollow.php:316
+msgid "announcement:"
+msgstr "Annuncio:"
+
+#: page.findmefollow.php:298
+msgid ""
+"Message to be played to the caller before dialing this group.<br><br>To add "
+"additional recordings please use the \"System Recordings\" MENU to the left"
+msgstr "Messaggio da riprodurre al chiamante prima di chiamare questo gruppo.<br><br>Per aggiungere ulteriori registrazioni utilizzare \"Registrazioni di Sistema\" nel MENU di sinistra"
+
+#: page.findmefollow.php:304
+msgid "None"
+msgstr "Nessuno"
+
+#: page.findmefollow.php:316
+msgid ""
+"Message to be played to the caller before dialing this group.<br><br>You "
+"must install and enable the \"Systems Recordings\" Module to edit this option"
+msgstr "Messaggio da rirprodurre al chiamante prima di chiamare questo gruppo.<br><br>Per utilizzare questa opzione, bisogna aver prima installato e attivato il modulo \"Registrazioni di Sistema\""
+
+#: page.findmefollow.php:326
+msgid "Play Music On Hold?"
+msgstr "Riproduci Musica di Attesa?"
+
+#: page.findmefollow.php:326
+msgid ""
+"If you select a Music on Hold class to play, instead of 'Ring', they will "
+"hear that instead of Ringing while they are waiting for someone to pick up."
+msgstr "Se si seleziona una classe di Musica di Attesa, invece che 'Squillo', l'utente ascolterà questa mentre è in attesa di una risposta."
+
+#: page.findmefollow.php:332
+msgid "Ring"
+msgstr "Squillo"
+
+#: page.findmefollow.php:344
+msgid "Destination if no answer"
+msgstr "Destinzione se nessuna risposta"
+
+msgid "Core"
+msgstr "Sistema"
+
+msgid "Conferences"
+msgstr "Conferenze"
+
+msgid "Phonebook Directory"
+msgstr "Rubrica"
+
+msgid "Queues"
+msgstr "Code"
+
+msgid "Ring Groups"
+msgstr "Gruppi di chiamata"
+
+msgid "Speed dial functions"
+msgstr "Selezione breve"
+
+msgid "Time Conditions"
+msgstr "Condizioni Temporali"
+
+msgid "Custom Contexts"
+msgstr "Contesti Personalizzati"
+
+msgid "Extended Routing"
+msgstr "Rotte specifiche"
+
+msgid "Custom App<span><br>ADVANCED USERS ONLY<br><br>Uses Goto() to send caller to a custom context.<br><br>The context name should start with \"custom-\", and be in the format custom-context,extension,priority. Example entry:<br><br><b>custom-myapp,s,1</b><br><br>The <b>[custom-myapp]</b> context would need to be created and included in extensions_custom.conf</span>"
+msgstr "Applicazione Personalizzata<span>SOLO UTENTI AVANZATI<br>Utilizzare Goto() per inviare la chiamata verso un contesto personalizzato.<br><br>Il nome del contesto deve iniziare per \"custom-\" e deve essere nel formato custom-contesto,extension,priorità. Esempio: <br><br><b>custom-app,s,1</b><br><br><b>Il contesto [custom-app] </b> deve poi essere creato e incluso nel file extensions_custom.conf</span"
+
+msgid "Submit Changes"
+msgstr "Invia"
+
+msgid "Edit"
+msgstr "Modifica"
+
+msgid "extension"
+msgstr "interno"
+
+msgid "You can optionally include an Alert Info which can create distinctive rings on SIP phones."
+msgstr "Si può anche includere come opzione un messaggio Alert Info per distinguere le suonerie su apparati di tipo SIP."
+
+msgid "Enable this if you're calling external numbers that need confirmation - eg, a mobile phone may go to voicemail which will pick up the call. Enabling this requires the remote side push 1 on their phone before the call is put through. This feature only works with the ringall/ringall-prim  ring strategy"
+msgstr "Attivare questa opzione se si vogliono chiamano numeri esterni che hanno bisogno di conferma - es., un telefono cellulare potrebbe andare ad una segreteria, e in quel caso la chiamata sarà presa. Attivando questa opzione l'utente remoto dovrà digitare 1 sul proprio telefono per accettare la chiamata. Questa opzione funziona solo con le strategie di squillo ringall e ringall-prim."
+
+msgid "Choose a user/extension:"
+msgstr "Scegliere un utente/interno:"
+
+msgid "Day Night Mode"
+msgstr "Servizio Giorno Notte"
+
+msgid "Terminate Call"
+msgstr "Termina chiamata"
+
+msgid "Extensions"
+msgstr "Interni"
+
+msgid "Voicemail"
+msgstr "Casella Vocale"
+
+msgid "Announcement:"
+msgstr "Annuncio:"
+
+msgid "Ring Time (max 60 sec)"
+msgstr "Tempo di squillo (max 60 sec)"
+
+msgid "CID Name Prefix"
+msgstr "Prefisso ID Chiamante"
+
+msgid "Follow-Me List"
+msgstr "Lista Seguimi"
+
+msgid "Disable as Default"
+msgstr "Predefinito disattivato"
+
+msgid ""
+"By default (not checked) any call to this extension will go to this FollowMe instead, including directory calls by name from IVRs. If checked, calls will go only to the extension.<BR>"
+"However, destinations that specify FollowMe will come here.<BR>"
+"Checking this box is often used in conjunction with VmX Locater, where you want a call to ring the extension, and then only if the caller chooses to find you do you want it to come here."
+msgstr "Nell'impostazione predefinita (non selezionato) tutte le chiamate su questo interno andranno al Seguimi, incluse le chiamate da un IVR. Se selezionato, le chiamate andranno solo all'interno.<br>Questa opzione è di solito usata insieme al VmX Locator, dove si puo' scegliere se inviare il chiamante al seguimi."
+
+msgid "Ring Strategy:"
+msgstr "Strategia di Squillo:"
+
+msgid "(edit)"
+msgstr "(modifica)"
+
+msgid "Edit Extension %s"
+msgstr "Modifica Interno %s"
+
+msgid "Edit Follow Me Settings"
+msgstr "Modifica impostazioni Seguimi"
+
+#: page.ringgroups.php:187
+msgid "firstavailable"
+msgstr ""
+
+#: page.ringgroups.php:187
+msgid "ring only the first available channel"
+msgstr "squilla solo il primo disponibile"
+
+#: page.ringgroups.php:188
+msgid "firstnotonphone"
+msgstr ""
+
+#: page.ringgroups.php:188
+msgid "ring only the first channel which is not offhook - ignore CW"
+msgstr "squilla solo il primo che è al telefono - ignora Avviso di Chiamata"

Modified: freepbx-modules/trunk/modules/findmefollow/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/findmefollow/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/findmefollow/module.xml (original)
+++ freepbx-modules/trunk/modules/findmefollow/module.xml Sun May 18 19:52:05 2008
@@ -1,8 +1,10 @@
 <module>
 	<rawname>findmefollow</rawname>
 	<name>Follow Me</name>
-	<version>2.4.13.2</version>
+	<version>2.4.14.1</version>
 	<changelog>
+		*2.4.14.1* added depends on 2.4.0
+		*2.4.14* Extension/dest registry, extension quickpick, added hunt strategy with confirmation, it trans, formatting changes
 		*2.4.13.2* #2193 moh path hardcoded
 		*2.4.13.1* bump for rc1
 		*2.4.13* added xml attribute needsenginedb, #1961 enabled to work with extension numbers leading with 0s
@@ -34,6 +36,9 @@
 		2.1.5: Fix bug #1142
 		2.1.4: Code cleanup
 	</changelog>
+	<depends>
+		<version>2.4.0</version>
+	</depends>
 	<type>setup</type>
 	<category>Inbound Call Control</category>
 	<description>
@@ -42,6 +47,6 @@
 	<menuitems>
 		<findmefollow needsenginedb="yes">Follow Me</findmefollow>
 	</menuitems>
-	<location>release/2.3/findmefollow-2.4.13.1.tgz</location>
-	<md5sum>2ce3986fa50e65b41298ef746fb38934</md5sum>
+	<location>release/2.4/findmefollow-2.4.14.tgz</location>
+	<md5sum>99fcd2babbeb72612ceea50c5b1346fa</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/findmefollow/page.findmefollow.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/findmefollow/page.findmefollow.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/findmefollow/page.findmefollow.php (original)
+++ freepbx-modules/trunk/modules/findmefollow/page.findmefollow.php Sun May 18 19:52:05 2008
@@ -186,7 +186,7 @@
 			</tr>
 
 			<tr>
-				<td><a href="#" class="info"><?php echo _("Disable as Default")?><span><?php echo _('By default (not checked) any call to this extension will go to this FollowMe instead, including directory calls by name from IVRs. If checked, calls will go only to the extension.<BR>However, destinations that specify FollowMe will come here.<BR>Checking this box is often used in conjunction with VmX Locater, where you want a call to ring the extension, and then only if the caller chooses to find you do you want it to come here.')?></span></a>:</td>
+				<td><a href="#" class="info"><?php echo _("Disable")?><span><?php echo _('By default (not checked) any call to this extension will go to this Follow-Me instead, including directory calls by name from IVRs. If checked, calls will go only to the extension.<BR>However, destinations that specify FollowMe will come here.<BR>Checking this box is often used in conjunction with VmX Locater, where you want a call to ring the extension, and then only if the caller chooses to find you do you want it to come here.')?></span></a>:</td>
 				<td><input type="checkbox" name="ddial" value="CHECKED" <?php echo $ddial ?>  /></td>
 			</tr>
 
@@ -196,7 +196,6 @@
 				</span></a>
 				</td>
 				<td>
-					&nbsp;
 					<select name="pre_ring"/>
 					<?php
 						$default = (isset($pre_ring) ? $pre_ring : 0);
@@ -208,9 +207,9 @@
 				</td>
 			</tr>
 
-
-			<tr>
-				<td> <a href="#" class="info"><?php echo _("Ring Strategy:")?>
+			<tr>
+				<td>
+				<a href="#" class="info"><?php echo _("Ring Strategy:")?>
 				<span>
 					<b><?php echo _("ringallv2")?></b>:  <?php echo _("ring primary extension for initial ring time followed by all additional extensions until one answers")?><br>
 					<b><?php echo _("ringall")?></b>:  <?php echo _("ring all available channels until one answers (default)")?><br>
@@ -220,9 +219,10 @@
 					<b><?php echo _("firstavailable")?></b>:  <?php echo _("ring only the first available channel")?><br>
 					<b><?php echo _("firstnotonphone")?></b>:  <?php echo _("ring only the first channel which is not offhook - ignore CW")?><br>
 				</span>
-				</a></td>
-				<td>
-					&nbsp;&nbsp;<select name="strategy"/>
+				</a>
+				</td>
+				<td>
+					<select name="strategy"/>
 					<?php
 						$default = (isset($strategy) ? $strategy : 'ringall');
                                                 $items = array('ringallv2','ringallv2-prim','ringall','ringall-prim','hunt','hunt-prim','memoryhunt','memoryhunt-prim','firstavailable','firstnotonphone');
@@ -233,55 +233,21 @@
 					</select>
 				</td>
 			</tr>
-			<tr>
-				<td><a href="#" class="info"><?php echo _("Alert Info")?>:<span><?php echo _('You can optionally include an Alert Info which can create distinctive rings on SIP phones.')?></span></a></td>
-				<td><input size="18" type="text" name="dring" value="<?php  echo $dring ?>"></td>
-			</tr>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("Confirm Calls")?><span><?php echo _('Enable this if you\'re calling external numbers that need confirmation - eg, a mobile phone may go to voicemail which will pick up the call. Enabling this requires the remote side push 1 on their phone before the call is put through. This feature only works with the ringall/ringall-prim  ring strategy')?></span></a>:</td>
-		<td> <?php if (!function_exists('recordings_list')) { echo _("System Recordings not installed. Option Disabled"); } else { ?>
-			<input type="checkbox" name="needsconf" value="CHECKED" <?php echo $needsconf ?>  /></td>
-<?php } ?>
-	</tr>
-<?php if(function_exists('recordings_list')) { //only include if recordings is enabled?>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("Remote Announce:")?><span><?php echo _("Message to be played to the person RECEIVING the call, if 'Confirm Calls' is enabled.<br><br>To add additional recordings use the \"System Recordings\" MENU to the left")?></span></a></td>
-		<td>
-			&nbsp;&nbsp;<select name="remotealert"/>
-			<?php
-				$tresults = recordings_list();
-				$default = (isset($remotealert) ? $remotealert : '');
-				echo '<option value="">'._("Default")."</option>";
-				if (isset($tresults[0])) {
-					foreach ($tresults as $tresult) {
-						echo '<option value="'.$tresult[2].'"'.($tresult[2] == $default ? ' SELECTED' : '').'>'.$tresult[1]."</option>\n";
-					}
-				}
-			?>
-			</select>
-		</td>
-	</tr>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("Too-Late Announce:")?><span><?php echo _("Message to be played to the person RECEIVING the call, if the call has already been accepted before they push 1.<br><br>To add additional recordings use the \"System Recordings\" MENU to the left")?></span></a></td>
-		<td>
-		&nbsp;&nbsp;<select name="toolate"/>
-			<?php
-				$tresults = recordings_list();
-				$default = (isset($toolate) ? $toolate : '');
-				echo '<option value="">'._("Default")."</option>";
-				if (isset($tresults[0])) {
-					foreach ($tresults as $tresult) {
-						echo '<option value="'.$tresult[2].'"'.($tresult[2] == $default ? ' SELECTED' : '').'>'.$tresult[1]."</option>\n";
-					}
-				}
-			?>
-			</select>
-		</td>
-	</tr>
-<?php } ?>
-			<tr>
-				<td valign="top"><a href="#" class="info"><?php echo _("Follow-Me List")?>:<span><br><?php echo _("List extensions to ring, one per line.<br><br>You can include an extension on a remote system, or an external number by suffixing a number with a pound (#).  ex:  2448089# would dial 2448089 on the appropriate trunk (see Outbound Routing).")?><br><br></span></a></td>
-				<td valign="top">&nbsp;
+
+			<tr>
+				<td>
+					<a href=# class="info"><?php echo _("Ring Time (max 60 sec)")?>
+						<span>
+							<?php echo _("Time in seconds that the phones will ring. For all hunt style ring strategies, this is the time for each iteration of phone(s) that are rung")?>
+						</span>
+					</a>
+				</td>
+				<td><input size="4" type="text" name="grptime" value="<?php  echo $grptime?$grptime:20 ?>"></td>
+			</tr>
+
+			<tr>
+				<td valign="top"><a href="#" class="info"><?php echo _("Follow-Me List")?>:<span><br><?php echo _("List extensions to ring, one per line, or use the Extension Quick Pick below.<br><br>You can include an extension on a remote system, or an external number by suffixing a number with a pound (#).  ex:  2448089# would dial 2448089 on the appropriate trunk (see Outbound Routing).")?><br><br></span></a></td>
+				<td valign="top">
 <?php
 		$rows = count($grplist)+1; 
 		if ($rows <= 2 && trim($grplist[0]) == "") {
@@ -289,67 +255,132 @@
 		}
 		($rows < 5) ? 5 : (($rows > 20) ? 20 : $rows);
 ?>
-					<textarea id="grplist" cols="15" rows="<?php  echo $rows ?>" name="grplist"><?php echo implode("\n",$grplist);?></textarea><br>
-					
-					<input type="submit" style="font-size:10px;" value="<?php echo _("Clean & Remove duplicates")?>" />
-				</td>
-			</tr>
+					<textarea id="grplist" cols="15" rows="<?php  echo $rows ?>" name="grplist"><?php echo implode("\n",$grplist);?></textarea>
+				</td>
+			</tr>
+
+			<tr>
+				<td>
+				<a href=# class="info"><?php echo _("Extension Quick Pick")?>
+					<span>
+						<?php echo _("Choose an extension to append to the end of the extension list above.")?>
+					</span>
+				</a>
+				</td>
+				<td>
+					<select onChange="insertExten();" id="insexten">
+						<option value=""><?php echo _("(pick extension)")?></option>
+	<?php
+						$results = core_users_list();
+						foreach ($results as $result) {
+							echo "<option value='".$result[0]."'>".$result[0]." (".$result[1].")</option>\n";
+						}
+	?>
+					</select>
+				</td>
+			</tr>
+
+<?php if(function_exists('recordings_list')) { //only include if recordings is enabled?>
+			<tr>
+				<td><a href="#" class="info"><?php echo _("Announcement:")?><span><?php echo _("Message to be played to the caller before dialing this group.<br><br>To add additional recordings please use the \"System Recordings\" MENU to the left")?></span></a></td>
+				<td>
+					<select name="annmsg"/>
+					<?php
+						$tresults = recordings_list();
+						$default = (isset($annmsg) ? $annmsg : '');
+						echo '<option value="">'._("None");
+						if (isset($tresults)) {
+							foreach ($tresults as $tresult) {
+								echo '<option value="'.$tresult[2].'"'.($tresult[2] == $default ? ' SELECTED' : '').'>'.$tresult[1];
+							}
+						}
+					?>		
+					</select>		
+				</td>
+			</tr>
+<?php }	else { ?>
+			<tr>
+				<td><a href="#" class="info"><?php echo _("Announcement:")?><span><?php echo _("Message to be played to the caller before dialing this group.<br><br>You must install and enable the \"Systems Recordings\" Module to edit this option")?></span></a></td>
+				<td>
+					<?php
+						$default = (isset($annmsg) ? $annmsg : '');
+					?>
+					<input type="hidden" name="annmsg" value="<?php echo $default; ?>"><?php echo ($default != '' ? $default : 'None'); ?>
+				</td>
+			</tr>
+
+<?php } if (function_exists('music_list')) { ?>
+			<tr>
+				<td><a href="#" class="info"><?php echo _("Play Music On Hold?")?><span><?php echo _("If you select a Music on Hold class to play, instead of 'Ring', they will hear that instead of Ringing while they are waiting for someone to pick up.")?></span></a></td>
+				<td>
+					<select name="ringing"/>
+					<?php
+						$tresults = music_list($amp_conf['ASTVARLIBDIR']."/mohmp3");
+						$cur = (isset($ringing) ? $ringing : 'Ring');
+						echo '<option value="Ring">'._("Ring")."</option>";
+						if (isset($tresults[0])) {
+							foreach ($tresults as $tresult) {
+								echo '<option value="'.$tresult.'"'.($tresult == $cur ? ' SELECTED' : '').'>'.$tresult."</option>\n";
+							}
+						}
+					?>
+					</select>
+					</td>
+				</tr>
+<?php } ?>
+
 			<tr>
 				<td><a href="#" class="info"><?php echo _("CID Name Prefix")?>:<span><?php echo _('You can optionally prefix the Caller ID name when ringing extensions in this group. ie: If you prefix with "Sales:", a call from John Doe would display as "Sales:John Doe" on the extensions that ring.')?></span></a></td>
 				<td><input size="4" type="text" name="grppre" value="<?php  echo $grppre ?>"></td>
 			</tr>
 
-
-			<tr>
-				<td><?php echo _("Ring Time (max 60 sec)")?>:</td>
-				<td><input size="4" type="text" name="grptime" value="<?php  echo $grptime?$grptime:20 ?>"></td>
-			</tr>
+			<tr>
+				<td><a href="#" class="info"><?php echo _("Alert Info")?>:<span><?php echo _('You can optionally include an Alert Info which can create distinctive rings on SIP phones.')?></span></a></td>
+				<td><input size="18" type="text" name="dring" value="<?php  echo $dring ?>"></td>
+			</tr>
+
+			<tr>
+				<td><a href="#" class="info"><?php echo _("Confirm Calls")?><span><?php echo _('Enable this if you\'re calling external numbers that need confirmation - eg, a mobile phone may go to voicemail which will pick up the call. Enabling this requires the remote side push 1 on their phone before the call is put through. This feature only works with the ringall/ringall-prim  ring strategy')?></span></a>:</td>
+				<td> 
+					<input type="checkbox" name="needsconf" value="CHECKED" <?php echo $needsconf ?>  />
+				</td>
+			</tr>
+
 <?php if(function_exists('recordings_list')) { //only include if recordings is enabled?>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("Announcement:")?><span><?php echo _("Message to be played to the caller before dialing this group.<br><br>To add additional recordings please use the \"System Recordings\" MENU to the left")?></span></a></td>
-		<td>
-			&nbsp;&nbsp;<select name="annmsg"/>
-			<?php
-				$tresults = recordings_list();
-				$default = (isset($annmsg) ? $annmsg : '');
-				echo '<option value="">'._("None");
-				if (isset($tresults)) {
-					foreach ($tresults as $tresult) {
-						echo '<option value="'.$tresult[2].'"'.($tresult[2] == $default ? ' SELECTED' : '').'>'.$tresult[1];
-					}
-				}
-			?>		
-			</select>		
-		</td>
-	</tr>
-<?php }	else { ?>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("Announcement:")?><span><?php echo _("Message to be played to the caller before dialing this group.<br><br>You must install and enable the \"Systems Recordings\" Module to edit this option")?></span></a></td>
-		<td>
-			<?php
-				$default = (isset($annmsg) ? $annmsg : '');
-			?>
-			<input type="hidden" name="annmsg" value="<?php echo $default; ?>"><?php echo ($default != '' ? $default : 'None'); ?>
-		</td>
-	</tr>
-<?php } if (function_exists('music_list')) { ?>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("Play Music On Hold?")?><span><?php echo _("If you select a Music on Hold class to play, instead of 'Ring', they will hear that instead of Ringing while they are waiting for someone to pick up.")?></span></a></td>
-		<td>
-			&nbsp;&nbsp;<select name="ringing"/>
-			<?php
-				$tresults = music_list($amp_conf['ASTVARLIBDIR']."/mohmp3");
-				$cur = (isset($ringing) ? $ringing : 'Ring');
-				echo '<option value="Ring">'._("Ring")."</option>";
-				if (isset($tresults[0])) {
-					foreach ($tresults as $tresult) {
-						echo '<option value="'.$tresult.'"'.($tresult == $cur ? ' SELECTED' : '').'>'.$tresult."</option>\n";
-					}
-				}
-			?>
-			</select>
-			</td>
-		</tr>
+			<tr>
+				<td><a href="#" class="info"><?php echo _("Remote Announce:")?><span><?php echo _("Message to be played to the person RECEIVING the call, if 'Confirm Calls' is enabled.<br><br>To add additional recordings use the \"System Recordings\" MENU to the left")?></span></a></td>
+				<td>
+					<select name="remotealert"/>
+					<?php
+						$tresults = recordings_list();
+						$default = (isset($remotealert) ? $remotealert : '');
+						echo '<option value="">'._("Default")."</option>";
+						if (isset($tresults[0])) {
+							foreach ($tresults as $tresult) {
+								echo '<option value="'.$tresult[2].'"'.($tresult[2] == $default ? ' SELECTED' : '').'>'.$tresult[1]."</option>\n";
+							}
+						}
+					?>
+					</select>
+				</td>
+			</tr>
+			<tr>
+				<td><a href="#" class="info"><?php echo _("Too-Late Announce:")?><span><?php echo _("Message to be played to the person RECEIVING the call, if the call has already been accepted before they push 1.<br><br>To add additional recordings use the \"System Recordings\" MENU to the left")?></span></a></td>
+				<td>
+				<select name="toolate"/>
+					<?php
+						$tresults = recordings_list();
+						$default = (isset($toolate) ? $toolate : '');
+						echo '<option value="">'._("Default")."</option>";
+						if (isset($tresults[0])) {
+							foreach ($tresults as $tresult) {
+								echo '<option value="'.$tresult[2].'"'.($tresult[2] == $default ? ' SELECTED' : '').'>'.$tresult[1]."</option>\n";
+							}
+						}
+					?>
+					</select>
+				</td>
+			</tr>
 <?php } ?>
 			
 			<tr><td colspan="2"><br><h5><?php echo _("Destination if no answer")?>:<hr></h5></td></tr>
@@ -371,6 +402,20 @@
 ?>
 <script language="javascript">
 <!--
+
+function insertExten() {
+	exten = document.getElementById('insexten').value;
+
+	grpList=document.getElementById('grplist');
+	if (grpList.value[ grpList.value.length - 1 ] == "\n") {
+		grpList.value = grpList.value + exten;
+	} else {
+		grpList.value = grpList.value + '\n' + exten;
+	}
+
+	// reset element
+	document.getElementById('insexten').value = '';
+}
 
 function checkGRP(theForm) {
 	var msgInvalidGrpNum = "<?php echo _('Invalid Group Number specified'); ?>";
@@ -378,7 +423,7 @@
 	var msgInvalidGrpPrefix = "<?php echo _('Invalid prefix. Valid characters: a-z A-Z 0-9 : _ -'); ?>";
 	var msgInvalidTime = "<?php echo _('Invalid time specified'); ?>";
 	var msgInvalidGrpTimeRange = "<?php echo _('Time must be between 1 and 60 seconds'); ?>";
-	var msgInvalidRingStrategy = "<?php echo _('You must choose ringall, ringall-prim, ringallv2 or ringallv2-prim ring strategy when using Confirm Calls'); ?>";
+	var msgInvalidRingStrategy = "<?php echo _('Only ringall, ringallv2, hunt and the respective -prim versions are supported when confirmation is checked'); ?>";
 
 
 
@@ -399,7 +444,7 @@
 			return warnInvalid(theForm.grptime, msgInvalidGrpTimeRange);
 	}
 
-	if (theForm.needsconf.checked && theForm.strategy.value.substring(0,7) != "ringall") {
+	if (theForm.needsconf.checked && (theForm.strategy.value.substring(0,7) != "ringall" && theForm.strategy.value.substring(0,4) != "hunt")) {
 		return warnInvalid(theForm.needsconf, msgInvalidRingStrategy);
 	}
 

Modified: freepbx-modules/trunk/modules/gabcast/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/gabcast/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/gabcast/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/gabcast/functions.inc.php Sun May 18 19:52:05 2008
@@ -39,6 +39,30 @@
 	return isset($extens)?$extens:null;
 	} else {
 		return null;
+	}
+}
+
+function gabcast_getdest($exten) {
+	return array('gabcast,'.$exten.',1');
+}
+
+function gabcast_getdestinfo($dest) {
+	global $active_modules;
+
+	if (substr(trim($dest),0,8) == 'gabcast,') {
+		$exten = explode(',',$dest);
+		$exten = $exten[1];
+		$thisexten = gabcast_get($exten);
+		if (empty($thisexten)) {
+			return array();
+		} else {
+			$type = isset($active_modules['gabcast']['type'])?$active_modules['gabcast']['type']:'tool';
+			return array('description' => 'Gabcast : Ext'.$thisexten[0].' -> channel '.$thisexten[1],
+			             'edit_url' => 'config.php?display=gabcast&action=edit&type='.$type.'&ext='.urlencode($exten),
+								  );
+		}
+	} else {
+		return false;
 	}
 }
 

Modified: freepbx-modules/trunk/modules/gabcast/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/gabcast/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/gabcast/module.xml (original)
+++ freepbx-modules/trunk/modules/gabcast/module.xml Sun May 18 19:52:05 2008
@@ -1,19 +1,24 @@
 <module>
 	<rawname>gabcast</rawname>
 	<name>Gabcast</name>
-	<version>1.2.5.1</version>
+	<version>2.4.0.1</version>
 	<type>tool</type>
 	<category>Third Party Addon</category>
 	<menuitems>
 		<gabcast>Gabcast</gabcast>
 	</menuitems>
 	<changelog>
+		*2.4.0.1* added depends on 2.4.0
+		*2.4.0* add dest registry, fix rnav formating
 		*1.2.5.1* bump for rc1
 		*1.2.5* #2070 fix proper use of script tags
 	  *1.2.4* changed ${CALLERID(number)} to ${AMPUSER} to accomodate CID number masquerading
 		*1.2.3* Add he_IL translation
 		*1.2.2* Fix issue where you were unable to add a channel 
 	</changelog>
-	<location>release/2.3/gabcast-1.2.5.tgz</location>
-	<md5sum>76c23ec8d6cb80e3bcde20e1390a67fb</md5sum>
+	<depends>
+		<version>2.4.0</version>
+	</depends>
+	<location>release/2.4/gabcast-2.4.0.tgz</location>
+	<md5sum>bb0c2df9d37121cdd41c7d344ded1ffd</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/gabcast/page.gabcast.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/gabcast/page.gabcast.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/gabcast/page.gabcast.php (original)
+++ freepbx-modules/trunk/modules/gabcast/page.gabcast.php Sun May 18 19:52:05 2008
@@ -98,9 +98,18 @@
 		<form method="POST" action="{$_SERVER['PHP_SELF']}?type={$type}&display={$iam}">
 		<input type="hidden" name="action" value="delete">
 		<input type="hidden" name="ext" value="{$thisxtn[0]}">
-		<input type="submit" value="delete settings"></form><hr>
+		<input type="submit" value="delete settings"></form>
 End_Of_Delete;
 	}
+		$usage_list = framework_display_destination_usage(gabcast_getdest($xtn));
+		if (!empty($usage_list)) {
+		?>
+			<a href="#" class="info"><?php echo $usage_list['text']?>:<span><?php echo $usage_list['tooltip']?></span></a>
+		<?php
+		}
+?>
+	<hr>
+<?php
 	
 	if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'add') {
 		$thisxtn['ext'] = $_REQUEST['ext'];
@@ -140,7 +149,7 @@
 
 function gabcast_sidebar($sel, $type, $iam) {
         echo "</div><div class='rnav'>\n";
-        echo "<li><a id='".($sel==''?'current':'std')."' ";
+        echo "<ul><li><a id='".($sel==''?'current':'std')."' ";
         echo "href='config.php?type={$type}&amp;display={$iam}&amp;action=add'>"._("Add Gabcast Channel")."</a></li>";
         //get the list of paging groups
         $resarr = gabcast_list();
@@ -153,7 +162,7 @@
                         echo _("Ext")." ${cursel} -> "._("Chan")." ${resar[1]} </a></li>";
                 }
         }
-        echo "</div><div class='content'><h2>"._("Gabcast Configuration")."</h2>\n";
+        echo "</ul></div><div class='content'><h2>"._("Gabcast Configuration")."</h2>\n";
 }
 
 function gabcast_player($chanid = false) {

Modified: freepbx-modules/trunk/modules/infoservices/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/infoservices/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/infoservices/module.xml (original)
+++ freepbx-modules/trunk/modules/infoservices/module.xml Sun May 18 19:52:05 2008
@@ -1,14 +1,15 @@
 <module>
 	<rawname>infoservices</rawname>
 	<name>Info Services</name>
-	<version>1.3.5.3</version>
+	<version>2.4.0.1</version>
 	<candisable>no</candisable>
 	<canuninstall>no</canuninstall>
 	<type>setup</type>
 	<category>Internal Options &amp; Configuration</category>
 	<description>Provides a number of applications accessable by feature codes: company directory, call trace (last call information), echo test, speaking clock, and speak current extension number.</description>
 	<changelog>
-		*1.3.5.3* #2731 fix press 0 for operator in directory
+		*2.4.0.1* #2731 fix press 0 for operator in directory
+		*2.4.0* bumped for 2.4
 		*1.3.5.2* changed categories
 		*1.3.5.1* bump for rc1
 		*1.3.5* #2145 add waitexten while waiting for user input, and make uninstallable
@@ -17,6 +18,6 @@
 		*1.3.2* Fixed SpeakExtension - add macro-user-callerid
 		*1.3.1* Improved accuracy of speaking clock
 	</changelog>
-	<location>release/2.3/infoservices-1.3.5.1.tgz</location>
-	<md5sum>428df7844e8efbe6114920d39fbe5859</md5sum>
+	<location>release/2.4/infoservices-2.4.0.tgz</location>
+	<md5sum>c6f5616c43cdbca383983cd9242b5614</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/inventorydb/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/inventorydb/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/inventorydb/module.xml (original)
+++ freepbx-modules/trunk/modules/inventorydb/module.xml Sun May 18 19:52:05 2008
@@ -1,17 +1,18 @@
 <module>
 	<rawname>inventorydb</rawname>
 	<name>Inventory</name>
-	<version>1.1.0</version>
+	<version>2.4.0</version>
 	<type>tool</type>
 	<category>Third Party Addon</category>
 	<menuitems>
 		<inventorydb>Inventory</inventorydb>
 	</menuitems>
 	<changelog>
+		*2.4.0* bumped for 2.4
 		*1.1.0* Added SQLite3 support. Fixes ticket:1783, bump for rc1
 		*1.0.3* Add he_IL translation
 	</changelog>
-	<location>release/2.3/inventorydb-1.0.3.tgz</location>
-	<md5sum>c91eeb1f8c96e0734df8b34c35e453b2</md5sum>
+	<location>release/2.3/inventorydb-1.1.0.tgz</location>
+	<md5sum>ae5cd1817f27ea15b5d25f8eff048bf8</md5sum>
 </module>
 

Modified: freepbx-modules/trunk/modules/ivr/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/ivr/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/ivr/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/ivr/functions.inc.php Sun May 18 19:52:05 2008
@@ -1,5 +1,5 @@
 <?php
- /* $Id: functions.inc.php 5714 2008-02-19 04:38:58Z p_lindheimer $ */
+ /* $Id: functions.inc.php 5712 2008-02-19 04:34:11Z p_lindheimer $ */
 
 
 function ivr_init() {
@@ -113,6 +113,31 @@
 		return null;
 }
 
+function ivr_getdest($exten) {
+	return array('ivr-'.$exten.',s,1');
+}
+
+function ivr_getdestinfo($dest) {
+	global $active_modules;
+
+	if (substr(trim($dest),0,4) == 'ivr-') {
+		$exten = explode(',',$dest);
+		$exten = substr($exten[0],4);
+
+		$thisexten = ivr_get_details($exten);
+		if (empty($thisexten)) {
+			return array();
+		} else {
+			//$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup';
+			return array('description' => 'IVR : '.$thisexten['displayname'],
+			             'edit_url' => 'config.php?display=ivr&action=edit&id='.urlencode($exten),
+								  );
+		}
+	} else {
+		return false;
+	}
+}
+
 function ivr_get_config($engine) {
         global $ext;
         global $conferences_conf;
@@ -133,8 +158,7 @@
 						// enabled since subsequent activations should work without regenerating the
 						// ivr. (and no harm done if context does not exist.
 						//
-						$ext->addInclude($id,'ext-findmefollow');
-                                        	$ext->addInclude($id,'ext-local');
+						$ext->addInclude($id,'from-did-direct-ivr');
 					}
 					// I'm not sure I like the ability of people to send voicemail from the IVR.
 					// Make it a config option, possibly?
@@ -329,4 +353,32 @@
 		return null;
 	}
 }
+
+function ivr_check_destinations($dest=true) {
+	global $active_modules;
+
+	$destlist = array();
+	if (is_array($dest) && empty($dest)) {
+		return $destlist;
+	}
+	$sql = "SELECT dest, displayname, selection, a.ivr_id ivr_id FROM ivr a INNER JOIN ivr_dests d ON a.ivr_id = d.ivr_id  ";
+	if ($dest !== true) {
+		$sql .= "WHERE dest in ('".implode("','",$dest)."')";
+	}
+	$sql .= "ORDER BY displayname";
+	$results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
+
+	//$type = isset($active_modules['ivr']['type'])?$active_modules['ivr']['type']:'setup';
+
+	foreach ($results as $result) {
+		$thisdest = $result['dest'];
+		$thisid   = $result['ivr_id'];
+		$destlist[] = array(
+			'dest' => $thisdest,
+			'description' => 'IVR: '.$result['displayname'].' / Option: '.$result['selection'],
+			'edit_url' => 'config.php?display=ivr&action=edit&id='.urlencode($thisid),
+		);
+	}
+	return $destlist;
+}
 ?>

Added: freepbx-modules/trunk/modules/ivr/i18n/it_IT/LC_MESSAGES/ivr.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/ivr/i18n/it_IT/LC_MESSAGES/ivr.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/ivr/i18n/it_IT/LC_MESSAGES/ivr.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/ivr/i18n/it_IT/LC_MESSAGES/ivr.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/ivr/i18n/it_IT/LC_MESSAGES/ivr.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/ivr/i18n/it_IT/LC_MESSAGES/ivr.po (added)
+++ freepbx-modules/trunk/modules/ivr/i18n/it_IT/LC_MESSAGES/ivr.po Sun May 18 19:52:05 2008
@@ -1,0 +1,159 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-01-26 13:36+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: Italian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: functions.inc.php:20
+msgid ""
+"There is a problem with install.sql, cannot re-create databases. Contact "
+"support\n"
+msgstr "C'è un problema con install.sql, non posso ricreare il database. Contattare il supporto\n"
+
+#: page.ivr.php:68 page.ivr.php:106
+msgid "Digital Receptionist"
+msgstr "IVR"
+
+#: page.ivr.php:70
+msgid "Instructions"
+msgstr "Istruzioni"
+
+#: page.ivr.php:71
+msgid ""
+"You use the Digital Receptionist to make IVR's, Interactive Voice Responce "
+"systems."
+msgstr "Da qui puoi si può creare facilmente un sistema IVR (Interactive Voice Responce)."
+
+#: page.ivr.php:72
+msgid ""
+"When creating a menu option, apart from the standard options of 0-9,* and #, "
+"you can also use 'i' and 't' destinations."
+msgstr "Quando si aggiunge una voce di menu, a parte le opzioni standard tipo 0-9, * e #, si possono utilizzare anche destinazioni 'i' e 't'."
+
+#: page.ivr.php:73
+msgid ""
+"'i' is used when the caller pushes an invalid button, and 't' is used when "
+"there is no response."
+msgstr "'i' (invalid) viene utilizzato quando un chiamante digita un numero non valido, 't' (timeout) invece quando non c'è nessuna digitazione."
+
+#: page.ivr.php:74
+msgid ""
+"If those options aren't supplied, the default 't' is to replay the menu "
+"three times and then hang up,"
+msgstr "Se queste opzioni non sono inserite, 't' predefinito ripeterà tre volte il menu e poi riaggancerà la linea;"
+
+#: page.ivr.php:75
+msgid ""
+"and the default 'i' is to say 'Invalid option, please try again' and replay "
+"the menu."
+msgstr "'i' predefinito invece riprodurrà il messaggio 'Opzione non valida, prego riprovare' e riproporrà il menu."
+
+#: page.ivr.php:76
+msgid "After three invalid attempts, the line is hung up."
+msgstr "Dopo tre tentativi non validi, la linea verrà riagganciata."
+
+#: page.ivr.php:86
+msgid "Add IVR"
+msgstr "Aggiungi IVR"
+
+#: page.ivr.php:107
+msgid "Edit Menu"
+msgstr "Modifica Menu"
+
+#: page.ivr.php:154 page.ivr.php:174
+msgid "Announcement"
+msgstr "Annuncio"
+
+#: page.ivr.php:154
+msgid ""
+"Message to be played to the caller. To add additional recordings please use "
+"the \"System Recordings\" MENU to the left"
+msgstr "Il messaggio da riprodurre al chiamante. Per aggiungere ulteriori registrazioni, utilizzare \"Registrazioni di Sistema\" nel MENU di sinistra"
+
+#: page.ivr.php:159
+msgid "None"
+msgstr "Nessuno"
+
+#: page.ivr.php:174
+msgid ""
+"Message to be played to the caller.<br><br>You must install and enable the "
+"\"Systems Recordings\" Module to edit this option"
+msgstr "Il messaggio da riprodurre al chiamante. Per aggiungere ulteriori registrazioni, utilizzare \"Registrazioni di Sistema\" nel MENU di sinistra"
+
+msgid "Return to IVR"
+msgstr "Ritorna all'IVR"
+
+msgid "Check this box to have this option return to a parent IVR if it was called from a parent IVR. If not, it will go to the chosen destination.<br><br>The return path will be to any IVR that was in the call path prior to this IVR which could lead to strange results if there was an IVR called in the call path but not immediately before this"
+msgstr "Selezionare questa opzione se si vuole ritornare ad un IVR parente se è stato richiamato da esso. Se no, andrà nella destinazione scelta.<br><br>Il percorso di ritorno sarà un qualsiasi IVR che è precedente nel percorso ma puo' dare risultati strani se l'IVR non è proprio quello immediatamente prima di questo"
+
+msgid "Core"
+msgstr "Sistema"
+
+msgid "Voicemail"
+msgstr "Casella Vocale"
+
+msgid "Extensions"
+msgstr "Interni"
+
+msgid "Day Night Mode"
+msgstr "Controllo Giorno Notte"
+
+msgid "Terminate Call"
+msgstr "Termina Chiamata"
+
+msgid "Conferences"
+msgstr "Conferenze"
+
+msgid "Phonebook Directory"
+msgstr "Rubrica"
+
+msgid "Queues"
+msgstr "Code"
+
+msgid "Ring Groups"
+msgstr "Gruppi di chiamata"
+
+msgid "Speed dial functions"
+msgstr "Selezione breve"
+
+msgid "Time Conditions"
+msgstr "Condizioni Temporali"
+
+msgid "Custom Contexts"
+msgstr "Contesti Personalizzati"
+
+msgid "Extended Routing"
+msgstr "Rotte specifiche"
+
+msgid "Custom App<span><br>ADVANCED USERS ONLY<br><br>Uses Goto() to send caller to a custom context.<br><br>The context name should start with \"custom-\", and be in the format custom-context,extension,priority. Example entry:<br><br><b>custom-myapp,s,1</b><br><br>The <b>[custom-myapp]</b> context would need to be created and included in extensions_custom.conf</span>"
+msgstr "Applicazione Personalizzata<span>SOLO UTENTI AVANZATI<br>Utilizzare Goto() per inviare la chiamata verso un contesto personalizzato.<br><br>Il nome del contesto deve iniziare per \"custom-\" e deve essere nel formato custom-contesto,extension,priorità. Esempio: <br><br><b>custom-app,s,1</b><br><br><b>Il contesto [custom-app] </b> deve poi essere creato e incluso nel file extensions_custom.conf</span>"
+
+msgid "Submit Changes"
+msgstr "Invia"
+
+msgid "Increase Options"
+msgstr "+ Opzioni"
+
+msgid "Decrease Options"
+msgstr "- Opzioni"
+
+msgid "Save"
+msgstr "Salva"
+
+msgid "Change Name"
+msgstr "Cambia Nome"
+
+msgid "Delete"
+msgstr "Elimina"

Modified: freepbx-modules/trunk/modules/ivr/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/ivr/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/ivr/module.xml (original)
+++ freepbx-modules/trunk/modules/ivr/module.xml Sun May 18 19:52:05 2008
@@ -1,14 +1,16 @@
 <module>
 	<rawname>ivr</rawname>
 	<name>IVR</name>
-	<version>2.5.15.2</version>
+	<version>2.5.16.2</version>
 	<type>setup</type>
 	<category>Inbound Call Control</category>
 	<description>
 		Creates Digital Receptionist (aka Auto-Attendant, aka Interactive Voice Response) menus. These can be used to send callers to different locations (eg, "Press 1 for sales") and/or allow direct-dialing of extension numbers. 
 	</description>
 	<changelog>
-		*2.5.15.2* #2687 breakout from Queue to Company Directory blocks voicemail
+		*2.5.16.2* #2687 breakout from Queue to Company Directory blocks voicemail
+		*2.5.16.1* #2591, added depends on 2.4.0
+		*2.5.16* Extension/dest registry, #2303, it translation
 		*2.5.15.1* bump for rc1
 		*2.5.15* bump version to be higher than 2.2 branch
 		*2.5.14.2* merge findmefollow/core extension destinations if any
@@ -30,9 +32,12 @@
 		*2.5.1* Changed name to IVR (from Digital Receptionist)
 		*2.5* First release for FreePBX 2.2 - Fixed compatibility issue with new UI
 	</changelog>
+	<depends>
+		<version>2.4.0</version>
+	</depends>
 	<menuitems>
 		<ivr>IVR</ivr>
 	</menuitems>
-	<location>release/2.3/ivr-2.5.15.1.tgz</location>
-	<md5sum>c630e18e0145980f5bbd7f78247670a4</md5sum>
+	<location>release/2.4/ivr-2.5.16.1.tgz</location>
+	<md5sum>e546e0d13bda109f326b10f94c0587fa</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/ivr/page.ivr.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/ivr/page.ivr.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/ivr/page.ivr.php (original)
+++ freepbx-modules/trunk/modules/ivr/page.ivr.php Sun May 18 19:52:05 2008
@@ -1,5 +1,5 @@
 <?php 
-/* $Id: page.ivr.php 3790 2007-02-16 18:52:53Z p_lindheimer $ */
+/* $Id: page.ivr.php 5700 2008-02-10 23:38:04Z p_lindheimer $ */
 //Copyright (C) 2004 Coalescent Systems Inc. (info at coalescentsystems.ca)
 //
 //This program is free software; you can redistribute it and/or
@@ -103,99 +103,110 @@
 	$ivr_dests = ivr_get_dests($id);
 ?>
 	<div class="content">
-        <h2><?php echo _("Digital Receptionist"); ?></h2>
-        <h3><?php echo _("Edit Menu")." ".$ivr_details['displayname']; ?></h3>
+	<h2><?php echo _("Digital Receptionist"); ?></h2>
+	<h3><?php echo _("Edit Menu")." ".$ivr_details['displayname']; ?></h3>
 <?php 
 ?>
-        <form name="prompt" action="<?php $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return prompt_onsubmit();">
-        <input type="hidden" name="action" value="edited" />
-        <input type="hidden" name="display" value="ivr" />
-        <input type="hidden" name="id" value="<?php echo $id ?>" />
+	<form name="prompt" action="<?php $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return prompt_onsubmit();">
+	<input type="hidden" name="action" value="edited" />
+	<input type="hidden" name="display" value="ivr" />
+	<input type="hidden" name="id" value="<?php echo $id ?>" />
 	<input name="Submit" type="submit" style="display:none;" value="save" />
 	<input name="delete" type="submit" value="<?php echo _("Delete")." "._("Digital Receptionist")." {$ivr_details['displayname']}"; ?>" />
-        <table>
-        <tr><td colspan=2><hr /></td></tr>
-        <tr>
-                <td><a href="#" class="info">Change Name<span>This changes the short name, visible on the right, of this IVR</span></a></td>
-                <td><input type="text" name="displayname" value="<?php echo $ivr_details['displayname'] ?>"></td>
-        </tr>
-        <tr>
-                <td><a href="#" class="info">Timeout<span>The amount of time (in seconds) before the 't' option, if specified, is used</span></a></td>
-                <td><input type="text" name="timeout" value="<?php echo $ivr_details['timeout'] ?>"></td>
-        </tr>
-        <?php if ( function_exists('voicemail_getVoicemail') ) { ?>
-        <tr>
-                <td><a href="#" class="info">Enable Directory<span>Let callers into the IVR dial '#' to access the directory</span></a></td>
-                <td><input type="checkbox" name="ena_directory" <?php echo $ivr_details['enable_directory'] ?>></td>
-        </tr>
-        <tr>
-                <td><a href="#" class="info">Directory Context<span>When # is selected, this is the voicemail directory context that is used</span></a></td>
-                <td>&nbsp;
-			 <select name="dircontext"/>
-                        <?php
-				$tresults = voicemail_getVoicemail();
-				$vmcontexts = array_keys($tresults);
-				foreach ($vmcontexts as $vmc) {
-					if ($vmc != 'general' ) 
-						echo '<option value="'.$vmc.'"'.($vmc == $ivr_details['dircontext'] ? ' SELECTED' : '').'>'.$vmc."</option>\n";
-				}
-                        ?>
-			</select>
-		</td>
-        </tr>
-        <?php } ?>
-        <tr>
-                <td><a href="#" class="info">Enable Direct Dial<span>Let callers into the IVR dial an extension directly</span></a></td>
-                <td><input type="checkbox" name="ena_directdial" <?php echo $ivr_details['enable_directdial'] ?>></td>
-        </tr>
-<?php
-    $annmsg = isset($ivr_details['announcement'])?$ivr_details['announcement']:'';
-	if(function_exists('recordings_list')) { //only include if recordings is enabled ?>
-        <tr>
-                <td><a href="#" class="info"><?php echo _("Announcement")?><span><?php echo _("Message to be played to the caller. To add additional recordings please use the \"System Recordings\" MENU to the left")?></span></a></td>
-                <td>&nbsp;
-                        <select name="annmsg"/>
-                        <?php
-                                $tresults = recordings_list();
-                                echo '<option value="">'._("None")."</option>";
-                                if (isset($tresults[0])) {
-                                        foreach ($tresults as $tresult) {
-                                                echo '<option value="'.$tresult[2].'"'.($tresult[2] == $annmsg ? ' SELECTED' : '').'>'.$tresult[1]."</option>\n";
-                                        }
-                                }
-                        ?>
-                        </select>
-                </td>
-        </tr>
+	<?php
+	if ($id) {
+		$usage_list = framework_display_destination_usage(ivr_getdest($id));
+		if (!empty($usage_list)) {
+		?>
+			<br /><a href="#" class="info"><?php echo $usage_list['text']?>:<span><?php echo $usage_list['tooltip']?></span></a>
+		<?php
+		}
+	}
+	?>
+	<table>
+		<tr><td colspan=2><hr /></td></tr>
+		<tr>
+			<td><a href="#" class="info"><?php echo _("Change Name"); ?><span><?php echo _("This changes the short name, visible on the right, of this IVR");?></span></a></td>
+			<td><input type="text" name="displayname" value="<?php echo $ivr_details['displayname'] ?>"></td>
+		</tr>
+		<tr>
+			<td><a href="#" class="info"><?php echo _("Timeout");?><span><?php echo _("The amount of time (in seconds) before the 't' option, if specified, is used");?></span></a></td>
+			<td><input type="text" name="timeout" value="<?php echo $ivr_details['timeout'] ?>"></td>
+		</tr>
+		<?php if ( function_exists('voicemail_getVoicemail') ) { ?>
+		<tr>
+			<td><a href="#" class="info"><?php echo _("Enable Directory");?><span><?php echo _("Let callers into the IVR dial '#' to access the directory");?></span></a></td>
+			<td><input type="checkbox" name="ena_directory" <?php echo $ivr_details['enable_directory'] ?>></td>
+		</tr>
+		<tr>
+			<td><a href="#" class="info"><?php echo _("Directory Context");?><span><?php echo _("When # is selected, this is the voicemail directory context that is used");?></span></a></td>
+			<td>
+				<select name="dircontext"/>
+					<?php
+					$tresults = voicemail_getVoicemail();
+					$vmcontexts = array_keys($tresults);
+					foreach ($vmcontexts as $vmc) {
+						if ($vmc != 'general' ) 
+							echo '<option value="'.$vmc.'"'.($vmc == $ivr_details['dircontext'] ? ' SELECTED' : '').'>'.$vmc."</option>\n";
+						}
+					?>
+				</select>
+			</td>
+		</tr>
+		<?php } ?>
+		<tr>
+			<td><a href="#" class="info"><?php echo _("Enable Direct Dial");?><span><?php echo _("Let callers into the IVR dial an extension directly");?></span></a></td>
+			<td><input type="checkbox" name="ena_directdial" <?php echo $ivr_details['enable_directdial'] ?>></td>
+		</tr>
+<?php
+			$annmsg = isset($ivr_details['announcement'])?$ivr_details['announcement']:'';
+			if(function_exists('recordings_list')) { //only include if recordings is enabled ?>
+		<tr>
+			<td><a href="#" class="info"><?php echo _("Announcement")?><span><?php echo _("Message to be played to the caller. To add additional recordings please use the \"System Recordings\" MENU to the left")?></span></a></td>
+			<td>
+				<select name="annmsg"/>
+				<?php
+					$tresults = recordings_list();
+					echo '<option value="">'._("None")."</option>";
+					if (isset($tresults[0])) {
+						foreach ($tresults as $tresult) {
+							echo '<option value="'.$tresult[2].'"'.($tresult[2] == $annmsg ? ' SELECTED' : '').'>'.$tresult[1]."</option>\n";
+						}
+					}
+				?>
+				</select>
+			</td>
+		</tr>
 	
 <?php
 	} else {
 ?>
-	<tr>
-                <td><a href="#" class="info"><?php echo _("Announcement")?><span><?php echo _("Message to be played to the caller.<br><br>You must install and enable the \"Systems Recordings\" Module to edit this option")?></span></a></td>
-                <td>&nbsp;
+		<tr>
+			<td><a href="#" class="info"><?php echo _("Announcement")?><span><?php echo _("Message to be played to the caller.<br><br>You must install and enable the \"Systems Recordings\" Module to edit this option")?></span></a></td>
+			<td>
 			<?php
 				$default = (isset($annmsg) ? $annmsg : '');
 			?>
-			<input type="hidden" name="annmsg" value="<?php echo $default; ?>"><?php echo ($default != '' ? $default : 'None'); ?>
+				<input type="hidden" name="annmsg" value="<?php echo $default; ?>"><?php echo ($default != '' ? $default : 'None'); ?>
+			</td>
+		</tr>
+<?php
+	}
+?>
+
+
+		<tr><td colspan=2><hr /></td></tr>
+		<tr><td colspan=2>	
+			<input name="increase" type="submit" value="<?php echo _("Increase Options")?>">
+			&nbsp;
+			<input name="Submit" type="submit" value="<?php echo _("Save")?>">
+			&nbsp;
+			<?php if ($nbroptions > 1) { ?>
+			<input name="decrease" type="submit" value="<?php echo _("Decrease Options")?>">
+			<?php } ?>
 		</td>
 	</tr>
-<?php
-	}
-?>
-
-
-        <tr><td colspan=2><hr /></td></tr>
-	<tr><td colspan=2>	
-	<input name="increase" type="submit" value="<?php echo _("Increase Options")?>">
-	&nbsp;
-	<input name="Submit" type="submit" value="<?php echo _("Save")?>">
-	&nbsp;
-	<?php if ($nbroptions > 1) { ?>
-	<input name="decrease" type="submit" value="<?php echo _("Decrease Options")?>">
-	<?php } ?>
-	</td></tr>
-        <tr><td colspan=2><hr /></td></tr>
+	<tr><td colspan=2><hr /></td></tr>
 <?php
 	// Draw the destinations
 	$dests = ivr_get_dests($id);
@@ -212,7 +223,7 @@
 	}
 ?>
 	
-        </table>
+</table>
 <?php
 	if ($nbroptions < $count) { 
 		echo "<input type='hidden' name='nbroptions' value=$count />\n";
@@ -278,7 +289,8 @@
 function drawdestinations($count, $sel,  $dest, $ivr_ret) { ?>
 	<tr> <td style="text-align:right;">
 
-		<small><a href="#" class="info"><?php echo _("Return to IVR")?><span><?php echo _("Check this box to have this option return to a parent IVR if it was called from a parent IVR. If not, it will go to the chosen destination.<br><br>The return path will be to any IVR that was in the call path prior to this IVR which could lead to strange results if there was an IVR called in the call path but not immediately before this")?></span></a></small><input type="checkbox" name="ivr_ret<?php echo $count ?>" "<?php echo $ivr_ret?'CHECKED':''; ?>"<br><br />
+	<small><a href="#" class="info"><?php echo _("Return to IVR")?><span><?php echo _("Check this box to have this option return to a parent IVR if it was called from a parent IVR. If not, it will go to the chosen destination.<br><br>The return path will be to any IVR that was in the call path prior to this IVR which could lead to strange results if there was an IVR called in the call path but not immediately before this")?></span></a></small>
+	<input type="checkbox" name="ivr_ret<?php echo $count ?>" value="ivr_ret" <?php echo $ivr_ret?'CHECKED':''; ?>><br><br />
 		<input size="2" type="text" name="option<?php echo $count ?>" value="<?php echo $sel ?>"><br />
 <?php if (strlen($sel)) {  ?>
 		<i style='font-size: x-small'>Leave blank to remove</i>

Added: freepbx-modules/trunk/modules/languages/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/languages/functions.inc.php?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/languages/functions.inc.php (added)
+++ freepbx-modules/trunk/modules/languages/functions.inc.php Sun May 18 19:52:05 2008
@@ -1,0 +1,231 @@
+<?php
+
+function languages_destinations() {
+	// return an associative array with destination and description
+	foreach (languages_list() as $row) {
+		$extens[] = array('destination' => 'app-languages,' . $row['language_id'] . ',1', 'description' => $row['description']);
+	}
+	return $extens;
+}
+
+function languages_getdest($exten) {
+	return array('app-languages,'.$exten.',1');
+}
+
+function languages_getdestinfo($dest) {
+	global $active_modules;
+
+	if (substr(trim($dest),0,14) == 'app-languages,') {
+		$exten = explode(',',$dest);
+		$exten = $exten[1];
+		$thisexten = languages_get($exten);
+		if (empty($thisexten)) {
+			return array();
+		} else {
+			$type = isset($active_modules['languages']['type'])?$active_modules['languages']['type']:'setup';
+			return array('description' => 'Language : '.$thisexten['description'],
+			             'edit_url' => 'config.php?display=languages&type='.$type.'&extdisplay='.urlencode($exten),
+								  );
+		}
+	} else {
+		return false;
+	}
+}
+
+function languages_get_config($engine) {
+	global $ext;
+	switch ($engine) {
+		case 'asterisk':
+			$ext->addInclude('from-internal-additional', 'app-languages');
+			foreach (languages_list() as $row) {
+					$ext->add('app-languages',$row['language_id'], '', new ext_noop('Changing Channel to language: '.$row['lang_code'].' ('.$row['description'].')'));
+					$ext->add('app-languages',$row['language_id'], '', new ext_setlanguage($row['lang_code']));
+					$ext->add('app-languages',$row['language_id'], '', new ext_goto($row['dest']));
+			}
+		break;
+	}
+}
+
+/**  Get a list of all languages
+ */
+function languages_list() {
+	global $db;
+	$sql = "SELECT language_id, description, lang_code, dest FROM languages ORDER BY description ";
+	$results = $db->getAll($sql, DB_FETCHMODE_ASSOC);
+	if(DB::IsError($results)) {
+		die_freepbx($results->getMessage()."<br><br>Error selecting from languages");	
+	}
+	return $results;
+}
+
+function languages_get($language_id) {
+	global $db;
+	$sql = "SELECT language_id, description, lang_code, dest FROM languages WHERE language_id = ".addslashes($language_id);
+	$row = $db->getRow($sql, DB_FETCHMODE_ASSOC);
+	if(DB::IsError($row)) {
+		die_freepbx($row->getMessage()."<br><br>Error selecting row from languages");	
+	}
+	
+	return $row;
+}
+
+function languages_add($description, $lang_code, $dest) {
+	global $db;
+	$sql = "INSERT INTO languages (description, lang_code, dest) VALUES (".
+		"'".addslashes($description)."', ".
+		"'".addslashes($lang_code)."', ".
+		"'".addslashes($dest)."')";
+	$result = $db->query($sql);
+	if(DB::IsError($result)) {
+		die_freepbx($result->getMessage().$sql);
+	}
+}
+
+function languages_delete($language_id) {
+	global $db;
+	$sql = "DELETE FROM languages WHERE language_id = ".addslashes($language_id);
+	$result = $db->query($sql);
+	if(DB::IsError($result)) {
+		die_freepbx($result->getMessage().$sql);
+	}
+}
+
+function languages_edit($language_id, $description, $lang_code, $dest) { 
+	global $db;
+	$sql = "UPDATE languages SET ".
+		"description = '".addslashes($description)."', ".
+		"lang_code = '".addslashes($lang_code)."', ".
+		"dest = '".addslashes($dest)."' ".
+		"WHERE language_id = ".addslashes($language_id);
+	$result = $db->query($sql);
+	if(DB::IsError($result)) {
+		die_freepbx($result->getMessage().$sql);
+	}
+}
+
+function languages_configpageinit($pagename) {
+	global $currentcomponent;
+
+	$action = isset($_REQUEST['action'])?$_REQUEST['action']:null;
+	$extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null;
+	$extension = isset($_REQUEST['extension'])?$_REQUEST['extension']:null;
+	$tech_hardware = isset($_REQUEST['tech_hardware'])?$_REQUEST['tech_hardware']:null;
+
+	// We only want to hook 'users' or 'extensions' pages.
+	if ($pagename != 'users' && $pagename != 'extensions') 
+		return true;
+	// On a 'new' user, 'tech_hardware' is set, and there's no extension. Hook into the page.
+	if ($tech_hardware != null || $pagename == 'users') {
+		language_applyhooks();
+		$currentcomponent->addprocessfunc('languages_configprocess', 8);
+	} elseif ($action=="add") {
+		// We don't need to display anything on an 'add', but we do need to handle returned data.
+		$currentcomponent->addprocessfunc('languages_configprocess', 8);
+	} elseif ($extdisplay != '') {
+		// We're now viewing an extension, so we need to display _and_ process.
+		language_applyhooks();
+		$currentcomponent->addprocessfunc('languages_configprocess', 8);
+	}
+}
+
+function language_applyhooks() {
+	global $currentcomponent;
+
+	// Add the 'process' function - this gets called when the page is loaded, to hook into 
+	// displaying stuff on the page.
+	$currentcomponent->addguifunc('languages_configpageload');
+}
+
+// This is called before the page is actually displayed, so we can use addguielem().
+function languages_configpageload() {
+	global $currentcomponent;
+
+	// Init vars from $_REQUEST[]
+	$action = isset($_REQUEST['action'])?$_REQUEST['action']:null;
+	$extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null;
+	
+	// Don't display this stuff it it's on a 'This xtn has been deleted' page.
+	if ($action != 'del') {
+		$langcode = languages_user_get($extdisplay);
+
+		$section = _('Language');
+		$msgInvalidLanguage = _('Please enter a valid Language Code');
+		$currentcomponent->addguielem($section, new gui_textbox('langcode', $langcode, _('Language Code'), _('The language code for this user. This will result in messages such as voiclangcode prompts to use the selected language if installed.'), "!isAlphanumeric()", $msgInvalidLanguage, true));
+	}
+}
+
+function languages_configprocess() {
+	//create vars from the request
+	$action = isset($_REQUEST['action'])?$_REQUEST['action']:null;
+	$ext = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null;
+	$extn = isset($_REQUEST['extension'])?$_REQUEST['extension']:null;
+	$langcode = isset($_REQUEST['langcode'])?$_REQUEST['langcode']:null;
+
+	if ($ext==='') { 
+		$extdisplay = $extn; 
+	} else {
+		$extdisplay = $ext;
+	} 
+	if ($action == "add" || $action == "edit") {
+		if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) {
+			languages_user_update($extdisplay, $langcode);
+		}
+	} elseif ($action == "del") {
+		languages_user_del($extdisplay);
+	}
+}
+
+function languages_user_get($xtn) {
+	global $astman;
+
+	// Retrieve the language configuraiton from this user from ASTDB
+	$langcode = $astman->database_get("AMPUSER",$xtn."/language");
+
+	return $langcode;
+}
+
+function languages_user_update($ext, $langcode) {
+	global $astman;
+	
+	if ($ena === 'disabled') {
+		languages_user_del($ext);
+	} else {
+		// Update the settings in ASTDB
+		$astman->database_put("AMPUSER",$ext."/language",$langcode);
+	}
+}
+
+function languages_user_del($ext) {
+	global $astman;
+
+	// Clean up the tree when the user is deleted
+	$astman->database_deltree("AMPUSER/$ext/language");
+}
+
+function languages_check_destinations($dest=true) {
+	global $active_modules;
+
+	$destlist = array();
+	if (is_array($dest) && empty($dest)) {
+		return $destlist;
+	}
+	$sql = "SELECT language_id, dest, description FROM languages ";
+	if ($dest !== true) {
+		$sql .= "WHERE dest in ('".implode("','",$dest)."')";
+	}
+	$results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
+
+	$type = isset($active_modules['languages']['type'])?$active_modules['languages']['type']:'setup';
+
+	foreach ($results as $result) {
+		$thisdest = $result['dest'];
+		$thisid   = $result['language_id'];
+		$destlist[] = array(
+			'dest' => $thisdest,
+			'description' => 'Language Change: '.$result['description'],
+			'edit_url' => 'config.php?display=languages&type='.$type.'&extdisplay='.urlencode($thisid),
+		);
+	}
+	return $destlist;
+}
+?>

Added: freepbx-modules/trunk/modules/languages/install.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/languages/install.php?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/languages/install.php (added)
+++ freepbx-modules/trunk/modules/languages/install.php Sun May 18 19:52:05 2008
@@ -1,0 +1,18 @@
+<?php
+
+global $db;
+
+$autoincrement = (($amp_conf["AMPDBENGINE"] == "sqlite") || ($amp_conf["AMPDBENGINE"] == "sqlite3")) ? "AUTOINCREMENT":"AUTO_INCREMENT";
+$sql = "CREATE TABLE IF NOT EXISTS languages (
+	language_id INTEGER NOT NULL PRIMARY KEY $autoincrement,
+	lang_code VARCHAR( 50 ) ,
+	description VARCHAR( 50 ) ,
+	dest VARCHAR( 255 )
+)";
+
+$check = $db->query($sql);
+if(DB::IsError($check)) {
+	die_freepbx("Can not create languages table\n");
+}
+
+?>

Added: freepbx-modules/trunk/modules/languages/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/languages/module.xml?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/languages/module.xml (added)
+++ freepbx-modules/trunk/modules/languages/module.xml Sun May 18 19:52:05 2008
@@ -1,0 +1,23 @@
+<module>
+	<rawname>languages</rawname>
+	<name>Languages</name>
+	<version>2.4.0.2</version>
+	<type>setup</type>
+	<category>Internal Options &amp; Configuration</category>
+	<description>
+		Adds the ability to changes the language within a call flow and add language attribute to users.
+	</description>
+	<menuitems>
+		<languages>Languages</languages>
+	</menuitems>
+	<changelog>
+		*2.4.0.2* added depends on 2.4.0
+		*2.4.0.1* #2578 use setlanguage to handle changes in Asterisk 1.6
+		*2.4.0* First release of module
+	</changelog>
+	<depends>
+		<version>2.4.0</version>
+	</depends>
+	<location>release/2.4/languages-2.4.0.1.tgz</location>
+	<md5sum>ad0600750834f04688e850ca545149ab</md5sum>
+</module>

Added: freepbx-modules/trunk/modules/languages/page.languages.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/languages/page.languages.php?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/languages/page.languages.php (added)
+++ freepbx-modules/trunk/modules/languages/page.languages.php Sun May 18 19:52:05 2008
@@ -1,0 +1,143 @@
+<?php 
+/** Language Module for FreePBX 2.4
+ * Copyright 2006 Philippe Lindheimer - Astrogen LLC
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * 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 General Public License for more details.
+ */
+
+$type = isset($_REQUEST['type']) ? $_REQUEST['type'] : 'setup';
+$action = isset($_REQUEST['action']) ? $_REQUEST['action'] :  '';
+if (isset($_REQUEST['delete'])) $action = 'delete'; 
+
+$language_id = isset($_REQUEST['language_id']) ? $_REQUEST['language_id'] :  false;
+$description = isset($_REQUEST['description']) ? $_REQUEST['description'] :  '';
+$lang_code = isset($_REQUEST['lang_code']) ? $_REQUEST['lang_code'] :  '';
+$dest = isset($_REQUEST['dest']) ? $_REQUEST['dest'] :  '';
+
+if (isset($_REQUEST['goto0']) && $_REQUEST['goto0']) {
+	$dest = $_REQUEST[ $_REQUEST['goto0'].'0' ];
+}
+
+switch ($action) {
+	case 'add':
+		languages_add($description, $lang_code, $dest);
+		needreload();
+		redirect_standard();
+	break;
+	case 'edit':
+		languages_edit($language_id, $description, $lang_code, $dest);
+		needreload();
+		redirect_standard('extdisplay');
+	break;
+	case 'delete':
+		languages_delete($language_id);
+		needreload();
+		redirect_standard();
+	break;
+}
+
+?> 
+</div>
+
+<div class="rnav"><ul>
+<?php 
+
+echo '<li><a href="config.php?display=languages&amp;type='.$type.'">'._('Add Language').'</a></li>';
+
+foreach (languages_list() as $row) {
+	echo '<li><a href="config.php?display=languages&amp;type='.$type.'&amp;extdisplay='.$row['language_id'].'" class="">'.$row['description'].'</a></li>';
+}
+
+?>
+</ul></div>
+
+<div class="content">
+
+<?php
+
+if ($extdisplay) {
+	// load
+	$row = languages_get($extdisplay);
+	
+	$description = $row['description'];
+	$lang_code   = $row['lang_code'];
+	$dest        = $row['dest'];
+
+	echo "<h2>"._("Edit: ")."$description ($lang_code)"."</h2>";
+} else {
+	echo "<h2>"._("Add Language")."</h2>";
+}
+
+$helptext = _("Languages allow you to change the language of the call flow and then continue on to the desired destination. For example, you may have an IVR option that says \"For French Press 5 now\". You would then create a French language instance and point it's destination at a French IVR. The language of the call's channel will now be in French. This will result in French sounds being chosen if installed.");
+echo $helptext;
+?>
+
+<form name="editLanguage" action="<?php  $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return checkLanguage(editLanguage);">
+	<input type="hidden" name="extdisplay" value="<?php echo $extdisplay; ?>">
+	<input type="hidden" name="language_id" value="<?php echo $extdisplay; ?>">
+	<input type="hidden" name="action" value="<?php echo ($extdisplay ? 'edit' : 'add'); ?>">
+	<table>
+	<tr><td colspan="2"><h5><?php  echo ($extdisplay ? _("Edit Language Instance") : _("Add Language Instance")) ?><hr></h5></td></tr>
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Description")?>:<span><?php echo _("The descriptive name of this language instance. For example \"French Main IVR\"")?></span></a></td>
+		<td><input size="30" type="text" name="description" value="<?php  echo $description; ?>"></td>
+	</tr>
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Language Code")?>:<span><?php echo _("The Asterisk language code you want to change to. For example \"fr\" for French, \"de\" for German")?></span></a></td>
+		<td><input size="14" type="text" name="lang_code" value="<?php echo $lang_code; ?>" /></td> </tr>
+	<tr><td colspan="2"><br><h5><?php echo _("Destination")?>:<hr></h5></td></tr>
+
+<?php 
+//draw goto selects
+echo drawselects($dest,0);
+?>
+			
+	<tr>
+		<td colspan="2"><br><input name="Submit" type="submit" value="<?php echo _("Submit Changes")?>">
+			<?php if ($extdisplay) { echo '&nbsp;<input name="delete" type="submit" value="'._("Delete").'">'; } ?>
+		</td>		
+
+		<?php
+		if ($extdisplay) {
+			$usage_list = framework_display_destination_usage(languages_getdest($extdisplay));
+			if (!empty($usage_list)) {
+			?>
+				<tr><td colspan="2">
+				<a href="#" class="info"><?php echo $usage_list['text']?>:<span><?php echo $usage_list['tooltip']?></span></a>
+				</td></tr>
+			<?php
+			}
+		}
+		?>
+	</tr>
+</table>
+</form>
+
+<script language="javascript">
+<!--
+
+function checkLanguage(theForm) {
+	var msgInvalidDescription = "<?php echo _('Invalid description specified'); ?>";
+
+	// set up the Destination stuff
+	setDestinations(theForm, '_post_dest');
+
+	// form validation
+	defaultEmptyOK = false;	
+	if (isEmpty(theForm.description.value))
+		return warnInvalid(theForm.description, msgInvalidDescription);
+
+	if (!validateDestinations(theForm, 1, true))
+		return false;
+
+	return true;
+}
+//-->
+</script>

Added: freepbx-modules/trunk/modules/languages/uninstall.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/languages/uninstall.php?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/languages/uninstall.php (added)
+++ freepbx-modules/trunk/modules/languages/uninstall.php Sun May 18 19:52:05 2008
@@ -1,0 +1,9 @@
+<?php
+
+global $db;
+
+echo "dropping table languages..";
+sql("DROP TABLE IF EXISTS `languages`");
+echo "done<br>\n";
+
+?>

Modified: freepbx-modules/trunk/modules/logfiles/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/logfiles/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/logfiles/module.xml (original)
+++ freepbx-modules/trunk/modules/logfiles/module.xml Sun May 18 19:52:05 2008
@@ -1,8 +1,9 @@
 <module>
 	<rawname>logfiles</rawname>
 	<name>Asterisk Logfiles</name>
-	<version>1.1.1</version>
+	<version>2.4.0</version>
 	<changelog>
+		*2.4.0* bumped for 2.4
 		*1.1.1* bump for rc1
 		*1.1.0* #1442 remove access problem and have log display in same window
 		*1.0.2* #2070 fix proper use of script tags
@@ -12,6 +13,6 @@
 	<menuitems>
 		<logfiles>Asterisk Logfiles</logfiles>
 	</menuitems>
-	<location>release/2.3/logfiles-1.1.0.tgz</location>
-	<md5sum>bbfef694584fff2037fad03370fd684f</md5sum>
+	<location>release/2.3/logfiles-1.1.1.tgz</location>
+	<md5sum>095088bda1045e40c18c249163b7e6ca</md5sum>
 </module>

Added: freepbx-modules/trunk/modules/manager/i18n/it_IT/LC_MESSAGES/manager.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/manager/i18n/it_IT/LC_MESSAGES/manager.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/manager/i18n/it_IT/LC_MESSAGES/manager.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/manager/i18n/it_IT/LC_MESSAGES/manager.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/manager/i18n/it_IT/LC_MESSAGES/manager.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/manager/i18n/it_IT/LC_MESSAGES/manager.po (added)
+++ freepbx-modules/trunk/modules/manager/i18n/it_IT/LC_MESSAGES/manager.po Sun May 18 19:52:05 2008
@@ -1,0 +1,118 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-01-26 14:03+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: Italian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: functions.inc.php:29
+msgid "Error writing the manager additional file."
+msgstr "Errore durante la scrittura del file addizionale di manager."
+
+#: functions.inc.php:123
+msgid "This manager already exists"
+msgstr "Questo manager già esiste"
+
+#: functions.inc.php:150
+msgid "Choose Manager:"
+msgstr "Scegliere il Manager:"
+
+#: functions.inc.php:150
+msgid "Choose the user that PHPAGI will use to connect the Asterisk API."
+msgstr "Scegliere l'utente con cui PHPAGI userà per connettersi con le API di Asterisk."
+
+#: page.manager.php:53 page.manager.php:84 page.manager.php:91
+msgid "Add Manager"
+msgstr "Aggiungi Manager"
+
+#: page.manager.php:67
+msgid "Manager"
+msgstr ""
+
+#: page.manager.php:67
+msgid "deleted"
+msgstr "eliminato"
+
+#: page.manager.php:81
+msgid "Manager:"
+msgstr ""
+
+#: page.manager.php:82
+msgid "Delete Manager"
+msgstr "Elimina Manager"
+
+#: page.manager.php:91
+msgid "Edit Manager"
+msgstr "Modifica Manager"
+
+#: page.manager.php:93
+msgid "Manager name:"
+msgstr "Nome Manager:"
+
+#: page.manager.php:93
+msgid "Name of the manager without space."
+msgstr "Il nome del manager senza spazi."
+
+#: page.manager.php:97
+msgid "Manager secret:"
+msgstr "Password Manager:"
+
+#: page.manager.php:97
+msgid "Password for the manager."
+msgstr "La password per il manager (secret)."
+
+#: page.manager.php:101
+msgid "Deny:"
+msgstr "Nega (deny):"
+
+#: page.manager.php:101
+msgid ""
+"If you want to deny many hosts or networks, use & char as separator.<br/><br/"
+">Example: 192.168.1.0/255.255.255.0&10.0.0.0/255.0.0.0"
+msgstr "Se si vuole negare l'accesso a più host o reti, utilizzare il carattere & come separatore.<br/><br/>Esempio: 192.168.1.0/255.255.255.0&10.0.0.0/255.0.0.0"
+
+#: page.manager.php:105
+msgid "Permit:"
+msgstr "Permetti (permit):"
+
+#: page.manager.php:105
+msgid ""
+"If you want to permit many hosts or networks, use & char as separator. Look "
+"at deny example."
+msgstr "Se si vuole permettere l'accesso a più host o reti, utilizzare il carattere & come separatore. Guarda come esempio Deny."
+
+#: page.manager.php:109
+msgid "Rights"
+msgstr "Permessi (rights)"
+
+#: page.manager.php:114
+msgid "Read"
+msgstr "Lettura (read)"
+
+#: page.manager.php:114
+msgid "Write"
+msgstr "Scrittura (write)"
+
+#: page.manager.php:116 page.manager.php:121 page.manager.php:126
+#: page.manager.php:131 page.manager.php:136 page.manager.php:141
+#: page.manager.php:146
+msgid "Check Asterisk documentation."
+msgstr "Controllare la documentazione di Asterisk"
+
+#: page.manager.php:151
+msgid "Check All/None."
+msgstr "Attiva tutto/niente"
+
+msgid "Submit Changes"
+msgstr "Invia"

Modified: freepbx-modules/trunk/modules/manager/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/manager/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/manager/module.xml (original)
+++ freepbx-modules/trunk/modules/manager/module.xml Sun May 18 19:52:05 2008
@@ -1,18 +1,19 @@
 <module>
 	<rawname>manager</rawname>
 	<name>Asterisk API</name>
-	<version>1.3.1</version>
+	<version>2.4.0</version>
 	<type>tool</type>
 	<category>System Administration</category>
 	<menuitems>
 		<manager>Asterisk API</manager>
 	</menuitems>
 	<changelog>
+		*2.4.0* it translations
 		*1.3.1* bump for rc1
 		*1.3* Added SQLite3 support, fixes ticket 1776
 		*1.2* Fix UI issues, and 'Array' message.
 		*1.1* First 2.2 release. Added he_IL support, fixed some warnings.
 	</changelog>
-	<location>release/2.3/manager-1.3.tgz</location>
-	<md5sum>f6f2e9b7aaad3dd4e730a3893b8429c2</md5sum>
+	<location>release/2.3/manager-1.3.1.tgz</location>
+	<md5sum>5dc873f6e5e3347b8b57216754d41207</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/miscapps/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/miscapps/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/miscapps/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/miscapps/functions.inc.php Sun May 18 19:52:05 2008
@@ -1,13 +1,4 @@
 <?php
-/*
-function miscapp_destinations() {
-	// return an associative array with destination and description
-	foreach (announcement_list() as $row) {
-		$extens[] = array('destination' => 'app-announcement,ann-'.$row[0].',1', 'description' => $row[1]);
-	}
-	return $extens;
-}
-*/
 
 function miscapps_contexts() {
 	// return an associative array with context and description
@@ -130,4 +121,31 @@
 	$fc->update();
 }
 
+function miscapps_check_destinations($dest=true) {
+	global $active_modules;
+
+	$destlist = array();
+	if (is_array($dest) && empty($dest)) {
+		return $destlist;
+	}
+	$sql = "SELECT miscapps_id, dest, description FROM miscapps ";
+	if ($dest !== true) {
+		$sql .= "WHERE dest in ('".implode("','",$dest)."')";
+	}
+	$results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
+
+	$type = isset($active_modules['miscapps']['type'])?$active_modules['miscapps']['type']:'setup';
+
+	foreach ($results as $result) {
+		$thisdest = $result['dest'];
+		$thisid   = $result['miscapps_id'];
+		$destlist[] = array(
+			'dest' => $thisdest,
+			'description' => 'Misc Application: '.$result['description'],
+			'edit_url' => 'config.php?display=miscapps&type='.$type.'&extdisplay='.urlencode($thisid),
+		);
+	}
+	return $destlist;
+}
+
 ?>

Added: freepbx-modules/trunk/modules/miscapps/i18n/it_IT/LC_MESSAGES/miscapps.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/miscapps/i18n/it_IT/LC_MESSAGES/miscapps.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/miscapps/i18n/it_IT/LC_MESSAGES/miscapps.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/miscapps/i18n/it_IT/LC_MESSAGES/miscapps.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/miscapps/i18n/it_IT/LC_MESSAGES/miscapps.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/miscapps/i18n/it_IT/LC_MESSAGES/miscapps.po (added)
+++ freepbx-modules/trunk/modules/miscapps/i18n/it_IT/LC_MESSAGES/miscapps.po Sun May 18 19:52:05 2008
@@ -1,0 +1,126 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-01-26 14:18+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: Italian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: page.miscapps.php:79
+msgid ""
+"Misc Applications are for adding feature codes that you can dial from "
+"internal phones that go to various destinations available in FreePBX. This "
+"is in contrast to the <strong>Misc Destinations</strong> module, which is "
+"for creating destinations that can be used by other FreePBX modules to dial "
+"internal numbers or feature codes."
+msgstr "Le Applicazioni Varie possono essere utilizzate per impostare dei servizi consultabili direttamente dai telefoni scegliendo una delle varie destinazioni disponibili in FreePBX. Non è la stessa cosa del modulo <strong>Destinazioni Varie</strong>, che serve a creare destinazioni da poter essere utilizzate da altri moduli FreePBX, per chiamare per esempio numeri interni o altri servizi."
+
+#: page.miscapps.php:88
+msgid "Edit Misc Application"
+msgstr "Modifica Applicazione Varia"
+
+#: page.miscapps.php:88
+msgid "Add Misc Application"
+msgstr "Aggiungi Applicazione Varia"
+
+#: page.miscapps.php:90
+msgid "Description"
+msgstr "Descrizione"
+
+#: page.miscapps.php:90
+msgid "The name of this application"
+msgstr "Il nome di questa applicazione"
+
+#: page.miscapps.php:94
+msgid "Feature Code"
+msgstr "Codice Servizio"
+
+#: page.miscapps.php:94
+msgid ""
+"The feature code/extension users can dial to access this application. This "
+"can also be modified on the Feature Codes page."
+msgstr "Il codice/estensione che gli utenti dovranno digitare per accedere a questa applicazione. Questa può essere anche modificata nella pagina Codici Servizi."
+
+#: page.miscapps.php:98
+msgid "Feature Status"
+msgstr "Stato Servizio"
+
+#: page.miscapps.php:98
+msgid "If this code is enabled or not."
+msgstr "Se questo codice è attivo o no."
+
+#: page.miscapps.php:105
+msgid "Destination"
+msgstr "Destinazione"
+
+#: page.miscapps.php:114
+msgid "Delete"
+msgstr "Elimina"
+
+msgid "Core"
+msgstr "Sistema"
+
+msgid "Conferences"
+msgstr "Conferenze"
+
+msgid "Phonebook Directory"
+msgstr "Rubrica"
+
+msgid "Queues"
+msgstr "Code"
+
+msgid "Ring Groups"
+msgstr "Gruppi di chiamata"
+
+msgid "Speed dial functions"
+msgstr "Selezione breve"
+
+msgid "Time Conditions"
+msgstr "Condizioni Temporali"
+
+msgid "Custom Contexts"
+msgstr "Contesti Personalizzati"
+
+msgid "Extended Routing"
+msgstr "Rotte specifiche"
+
+msgid "Custom App<span><br>ADVANCED USERS ONLY<br><br>Uses Goto() to send caller to a custom context.<br><br>The context name should start with \"custom-\", and be in the format custom-context,extension,priority. Example entry:<br><br><b>custom-myapp,s,1</b><br><br>The <b>[custom-myapp]</b> context would need to be created and included in extensions_custom.conf</span>"
+msgstr "Applicazione Personalizzata<span>SOLO UTENTI AVANZATI<br>Utilizzare Goto() per inviare la chiamata verso un contesto personalizzato.<br><br>Il nome del contesto deve iniziare per \"custom-\" e deve essere nel formato custom-contesto,extension,priorità. Esempio: <br><br><b>custom-app,s,1</b><br><br><b>Il contesto [custom-app] </b> deve poi essere creato e incluso nel file extensions_custom.conf</span>"
+
+
+msgid "Submit Changes"
+msgstr "Invia"
+
+msgid "Edit"
+msgstr "Modifica"
+
+msgid "Enabled"
+msgstr "Attivato"
+
+msgid "Disabled"
+msgstr "Disattivato"
+
+msgid "Add Misc. Application"
+msgstr "Aggiungi Applicazione Varia"
+
+msgid "Voicemail"
+msgstr "Casella Vocale"
+
+msgid "Extensions"
+msgstr "Interni"
+
+msgid "Day Night Mode"
+msgstr "Controllo Giorno Notte"
+
+msgid "Terminate Call"
+msgstr "Termina Chiamata"

Modified: freepbx-modules/trunk/modules/miscapps/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/miscapps/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/miscapps/module.xml (original)
+++ freepbx-modules/trunk/modules/miscapps/module.xml Sun May 18 19:52:05 2008
@@ -1,7 +1,7 @@
 <module>
 	<rawname>miscapps</rawname>
 	<name>Misc Applications</name>
-	<version>0.2.3.5</version>
+	<version>2.4.0.1</version>
 	<type>setup</type>
 	<category>Internal Options &amp; Configuration</category>
 	<description>
@@ -11,6 +11,8 @@
 		<miscapps>Misc Applications</miscapps>
 	</menuitems>
 	<changelog>
+		*2.4.0.1* added depends on 2.4.0
+		*2.4.0* Extension / dest registry, it translation
 		*0.2.3.5* #2305 Feature Status broken
 		*0.2.3.3* fixed some undefined variables, bump for rc1
 		*0.2.3.2* #2177: removed apparently corrupted newline at end of file
@@ -22,6 +24,9 @@
 		*0.2* Fix bug with adding new apps
 		*0.1.1* Fixed publish location for trunk/2.3 repository
 	</changelog>
-	<location>release/2.3/miscapps-0.2.3.4.tgz</location>
-	<md5sum>fb70be71fd4c5a96e7206d929d46c3d0</md5sum>
+	<depends>
+		<version>2.4.0</version>
+	</depends>
+	<location>release/2.4/miscapps-2.4.0.tgz</location>
+	<md5sum>a1d5a86b3d700d6e1ebaf8fc01833819</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/miscapps/page.miscapps.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/miscapps/page.miscapps.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/miscapps/page.miscapps.php (original)
+++ freepbx-modules/trunk/modules/miscapps/page.miscapps.php Sun May 18 19:52:05 2008
@@ -29,14 +29,33 @@
 
 switch ($action) {
 	case 'add':
-		miscapps_add($description, $ext, $dest);
-		needreload();
-		redirect_standard();
+		$conflict_url = array();
+		$usage_arr = framework_check_extension_usage($ext);
+		if (!empty($usage_arr)) {
+			$conflict_url = framework_display_extension_usage_alert($usage_arr);
+		} else {
+			miscapps_add($description, $ext, $dest);
+			needreload();
+			redirect_standard();
+		}
 	break;
+	// TODO: need to lookup the current extension based on the id and if it is changing
+	//       do a check to make sure it doesn't conflict. If not changing, np.
+	//
 	case 'edit':
-		miscapps_edit($miscapp_id, $description, $ext, $dest, $enabled);
-		needreload();
-		redirect_standard('extdisplay');
+		$fc = new featurecode('miscapps', 'miscapp_'.$miscapp_id);
+		$conflict_url = array();
+		if ($fc->getDefault() != $ext) {
+			$usage_arr = framework_check_extension_usage($ext);
+			if (!empty($usage_arr)) {
+				$conflict_url = framework_display_extension_usage_alert($usage_arr);
+			}
+		}
+		if (empty($conflict_url)) {
+			miscapps_edit($miscapp_id, $description, $ext, $dest, $enabled);
+			needreload();
+			redirect_standard('extdisplay');
+		}
 	break;
 	case 'delete':
 		miscapps_delete($miscapp_id);
@@ -74,10 +93,19 @@
 	$dest = $row['dest'];
 	$enabled = $row['enabled'];
 
+	echo "<h2>"._("Edit Misc Application")."</h2>";
+} else {
+	echo "<h2>"._("Add MIsc Application")."</h2>";
 }
 
 $helptext = _("Misc Applications are for adding feature codes that you can dial from internal phones that go to various destinations available in FreePBX. This is in contrast to the <strong>Misc Destinations</strong> module, which is for creating destinations that can be used by other FreePBX modules to dial internal numbers or feature codes.");
-echo "<p>".$helptext."</p>\n";
+echo $helptext;
+?>
+
+<?php if (!empty($conflict_url)) {
+      	echo "<h5>"._("Conflicting Extensions")."</h5>";
+      	echo implode('<br .>',$conflict_url);
+      }
 ?>
 
 <form name="editMiscapp" action="<?php  $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return checkMiscapp(editMiscapp);">

Modified: freepbx-modules/trunk/modules/miscdests/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/miscdests/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/miscdests/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/miscdests/functions.inc.php Sun May 18 19:52:05 2008
@@ -12,6 +12,30 @@
 		return $extens;
 	} else {
 		return null;
+	}
+}
+
+function miscdests_getdest($exten) {
+	return array('ext-miscdests,'.$exten.',1');
+}
+
+function miscdests_getdestinfo($dest) {
+	global $active_modules;
+
+	if (substr(trim($dest),0,14) == 'ext-miscdests,') {
+		$exten = explode(',',$dest);
+		$exten = $exten[1];
+		$thisexten = miscdests_get($exten);
+		if (empty($thisexten)) {
+			return array();
+		} else {
+			//$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup';
+			return array('description' => 'Misc Destination : '.$thisexten['description'],
+			             'edit_url' => 'config.php?display=miscdests&id='.urlencode($exten),
+								  );
+		}
+	} else {
+		return false;
 	}
 }
 

Added: freepbx-modules/trunk/modules/miscdests/i18n/it_IT/LC_MESSAGES/miscdests.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/miscdests/i18n/it_IT/LC_MESSAGES/miscdests.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/miscdests/i18n/it_IT/LC_MESSAGES/miscdests.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/miscdests/i18n/it_IT/LC_MESSAGES/miscdests.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/miscdests/i18n/it_IT/LC_MESSAGES/miscdests.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/miscdests/i18n/it_IT/LC_MESSAGES/miscdests.po (added)
+++ freepbx-modules/trunk/modules/miscdests/i18n/it_IT/LC_MESSAGES/miscdests.po Sun May 18 19:52:05 2008
@@ -1,0 +1,239 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-01-26 14:38+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: Italian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: page.miscdests.php:69 page.miscdests.php:107 page.miscdests.php:114
+msgid "Add Misc Destination"
+msgstr "Aggiungi Destinazione Varia"
+
+#: page.miscdests.php:83
+msgid "Misc Destination"
+msgstr "Destinazione Varia"
+
+#: page.miscdests.php:83
+msgid "deleted"
+msgstr "eliminata"
+
+#: page.miscdests.php:97
+msgid ""
+"Misc Destinations are for adding destinations that can be used by other "
+"FreePBX modules, generally used to route incoming calls. If you want to "
+"create feature codes that can be dialed by internal users and go to various "
+"destinations, please see the <strong>Misc Applications</strong> module."
+msgstr "Le Destinazioni Varie sono utili per aggiungere destinazioni che possono essere utilizzate da altri moduli FreePBX, in generale per instradare le chiamate in ingresso. Se invece si vuole creare una destinazione da poter essere utilizzata dagli interni, vedere il modulo <strong>Applicazioni Varie</strong>"
+
+#: page.miscdests.php:102
+msgid "Misc Destination:"
+msgstr "Destinazione Varia"
+
+#: page.miscdests.php:103
+msgid "Delete Misc Destination"
+msgstr "Elimina Destinazione Varia"
+
+#: page.miscdests.php:105
+msgid "Misc Destinations"
+msgstr "Destinazioni Varie"
+
+#: page.miscdests.php:114
+msgid "Edit Misc Destination"
+msgstr "Modifica Destinazione Varia"
+
+#: page.miscdests.php:119
+msgid "description:"
+msgstr "Descrizione:"
+
+#: page.miscdests.php:119
+msgid "Give this Misc Destination a brief name to help you identify it."
+msgstr "Dare alla Destinazione Varia un nome breve per una facile identificazione."
+
+#: page.miscdests.php:123
+msgid "dial:"
+msgstr "Chiama:"
+
+#: page.miscdests.php:123
+msgid ""
+"Enter the number this destination will simulate dialing, exactly as you "
+"would dial it from an internal phone. When you route a call to this "
+"destination, it will be as if the caller dialed this number from an internal "
+"phone."
+msgstr "Immettere il numero per questa destinazione. Quando si dirotta una chiamata verso questa destinazione, è come se fosse stato chiamato il numero da un telefono interno."
+
+#: page.miscdests.php:128
+msgid "featurecode shortcuts"
+msgstr "Collegamento veloce Servizio"
+
+msgid "Submit Changes"
+msgstr "Invia"
+
+msgid "Blacklist a number"
+msgstr "Inserisce un numero in Blacklist"
+
+msgid "Blacklist the last caller"
+msgstr "Inserisce l'ultimo chiamante in Blacklist"
+
+msgid "Remove a number from the blacklist"
+msgstr "Rimuove un numero dalla Blacklist"
+
+msgid "Call Forward"
+msgstr "Trasferimeto di chiamata"
+
+msgid "Call Forward All Activate"
+msgstr "Attiva Trasferimento di Chiamata Incondizionato"
+
+msgid "Call Forward All Deactivate"
+msgstr "Disattiva Trasferimento di Incondizionato"
+
+msgid "Call Forward All Prompting Deactivate"
+msgstr "Disattiva Trasferimento di Incondizionato (chiede dettagli)"
+
+msgid "Call Forward Busy Activate"
+msgstr "Attiva Trasferimento di Chiamata su Occupato"
+
+msgid "Call Forward Busy Deactivate"
+msgstr "Disattiva Trasferimento di Chiamata su Occupato"
+
+msgid "Call Forward Busy Prompting Deactivate"
+msgstr "Disattiva Trasferimento di Chiamata su Occupato (chiede dettagli)"
+
+msgid "Call Forward No Answer/Unavailable Activate"
+msgstr "Attiva Trasferimento su Nessuna Risposta/Non disponibile"
+
+msgid "Call Forward No Answer/Unavailable Deactivate"
+msgstr "Disattiva Trasferimento su Nessuna Risposta/Non disponibile"
+
+msgid "Call Waiting"
+msgstr "Avviso di Chiamata"
+
+msgid "Call Waiting - Activate"
+msgstr "Attiva Avviso di Chiamata"
+
+msgid "Call Waiting - Deactivate"
+msgstr "Disattiva Avviso di Chiamata"
+
+msgid "Core"
+msgstr "Sistema"
+
+msgid "Call Pickup (Can be used with GXP-2000)"
+msgstr "Call Pickup"
+
+msgid "Simulate Incoming Call"
+msgstr "Simulazione chiamata in entrata"
+
+msgid "Simulate Incoming FAX Call"
+msgstr "Simulazione chiamata FAX in entrata"
+
+msgid "User Logoff"
+msgstr "Disconessione Utente"
+
+msgid "User Logon"
+msgstr "Connessione Utente"
+
+msgid "Dictation"
+msgstr "Dettatura"
+
+msgid "Email completed dictation"
+msgstr "Invio Email a Dettatura completata"
+
+msgid "Perform dictation"
+msgstr "Esecuzione Dettatura"
+
+msgid "Do-Not-Disturb (DND)"
+msgstr "Non Disturbare (DND)"
+
+msgid "DND Activate"
+msgstr "Attiva Non Disturbare"
+
+msgid "DND Deactivate"
+msgstr "Disattiva Non Disturbare"
+
+msgid "Info Services"
+msgstr "Servizi di informazione"
+
+msgid "Call Trace"
+msgstr "Ultimi numeri chiamati"
+
+msgid "Directory"
+msgstr "Elenco Telefonico"
+
+msgid "Echo Test"
+msgstr "Test dell'Eco"
+
+msgid "Speak Your Exten Number"
+msgstr "Riproduzione Numero Interno"
+
+msgid "Speaking Clock"
+msgstr "Ora e Data"
+
+msgid "Misc Applications"
+msgstr "Applicazioni Varie"
+
+msgid "Paging and Intercom"
+msgstr "Paging e Intercom"
+
+msgid "Intercom prefix"
+msgstr "Prefisso Intercom"
+
+msgid "User Intercom Allow"
+msgstr "Permetti Intercom"
+
+msgid "User Intercom Disallow"
+msgstr "Non permettere Intercom"
+
+msgid "Phonebook Directory"
+msgstr "Rubrica telefonica"
+
+msgid "Phonebook dial-by-name directory"
+msgstr "Rubrica telefonica (chiama-per-nome)"
+
+msgid "Recordings"
+msgstr "Registrazioni"
+
+msgid "Check Recording"
+msgstr "Controllo registrazione"
+
+msgid "Save Recording"
+msgstr "Registrazione"
+
+msgid "Speed dial functions"
+msgstr "Funzioni Selezione breve"
+
+msgid "Set user speed dial"
+msgstr "Imposta numero in Selezione breve"
+
+msgid "Speeddial prefix"
+msgstr "Prefisso Selezione breve"
+
+msgid  "Voicemail"
+msgstr "Casella Vocale"
+
+msgid "Dial Voicemail"
+msgstr "Menu Casella Vocale"
+
+msgid "My Voicemail"
+msgstr "Menu propria Casella Vocale"
+
+msgid "Extension"
+msgstr "Interno"
+
+msgid "Day Night Control"
+msgstr "Servizio Giorno Notte"
+
+msgid "Day/Night Control Toggle"
+msgstr "Codice Servizio Giorno/Notte"
+
+msgid "Instructions"
+msgstr "Istruzioni"

Modified: freepbx-modules/trunk/modules/miscdests/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/miscdests/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/miscdests/module.xml (original)
+++ freepbx-modules/trunk/modules/miscdests/module.xml Sun May 18 19:52:05 2008
@@ -1,11 +1,13 @@
 <module>
 	<rawname>miscdests</rawname>
 	<name>Misc Destinations</name>
-	<version>1.3.4.3</version>
+	<version>2.4.0.1</version>
 	<type>setup</type>
 	<category>Internal Options &amp; Configuration</category>
 	<description>Allows creating destinations that dial any local number (extensions, feature codes, outside phone numbers) that can be used by other modules (eg, IVR, time conditions) as a call destination.</description>
 	<changelog>
+		*2.4.0.1* added depends on 2.4.0
+		*2.4.0* Extension/dest registry, it translation
 		*1.3.4.3* changed categories
 		*1.3.4.2* bump for rc1
 		*1.3.4.1* changed freePBX to FreePBX
@@ -15,9 +17,12 @@
 		*1.3.1* Updated help text
 		*1.3* First release for FreePBX 2.2 - Fixed GUI issues
 	</changelog>
+	<depends>
+		<version>2.4.0</version>
+	</depends>
 	<menuitems>
 		<miscdests>Misc Destinations</miscdests>
 	</menuitems>
-	<location>release/2.3/miscdests-1.3.4.2.tgz</location>
-	<md5sum>550b8a0080e533941eb2f0280cd2fbad</md5sum>
+	<location>release/2.4/miscdests-2.4.0.tgz</location>
+	<md5sum>54cdac4635d882e363ae5ce7c7d83056</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/miscdests/page.miscdests.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/miscdests/page.miscdests.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/miscdests/page.miscdests.php (original)
+++ freepbx-modules/trunk/modules/miscdests/page.miscdests.php Sun May 18 19:52:05 2008
@@ -94,20 +94,25 @@
 	$delURL = $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'].'&action=delete';
 
 
-echo "<h2>"._("Misc Destinations")."</h2>";
-echo "<h3>"._("Instructions")."</h3>";
 $helptext = _("Misc Destinations are for adding destinations that can be used by other FreePBX modules, generally used to route incoming calls. If you want to create feature codes that can be dialed by internal users and go to various destinations, please see the <strong>Misc Applications</strong> module.");
 
 
 	
 		if ($extdisplay){ ?>
 	<h2><?php echo _("Misc Destination:")." ". $description; ?></h2>
-	<p><a href="<?php echo $delURL ?>"><?php echo _("Delete Misc Destination")?> '<?php echo $description; ?>'</a></p>
-<?php		} else { 
-			echo "<h2>"._("Misc Destinations")."</h2>";
-			echo "<p>".$helptext."</p>\n"; ?>
-	<h2><?php echo _("Add Misc Destination"); ?></h2>
-<?php		}
+	<a href="<?php echo $delURL ?>"><?php echo _("Delete Misc Destination")?> '<?php echo $description; ?>'</a>
+
+<?php
+			$usage_list = framework_display_destination_usage(miscdests_getdest($extdisplay));
+			if (!empty($usage_list)) {
+?>
+				<br /><a href="#" class="info"><?php echo $usage_list['text']?>:<span><?php echo $usage_list['tooltip']?></span></a>
+<?php
+			}
+		} else { 
+			echo "<h2>"._("Add Misc Destination")."</h2>";
+			echo $helptext;
+		}
 ?>
 	<form autocomplete="off" name="editMD" action="<?php $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return editMD_onsubmit();">
 	<input type="hidden" name="display" value="<?php echo $dispnum?>">

Added: freepbx-modules/trunk/modules/music/i18n/it_IT/LC_MESSAGES/music.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/music/i18n/it_IT/LC_MESSAGES/music.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/music/i18n/it_IT/LC_MESSAGES/music.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/music/i18n/it_IT/LC_MESSAGES/music.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/music/i18n/it_IT/LC_MESSAGES/music.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/music/i18n/it_IT/LC_MESSAGES/music.po (added)
+++ freepbx-modules/trunk/modules/music/i18n/it_IT/LC_MESSAGES/music.po Sun May 18 19:52:05 2008
@@ -1,0 +1,107 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-01-26 15:07+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: Italian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: install.php:24 page.music.php:104
+msgid "Cannot write to file"
+msgstr "Impossibile scrivere il file"
+
+#: page.music.php:65 page.music.php:202
+msgid "Add Music Category"
+msgstr "Aggiungi Categoria Musica"
+
+#: page.music.php:159
+msgid "Delete"
+msgstr "Elimina"
+
+#: page.music.php:192
+msgid "On Hold Music"
+msgstr "Musica di Attesa"
+
+#: page.music.php:204
+msgid "Category Name:"
+msgstr "Nome Categoria:"
+
+#: page.music.php:204
+msgid ""
+"Allows you to Set up Different Categories for music on hold.  This is useful "
+"if you would like to specify different Hold Music or Commercials for various "
+"ACD Queues."
+msgstr "Permette di impostare differenti categorie di musiche di attesa. E' molto utile se si vogliono creare attese o messaggi per diverse Code."
+
+#: page.music.php:239
+msgid "Category:"
+msgstr "Categoria:"
+
+#: page.music.php:239
+msgid "default"
+msgstr "predefinito"
+
+#: page.music.php:241
+msgid "Delete Music Category"
+msgstr "Elimna Categoria Musica"
+
+#: page.music.php:244
+msgid "Upload a .wav or .mp3 file:"
+msgstr "Carica un file .wav o .mp3:"
+
+#: page.music.php:267 page.music.php:269 page.music.php:277
+msgid "Error Processing"
+msgstr "Errore durante il processo"
+
+#: page.music.php:267
+msgid "No file provided"
+msgstr "Nessun file caricato"
+
+#: page.music.php:267
+msgid "Please select a file to upload"
+msgstr "Prego selezionare un file da caricare"
+
+#: page.music.php:269
+msgid "Check"
+msgstr "Controllo"
+
+#: page.music.php:269
+msgid "in"
+msgstr "di"
+
+#: page.music.php:278
+msgid "This is not a fatal error, your Music on Hold may still work."
+msgstr "Questo non è un errore fatale, la Musica di Attesa potrebbe ancora funzionare."
+
+#: page.music.php:280
+msgid "Completed processing"
+msgstr "Processo completato"
+
+#: page.music.php:298
+msgid ""
+"You must have at least one file for On Hold Music.  Please upload one before "
+"deleting this one."
+msgstr "Bisogna avere almeno un file per la Musica di Attesa. Caricarne uno prima di cancellare questo."
+
+#: page.music.php:302
+msgid "Deleted"
+msgstr "Eliminato"
+
+msgid "Enable Random Play"
+msgstr "Attiva Riproduzione Casuale"
+
+msgid "Submit Changes"
+msgstr "Invia"
+
+msgid "Disable Random Play"
+msgstr "Disattiva Riproduzione Casuale"

Modified: freepbx-modules/trunk/modules/music/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/music/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/music/module.xml (original)
+++ freepbx-modules/trunk/modules/music/module.xml Sun May 18 19:52:05 2008
@@ -1,13 +1,16 @@
 <module>
 	<rawname>music</rawname>
 	<name>Music on Hold</name>
-	<version>1.5.1.5</version>
+	<version>2.4.0.1</version>
 	<candisable>no</candisable>
 	<canuninstall>no</canuninstall>
 	<type>setup</type>
 	<category>Internal Options &amp; Configuration</category>
 	<description>Uploading and management of sound files (wav, mp3) to be used for on-hold music.</description>
 	<changelog>
+		*2.4.0.1* #2591 localization fixes
+		*2.4.0* it translations, bump for 2.4
+		*1.5.2* #1923 Add option to no encode wav to mp3 (but recode it to 8K samples)
 		*1.5.1.5* #2193 moh path hardcoded
 		*1.5.1.4* bump for rc1
 		*1.5.1.3* #1969 fix javascript validation, add canunninstall:no
@@ -26,6 +29,6 @@
 	<menuitems>
 		<music>Music on Hold</music>
 	</menuitems>
-	<location>release/2.3/music-1.5.1.4.tgz</location>
-	<md5sum>9e119508231e205de5d46719c900188e</md5sum>
+	<location>release/2.4/music-2.4.0.tgz</location>
+	<md5sum>ffb315b73dc9e04a493c23a0db75a214</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/music/page.music.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/music/page.music.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/music/page.music.php (original)
+++ freepbx-modules/trunk/modules/music/page.music.php Sun May 18 19:52:05 2008
@@ -1,4 +1,4 @@
-<?php /* $Id: page.music.php 4913 2007-08-21 04:49:30Z p_lindheimer $ */
+<?php /* $Id: page.music.php 5658 2008-02-09 18:46:02Z p_lindheimer $ */
 //Copyright (C) 2004 Coalescent Systems Inc. (info at coalescentsystems.ca)
 //
 //This program is free software; you can redistribute it and/or
@@ -173,17 +173,34 @@
 	}
 }
 
-function process_mohfile($mohfile)
+function process_mohfile($mohfile,$onlywav=false)
 {
 	global $path_to_dir;
 	$output = 0;
 	$returncode = 0;
+
 	$origmohfile=$path_to_dir."/orig_".$mohfile;
 	$newname = strtr($mohfile,"&", "_");
-	$newmohfile=$path_to_dir."/". ((strpos($newname,'.mp3') === false) ? $newname.".mp3" : $newname);
-	$lamecmd="lame --cbr -m m -t -F \"".$origmohfile."\" \"".$newmohfile."\" 2>&1 ";
-	if (strpos($newmohfile,'.mp3') !== false) 
-		exec($lamecmd, $output, $returncode);
+	if(strstr($newname,".mp3")) {
+		$onlywav = false;
+	}
+	if(!$onlywav) {
+		$newmohfile=$path_to_dir."/". ((strpos($newname,'.mp3') === false) ? $newname.".mp3" : $newname);
+		$lamecmd="lame --cbr -m m -t -F \"".$origmohfile."\" \"".$newmohfile."\" 2>&1 ";
+		if (strpos($newmohfile,'.mp3') !== false) 
+			exec($lamecmd, $output, $returncode);
+		} else {
+			$newmohfile = $path_to_dir."/wav_".$newname;
+			$soxcmd = "sox \"".$origmohfile."\" -r 8000 -c 1 \"".$newmohfile."\" ";
+			$soxresample = "resample -ql ";
+			exec($soxcmd.$soxresample."2>&1", $output, $returncode);
+			if ($returncode != 0) {
+				// try it again without the resample in case the input sample rate was the same
+				//
+				exec("rm -rf \"".$newmohfile."\"");
+				exec($soxcmd."2>&1", $output, $returncode);
+			}
+		}
 	if ($returncode != 0) {
 		return join("<br>\n", $output);
 	}
@@ -261,14 +278,16 @@
 		<input type="hidden" name="action" value="addedfile">
 		<input type="file" name="mohfile"/>
 		<input type="button" value="<?php echo _("Upload")?>" onclick="document.upload.submit(upload);alert('<?php echo addslashes(_("Please wait until the page loads. Your file is being processed."))?>');"/>
+		<br />
+		<input type="checkbox" name="onlywav" checked="checked"><small><?php echo _("Do not encode wav to mp3"); ?></small>
 	</form>
 	<br />
 	<form name="randomon" action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
 	<?php 
 		if (file_exists("{$path_to_dir}/.random")) {
-			?> <input type="submit" name="randoff" value="Disable Random Play"> <?php
-		} else {
-			?> <input type="submit" name="randon" value="Enable Random Play"> <?php
+			?> <input type="submit" name="randoff" value="<?php echo _("Disable Random Play");?>"> <?php
+		} else {
+			?> <input type="submit" name="randon" value="<?php echo _("Enable Random Play");?>"> <?php
 		}
 	?>
 	</form>
@@ -286,7 +305,9 @@
 	if (isset($_FILES['mohfile']['tmp_name']) && is_uploaded_file($_FILES['mohfile']['tmp_name'])) {
 		//echo $_FILES['mohfile']['name']." uploaded OK";
 		move_uploaded_file($_FILES['mohfile']['tmp_name'], $path_to_dir."/orig_".$_FILES['mohfile']['name']);
-		$process_err = process_mohfile($_FILES['mohfile']['name']);
+
+		$process_err = process_mohfile($_FILES['mohfile']['name'],($_REQUEST['onlywav'] != ''));
+
 		if (isset($process_err)) {
 			echo "<h5>"._("Error Processing").": \"$process_err\" for ".$_FILES['mohfile']['name']."!</h5>\n";
 			echo "<h5>"._("This is not a fatal error, your Music on Hold may still work.")."</h5>\n";

Modified: freepbx-modules/trunk/modules/paging/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/paging/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/paging/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/paging/functions.inc.php Sun May 18 19:52:05 2008
@@ -16,107 +16,245 @@
 		case "asterisk":
 			// setup for intercom
 			$fcc = new featurecode('paging', 'intercom-prefix');
-			$code = $fcc->getCodeActive();
+			$intercom_code = $fcc->getCodeActive();
 			unset($fcc);
 
 			// Since these are going down channel local, set ALERT_INFO and SIPADDHEADER which will be set in dialparties.agi
 			// no point in even setting the headers here they will get lost in channel local
 			//
-			if (!empty($code)) {
-				$ext->add('ext-intercom', '_'.$code.'.', '', new ext_setvar('dialnumber', '${EXTEN:'.strlen($code).'}'));
-				$ext->add('ext-intercom', '_'.$code.'.', '', new ext_dbget('user-intercom','AMPUSER/${dialnumber}/intercom'));
-				$ext->add('ext-intercom', '_'.$code.'.', '', new ext_gotoif('$["${user-intercom}" = "disabled" ]', 'nointercom'));
-				$ext->add('ext-intercom', '_'.$code.'.', '', new ext_setvar('__SIPADDHEADER', 'Call-Info: \;answer-after=0'));
-				$ext->add('ext-intercom', '_'.$code.'.', '', new ext_setvar('__ALERT_INFO', 'Ring Answer'));
-				$ext->add('ext-intercom', '_'.$code.'.', '', new ext_setvar('__SIP_URI_OPTIONS', 'intercom=true'));
-				$ext->add('ext-intercom', '_'.$code.'.', '', new ext_macro('user-callerid'));
-				$ext->add('ext-intercom', '_'.$code.'.', '', new ext_dial('Local/${dialnumber}@from-internal/n','',''));
-				$ext->add('ext-intercom', '_'.$code.'.', '', new ext_busy());
-				$ext->add('ext-intercom', '_'.$code.'.', '', new ext_macro('hangupcall'));
-				$ext->add('ext-intercom', '_'.$code.'.', 'nointercom', new ext_noop('Intercom disallowed by ${dialnumber}'));
-				$ext->add('ext-intercom', '_'.$code.'.', '', new ext_playback('intercom&for&extension'));
-				$ext->add('ext-intercom', '_'.$code.'.', '', new ext_saydigits('${dialnumber}'));
-				$ext->add('ext-intercom', '_'.$code.'.', '', new ext_playback('is&disabled'));
-				$ext->add('ext-intercom', '_'.$code.'.', '', new ext_congestion());
-
+			$extpaging = 'ext-paging';
+			if (!empty($intercom_code)) {
+				$code = '_'.$intercom_code.'.';
+				$context = 'ext-intercom';
+				$ext->add($context, $code, '', new ext_macro('user-callerid'));
+				$ext->add($context, $code, '', new ext_setvar('dialnumber', '${EXTEN:'.strlen($intercom_code).'}'));
+				$ext->add($context, $code, '', new ext_gotoif('$["${DB(AMPUSER/${AMPUSER}/intercom/block)}" = "blocked"]', 'end'));
+				$ext->add($context, $code, '', new ext_gotoif('$["${DB(DND/${dialnumber})}" = "YES"]', 'end'));
+				$ext->add($context, $code, '', new ext_gotoif('$["${DB(AMPUSER/${dialnumber}/intercom/${AMPUSER})}" = "allow" ]', 'allow'));
+				$ext->add($context, $code, '', new ext_gotoif('$["${DB(AMPUSER/${dialnumber}/intercom/${AMPUSER})}" = "deny" ]', 'nointercom'));
+				$ext->add($context, $code, '', new ext_gotoif('$["${DB(AMPUSER/${dialnumber}/intercom)}" = "disabled" ]', 'nointercom'));
+				$ext->add($context, $code, 'allow', new ext_dbget('DEVICES','AMPUSER/${dialnumber}/device'));
+				$ext->add($context, $code, '', new ext_gotoif('$["${DEVICES}" = "" ]', 'end'));
+				$ext->add($context, $code, '', new ext_setvar('LOOPCNT', '${FIELDQTY(DEVICES,&)}'));
+				$ext->add($context, $code, '', new ext_gotoif('$[${LOOPCNT} > 1 ]', 'pagemode'));
+				$ext->add($context, $code, '', new ext_macro('autoanswer','${DEVICES}'));
+				$ext->add($context, $code, 'check', new ext_chanisavail('${DIAL}', 'sj'));
+				$ext->add($context, $code, '', new ext_dial('${DIAL}','5,A(beep)'));
+				$ext->add($context, $code, 'end', new ext_busy());
+				$ext->add($context, $code, '', new ext_macro('hangupcall'));
+				$ext->add($context, $code, '', new ext_busy(), 'check',101);
+				$ext->add($context, $code, '', new ext_macro('hangupcall'));
+				$ext->add($context, $code, 'pagemode', new ext_setvar('ITER', '1'));
+				$ext->add($context, $code, '', new ext_setvar('DIALSTR', ''));
+				$ext->add($context, $code, 'begin', new ext_setvar('DIALSTR', '${DIALSTR}&LOCAL/PAGE${CUT(DEVICES,&,${ITER})}@'.$extpaging));
+				$ext->add($context, $code, '', new ext_setvar('ITER', '$[${ITER} + 1]'));
+				$ext->add($context, $code, '', new ext_gotoif('$[${ITER} <= ${LOOPCNT}]', 'begin'));
+				$ext->add($context, $code, '', new ext_setvar('DIALSTR', '${DIALSTR:1}'));
+				$ext->add($context, $code, '', new ext_setvar('_FORCE_PAGE', '0'));
+				$ext->add($context, $code, '', new ext_setvar('_AMPUSER', '${AMPUSER}'));
+				$ext->add($context, $code, '', new ext_page('${DIALSTR},d'));
+				$ext->add($context, $code, '', new ext_busy());
+				$ext->add($context, $code, '', new ext_macro('hangupcall'));
+				$ext->add($context, $code, 'nointercom', new ext_noop('Intercom disallowed by ${dialnumber}'));
+				$ext->add($context, $code, '', new ext_playback('intercom&for&extension'));
+				$ext->add($context, $code, '', new ext_saydigits('${dialnumber}'));
+				$ext->add($context, $code, '', new ext_playback('is&disabled'));
+				$ext->add($context, $code, '', new ext_congestion());
+
+				$extintercomusers = 'ext-intercom-users';
 				$userlist = core_users_list();
 				if (is_array($userlist)) {
 					foreach($userlist as $item) {
-						$intercom_code = $code.$item[0];
-						$ext->add('ext-intercom-users', '_'.$intercom_code, '', new ext_goto('ext-intercom,${EXTEN},1'));
+						$ext_intercom_code = $intercom_code.$item[0];
+						$ext->add($extintercomusers, $ext_intercom_code, '', new ext_goto($context.',${EXTEN},1'));
 					}
 				}
-				$ext->addInclude('from-internal-additional', 'ext-intercom-users');
+
+				$context = $extintercomusers;
+				$ext->addInclude('from-internal-additional', $context);
+			}
 			
-				$fcc = new featurecode('paging', 'intercom-on');
-				$oncode = $fcc->getCodeActive();
-				unset($fcc);
-
-				if ($oncode) {
-					$ext->add('ext-intercom-users', $oncode, '', new ext_answer(''));
-					$ext->add('ext-intercom-users', $oncode, '', new ext_wait('1'));
-					$ext->add('ext-intercom-users', $oncode, '', new ext_macro('user-callerid'));
-					$ext->add('ext-intercom-users', $oncode, '', new ext_setvar('DB(AMPUSER/${AMPUSER}/intercom)', 'enabled'));
-					$ext->add('ext-intercom-users', $oncode, '', new ext_playback('intercom&enabled'));
-					$ext->add('ext-intercom-users', $oncode, '', new ext_macro('hangupcall'));
+			$fcc = new featurecode('paging', 'intercom-on');
+			$oncode = $fcc->getCodeActive();
+			unset($fcc);
+
+			if ($oncode) {
+				$ext->add($context, $oncode, '', new ext_answer(''));
+				$ext->add($context, $oncode, '', new ext_wait('1'));
+				$ext->add($context, $oncode, '', new ext_macro('user-callerid'));
+				$ext->add($context, $oncode, '', new ext_setvar('DB(AMPUSER/${AMPUSER}/intercom)', 'enabled'));
+				$ext->add($context, $oncode, '', new ext_playback('intercom&enabled'));
+				$ext->add($context, $oncode, '', new ext_macro('hangupcall'));
+
+				$target = '${EXTEN:'.strlen($oncode).'}';
+				$oncode = "_".$oncode.".";
+				$ext->add($context, $oncode, '', new ext_answer(''));
+				$ext->add($context, $oncode, '', new ext_wait('1'));
+				$ext->add($context, $oncode, '', new ext_macro('user-callerid'));
+				$ext->add($context, $oncode, '', new ext_gotoif('$["${DB(AMPUSER/${AMPUSER}/intercom/'.$target.')}" = "allow" ]}','unset'));
+				$ext->add($context, $oncode, '', new ext_gotoif('$[${DB_EXISTS(AMPUSER/${EXTEN:3}/device)} != 1]','invaliduser'));
+				$ext->add($context, $oncode, '', new ext_dbput('AMPUSER/${AMPUSER}/intercom/'.$target, 'allow'));
+				$ext->add($context, $oncode, '', new ext_playback('intercom&enabled&for&extension&number'));
+				$ext->add($context, $oncode, '', new ext_saydigits($target));
+				$ext->add($context, $oncode, '', new ext_macro('hangupcall'));
+				$ext->add($context, $oncode, 'unset', new ext_dbdeltree('AMPUSER/${AMPUSER}/intercom/'.$target));
+				$ext->add($context, $oncode, '', new ext_playback('intercom&enabled&cancelled&for&extension&number'));
+				$ext->add($context, $oncode, '', new ext_saydigits($target));
+				$ext->add($context, $oncode, '', new ext_macro('hangupcall'));
+				$ext->add($context, $oncode, 'invaliduser', new ext_playback('extension&number'));
+				$ext->add($context, $oncode, '', new ext_saydigits($target));
+				$ext->add($context, $oncode, '', new ext_playback('is&invalid'));
+				$ext->add($context, $oncode, '', new ext_macro('hangupcall'));
+			}
+			
+			$fcc = new featurecode('paging', 'intercom-off');
+			$offcode = $fcc->getCodeActive();
+			unset($fcc);
+	
+			if ($offcode) {
+				$ext->add($context, $offcode, '', new ext_answer(''));
+				$ext->add($context, $offcode, '', new ext_wait('1'));
+				$ext->add($context, $offcode, '', new ext_macro('user-callerid'));
+				$ext->add($context, $offcode, '', new ext_setvar('DB(AMPUSER/${AMPUSER}/intercom)', 'disabled'));
+				$ext->add($context, $offcode, '', new ext_playback('intercom&disabled'));
+				$ext->add($context, $offcode, '', new ext_macro('hangupcall'));
+
+				$target = '${EXTEN:'.strlen($offcode).'}';
+				$offcode = "_".$offcode.".";
+				$ext->add($context, $offcode, '', new ext_answer(''));
+				$ext->add($context, $offcode, '', new ext_wait('1'));
+				$ext->add($context, $offcode, '', new ext_macro('user-callerid'));
+				$ext->add($context, $offcode, '', new ext_gotoif('$["${DB(AMPUSER/${AMPUSER}/intercom/'.$target.')}" = "deny" ]}','unset2'));
+				$ext->add($context, $offcode, '', new ext_gotoif('$[${DB_EXISTS(AMPUSER/${EXTEN:3}/device)} != 1]','invaliduser2'));
+				$ext->add($context, $offcode, '', new ext_dbput('AMPUSER/${AMPUSER}/intercom/'.$target, 'deny'));
+				$ext->add($context, $offcode, '', new ext_playback('intercom&disabled&for&extension&number'));
+				$ext->add($context, $offcode, '', new ext_saydigits($target));
+				$ext->add($context, $offcode, '', new ext_macro('hangupcall'));
+				$ext->add($context, $offcode, 'unset2', new ext_dbdeltree('AMPUSER/${AMPUSER}/intercom/'.$target));
+				$ext->add($context, $offcode, '', new ext_playback('intercom&disabled&cancelled&for&extension&number'));
+				$ext->add($context, $offcode, '', new ext_saydigits($target));
+				$ext->add($context, $offcode, '', new ext_macro('hangupcall'));
+				$ext->add($context, $offcode, 'invaliduser2', new ext_playback('extension&number'));
+				$ext->add($context, $offcode, '', new ext_saydigits($target));
+				$ext->add($context, $offcode, '', new ext_playback('is&invalid'));
+				$ext->add($context, $offcode, '', new ext_macro('hangupcall'));
+			}
+
+			/* Create macro-autoanswer that will try to intelligently set the
+		   	required parameters to handle paging. Eventually it will use
+			 	known device information.
+
+				This macro does the following:
+
+				Input:  FreePBX Device number to be called requiring autoanswer
+				Output: ${DIAL} Channel Variable with the dial string to be called
+				        Appropriate SIP headers added
+								Other special requirements that may be custom for this device
+
+				1. Set ${DIAL} to the device's dial string
+				2. If there is a device specific macro defined in the DEVICE's object
+				   (DEVICE/<devicenum>/autoanswer/macro) then execute that macro and end
+				3. Set defaults for Alert-Info and Call-Info headers and SIP_URI_OPTIONS
+				4. Try to identify endpoints by their useragents that may need known
+				   changes and make those changes. These are generated from the
+					 paging_autoanswer table so users can extend them
+				5. Set the variables and end unless a useragent specific ANSWERMACRO is
+				   defined in which case call it and end.
+
+				This macro is called for intercoming and paging to try and enable the
+				target device to auto-answer. Devices with special needs can be handled
+				with the device specific macro. For example, if you have a device that
+				can not auto-answer except by specifically configuring a line key on
+				the device that always answers, you could use a device specific macro
+				to change the dialstring. If you had a set of such devices, you could
+				standardize on the device numbers (e.g. nnnn for normal calls and 2nnnn
+				for auto-answer calls). You could then create a general purpose macro
+				to modify the dial string accordingly. Provisioning tools will be able
+				to take advantage of setting and creating such an ability.
+				If you have a set of devices that can be identified with a SIP useragent
+				then you can use a general macro without setting info in each device.
+		 	*/
+
+			// Get the default values from the SQL table
+			//
+			$alertinfo = 'Alert-Info: Ring Answer';
+			$callinfo  = 'Call-Info: <uri>\;answer-after=0';
+			$sipuri    = 'intercom=true';
+			$autoanswer_arr = paging_get_autoanswer_defaults();
+			foreach ($autoanswer_arr as $autosetting) {
+				switch (trim($autosetting['var'])) {
+					case 'ALERTINFO':
+						$alertinfo = trim($autosetting['setting']);
+						break;
+					case 'CALLINFO':
+						$callinfo = trim($autosetting['setting']);
+						break;
+					case 'SIPURI':
+						$sipuri = trim($autosetting['setting']);
+						break;
+				default:
 				}
-			
-				$fcc = new featurecode('paging', 'intercom-off');
-				$offcode = $fcc->getCodeActive();
-				unset($fcc);
-	
-				if ($offcode) {
-					$ext->add('ext-intercom-users', $offcode, '', new ext_answer(''));
-					$ext->add('ext-intercom-users', $offcode, '', new ext_wait('1'));
-					$ext->add('ext-intercom-users', $offcode, '', new ext_macro('user-callerid'));
-					$ext->add('ext-intercom-users', $offcode, '', new ext_setvar('DB(AMPUSER/${AMPUSER}/intercom)', 'disabled'));
-					$ext->add('ext-intercom-users', $offcode, '', new ext_playback('intercom&disabled'));
-					$ext->add('ext-intercom-users', $offcode, '', new ext_macro('hangupcall'));
+			}
+
+			$macro = 'macro-autoanswer';
+			$ext->add($macro, "s", '', new ext_setvar('DIAL', '${DB(DEVICE/${ARG1}/dial)}'));
+			$ext->add($macro, "s", '', new ext_gotoif('$["${DB(DEVICE/${ARG1}/autoanswer/macro)}" != "" ]', 'macro'));
+			$ext->add($macro, "s", '', new ext_setvar('phone', '${SIPPEER(${CUT(DIAL,/,2)}:useragent)}'));
+			$ext->add($macro, "s", '', new ext_setvar('ALERTINFO', $alertinfo));
+			$ext->add($macro, "s", '', new ext_setvar('CALLINFO', $callinfo));
+			$ext->add($macro, "s", '', new ext_setvar('SIPURI', $sipuri));
+			$ext->add($macro, "s", '', new ext_setvar('ANSWERMACRO', ''));
+
+			// Defaults are setup, now make specific adjustments for detected phones
+			// These come from the SQL table as well where installations can make customizations
+			//
+			$autoanswer_arr = paging_get_autoanswer_useragents();
+			foreach ($autoanswer_arr as $autosetting) {
+				$useragent   = trim($autosetting['useragent']);
+				$autovar     = trim($autosetting['var']);
+				$data        = trim($autosetting['setting']);
+				switch (trim($autovar)) {
+					case 'ALERTINFO':
+					case 'CALLINFO':
+					case 'SIPURI':
+					case 'ANSWERMACRO':
+						$ext->add($macro, "s", '', new ext_execif('$["${phone:0:'.strlen($useragent).'}" = "'.$useragent.'"]', 'Set',$autovar.'='.$data));
+						break;
+				default:
 				}
 			}
 
-			// Get a list of all the phones used for paging
-			$sql = "SELECT DISTINCT ext FROM paging_groups";
-			$results = $db->getAll($sql);
-			if (!isset($results[0][0])) {
-				// There are no phones here, no paging support, lets give up now.
-				return 0;
-			}
-			// We have paging support.
-			$ext->addInclude('from-internal-additional','ext-paging');
-			// Lets give all the phones their PAGExxx lines.
-			// TODO: Support for specific phones configurations
- 			foreach ($results as $grouparr) {
-				$skipheaders = false;
-				$xtn=trim($grouparr[0]);
-				if (strtoupper(substr($xtn,-1)) == "X") {
-					// hack for allowing no SIP headers
-					//TODO : replace this with DevicesTakeTwo stuff
-					$xtn = rtrim($xtn,"xX");
-					$skipheaders = true;
-				}
+			// Now any adjustments have been made, set the headers and done
+			//
+			$ext->add($macro, "s", '', new ext_gotoif('$["${ANSWERMACRO}" != ""]','macro2'));
+			$ext->add($macro, "s", '', new ext_execif('$["${ALERTINFO}" != ""]', 'SipAddHeader','${ALERTINFO}'));
+			$ext->add($macro, "s", '', new ext_execif('$["${CALLINFO}" != ""]', 'SipAddHeader','${CALLINFO}'));
+			$ext->add($macro, "s", '', new ext_execif('$["${SIPURI}" != ""]', 'Set','__SIP_URI_OPTIONS=${SIPURI}'));
+			$ext->add($macro, "s", 'macro', new ext_macro('${DB(DEVICE/${ARG1}/autoanswer/macro)}','${ARG1}'), 'n',2);
+			$ext->add($macro, "s", 'macro2', new ext_macro('${ANSWERMACRO}','${ARG1}'), 'n',2);
+
+
+			// Create the paging context that is used in the paging application for each phone to auto-answer
+			//
+			$ext->addInclude('from-internal-additional',$extpaging);
 				
-				$ext->add('ext-paging', "PAGE${xtn}", '', new ext_gotoif('$[ ${AMPUSER} = '.$xtn.' ]','skipself'));
-				$ext->add('ext-paging', "PAGE${xtn}", '', new ext_gotoif('$[ ${FORCE_PAGE} != 1 ]','AVAIL'));
-				$ext->add('ext-paging', "PAGE${xtn}", '', new ext_setvar('AVAILSTATUS', 'not checked'));
-				$ext->add('ext-paging', "PAGE${xtn}", '', new ext_goto('SKIPCHECK'));
-				$ext->add('ext-paging', "PAGE${xtn}", 'AVAIL', new ext_chanisavail('${DB(DEVICE/'.$xtn.'/dial)}', 'js'));
-				$ext->add('ext-paging', "PAGE${xtn}", 'SKIPCHECK', new ext_noop('Seems to be available (state = ${AVAILSTATUS}'));
+			$ext->add($extpaging, "_PAGE.", '', new ext_gotoif('$[ ${AMPUSER} = ${EXTEN:4} ]','skipself'));
+			$ext->add($extpaging, "_PAGE.", '', new ext_gotoif('$[ ${FORCE_PAGE} != 1 ]','AVAIL'));
+			$ext->add($extpaging, "_PAGE.", '', new ext_setvar('AVAILSTATUS', 'not checked'));
+			$ext->add($extpaging, "_PAGE.", '', new ext_goto('SKIPCHECK'));
+			$ext->add($extpaging, "_PAGE.", 'AVAIL', new ext_chanisavail('${DB(DEVICE/${EXTEN:4}/dial)}', 'js'));
+			$ext->add($extpaging, "_PAGE.", 'SKIPCHECK', new ext_noop('Seems to be available (state = ${AVAILSTATUS}'));
 				
-				if (!$skipheaders) {
-					$ext->add('ext-paging', "PAGE${xtn}", '', new ext_sipaddheader('Call-Info','\;answer-after=0'));
-					$ext->add('ext-paging', "PAGE${xtn}", '', new ext_alertinfo('Ring Answer'));
-					$ext->add('ext-paging', "PAGE${xtn}", '', new ext_setvar('__SIP_URI_OPTIONS', 'intercom=true'));
-				}
+			$ext->add($extpaging, "_PAGE.", '', new ext_macro('autoanswer','${EXTEN:4}'));
+		
+			$ext->add($extpaging, "_PAGE.", '', new ext_dial('${DIAL}', '5, A(beep)'));
+			$ext->add($extpaging, "_PAGE.", 'skipself', new ext_noop('Not paging originator'));
+			$ext->add($extpaging, "_PAGE.", '', new ext_hangup());
 				
-				$ext->add('ext-paging', "PAGE${xtn}", '', new ext_dial("\${DB(DEVICE/${xtn}/dial)}", '5, A(beep)'));
-				$ext->add('ext-paging', "PAGE${xtn}", 'skipself', new ext_noop('Not paging originator'));
-				$ext->add('ext-paging', "PAGE${xtn}", '', new ext_hangup());
-				
-				$ext->add('ext-paging', "PAGE${xtn}", '', new ext_noop('Channel ${AVAILCHAN} is not available (state = ${AVAILSTATUS})'), 'AVAIL',101);
-			}
+			$ext->add($extpaging, "_PAGE.", '', new ext_noop('Channel ${AVAILCHAN} is not available (state = ${AVAILSTATUS})'), 'AVAIL',101);
+			//
 			// Now get a list of all the paging groups...
-			$sql = "SELECT page_group, force_page FROM paging_config";
+			$sql = "SELECT page_group, force_page, duplex FROM paging_config";
 			$paging_groups = $db->getAll($sql, DB_FETCHMODE_ASSOC);
 			foreach ($paging_groups as $thisgroup) {
 				$grp=trim($thisgroup['page_group']);
@@ -128,34 +266,92 @@
 						$local_dial[0] = rtrim($local_dial[0],"xX");
 					}
 
-					$dialstr .= "LOCAL/PAGE".trim($local_dial[0])."@ext-paging&";
+					$dialstr .= "LOCAL/PAGE".trim($local_dial[0])."@".$extpaging."&";
 				}
 				// It will always end with an &, so lets take that off.
 				$dialstr = rtrim($dialstr, "&");
-				$ext->add('ext-paging', "Debug", '', new ext_noop("dialstr is $dialstr"));
-				$ext->add('ext-paging', $grp, '', new ext_answer(''));
-				$ext->add('ext-paging', $grp, '', new ext_setvar("_FORCE_PAGE", ($thisgroup['force_page']?1:0)));
-				$ext->add('ext-paging', $grp, '', new ext_macro('user-callerid'));
+
+				if ($thisgroup['duplex']) {
+					$dialstr .= ",d";
+				}
+				$ext->add($extpaging, "Debug", '', new ext_noop("dialstr is $dialstr"));
+				$ext->add($extpaging, $grp, '', new ext_answer(''));
+				$ext->add($extpaging, $grp, '', new ext_setvar("_FORCE_PAGE", ($thisgroup['force_page']?1:0)));
+				$ext->add($extpaging, $grp, '', new ext_macro('user-callerid'));
 				// make AMPUSER inherited here, so we can skip the proper 'self' if using cidnum masquerading
-				$ext->add('ext-paging', $grp, '', new ext_setvar('_AMPUSER', '${AMPUSER}'));
-				$ext->add('ext-paging', $grp, '', new ext_page($dialstr));
+				$ext->add($extpaging, $grp, '', new ext_setvar('_AMPUSER', '${AMPUSER}'));
+				$ext->add($extpaging, $grp, '', new ext_page($dialstr));
 			}
 			
 		break;
 	}
 }
 
+function paging_get_autoanswer_defaults() {
+	global $db;
+
+	$sql = "SELECT * FROM paging_autoanswer WHERE useragent = 'default'";
+	$results = $db->getAll($sql,DB_FETCHMODE_ASSOC);
+	if(DB::IsError($results)) {
+		$results = array();
+	} 
+	return $results;
+}
+
+function paging_get_autoanswer_useragents($useragent = '') {
+	global $db;
+
+	$sql = "SELECT * FROM paging_autoanswer WHERE useragent != 'default' ";
+	if ($useragent != "") {
+		$sql .= "AND useragent = $useragent ";
+	}
+	$results = $db->getAll($sql,DB_FETCHMODE_ASSOC);
+	if(DB::IsError($results)) {
+		$results = array();
+	} 
+	return $results;
+}
+
 function paging_list() {
 	global $db;
 
-	$sql = "SELECT DISTINCT page_number FROM paging_groups ORDER BY page_number";
-	$results = $db->getAll($sql);
+	$sql = "SELECT page_group, description FROM paging_config ORDER BY page_group";
+	$results = $db->getAll($sql,DB_FETCHMODE_ASSOC);
 	if(DB::IsError($results)) {
 		$results = null;
+	} else {
+		foreach ($results as $key => $list) {
+			$results[$key][0] = $list['page_group'];
+		}
 	}
 	// There should be a checkRange here I think, but I haven't looked into it yet.
-//	return array('999', '998', '997');
+	//	return array('999', '998', '997');
 	return $results;
+}
+
+function paging_check_extensions($exten=true) {
+	global $active_modules;
+
+	$extenlist = array();
+	if (is_array($exten) && empty($exten)) {
+		return $extenlist;
+	}
+
+	$sql = "SELECT page_group, description FROM paging_config ";
+	if (is_array($exten)) {
+		$sql .= "WHERE page_group in ('".implode("','",$exten)."')";
+	}
+	$sql .= " ORDER BY page_group";
+	$results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
+
+	$type = isset($active_modules['paging']['type'])?$active_modules['paging']['type']:'setup';
+	foreach ($results as $result) {
+		$thisexten = $result['page_group'];
+		$extenlist[$thisexten]['description'] = _("Page Group: ").$result['description'];
+		$extenlist[$thisexten]['status'] = 'INUSE';
+		$extenlist[$thisexten]['edit_url'] = 'config.php?type='.urlencode($type).'setup&display=paging&selection='.urlencode($thisexten).'&action=modify';
+	}
+	return $extenlist;
 }
 
 function paging_get_devs($grp) {
@@ -181,12 +377,20 @@
 
 	$sql = "SELECT * FROM paging_config WHERE page_group='$grp'";
 	$results = $db->getRow($sql, DB_FETCHMODE_ASSOC);
-	if(DB::IsError($results)) 
+	if(DB::IsError($results)) {
 		$results = null;
+	}
+	$sql = "SELECT * FROM admin WHERE variable='default_page_grp' AND value='$grp'";
+	$default_group = $db->getRow($sql, DB_FETCHMODE_ASSOC);
+	if(DB::IsError($default_group)) {
+		$results['default_group'] = 0;
+	} else {
+		$results['default_group'] = empty($default_group) ? 0 : $default_group['value'];
+	}
 	return $results;
 }
 
-function paging_modify($oldxtn, $xtn, $plist, $force_page) {
+function paging_modify($oldxtn, $xtn, $plist, $force_page, $duplex, $description='', $default_group=0) {
 	global $db;
 
 	// Just in case someone's trying to be smart with a SQL injection.
@@ -196,7 +400,7 @@
 	paging_del($oldxtn);
 
 	// Now add it all back in.
-	paging_add($xtn, $plist, $force_page);
+	paging_add($xtn, $plist, $force_page, $duplex, $description, $default_group);
 
 	// Aaad we need a reload.
 	needreload();
@@ -218,11 +422,12 @@
 		var_dump($res);
 		die_freepbx("Error in paging_del(): ");
 	}
+	sql("DELETE FROM `admin` WHERE variable = 'default_page_grp' AND value = '$xtn'");
 	
 	needreload();
 }
 
-function paging_add($xtn, $plist, $force_page) {
+function paging_add($xtn, $plist, $force_page, $duplex, $description='', $default_group) {
 	global $db;
 
 	// $plist contains a string of extensions, with \n as a seperator. 
@@ -240,42 +445,123 @@
 		$db->query($sql);
 	}
 	
-	$sql = "INSERT INTO paging_config(page_group, force_page) VALUES ('$xtn', '$force_page')";
+	$description = addslashes(trim($description));
+	$sql = "INSERT INTO paging_config(page_group, force_page, duplex, description) VALUES ('$xtn', '$force_page', '$duplex', '$description')";
 	$db->query($sql);
 	
+	if ($default_group) {
+		sql("DELETE FROM `admin` WHERE variable = 'default_page_grp'");
+		sql("INSERT INTO `admin` (variable, value) VALUES ('default_page_grp', '$xtn')");
+	} else {
+		sql("DELETE FROM `admin` WHERE variable = 'default_page_grp' AND value = '$xtn'");
+	}
+	
 	needreload();
 }
 
-	
-// this can be removed in 2.2 and put back to just runModuleSQL which is in admin/functions.inc.php
-// I didn't want to do it in 2.1 as there's a significant user base out there, and it will break
-// them if we do it here.
-
-function pagingrunModuleSQL($moddir,$type){
-        global $db;
-        $data='';
-        if (is_file("modules/{$moddir}/{$type}.sql")) {
-                // run sql script
-                $fd = fopen("modules/{$moddir}/{$type}.sql","r");
-                while (!feof($fd)) {
-                        $data .= fread($fd, 1024);
-                }
-                fclose($fd);
-
-                preg_match_all("/((SELECT|INSERT|UPDATE|DELETE|CREATE|DROP).*);\s*\n/Us", $data, $matches);
-
-                foreach ($matches[1] as $sql) {
-                                $result = $db->query($sql);
-                                if(DB::IsError($result)) {
-                                        return false;
-                                }
-                }
-                return true;
-        }
-                return true;
-}
-
-
-
+function paging_check_default($extension) {
+	$sql = "SELECT ext FROM paging_groups WHERE ext = '$extension' AND page_number = (SELECT value FROM admin WHERE variable = 'default_page_grp' limit 1)";
+	$results = sql($sql,"getAll");
+	return (count($results) ? 1 : 0);
+}
+
+function paging_set_default($extension, $value) {
+	$default_group = sql("SELECT value FROM `admin` WHERE variable = 'default_page_grp' limit 1", "getOne");
+	if ($default_group == '') {
+		return false;
+	}
+	sql("DELETE FROM paging_groups WHERE ext = '$extension' AND page_number = '$default_group'");
+	if ($value == 1) {
+		sql("INSERT INTO paging_groups (page_number, ext) VALUES ('$default_group', '$extension')");
+	}
+}
+	
+function paging_configpageinit($pagename) {
+	global $currentcomponent;
+
+	$action = isset($_REQUEST['action'])?$_REQUEST['action']:null;
+	$extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null;
+	$extension = isset($_REQUEST['extension'])?$_REQUEST['extension']:null;
+	$tech_hardware = isset($_REQUEST['tech_hardware'])?$_REQUEST['tech_hardware']:null;
+
+	// We only want to hook 'devices' or 'extensions' pages.
+	if ($pagename != 'devices' && $pagename != 'extensions') {
+		return true;
+	}
+
+	if ($tech_hardware != null && ($pagename == 'extensions' || $pagename == 'devices')) {
+		paging_applyhooks();
+		$currentcomponent->addprocessfunc('paging_configprocess', 8);
+	} elseif ($action=="add") {
+		// We don't need to display anything on an 'add', but we do need to handle returned data.
+		$currentcomponent->addprocessfunc('paging_configprocess', 8);
+	} elseif ($extdisplay != '') {
+		// We're now viewing an extension, so we need to display _and_ process.
+		paging_applyhooks();
+		$currentcomponent->addprocessfunc('paging_configprocess', 8);
+	}
+}
+
+function paging_applyhooks() {
+	global $currentcomponent;
+
+	// Add the 'process' function - this gets called when the page is loaded, to hook into 
+	// displaying stuff on the page.
+	$currentcomponent->addoptlistitem('page_group', '0', _("Exclude"));
+	$currentcomponent->addoptlistitem('page_group', '1', _("Include"));
+	$currentcomponent->setoptlistopts('page_group', 'sort', false);
+
+	$currentcomponent->addguifunc('paging_configpageload');
+}
+
+/*
+*/
+// This is called before the page is actually displayed, so we can use addguielem().
+function paging_configpageload() {
+	global $currentcomponent;
+
+	// Init vars from $_REQUEST[]
+	$action = isset($_REQUEST['action']) ? $_REQUEST['action']:null;
+	$extdisplay = isset($_REQUEST['extdisplay']) ? $_REQUEST['extdisplay']:null;
+	
+	// Don't display this stuff it it's on a 'This xtn has been deleted' page.
+	if ($action != 'del') {
+
+		$default_group = sql("SELECT value FROM `admin` WHERE variable = 'default_page_grp'", "getOne");
+		$section = _("Default Group Inclusion");
+		if ($default_group != "") {
+			$in_default_page_grp = paging_check_default($extdisplay);
+			$currentcomponent->addguielem($section, new gui_selectbox('in_default_page_grp', $currentcomponent->getoptlist('page_group'), $in_default_page_grp, _('Default Page Group'), _('You can include or exclude this extension/device from being part of the default page group when creating or editing.'), false));
+		} 
+	}
+}
+
+function paging_configprocess() {
+	global $db;
+
+	//create vars from the request
+	//
+	$action = isset($_REQUEST['action'])?$_REQUEST['action']:null;
+	$ext = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null;
+	$extn = isset($_REQUEST['extension'])?$_REQUEST['extension']:null;
+	$in_default_page_grp = isset($_REQUEST['in_default_page_grp'])?$_REQUEST['in_default_page_grp']:false;
+
+	if (($_REQUEST['display'] == 'devices') && $action == 'add') {
+		$extdisplay = $_REQUEST['deviceid'];
+	} else {
+		$extdisplay = ($ext=='') ? $extn : $ext;
+	}
+
+	if ($action == "add" || $action == "edit") {
+		if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) {
+			if ($in_default_page_grp !== false) {
+				paging_set_default($extdisplay, $in_default_page_grp);
+			}
+		}
+	} elseif ($action == "del") {
+		$sql = "DELETE FROM paging_groups WHERE ext = '$extdisplay'";
+		sql($sql);
+	}
+}
 
 ?>

Added: freepbx-modules/trunk/modules/paging/i18n/it_IT/LC_MESSAGES/paging.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/paging/i18n/it_IT/LC_MESSAGES/paging.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/paging/i18n/it_IT/LC_MESSAGES/paging.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/paging/i18n/it_IT/LC_MESSAGES/paging.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/paging/i18n/it_IT/LC_MESSAGES/paging.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/paging/i18n/it_IT/LC_MESSAGES/paging.po (added)
+++ freepbx-modules/trunk/modules/paging/i18n/it_IT/LC_MESSAGES/paging.po Sun May 18 19:52:05 2008
@@ -1,0 +1,91 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-01-26 15:16+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: Italian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: functions.inc.php:23
+msgid ""
+"There is a problem with install.sql, cannot re-create databases. Contact "
+"support\n"
+msgstr "C'è un problema con install.sql, non posso ricreare il database. Contattare il supporto.\n"
+
+#: functions.inc.php:26
+msgid "Database was deleted! Recreated successfully.<br>\n"
+msgstr "Il Database era stato cancellato! Ricreato con successo.<br>\n"
+
+#: page.paging.php:57
+msgid ""
+"This module is for specific phones that are capable of Paging or Intercom. "
+"This section is for configuring group paging, intercom is configured through "
+"<strong>Feature Codes</strong>.<br /><br />The current list of supported "
+"phones is GXP-2000 with firmware 1.0.13 or higher, Snom phones with 'recent' "
+"firmware, Polycom phones (provisioned to auto answer), Linksys/Sipura "
+"phones, and a few various others. Any phone that is always set to auto-"
+"answer should also work (such as the console extension if configured)."
+msgstr "Questo modulo è valido per i telefoni che sono in grado di utilizzare il Paging o l'Intercom. Questa sezione è per configurare il gruppo Page, l'intercom si può configurare attraverso i <strong>Codici Servizi</strong>.<br/><br/>Al momento sono supportati solo i telefoni Grandstream GXP2000 con firmware 1.0.13 o superiore, Snom, Polycom e Linksys/Sipura. Tutti i telefoni che hanno comunque la possibilità di utilizzare l'auto-answer dovrebbere funzionare (come anche la console se configurata)."
+
+#: page.paging.php:69
+msgid "Delete Group"
+msgstr "Elimina Gruppo"
+
+#: page.paging.php:84
+msgid "Modify Paging Group"
+msgstr "Modifica Gruppo Paging"
+
+#: page.paging.php:84 page.paging.php:149
+msgid "Add Paging Group"
+msgstr "Aggiungi Gruppo Paging"
+
+#: page.paging.php:85
+msgid "Paging Extension"
+msgstr "Interno Paging"
+
+#: page.paging.php:86
+msgid "The number users will dial to page this group"
+msgstr "Il numero che gli utenti dovranno chiamare per effettuare il page su questo gruppo"
+
+#: page.paging.php:89
+msgid "extension list:"
+msgstr "Lista interni:"
+
+#: page.paging.php:89
+msgid ""
+"Select extension(s)to page. If using users and devices mode, this will be "
+"the device number to page, potentially confusing if extension numbers and "
+"device numbers don't match. Use Ctrl key to select multiple.."
+msgstr "Selezionare gli interni da includere nel gruppo Page. Se si utilizza la modalità utenti e apparati (users and devices), questo dovrà essere il numero dell'apparato. Utilizzare il tasto Ctrl per selezioni multiple."
+
+#: page.paging.php:108
+msgid "Force if busy"
+msgstr "Forza se occupato"
+
+#: page.paging.php:109
+msgid ""
+"If selected, will not check if the device is in use before paging it. This "
+"means conversations can be interrupted by a page (depending on how the "
+"device handles it). This is useful for \"emergency\" paging groups "
+msgstr "Se selezionato, non verrà controllato se gli apparati sono in uso. Questo significa che una conversazione potrebbe interrompersi durante una chiamata page (dipende in che modo l'apparato gestisce la situazione). Questo è utile per gruppi page di \"emergenza\"."
+
+#: page.paging.php:158
+msgid "Page Group"
+msgstr "Gruppo Page"
+
+#: page.paging.php:161
+msgid "Paging and Intercom"
+msgstr "Paging e Intercom"
+
+msgid "Submit Changes"
+msgstr "Invia"

Modified: freepbx-modules/trunk/modules/paging/install.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/paging/install.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/paging/install.php (original)
+++ freepbx-modules/trunk/modules/paging/install.php Sun May 18 19:52:05 2008
@@ -21,10 +21,14 @@
 $fcc->update();
 unset($fcc);	
 
-$sql = "CREATE TABLE IF NOT EXISTS paging_overview 
-	( config VARCHAR(50), 
-	  detail VARCHAR(25)
-	)";
+// Remove old tables that were never used
+//
+$sql = "DROP TABLE IF EXISTS paging_phones";
+$result = $db->query($sql);
+if(DB::IsError($result)) {
+	die_freepbx($result->getDebugInfo());
+}
+$sql = "DROP TABLE IF EXISTS paging_overview";
 $result = $db->query($sql);
 if(DB::IsError($result)) {
 	die_freepbx($result->getDebugInfo());
@@ -32,18 +36,24 @@
 
 $sql = "CREATE TABLE IF NOT EXISTS paging_groups 
 	( page_number VARCHAR(50), 
-	  ext VARCHAR(25)
+	  ext VARCHAR(25),
+		PRIMARY KEY (page_number, ext)
 	)";
 $result = $db->query($sql);
 if(DB::IsError($result)) {
 	die_freepbx($result->getDebugInfo());
 }
 
-$sql = "CREATE TABLE IF NOT EXISTS paging_phones 
-	( phone_name VARCHAR(50), 
-	  priority INT, 
-		command VARCHAR(50)
-	)";
+// Create table used to change defaults and customize
+// for certain phone types
+//
+$sql = "
+CREATE TABLE IF NOT EXISTS `paging_autoanswer` (
+	`useragent` VARCHAR( 255 ) NOT NULL ,
+	`var` VARCHAR( 20 ) NOT NULL ,
+	`setting` VARCHAR( 255 ) NOT NULL ,
+	PRIMARY KEY ( `useragent` , `var` )
+);";
 $result = $db->query($sql);
 if(DB::IsError($result)) {
 	die_freepbx($result->getDebugInfo());
@@ -62,7 +72,10 @@
 	
 	$sql = "CREATE TABLE IF NOT EXISTS paging_config 
 		( page_group VARCHAR(255), 
-	  	force_page INTEGER(1) NOT NULL
+	  	force_page INTEGER(1) NOT NULL,
+			duplex     INTEGER(1) NOT NULL default '0',
+			description VARCHAR(255) NOT NULL default '',
+			PRIMARY KEY (page_group)
 		)";
 	$result = $db->query($sql);
 	if(DB::IsError($result)) {
@@ -70,38 +83,55 @@
 	}
 
 	// insert default values
-	$sql = "INSERT INTO paging_config  SELECT DISTINCT page_number, 0 FROM paging_groups;";
+	$sql = "INSERT INTO paging_config (page_group, force_page, duplex, description)  SELECT DISTINCT page_number, 0, 0, '' FROM paging_groups";
 	$result = $db->query($sql);
 	if(DB::IsError($result)) {
 		die_freepbx($result->getDebugInfo());
 	}
 }
+
+// Set the initial default values, if already 
+
 // These are the three most common ways of auto answering.
-// Set them up for now - this will all change when paging gets modified
-// (I don't think this is even being used)
+// If the table is already populated then error will be ignored and user data will not get altered
 //
-$sql = "INSERT INTO paging_phones VALUES ('GXP-2000', 1, 'Set(SIPADDHEADER=\"Call-Info: answer-after=0\")')";
+$sql = "INSERT INTO paging_autoanswer (useragent, var, setting) VALUES ('default', 'CALLINFO', 'Call-Info: <uri>\\\\;answer-after=0')";
 $result = $db->query($sql);
-if(DB::IsError($result)) {
-	die_freepbx($result->getDebugInfo());
-}
-$sql = "INSERT INTO paging_phones VALUES ('Polycom', 1, 'Set(ALERT_INFO=\"Ring Answer\")')";
+$sql = "INSERT INTO paging_autoanswer (useragent, var, setting) VALUES ('default', 'ALERTINFO', 'Alert-Info: Ring Answer')";
 $result = $db->query($sql);
-if(DB::IsError($result)) {
-	die_freepbx($result->getDebugInfo());
-}
-$sql = "INSERT INTO paging_phones VALUES ('Snom', 1, 'Set(SIP_URI_OPTIONS=\"intercom=true\")')";
+$sql = "INSERT INTO paging_autoanswer (useragent, var, setting) VALUES ('default', 'SIPURI', 'intercom=true')";
 $result = $db->query($sql);
-if(DB::IsError($result)) {
-	die_freepbx($result->getDebugInfo());
+
+// Add dulex field
+//
+$sql = "SELECT duplex FROM paging_config";
+$result = $db->getRow($sql, DB_FETCHMODE_ASSOC);
+if (DB::IsError($result)) {
+	$sql = "ALTER TABLE paging_config ADD duplex INTEGER(1) NOT NULL default '0'";
+	$results = $db->query($sql);
+	if(DB::IsError($results)) {
+	        die_freepbx($results->getMessage());
+	}
 }
 
-// Now mark the version - again, not even sure if this is in use anymore
+// Add description field
 //
-$sql = "INSERT INTO paging_overview VALUES ('version', 1)";
+$sql = "SELECT description FROM paging_config";
+$result = $db->getRow($sql, DB_FETCHMODE_ASSOC);
+if (DB::IsError($result)) {
+	$sql = "ALTER TABLE paging_config ADD description VARCHAR(255) NOT NULL default ''";
+	$results = $db->query($sql);
+	if(DB::IsError($results)) {
+	        die_freepbx($results->getMessage());
+	}
+}
+// Make sure primary keys are set, they were not originally. Don't check for error,
+// if they exist it will give an error
+//
+$sql = "ALTER TABLE `paging_groups` ADD PRIMARY KEY ( `page_number` , `ext` )";
 $result = $db->query($sql);
-if(DB::IsError($result)) {
-	die_freepbx($result->getDebugInfo());
-}
+
+$sql = "ALTER TABLE `paging_config` ADD PRIMARY KEY ( `page_group` )";
+$result = $db->query($sql);
 
 ?>

Modified: freepbx-modules/trunk/modules/paging/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/paging/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/paging/module.xml (original)
+++ freepbx-modules/trunk/modules/paging/module.xml Sun May 18 19:52:05 2008
@@ -1,11 +1,19 @@
 <module>
 	<rawname>paging</rawname>
 	<name>Paging and Intercom</name>
-	<version>1.6.6.2</version>
+	<version>2.4.0.4</version>
 	<type>setup</type>
 	<category>Internal Options &amp; Configuration</category>
 	<changelog>
-		*1.6.6.2* #2437 answer channle, page doesn't - and fix js validation allowing blank page groups
+		*2.4.0.4* #2758 don't show intercom instructions when disabled, bogus codes were displayed
+		*2.4.0.3* added depends on 2.4.0
+		*2.4.0.2* small fix so duplicate extension link is displayed when conflicts are found
+		*2.4.0.1* #2559 typo in install script, extra \\ needed (you must un-install and re-install or delete paging_autoanswer table entries to take effect)
+		*2.4.0* #2537, #2533, add default paging group w/ hooks to extensions/devices, fix jv validation error, it translation, remove extension/device from pagegroups upon delete
+		*2.1.0* Add page group description, add extension and destination registry call-backs, add SQL based answer variable defaults and phone specific ones
+		*2.0.1* Don't allow incoming intercom if DND is set and fix Aastra intercom going to auto mute
+		*2.0.0* #1926, #1978 fix deficiencies in intercom, add support for explicit allow and deny, expand phones that can auto-answer
+		*1.6.7* Add support for duplex paging
 		*1.6.6.1* #2376 enable/disable code broke in 1.6.6 and add user-callerid to get proper cid on intercom
 		*1.6.6* #2376 only interecept *80nnn for local extensions so branch offices can be intercomed
 		*1.6.5.2* bump for rc1
@@ -20,15 +28,14 @@
 		*1.5.1* Fixed bug with saving paging group
 		*1.5* First release for FreePBX 2.2 - Fixed compatibility issue with new UI
 	</changelog>
-	<requirements>
-		<version>2.3.0beta2</version>
-	</requirements>
+	<depends>
+		<version>2.4.0</version>
+	</depends>
 	<description>Allows creation of paging groups to make announcements using the speaker built into most SIP phones. 
-	
-	Also creates an Intercom feature code that can be used as a prefix to talk directly to one person, as well as optional feature codes to block/allow intercom calls.</description>
+	Also creates an Intercom feature code that can be used as a prefix to talk directly to one person, as well as optional feature codes to block/allow intercom calls to all users as well as blocking specific users or only allowing specific users.</description>
 	<menuitems>
 		<paging>Paging and Intercom</paging>
 	</menuitems>
-	<location>release/2.3/paging-1.6.6.1.tgz</location>
-	<md5sum>608f60ae27fe977ed4d0043ecec1a79d</md5sum>
+	<location>release/2.4/paging-2.4.0.3.tgz</location>
+	<md5sum>bed204e4f54466e6b941817ab58a9dc9</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/paging/page.paging.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/paging/page.paging.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/paging/page.paging.php (original)
+++ freepbx-modules/trunk/modules/paging/page.paging.php Sun May 18 19:52:05 2008
@@ -1,5 +1,5 @@
 <?php 
-/* $Id: page.paging.php 5384 2007-12-10 18:39:19Z p_lindheimer $ */
+/* $Id: page.paging.php 5731 2008-03-28 21:53:16Z p_lindheimer $ */
 //Copyright (C) 2006 Rob Thomas (xrobau at gmail.com)
 //
 //This program is free software; you can redistribute it and/or
@@ -17,10 +17,13 @@
 
 $action = isset($_REQUEST['action'])?$_REQUEST['action']:'';
 $force_page = isset($_REQUEST['force_page']) ? $_REQUEST['force_page']:0;
+$duplex = isset($_REQUEST['duplex']) ? $_REQUEST['duplex']:0;
+$default_group = isset($_REQUEST['default_group']) ? $_REQUEST['default_group']:0;
 $selection = isset($_REQUEST['selection'])?$_REQUEST['selection']:'';
 $pagelist = isset($_REQUEST['pagelist'])?$_REQUEST['pagelist']:'';
 $pagenbr = isset($_REQUEST['pagenbr'])?$_REQUEST['pagenbr']:'';
 $pagegrp = isset($_REQUEST['pagegrp'])?$_REQUEST['pagegrp']:'';
+$description = isset($_REQUEST['description'])?$_REQUEST['description']:'';
 
 ?>
 
@@ -43,8 +46,21 @@
 		paging_show($selection, $display, $type);
 		break;
 	case "submit":
-		paging_modify($pagegrp, $pagenbr, $pagelist, $force_page);
-		redirect_standard();
+		//TODO: issue, we are deleting and adding at the same time so remeber later to check
+		//      if we are deleting a destination
+		$usage_arr = array();
+		if (trim($pagegrp) != trim($pagenbr)) {
+			$usage_arr = framework_check_extension_usage($pagenbr);
+		}
+		if (!empty($usage_arr)) {
+			$conflict_url = array();
+			$conflict_url = framework_display_extension_usage_alert($usage_arr);
+			paging_sidebar($selection, $type, $display);
+			paging_show($pagegrp, $display, $type, $conflict_url);
+		} else {
+			paging_modify($pagegrp, $pagenbr, $pagelist, $force_page, $duplex, $description, $default_group);
+			redirect_standard();
+		}
 		break;
 	default:
 		paging_sidebar($selection, $type, $display);
@@ -52,14 +68,35 @@
 }
 
 function paging_text() {
-?>
-<p><?php echo _("This module is for specific phones that are capable of Paging or Intercom. This section is for configuring group paging, intercom is configured through <strong>Feature Codes</strong>.<br /><br />The current list of supported phones is GXP-2000 with firmware 1.0.13 or higher, Snom phones with 'recent' firmware, Polycom phones (provisioned to auto answer), Linksys/Sipura phones, and a few various others. Any phone that is always set to auto-answer should also work (such as the console extension if configured).") ?></p>
+
+	$fcc = new featurecode('paging', 'intercom-prefix');
+	$intercom_code = $fcc->getCodeActive();
+	unset($fcc);
+	$fcc = new featurecode('paging', 'intercom-on');
+	$oncode = $fcc->getCodeActive();
+	unset($fcc);
+	$fcc = new featurecode('paging', 'intercom-off');
+	$offcode = $fcc->getCodeActive();
+	unset($fcc);
+?>
+<p>
+<?php 
+	echo _("This module is for specific phones that are capable of Paging or Intercom. This section is for configuring group paging, intercom is configured through <strong>Feature Codes</strong>. Intercom must be enabled on a handset before it will allow incoming calls. It is possible to restrict incoming intercom calls to specific extensions only, or to allow intercom calls from all extensions but explicitly deny from specific extensions.<br /><br />This module should work with Aastra, Grandstream, Linksys/Sipura, Mitel, Polycom, SNOM , and possibly other SIP phones (not ATAs). Any phone that is always set to auto-answer should also work (such as the console extension if configured).") 
+?><br /><br /><?php
+	if ($intercom_code != '') {
+		echo sprintf(_("Example usage:<br /><table><tr><td><strong>%snnn</strong>:</td><td>Intercom extension nnn</td></tr><tr><td><strong>%s</strong>:</td><td>Enable all extensions to intercom you (except those explicitly denied)</td></tr><tr><td><strong>%snnn</strong>:</td><td>Explicitly allow extension nnn to intercom you (even if others are disabled)</td></tr><tr><td><strong>%s</strong>:</td><td>Disable all extensions from intercoming you (except those explicitly allowed)</td></tr><tr><td><strong>%snnn</strong>:</td><td>Explicitly deny extension nnn to intercom you (even if generally enabled)</td></tr></table>"),$intercom_code,$oncode,$oncode,$offcode,$offcode);
+	} else {
+		echo _("Intercom mode is currently disabled, it can be enabled in the Feature Codes Panel.");
+	}
+?>
+</p>
 <?php
 }
 
-function paging_show($xtn, $display, $type) {
+function paging_show($xtn, $display, $type, $conflict_url=array()) {
 	if ($xtn) {
-		$rows = count(paging_get_devs($xtn))+1;
+		$selected = paging_get_devs($xtn);
+		$rows = count($selected)+1;
 		if ($rows < 5) 
 			$rows = 5;
 		if ($rows > 20)
@@ -69,10 +106,17 @@
 	} else {
 		$rows = 5;
 	}
+	if (!empty($conflict_url)) {
+		echo "<h5>"._("Conflicting Extensions")."</h5>";
+		echo implode('<br />',$conflict_url);
+	}
 	
 	$config = paging_get_pagingconfig($xtn);
-	
+
 	$force_page = $config['force_page'];
+	$duplex = $config['duplex'];
+	$default_group = $config['default_group'];
+	$description = $config['description'];
 	
 	echo "<form name='page_edit' action='".$_SERVER['PHP_SELF']."' method='post' onsubmit='return page_edit_onsubmit();'>\n";
 	echo "<input type='hidden' name='display' value='${display}'>\n";
@@ -81,17 +125,23 @@
 	echo "<input type='hidden' name='action' value='submit'>\n";
 	echo "<table><tr><td colspan=2><h5>";
 	echo ($xtn)?_("Modify Paging Group"):_("Add Paging Group")."</h5></td></tr>\n";  ?>
-	<tr><td><a href='#' class='info'><?php echo _("Paging Extension") ?><span>
-	<?php echo _("The number users will dial to page this group") ?></span></a></td>
-	<td><input size='5' type='text' name='pagenbr' value='<?php echo $xtn ?>'></td>
+	<tr>
+		<td><a href='#' class='info'><?php echo _("Paging Extension") ?><span><?php echo _("The number users will dial to page this group") ?></span></a></td>
+		<td><input size='5' type='text' name='pagenbr' value='<?php echo $xtn ?>'></td>
 	</tr>
-	<tr><td valign='top'><a href='#' class='info'><?php echo _("extension list:")."<span><br>"._("Select extension(s)to page. If using users and devices mode, this will be the device number to page, potentially confusing if extension numbers and device numbers don't match. Use Ctrl key to select multiple..") ?> 
+	<tr>
+    <td> <a href="#" class="info"><?php echo _("Group Description:")?>:<span><?php echo _("Provide a descriptive title for this Page Group.")?></span></a></td>
+		<td><input size="24" maxlength="24" type="text" name="description" id="description" value="<?php echo htmlspecialchars($description); ?>"></td>
+	</tr>
+	<tr><td valign='top'><a href='#' class='info'><?php echo _("Device List:")."<span><br>"._("Select Device(s)to page. This is the phone that should be paged. In most installations, this is the same as the Extension. If you are configured to use \"Users & Devices\" this is the acutal Device and not the User.  Use Ctrl key to select multiple..") ?> 
 	<br><br></span></a></td>
 	<td valign="top"> 
 	
 	<select multiple="multiple" name="pagelist[]" id="xtnlist" >
 	<?php 
-	$selected = paging_get_devs($xtn); 
+	if (!isset($selected)) {
+		$selected = paging_get_devs($xtn); 
+	}
 	if (is_null($selected)) $selected = array();
 	foreach (core_devices_list() as $device) {
 		echo '<option value="'.$device[0].'" ';
@@ -107,6 +157,14 @@
 	<tr><td><label for="force_page"><a href='#' class='info'><?php echo _("Force if busy") ?><span>
 	<?php echo _("If selected, will not check if the device is in use before paging it. This means conversations can be interrupted by a page (depending on how the device handles it). This is useful for \"emergency\" paging groups ") ?></span></a></label></td>
 	<td><input type='checkbox' name='force_page' id="force_page" value='1' <?php if ($force_page) { echo 'CHECKED'; } ?>></td>
+
+	<tr><td><label for="duplex"><a href='#' class='info'><?php echo _("Duplex") ?><span>
+	<?php echo _("Paging is typically one way for annoucements only. Checking this will make the paging duplex, allowing all phones in the paging group to be able to talk and be heard by all. This makes it like an \"instant conference\"") ?></span></a></label></td>
+	<td><input type='checkbox' name='duplex' id="duplex" value='1' <?php if ($duplex) { echo 'CHECKED'; } ?>></td>
+
+	<tr><td><label for="default_group"><a href='#' class='info'><?php echo _("Default Page Group") ?><span>
+	<?php echo _("Each PBX system can have a single Default Page Group. If specified, extensions can be automatically added (or removed) from this group in the Extensions (or Devices) tab.<br />Making this group the default will uncheck the option from the current default group if specified.") ?></span></a></label></td>
+	<td><input type='checkbox' name='default_group' id="default_group" value='1' <?php if ($default_group) { echo 'CHECKED'; } ?>></td>
 	
 	<tr>
 	<td colspan="2"><br><h6><input type="submit" name="Submit" type="button" value="<?php echo _("Submit Changes")?>"></h6></td>
@@ -130,7 +188,7 @@
 		if (theForm.xtnlist.options[i].selected) selected += 1;
 	}
 	if (selected < 1) {
-		theForm.xtnlist.focus();
+    theForm.xtnlist.focus();
 		alert(msgInvalidExtList);
 		return false;
 	}
@@ -152,11 +210,11 @@
 	$presults = paging_list();
 	if ($presults) {
 		foreach ($presults as $grouparr) {
-			$group = $grouparr[0];
+			$group = $grouparr['page_group'];
 			echo "<li><a id=\"".($selection==$group ? 'current':'std');
 			echo "\" href=\"config.php?type=${type}&amp;display=";
 			echo "${display}&amp;selection=${group}&amp;action=modify\">";
-			echo _("Page Group")." ${group}</a></li>";
+			echo $group." ".((trim($grouparr['description']) != '')?htmlspecialchars($grouparr['description']):_("Page Group"))."</a></li>";
 		}
 	} 
 	echo "</ul></div><div class='content'><h2>"._("Paging and Intercom")."</h2>\n";

Modified: freepbx-modules/trunk/modules/paging/uninstall.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/paging/uninstall.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/paging/uninstall.php (original)
+++ freepbx-modules/trunk/modules/paging/uninstall.php Sun May 18 19:52:05 2008
@@ -53,4 +53,12 @@
 }
 echo "done<br>\n";
 
+echo "dropping table paging_autoanswer..";
+$sql = "DROP TABLE IF EXISTS paging_autoanswer";
+$result = $db->query($sql);
+if(DB::IsError($result)) {
+	echo "ERROR DELETING TABLE: ".$result->getDebugInfo();
+}
+echo "done<br>\n";
+
 ?>

Modified: freepbx-modules/trunk/modules/parking/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/parking/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/parking/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/parking/functions.inc.php Sun May 18 19:52:05 2008
@@ -1,15 +1,17 @@
 <?php /* $Id: functions.inc.php 2188 2006-07-27 02:21:52Z p_lindheimer $ */
-
-function parking_destinations() {
-}
 
 /* 	Generates dialplan for parkinglot
 	We call this with retrieve_conf
 */
+
 function parking_get_config($engine) {
 	global $db;
+	global $amp_conf;
 	global $ext;  // is this the best way to pass this?
 	global $asterisk_conf;
+	global $core_conf;
+	global $version;
+
 	switch($engine) {
 		case "asterisk":
 
@@ -33,44 +35,58 @@
 		$parkpos1	= $parkext + 1;
 		$parkpos2	= $parkpos1 + $numslots;
 
-		//open the file and truncate. If diabled, file will be deleted this way
-		//AND GET THE ENV VARIABLES TO CALL THIS BY
-
-		$filename = isset($asterisk_conf["astetcdir"]) && $asterisk_conf["astetcdir"] != '' ? rtrim($asterisk_conf["astetcdir"],DIRECTORY_SEPARATOR) : "/etc/asterisk";
-		$filename .= "/parking_additional.inc";
-		$fh = fopen($filename, "w+");
-		fwrite($fh, ";*** WARNING: DO NOT HAND EDIT THIS FILE IT IS AUTO-GENERATD ***\n;\n");
-
 		if ($parkingenabled) {
 			// TODO: lookup ampportal.conf variables for this, don't hard code
 			// first write features_additional.inc include file
 			//
-			fwrite($fh, "parkext => ".$parkext."\n");
-			fwrite($fh, "parkpos => ".$parkpos1."-".$parkpos2."\n");
-			fwrite($fh, "context => ".$parkingcontext."\n");
+			$core_conf->addFeatureGeneral('parkext',$parkext);
+			$core_conf->addFeatureGeneral('parkpos',$parkpos1."-".$parkpos2);
+			$core_conf->addFeatureGeneral('context',$parkingcontext);
+
 			if ($parkingtime) {
-				fwrite($fh, "parkingtime => ".$parkingtime."\n");
+				$core_conf->addFeatureGeneral('parkingtime',$parkingtime);
 			}
 
 			// Now generate dialplan
 			$ext->add($contextname, "t", '', new ext_noop('Parked Call Timed Out and Got Orphaned'));
-			if ($parkalertinfo) {
-				$ext->add($contextname, "t", '', new ext_setvar('__ALERT_INFO',str_replace(';', '\;', $parkalertinfo)));
+
+			// If we have an appropriate Asterisk patch, set paraemters for Asterisk
+			//
+			if (isset($amp_conf["PARKINGPATCH"]) && strtolower($amp_conf["PARKINGPATCH"]) == 'true') {
+				if ($parkalertinfo) {
+					$core_conf->addFeatureGeneral('parkreturnalertinfo',$parkalertinfo);
+				}
+				if ($parkcid) {
+					$core_conf->addFeatureGeneral('parkreturncidprefix',$parkcid);
+				}
+			// No patch, do the default for orphaned calls
+			} else {
+				if ($parkalertinfo) {
+					$ext->add($contextname, "t", '', new ext_setvar('__ALERT_INFO',str_replace(';', '\;', $parkalertinfo)));
+				}
+				if ($parkcid) {
+					$ext->add($contextname, "t", '', new ext_setvar('CALLERID(name)', $parkcid.'${CALLERID(name)}'));
+				}
 			}
-			if ($parkcid) {
-				$ext->add($contextname, "t", '', new ext_setvar('CALLERID(name)', $parkcid.'${CALLERID(name)}'));
-			}
+
 			if ($parkingannmsg) {
 				$ext->add($contextname, "t", '', new ext_playback($parkingannmsg));
 			}
 			// goto the destination here
 			//
 			$ext->add($contextname, "t", '', new ext_goto($goto));
-		} else {
-		fwrite($fh, ";***              PARKING LOT HAS BEEN DISABLED              ***\n");
+
+			// Asterisk 1.4 requires hints to be generated for parking
+			//
+			if (version_compare($version, "1.4", "ge")) {
+				$parkhints = 'park-hints';
+				$ext->addInclude('from-internal-additional', $parkhints); // Add the include from from-internal
+				for ($slot = $parkpos1; $slot <= $parkpos2; $slot++) {
+					$ext->addHint($parkhints, $slot, "park:$slot@$parkingcontext");
+					$ext->add($parkhints, $slot, '', new ext_parkedcall($slot));
+				}
+			}
 		}
-		fclose($fh);
-		chmod($filename, 0660);
 		break;
 	}
 }
@@ -125,6 +141,32 @@
 	return $results;
 }
 
+function parking_check_destinations($dest=true) {
+	global $active_modules;
+
+	$destlist = array();
+	if (is_array($dest) && empty($dest)) {
+		return $destlist;
+	}
+	$sql = "SELECT keyword, data FROM parkinglot WHERE keyword = 'goto' ";
+	if ($dest !== true) {
+		$sql .= "AND data in ('".implode("','",$dest)."')";
+	}
+	$results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
+
+	$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup';
+
+	foreach ($results as $result) {
+		$thisdest = $result['data'];
+		$destlist[] = array(
+			'dest' => $thisdest,
+			'description' => 'Parking Lot',
+			'edit_url' => 'config.php?type='.$type.'&display=parking',
+		);
+	}
+	return $destlist;
+}
+
 // Duly stolen from the queues module (since I can't count on it being there, but would not be bad to stuff back in the common include
 //
 function parking_timeString($seconds, $full = false) {

Added: freepbx-modules/trunk/modules/parking/i18n/it_IT/LC_MESSAGES/parking.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/parking/i18n/it_IT/LC_MESSAGES/parking.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/parking/i18n/it_IT/LC_MESSAGES/parking.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/parking/i18n/it_IT/LC_MESSAGES/parking.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/parking/i18n/it_IT/LC_MESSAGES/parking.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/parking/i18n/it_IT/LC_MESSAGES/parking.po (added)
+++ freepbx-modules/trunk/modules/parking/i18n/it_IT/LC_MESSAGES/parking.po Sun May 18 19:52:05 2008
@@ -1,0 +1,164 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-01-26 17:55+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: Italian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: page.parking.php:61
+msgid "Parking Lot Options"
+msgstr "Opzioni Parcheggio"
+
+#: page.parking.php:63
+msgid "Enable Parking Lot Feature"
+msgstr "Attiva Parcheggio Chiamate"
+
+#: page.parking.php:63
+msgid "Check this box to enable the parking feature"
+msgstr "Spuntare questa opzione per attivare il parcheggio delle chiamate"
+
+#: page.parking.php:67
+msgid "Parking Lot Extension:"
+msgstr "Interno Parcheggio:"
+
+#: page.parking.php:68
+msgid "This is the extension where you will transfer a call to park it."
+msgstr "Il numero dove si chiamerà per parcheggiare le chiamate."
+
+#: page.parking.php:73
+msgid "Number of Slots:"
+msgstr "Numero intervallo interni:"
+
+#: page.parking.php:73
+msgid ""
+"The total number of parking lot spaces to configure. Example, if 70 is the "
+"extension and 8 slots are configured, the parking slots will be 71-79"
+msgstr "Il numero totale di interni parcheggio da configurare. Esempio, se 70 è l'interno parcheggio e 8 è l'intervallo interni, dal 71 al 79 saranno gli interni disponibili"
+
+#: page.parking.php:86
+msgid "Parking Timeout:"
+msgstr "Timout Parcheggio:"
+
+#: page.parking.php:86
+msgid ""
+"The timeout period that a parked call will attempt to ring back the original "
+"parker if not answered"
+msgstr "Il tempo di timeout prima che una chiamata parcheggiata ritorni indietro all'interno di origine se non è stata risposta"
+
+#: page.parking.php:99
+msgid "Parking Lot Context:"
+msgstr "Contesto Parcheggio:"
+
+#: page.parking.php:100
+msgid ""
+"This is the parking lot context. You should not change it from the default "
+"unless you know what you are doing."
+msgstr "Questo è il contesto del parcheggio. Non bisognerebbe cambiare il valore predefinito se non si sa cos'è."
+
+#: page.parking.php:104
+msgid "Actions for Timed-Out Orphans"
+msgstr "Azioni per le chiamate orfane in attesa"
+
+#: page.parking.php:106
+msgid "Parking Alert-Info:"
+msgstr "Alert-info Parcheggio:"
+
+#: page.parking.php:107
+msgid ""
+"Alert-Info to put in channel before going to defined destination below. This "
+"can create distinct rings on some SIP phones and can serve to alert the "
+"recipients that the call is from an Orphaned parked call"
+msgstr "Alert-Info da inserire nel canale prima di andare alla destinazione qui sotto. Questo è utile per distinguere le suonerie con apparati di tipo SIP e sapere se la chiamata parcheggiata è orfana"
+
+#: page.parking.php:112
+msgid "CallerID Prepend:"
+msgstr "Prefisso ID Chiamante:"
+
+#: page.parking.php:113
+msgid ""
+"String to pre-pend to the current Caller-ID associated with this call (if "
+"any), before going to defined destination below. This can serve to alert the "
+"recipients that the call is from an Orphaned parked call"
+msgstr "Il prefisso da aggiungere all'ID Chiamante associato alla chiamata (se presente), prima di essere reindirizzata alla destinazione sottostante. E' utile per sapere se la chiamata è orfana e proviene dal parcheggio."
+
+#: page.parking.php:119 page.parking.php:137
+msgid "Announcement:"
+msgstr "Annuncio:"
+
+#: page.parking.php:119
+msgid ""
+"Optional message to be played to the orphaned caller prior to going on the "
+"to supplied destination below.<br><br>To add additional recordings please "
+"use the \"System Recordings\" MENU to the left"
+msgstr "Messaggio opzionale da riprodurre al chiamante orfano prima di essere reindirizzato alla destinazione sottostante.<br><br>Per aggiungere ulteriori registrazioni utilizzare \"Registrazioni di Sistema\" nel MENU di sinistra"
+
+#: page.parking.php:125
+msgid "None"
+msgstr "Nessuno"
+
+#: page.parking.php:137
+msgid ""
+"Optional message to be played to the orphaned caller prior to going on to "
+"the supplied destination below.<br><br>You must install and enable the "
+"\"Systems Recordings\" Module to edit this option"
+msgstr "Messaggio opzionale da riprodurre al chiamante orfano prima di essere reindirizzato alla destinazione sottostante.<br><br>Il modulo \"Registrazioni di Sistema\" deve essere installato e attivato prima di utilizzare questa opzione"
+
+#: page.parking.php:147
+msgid "Destination for Orphaned Parked Calls"
+msgstr "Destinazione per le Chiamate Parcheggiate Orfane "
+
+msgid "Core"
+msgstr "Sistema"
+
+msgid "Conferences"
+msgstr "Conferenze"
+
+msgid "Phonebook Directory"
+msgstr "Rubrica"
+
+msgid "Queues"
+msgstr "Code"
+
+msgid "Ring Groups"
+msgstr "Gruppi di chiamata"
+
+msgid "Speed dial functions"
+msgstr "Selezione breve"
+
+msgid "Time Conditions"
+msgstr "Condizioni Temporali"
+
+msgid "Custom Contexts"
+msgstr "Contesti Personalizzati"
+
+msgid "Extended Routing"
+msgstr "Rotte specifiche"
+
+msgid "Custom App<span><br>ADVANCED USERS ONLY<br><br>Uses Goto() to send caller to a custom context.<br><br>The context name should start with \"custom-\", and be in the format custom-context,extension,priority. Example entry:<br><br><b>custom-myapp,s,1</b><br><br>The <b>[custom-myapp]</b> context would need to be created and included in extensions_custom.conf</span>"
+msgstr "Applicazione Personalizzata<span>SOLO UTENTI AVANZATI<br>Utilizzare Goto() per inviare la chiamata verso un contesto personalizzato.<br><br>Il nome del contesto deve iniziare per \"custom-\" e deve essere nel formato custom-contesto,extension,priorità. Esempio: <br><br><b>custom-app,s,1</b><br><br><b>Il contesto [custom-app] </b> deve poi essere creato e incluso nel file extensions_custom.conf</span"
+
+msgid "Submit Changes"
+msgstr "Invia"
+
+msgid "Voicemail"
+msgstr "Casella Vocale"
+
+msgid "Extensions"
+msgstr "Interni"
+
+msgid "Day Night Mode"
+msgstr "Controllo Giorno Notte"
+
+msgid "Terminate Call"
+msgstr "Termina Chiamata"

Modified: freepbx-modules/trunk/modules/parking/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/parking/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/parking/module.xml (original)
+++ freepbx-modules/trunk/modules/parking/module.xml Sun May 18 19:52:05 2008
@@ -1,22 +1,30 @@
 <module>
 	<rawname>parking</rawname>
 	<name>Parking Lot</name>
-	<version>2.1.2.1</version>
+	<version>2.4.0.5</version>
 	<type>setup</type>
 	<category>Internal Options &amp; Configuration</category>
 	<description>Manages parking lot extensions and other options.
-	
 	Parking is a way of putting calls "on hold", and then picking them up from any extension.</description>
 	<menuitems>
 		<parking>Parking Lot</parking>
 	</menuitems>
 	<changelog>
+		*2.4.0.5* added depends on 2.4.0
+		*2.4.0.4* removed parkhints on Asterisk 1.2, metermaid already does and this creates undesired hints
+		*2.4.0.3* change to core_conf and features_general_addtional.conf, no more parking_additianal.inc
+		*2.4.0.2* create hints for Asterisk 1.4 and above
+		*2.4.0.1* add parking_conf class, support PARKINGPATCH config
+		*2.4.0* Destination registry, it translation
 		*2.1.2.1* bump for rc1
 		*2.1.2* merge findmefollow/core extension destinations if any
 		*2.1.1* fix pseudo hardcoded path issue (hardcoded form missing global)
 		*2.1* Remove settings on uninstall bug #1597
 		*2.0.2* Add he_IL translation
 	</changelog>
-	<location>release/2.3/parking-2.1.2.tgz</location>
-	<md5sum>693687106df687dccd1fd8bc140eba21</md5sum>
+	<depends>
+		<version>2.4.0</version>
+	</depends>
+	<location>release/2.4/parking-2.4.0.4.tgz</location>
+	<md5sum>af4c4b20cb5a640b21d13d6ab25036ad</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/pbdirectory/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/pbdirectory/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/pbdirectory/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/pbdirectory/functions.inc.php Sun May 18 19:52:05 2008
@@ -6,6 +6,19 @@
 	// return an associative array with destination and description
 	$extens[] = array('destination' => 'app-pbdirectory,pbdirectory,1', 'description' => 'Phonebook Directory');
 	return $extens;
+}
+
+function pbdirectory_getdestinfo($dest) {
+	global $active_modules;
+
+	if (trim($dest) == 'app-pbdirectory,pbdirectory,1') {
+		//$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup';
+		return array('description' => 'Phonebook Directory',
+		             'edit_url' => false,
+							  );
+	} else {
+		return false;
+	}
 }
 
 function pbdirectory_get_config($engine) {
@@ -25,6 +38,7 @@
 				$ext->add('app-pbdirectory', $code, '', new ext_goto(1,'pbdirectory'));
 			}
 			
+			$ext->add('app-pbdirectory', 'pbdirectory', '', new ext_macro('user-callerid'));
 			$ext->add('app-pbdirectory', 'pbdirectory', '', new ext_agi('pbdirectory'));
 			$ext->add('app-pbdirectory', 'pbdirectory', '', new ext_gotoif('$["${dialnumber}"=""]','hangup,1'));
 			$ext->add('app-pbdirectory', 'pbdirectory', '', new ext_noop('Got number to dial: ${dialnumber}'));

Modified: freepbx-modules/trunk/modules/pbdirectory/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/pbdirectory/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/pbdirectory/module.xml (original)
+++ freepbx-modules/trunk/modules/pbdirectory/module.xml Sun May 18 19:52:05 2008
@@ -1,26 +1,26 @@
 <module>
 	<rawname>pbdirectory</rawname>
 	<name>Phonebook Directory</name>
-	<version>0.3.1.3</version>
+	<version>2.4.0.2</version>
 	<type>tool</type>
 	<category>CID &amp; Number Management</category>
-	<location>release/2.3/pbdirectory-0.3.1.2.tgz</location>
+	<location>release/2.4/pbdirectory-2.4.0.1.tgz</location>
 	<description>Provides a dial-by-name directory for phonebook entries</description>
 	<changelog>
-		*0.3.1.3* changed requirements 2.2 to depends
+		*2.4.0.2* removed 2.4.0 requirement possible causing broken module issue
+		*2.4.0.1* added depends on 2.4.0
+		*2.4.0* Destination registry, added missing macro-user-callerid call
 		*0.3.1.2* #2343 pbdirectory script errors
 		*0.3.1.1* bump for rc1
 		*0.3.1* fixed some hard coded paths, requires core modules:  2.3.0beta1.6 or above
 		*0.3* First changelog entry
 	</changelog>
 	<depends>
-		<version>2.2</version>
+		<version>2.4.0</version>
 	</depends>
 	<requirements>
 		<module>phonebook</module>
 		<module>speeddial</module>
 	</requirements>
-	<md5sum>c40f7a1208403bac111fa17ccc0f20a5</md5sum>
-	<changelog>
-	</changelog>
+	<md5sum>15260ca4971c16bb41c359092d0e9f52</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/phonebook/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/phonebook/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/phonebook/module.xml (original)
+++ freepbx-modules/trunk/modules/phonebook/module.xml Sun May 18 19:52:05 2008
@@ -1,16 +1,17 @@
 <module>
 	<rawname>phonebook</rawname>
 	<name>Phonebook</name>
-	<version>1.1.5.7</version>
+	<version>2.4.0</version>
 	<description>Provides a phonebook for FreePBX, it can be used as base for Caller ID Lookup and Speed Dial</description>
 	<type>tool</type>
 	<category>System Administration</category>
 	<menuitems>
 		<phonebook needsenginedb="yes">Asterisk Phonebook</phonebook>
 	</menuitems>
-	<location>release/2.3/phonebook-1.1.5.6.tgz</location>
-	<md5sum>ddd2f3eedff4d6a60b12abeedfcc5fd8</md5sum>
+	<location>release/2.3/phonebook-1.1.5.7.tgz</location>
+	<md5sum>ac2f7115bc943a66faa552dab0dd4dc6</md5sum>
 	<changelog>
+		*2.4.0* it translation, bump for 2.4
 		*1.1.5.7* changed categories
 		*1.1.5.6* bump for rc1
 		*1.1.5.5* added xml attribute needsenginedb

Modified: freepbx-modules/trunk/modules/phpagiconf/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/phpagiconf/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/phpagiconf/module.xml (original)
+++ freepbx-modules/trunk/modules/phpagiconf/module.xml Sun May 18 19:52:05 2008
@@ -1,7 +1,7 @@
 <module>
 	<rawname>phpagiconf</rawname>
 	<name>PHPAGI Config</name>
-	<version>1.2.2</version>
+	<version>2.4.0</version>
 	<type>tool</type>
 	<category>System Administration</category>
 	<menuitems>
@@ -11,11 +11,12 @@
 		<module>manager ge1.0.4</module>
 	</depends> 
 	<changelog>
+		*2.4.0* bump for 2.4
 		*1.2.2* Changed categories
 		*1.2.1* Fixed javascript error, removed unused script, bump for rc1
 		*1.2* Create tmp files in /etc/asterisk, fixes ticket:1910
 		*1.1* Removed old dependancy checking code, first 2.2 release
 	</changelog>
-	<location>release/2.3/phpagiconf-1.2.1.tgz</location>
-	<md5sum>251deda6ef264817818f6c756b56b6b3</md5sum>
+	<location>release/2.3/phpagiconf-1.2.2.tgz</location>
+	<md5sum>10407b881f66418c95aa564ed2becc10</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/phpinfo/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/phpinfo/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/phpinfo/module.xml (original)
+++ freepbx-modules/trunk/modules/phpinfo/module.xml Sun May 18 19:52:05 2008
@@ -1,8 +1,9 @@
 <module>
 	<rawname>phpinfo</rawname>
 	<name>PHP Info</name>
-	<version>1.1.0.1</version>
+	<version>2.4.0</version>
 	<changelog>
+		*2.4.0* bump for 2.4
 		*1.1.0.1* bump for rc1
 		*1.1.0* #1442 remove access problem and iframe
 	</changelog>
@@ -11,6 +12,6 @@
 	<menuitems>
 		<phpinfo>PHP Info</phpinfo>
 	</menuitems>
-	<location>release/2.3/phpinfo-1.1.0.tgz</location>
-	<md5sum>c9dc164d56ce7121480f6e39a34e249d</md5sum>
+	<location>release/2.3/phpinfo-1.1.0.1.tgz</location>
+	<md5sum>00dbb7252b3da7f78c36187a4322f879</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/pinsets/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/pinsets/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/pinsets/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/pinsets/functions.inc.php Sun May 18 19:52:05 2008
@@ -49,9 +49,9 @@
 				
 				// write out a macro that handles the authenticate
 				$ext->add('macro-pinsets', 's', '', new ext_gotoif('${ARG2} = 1','cdr,1'));
-				$ext->add('macro-pinsets', 's', '', new ext_authenticate($asterisk_conf['astetcdir'].'/pinset_${ARG1}'));
+				$ext->add('macro-pinsets', 's', '', new ext_execif('$["${DB(AMPUSER/${AMPUSER}/pinless)}" != "NOPASSWD"]', 'Authenticate',$asterisk_conf['astetcdir'].'/pinset_${ARG1}'));
 				// authenticate with the CDR option (a)
-				$ext->add('macro-pinsets', 'cdr', '', new ext_authenticate($asterisk_conf['astetcdir'].'/pinset_${ARG1}','a'));
+				$ext->add('macro-pinsets', 'cdr', '', new ext_execif('$["${DB(AMPUSER/${AMPUSER}/pinless)}" != "NOPASSWD"]', 'Authenticate',$asterisk_conf['astetcdir'].'/pinset_${ARG1},a'));
 			}
 		break;
 	}
@@ -91,7 +91,7 @@
 									$extension = str_replace('|','',$rt);
 									// If there are any wildcards in there, add a _ to the start
 									if (preg_match("/\.|z|x|\[|\]/i", $extension)) { $extension = "_".$extension; }
-									$ext->splice($context, $extension, 0, new ext_macro('pinsets', $thisitem['pinsets_id'].','.$thisitem['addtocdr']));
+									$ext->splice($context, $extension, 1, new ext_macro('pinsets', $thisitem['pinsets_id'].','.$thisitem['addtocdr']));
 								}						
 								
 							}

Added: freepbx-modules/trunk/modules/pinsets/i18n/it_IL/LC_MESSAGES/pinsets.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/pinsets/i18n/it_IL/LC_MESSAGES/pinsets.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/pinsets/i18n/it_IL/LC_MESSAGES/pinsets.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/pinsets/i18n/it_IL/LC_MESSAGES/pinsets.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/pinsets/i18n/it_IL/LC_MESSAGES/pinsets.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/pinsets/i18n/it_IL/LC_MESSAGES/pinsets.po (added)
+++ freepbx-modules/trunk/modules/pinsets/i18n/it_IL/LC_MESSAGES/pinsets.po Sun May 18 19:52:05 2008
@@ -1,0 +1,81 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-02-01 16:13+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: Italian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: page.pinsets.php:50
+msgid "Add Password Set"
+msgstr "Aggiungi Gruppo PIN"
+
+#: page.pinsets.php:63
+msgid "PIN Set "
+msgstr "Gruppo PIN"
+
+#: page.pinsets.php:63
+msgid "deleted"
+msgstr "eliminato"
+
+#: page.pinsets.php:76
+msgid "Delete PIN Set"
+msgstr "Elimina Gruppo PIN"
+
+#: page.pinsets.php:81
+msgid "PIN Set:"
+msgstr "Gruppo PIN:"
+
+#: page.pinsets.php:81
+msgid "Add PIN Set"
+msgstr "Aggiungi Gruppo PIN"
+
+#: page.pinsets.php:83
+msgid ""
+"PIN Sets are used to manage lists of PINs that can be used to access "
+"restricted features such as Outbound Routes. The PIN can also be added to "
+"the CDR record's 'accountcode' field."
+msgstr "In questa pagina è possibile gestire i Gruppi PIN, utilizzati per restringere l'accesso a particolari servizi come per esempio le Rotte in Uscita. Il PIN può essere anche inserito nel campo CDR 'accountcode' dell'utente."
+
+#: page.pinsets.php:93
+msgid "Edit PIN Set"
+msgstr "Modifica Gruppo PIN"
+
+#: page.pinsets.php:93
+msgid "New PIN Set"
+msgstr "Nuovo Gruppo PIN"
+
+#: page.pinsets.php:100
+msgid "PIN Set Description:"
+msgstr "Descrizione Gruppo PIN"
+
+#: page.pinsets.php:104
+msgid "Record In CDR?:"
+msgstr "Registra nel CDR?:"
+
+#: page.pinsets.php:104
+msgid ""
+"Select this box if you would like to record the PIN in the call detail "
+"records when used"
+msgstr "Spuntare questa casella se si vogliono registrare i PIN nel dettaglio delle chiamate"
+
+#: page.pinsets.php:108
+msgid "PIN List:"
+msgstr "Lista PIN:"
+
+#: page.pinsets.php:108
+msgid "Enter a list of one or more PINs.  One PIN per line."
+msgstr "Immettere in lista uno o più PIN. Uno per riga."
+
+msgid "Submit Changes"
+msgstr "Invia"

Modified: freepbx-modules/trunk/modules/pinsets/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/pinsets/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/pinsets/module.xml (original)
+++ freepbx-modules/trunk/modules/pinsets/module.xml Sun May 18 19:52:05 2008
@@ -1,11 +1,13 @@
 <module>
 	<rawname>pinsets</rawname>
 	<name>PIN Sets</name>
-	<version>1.2.2.2</version>
+	<version>2.4.0</version>
 	<type>setup</type>
 	<category>Internal Options &amp; Configuration</category>
 	<description>Allow creation of lists of PINs (numbers for passwords) that can be used by other modules (eg, trunks).</description>
 	<changelog>
+		*2.4.0* bump for 2.4
+		*1.2.3* #2393 add support for pinless dialing
 		*1.2.2.2* #2172 deprecated use of |
 		*1.2.2.1* bump for rc1
 		*1.2.2* Put None label in menu hook
@@ -17,6 +19,6 @@
 	<menuitems>
 		<pinsets>PIN Sets</pinsets>
 	</menuitems>
-	<location>release/2.3/pinsets-1.2.2.1.tgz</location>
-	<md5sum>895f85d305d2084c244fa92ee76ee42d</md5sum>
+	<location>release/2.4/pinsets-1.2.3.tgz</location>
+	<md5sum>585bf5ad39fa1782caa4b90b52d3ea74</md5sum>
 </module>

Added: freepbx-modules/trunk/modules/printextensions/i18n/it_IT/LC_MESSAGES/printextensions.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/printextensions/i18n/it_IT/LC_MESSAGES/printextensions.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/printextensions/i18n/it_IT/LC_MESSAGES/printextensions.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/printextensions/i18n/it_IT/LC_MESSAGES/printextensions.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/printextensions/i18n/it_IT/LC_MESSAGES/printextensions.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/printextensions/i18n/it_IT/LC_MESSAGES/printextensions.po (added)
+++ freepbx-modules/trunk/modules/printextensions/i18n/it_IT/LC_MESSAGES/printextensions.po Sun May 18 19:52:05 2008
@@ -1,0 +1,33 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-02-01 16:37+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: Italian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: page.printextensions.php:30
+msgid "Company Directory"
+msgstr "Elenco Telefonico"
+
+msgid "Name"
+msgstr "Nome"
+
+msgid "Extension"
+msgstr "Interno"
+
+msgid "Assigned DID"
+msgstr "Selezione Passante"
+
+msgid "Printer Friendly"
+msgstr "Versione per la stampa"

Modified: freepbx-modules/trunk/modules/printextensions/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/printextensions/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/printextensions/module.xml (original)
+++ freepbx-modules/trunk/modules/printextensions/module.xml Sun May 18 19:52:05 2008
@@ -1,7 +1,7 @@
 <module>
 	<rawname>printextensions</rawname>
 	<name>Print Extensions</name>
-	<version>1.3.2</version>
+	<version>2.4.0</version>
 	<type>tool</type>
 	<category>Third Party Addon</category>
 	<description>Creates a printable list of names and extension numbers</description>
@@ -9,9 +9,10 @@
 		<printextensions>Print Extensions</printextensions>
 	</menuitems>
 	<changelog>
+		*2.4.0* it translations, bump for 2.4
 		*1.3.2* Fixed uninizialized variable errors, bump for rc1
 		*1.3.1* Add he_IL translation
 	</changelog>
-	<location>release/2.3/printextensions-1.3.1.tgz</location>
-	<md5sum>b9252d8e33cd6fc984cea23aa7506a3b</md5sum>
+	<location>release/2.3/printextensions-1.3.2.tgz</location>
+	<md5sum>e951d15435b421d6e43ae5bb133699a6</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/queues/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/queues/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/queues/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/queues/functions.inc.php Sun May 18 19:52:05 2008
@@ -1,4 +1,102 @@
 <?php /* $id:$ */
+
+class queues_conf {
+	// return an array of filenames to write
+	// files named like pinset_N
+	function get_filename() {
+		return "queues_additional.conf";
+	}
+	
+	// return the output that goes in each of the files
+	function generateConf() {
+
+		global $db;
+		global $version;
+
+		$additional = "";
+		$output = "";
+		// Asterisk 1.4 does not like blank assignments so just don't put them there
+		//
+		$ver12 = version_compare($version, '1.4', 'lt');
+		
+		// legacy but in case someone was using this we will leave it
+		//
+		$sql = "SELECT keyword,data FROM queues_details WHERE id='-1' AND keyword <> 'account'";
+		$results = $db->getAll($sql, DB_FETCHMODE_ASSOC);
+		if(DB::IsError($results)) {
+   		die($results->getMessage());
+		}
+		foreach ($results as $result) {
+			if (!$ver12 && trim($result['data']) == '') {
+				continue;
+			}
+			$additional .= $result['keyword']."=".$result['data']."\n";
+		}
+
+		$results = queues_list();
+		foreach ($results as $result) {
+			$output .= "[".$result[0]."]\n";
+
+			// passing 2nd param 'true' tells queues_get to send back only queue_conf required params
+			// and nothing else
+			//
+			$results2 = queues_get($result[0], true);
+
+			// memebers is an array of members so we set it asside and remove it
+			// and then generate each later
+			//
+			$members = $results2['member'];
+			unset($results2['member']);
+
+			foreach ($results2 as $keyword => $data) {
+				if ($ver12){
+					$output .= $keyword."=".$data."\n";
+				}else{
+					switch($keyword){
+						case (trim($data) == ''):
+						case 'monitor-join': 
+							break;
+						case 'monitor-format':
+							if (strtolower($data) != 'no'){
+								$output .= "monitor-type=mixmonitor\n";
+								$output .= $keyword."=".$data."\n";
+							}
+							break;
+						default:
+							$output .= $keyword."=".$data."\n";
+							break;
+					}
+				}
+			}
+
+			// Now pull out all the memebers, one line for each
+			//
+			foreach ($members as $member) {
+				$output .= "member=".$member."\n";
+			}
+			$output .= $additional."\n";
+		}
+
+		// Before returning the results, do an integrity check to see
+		// if there are any truncated compound recrodings and if so
+		// crate a noticication.
+		//
+		$nt = notifications::create($db);
+
+		$compound_recordings = queues_check_compoundrecordings();
+		if (empty($compound_recordings)) {
+			$nt->delete('queues', 'COMPOUNDREC');
+		} else {
+			$str = _("Warning, there are compound recordings configured in one or more Queue configurations. Queues can not play these so they have been truncated to the first sound file. You should correct this problem.<br />Details:<br /><br />");
+			foreach ($compound_recordings as $item) {
+				$str .= sprintf(_("Queue - %s (%s): %s<br />"), $item['extension'], $item['descr'], $item['error']);
+			}
+			$nt->add_error('queues', 'COMPOUNDREC', _("Compound Recordings in Queues Detected"), $str);
+		}
+		return $output;
+	}
+}
+
 // The destinations this module provides
 // returns a associative arrays with keys 'destination' and 'description'
 function queues_destinations() {
@@ -16,6 +114,30 @@
 		return $extens;
 	else
 		return null;
+}
+
+function queues_getdest($exten) {
+	return array('ext-queues,'.$exten.',1');
+}
+
+function queues_getdestinfo($dest) {
+	global $active_modules;
+
+	if (substr(trim($dest),0,11) == 'ext-queues,') {
+		$exten = explode(',',$dest);
+		$exten = $exten[1];
+		$thisexten = queues_get($exten);
+		if (empty($thisexten)) {
+			return array();
+		} else {
+			//$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup';
+			return array('description' => 'Queue '.$exten.' : '.$thisexten['name'],
+			             'edit_url' => 'config.php?display=queues&extdisplay='.urlencode($exten),
+								  );
+		}
+	} else {
+		return false;
+	}
 }
 
 /* 	Generates dialplan for "queues" components (extensions & inbound routing)
@@ -35,6 +157,7 @@
 					$q = queues_get($exten);
 
 					$grppre = (isset($q['prefix'])?$q['prefix']:'');
+					$alertinfo = (isset($q['alertinfo'])?$q['alertinfo']:'');
 					
 					$ext->add('ext-queues', $exten, '', new ext_macro('user-callerid'));
 					$ext->add('ext-queues', $exten, '', new ext_answer(''));
@@ -66,6 +189,10 @@
 						$ext->add('ext-queues', $exten, '', new ext_setvar('CALLERID(name)','${RGPREFIX}${CALLERID(name)}'));
 					}
 
+					// Set Alert_Info
+					if ($alertinfo != '') {
+						$ext->add('ext-queues', $exten, '', new ext_setvar('__ALERT_INFO', str_replace(';', '\;', $alertinfo)));
+					}
 
 					$ext->add('ext-queues', $exten, '', new ext_setvar('MONITOR_FILENAME','/var/spool/asterisk/monitor/q${EXTEN}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${UNIQUEID}'));
 					$joinannounce = (isset($q['joinannounce'])?$q['joinannounce']:'');
@@ -78,6 +205,11 @@
 					if (isset($q['music'])) {
  						$ext->add('ext-queues', $exten, '', new ext_setvar('__MOHCLASS', $q['music']));
 					}
+					// Set CWIGNORE  if enabled so that busy agents don't have another line key ringing and
+					// stalling the ACD.
+					if ($q['cwignore']) {
+ 						$ext->add('ext-queues', $exten, '', new ext_setvar('_CWIGNORE', 'TRUE'));
+					}
 					$agentannounce = (isset($q['agentannounce'])?$q['agentannounce']:'');
 					$ext->add('ext-queues', $exten, '', new ext_queue($exten,$options,'',$agentannounce,$q['maxwait']));
  
@@ -103,108 +235,67 @@
 }
 
 function queues_timeString($seconds, $full = false) {
-        if ($seconds == 0) {
-                return "0 ".($full ? "seconds" : "s");
-        }
-
-        $minutes = floor($seconds / 60);
-        $seconds = $seconds % 60;
-
-        $hours = floor($minutes / 60);
-        $minutes = $minutes % 60;
-
-        $days = floor($hours / 24);
-        $hours = $hours % 24;
-
-        if ($full) {
-                return substr(
-                                ($days ? $days." day".(($days == 1) ? "" : "s").", " : "").
-                                ($hours ? $hours." hour".(($hours == 1) ? "" : "s").", " : "").
-                                ($minutes ? $minutes." minute".(($minutes == 1) ? "" : "s").", " : "").
-                                ($seconds ? $seconds." second".(($seconds == 1) ? "" : "s").", " : ""),
-                               0, -2);
-        } else {
-                return substr(($days ? $days."d, " : "").($hours ? $hours."h, " : "").($minutes ? $minutes."m, " : "").($seconds ? $seconds."s, " : ""), 0, -2);
-        }
-}
-
-/*
-This module needs to be updated to use it's own database table and not the extensions table
-*/
-
-function queues_add($account,$name,$password,$prefix,$goto,$agentannounce,$members,$joinannounce,$maxwait) {
+	if ($seconds == 0) {
+		return "0 ".($full ? "seconds" : "s");
+	}
+
+	$minutes = floor($seconds / 60);
+	$seconds = $seconds % 60;
+
+	$hours = floor($minutes / 60);
+	$minutes = $minutes % 60;
+
+	$days = floor($hours / 24);
+	$hours = $hours % 24;
+
+	if ($full) {
+ 		return substr(
+		              ($days ? $days." day".(($days == 1) ? "" : "s").", " : "").
+		              ($hours ? $hours." hour".(($hours == 1) ? "" : "s").", " : "").
+		              ($minutes ? $minutes." minute".(($minutes == 1) ? "" : "s").", " : "").
+		              ($seconds ? $seconds." second".(($seconds == 1) ? "" : "s").", " : ""),
+		              0, -2);
+	} else {
+		return substr(($days ? $days."d, " : "").($hours ? $hours."h, " : "").($minutes ? $minutes."m, " : "").($seconds ? $seconds."s, " : ""), 0, -2);
+	}
+}
+
+function queues_add($account,$name,$password,$prefix,$goto,$agentannounce,$members,$joinannounce,$maxwait,$alertinfo='',$cwignore='no') {
 	global $db;
+
+	if (trim($account) == '') {
+		echo "<script>javascript:alert('"._("Bad Queue Number, can not be blank")."');</script>";
+		return false;
+	}
 
 	//add to extensions table
 	if (empty($agentannounce) || $agentannounce == 'None') {
 		$agentannounce="";
 	}
 
-	$addarray = array('ext-queues',$account,'1','Answer',''.'','','0');
-	legacy_extensions_add($addarray);
-	$addarray = array('ext-queues',$account,'2','SetCIDName',$prefix.'${CALLERID(name)}','','0');
-	legacy_extensions_add($addarray);
-	$addarray = array('ext-queues',$account,'3','SetVar','MONITOR_FILENAME=/var/spool/asterisk/monitor/q${EXTEN}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${UNIQUEID}','','0');
-	legacy_extensions_add($addarray);
-	if ($joinannounce != 'None') {
-		$addarray = array('ext-queues',$account,'4','Playback',$joinannounce,'','0');
-		legacy_extensions_add($addarray);
-	}
-	$addarray = array('ext-queues',$account,'5','Queue',$account.',t,,'.$agentannounce.','.$maxwait,$name,'0');
-	legacy_extensions_add($addarray);
-	$addarray = array('ext-queues',$account.'*','1','Macro','agent-add,'.$account.','.$password,'','0');
-	legacy_extensions_add($addarray);
-	$addarray = array('ext-queues',$account.'**','1','Macro','agent-del,'.$account,'','0');
-	legacy_extensions_add($addarray);
-	
-	//failover goto
-	$addarray = array('ext-queues',$account,'6','Goto',$goto,'jump','0');
-	legacy_extensions_add($addarray);
-	//setGoto($account,'ext-queues','6',$goto,0);
-	// Announce Menu?
-	$qpannounce = '';
-	if ($_REQUEST['announcemenu']=='none') {
-		$context = '';
-	} else {
-		$arr = (ivr_get_details($_REQUEST['announcemenu']));
-		if( isset($arr['announcement']) && !empty($arr['announcement']) ) {
-			$qpannounce = $arr['announcement'];
-		} else {
-			$qthanku = 'silence/1';
-		}
-		$context = "ivr-".$_REQUEST['announcemenu'];
-	}
-	
-	
-	// now add to queues table
-	$fields = array(
-		array($account,'account',$account,0),
-		array($account,'maxlen',($_REQUEST['maxlen'])?$_REQUEST['maxlen']:'0',0),
-		array($account,'joinempty',($_REQUEST['joinempty'])?$_REQUEST['joinempty']:'yes',0),
-		array($account,'leavewhenempty',($_REQUEST['leavewhenempty'])?$_REQUEST['leavewhenempty']:'no',0),
-		array($account,'strategy',($_REQUEST['strategy'])?$_REQUEST['strategy']:'ringall',0),
-		array($account,'timeout',(isset($_REQUEST['timeout']))?$_REQUEST['timeout']:'15',0),
-		array($account,'retry',($_REQUEST['retry'])?$_REQUEST['retry']:'5',0),
-		array($account,'wrapuptime',($_REQUEST['wrapuptime'])?$_REQUEST['wrapuptime']:'0',0),
-		//array($account,'agentannounce',($_REQUEST['agentannounce'])?$_REQUEST['agentannounce']:'None'),
-		array($account,'announce-frequency',($_REQUEST['announcefreq'])?$_REQUEST['announcefreq']:'0',0),
-		array($account,'announce-holdtime',($_REQUEST['announceholdtime'])?$_REQUEST['announceholdtime']:'no',0),
-		array($account,'queue-youarenext',($_REQUEST['announceposition']=='no')?'silence/1':'queue-youarenext',0),  //if no, play no sound
-		array($account,'queue-thereare',($_REQUEST['announceposition']=='no')?'silence/1':'queue-thereare',0),  //if no, play no sound
-		array($account,'queue-callswaiting',($_REQUEST['announceposition']=='no')?'silence/1':'queue-callswaiting',0),  //if no, play no sound
-		array($account,'queue-thankyou',($_REQUEST['announceposition']=='no')?'':'queue-thankyou',0),  //if no, play no sound
-		array($account,'periodic-announce',$qpannounce,0), //periodic breakout IVR recording to play back
-		array($account,'periodic-announce-frequency',($_REQUEST['pannouncefreq'])?$_REQUEST['pannouncefreq']:'0',0),
-		array($account,'context',$context,0), 
-		array($account,'monitor-format',($_REQUEST['monitor-format'])?$_REQUEST['monitor-format']:'',0),
-		array($account,'monitor-join','yes',0),
-		array($account,'rtone',($_REQUEST['rtone'])?$_REQUEST['rtone']:0,0),
-		array($account,'eventwhencalled',($_REQUEST['eventwhencalled'])?$_REQUEST['eventwhencalled']:'no',0),
-		array($account,'eventmemberstatus',($_REQUEST['eventmemberstatus'])?$_REQUEST['eventmemberstatus']:'no',0));
-
-		if ($_REQUEST['music'] != 'inherit') {
-			$fields[] = array($account,'music',($_REQUEST['music'])?$_REQUEST['music']:'default',0);
-		}
+$fields = array(
+	array($account,'maxlen',($_REQUEST['maxlen'])?$_REQUEST['maxlen']:'0',0),
+	array($account,'joinempty',($_REQUEST['joinempty'])?$_REQUEST['joinempty']:'yes',0),
+	array($account,'leavewhenempty',($_REQUEST['leavewhenempty'])?$_REQUEST['leavewhenempty']:'no',0),
+	array($account,'strategy',($_REQUEST['strategy'])?$_REQUEST['strategy']:'ringall',0),
+	array($account,'timeout',(isset($_REQUEST['timeout']))?$_REQUEST['timeout']:'15',0),
+	array($account,'retry',(isset($_REQUEST['retry']) && $_REQUEST['retry'] != '')?$_REQUEST['retry']:'5',0),
+	array($account,'wrapuptime',($_REQUEST['wrapuptime'])?$_REQUEST['wrapuptime']:'0',0),
+	array($account,'announce-frequency',($_REQUEST['announcefreq'])?$_REQUEST['announcefreq']:'0',0),
+	array($account,'announce-holdtime',($_REQUEST['announceholdtime'])?$_REQUEST['announceholdtime']:'no',0),
+	array($account,'queue-youarenext',($_REQUEST['announceposition']=='no')?'silence/1':'queue-youarenext',0),  //if no, play no sound
+	array($account,'queue-thereare',($_REQUEST['announceposition']=='no')?'silence/1':'queue-thereare',0),  //if no, play no sound
+	array($account,'queue-callswaiting',($_REQUEST['announceposition']=='no')?'silence/1':'queue-callswaiting',0),  //if no, play no sound
+	array($account,'queue-thankyou',($_REQUEST['announceposition']=='no')?'':'queue-thankyou',0),  //if no, play no sound
+	array($account,'periodic-announce-frequency',($_REQUEST['pannouncefreq'])?$_REQUEST['pannouncefreq']:'0',0),
+	array($account,'monitor-format',($_REQUEST['monitor-format'])?$_REQUEST['monitor-format']:'',0),
+	array($account,'monitor-join','yes',0),
+	array($account,'eventwhencalled',($_REQUEST['eventwhencalled'])?$_REQUEST['eventwhencalled']:'no',0),
+	array($account,'eventmemberstatus',($_REQUEST['eventmemberstatus'])?$_REQUEST['eventmemberstatus']:'no',0));
+
+	if ($_REQUEST['music'] != 'inherit') {
+		$fields[] = array($account,'music',($_REQUEST['music'])?$_REQUEST['music']:'default',0);
+	}
 
 	//there can be multiple members
 	if (isset($members)) {
@@ -215,36 +306,56 @@
 		}
 	}
 
-    $compiled = $db->prepare('INSERT INTO queues (id, keyword, data, flags) values (?,?,?,?)');
+	$compiled = $db->prepare('INSERT INTO queues_details (id, keyword, data, flags) values (?,?,?,?)');
 	$result = $db->executeMultiple($compiled,$fields);
-    if(DB::IsError($result)) {
-        die_freepbx($result->getMessage()."<br><br>error adding to queues table");	
-    }
+	if(DB::IsError($result)) {
+		die_freepbx($result->getMessage()."<br><br>error adding to queues_details table");	
+	}
+	$extension   	 = $account;
+	$descr         = isset($name) ? $name:'';
+	$grppre        = isset($prefix) ? $prefix:'';
+	$alertinfo     = isset($alertinfo) ? $alertinfo:'';
+	$joinannounce  = strtolower($joinannounce) != 'none' ? $joinannounce:'';
+	$ringing       = isset($_REQUEST['rtone']) ? $_REQUEST['rtone']:'';
+	$agentannounce = strtolower($agentannounce) != 'none' ? $agentannounce:'';
+	$maxwait       = isset($maxwait) ? $maxwait:'';
+	$password      = isset($password) ? $password:'';
+	$ivr_id        = isset($_REQUEST['announcemenu']) ? $_REQUEST['announcemenu']:'none';
+	$dest          = isset($goto) ? $goto:'';
+	$cwignore      = isset($cwignore) ? $cwignore:'0';
+
+	// Assumes it has just been deleted
+	$sql = "INSERT INTO queues_config (extension, descr, grppre, alertinfo, joinannounce, ringing, agentannounce, maxwait, password, ivr_id, dest, cwignore)
+         	VALUES ('$extension', '$descr', '$grppre', '$alertinfo', '$joinannounce', '$ringing', '$agentannounce', '$maxwait', '$password', '$ivr_id', '$dest', '$cwignore')	";
+	$results = sql($sql);
+	return true;
 }
 
 function queues_del($account) {
 	global $db;
-	//delete from extensions table
-	legacy_extensions_del('ext-queues',$account);
-	legacy_extensions_del('ext-queues',$account.'*');
-	legacy_extensions_del('ext-queues',$account.'**');
-	
-	$sql = "DELETE FROM queues WHERE id = '$account'";
+	
+	$sql = "DELETE FROM queues_details WHERE id = '$account'";
     $result = $db->query($sql);
     if(DB::IsError($result)) {
         die_freepbx($result->getMessage().$sql);
     }
+	$sql = "DELETE FROM queues_config WHERE extension = '$account'";
+    $result = $db->query($sql);
+    if(DB::IsError($result)) {
+        die_freepbx($result->getMessage().$sql);
+    }
 
 }
 
 //get the existing queue extensions
 function queues_list() {
 	global $db;
-	$sql = "SELECT extension,descr FROM extensions WHERE application = 'Queue' ORDER BY extension";
+	$sql = "SELECT extension, descr FROM queues_config ORDER BY extension";
 	$results = $db->getAll($sql);
 	if(DB::IsError($results)) {
-		$results = null;
-	}
+		$results = array();
+	}
+
 	foreach($results as $result){
 		if (checkRange($result[0])){
 			$extens[] = array($result[0],$result[1]);
@@ -253,35 +364,130 @@
 	if (isset($extens)) {
 		return $extens;
 	} else {
-		return null;
-	}
-}
-
-
-function queues_get($account) {
+		return array();
+	}
+}
+
+function queues_check_extensions($exten=true) {
+	global $active_modules;
+
+	$extenlist = array();
+	if (is_array($exten) && empty($exten)) {
+		return $extenlist;
+	}
+	$sql = "SELECT extension, descr FROM queues_config ";
+	if (is_array($exten)) {
+		$sql .= "WHERE extension in ('".implode("','",$exten)."')";
+	}
+	$sql .= " ORDER BY extension";
+	$results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
+
+	//$type = isset($active_modules['queues']['type'])?$active_modules['queues']['type']:'setup';
+	foreach ($results as $result) {
+		$thisexten = $result['extension'];
+		$extenlist[$thisexten]['description'] = _("Queue: ").$result['descr'];
+		$extenlist[$thisexten]['status'] = 'INUSE';
+		$extenlist[$thisexten]['edit_url'] = 'config.php?display=queues&extdisplay='.urlencode($thisexten);
+	}
+	return $extenlist;
+}
+
+function queues_check_destinations($dest=true) {
+	global $active_modules;
+
+	$destlist = array();
+	if (is_array($dest) && empty($dest)) {
+		return $destlist;
+	}
+	$sql = "SELECT extension, descr, dest FROM queues_config";
+	if ($dest !== true) {
+		$sql .= " WHERE dest in ('".implode("','",$dest)."')";
+	}
+	$sql .= " ORDER BY extension";
+
+	$results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
+
+	//$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup';
+
+	foreach ($results as $result) {
+		$thisdest = $result['dest'];
+		$thisid   = $result['extension'];
+		$destlist[] = array(
+			'dest' => $thisdest,
+			'description' => 'Queue: '.$result['descr'].'('.$thisid.')',
+			'edit_url' => 'config.php?display=queues&extdisplay='.urlencode($thisid),
+		);
+	}
+	return $destlist;
+}
+
+function queues_check_compoundrecordings() {
+	global $db;
+
+	$compound_recordings = array();
+	$sql = "SELECT extension, descr, agentannounce, ivr_id FROM queues_config WHERE (ivr_id != 'none' AND ivr_id != '') OR agentannounce != ''";
+	$results = sql($sql, "getAll",DB_FETCHMODE_ASSOC);
+
+	if (function_exists('ivr_list')) {
+		$ivr_details = ivr_list();
+		foreach ($ivr_details as $item) {
+			$ivr_hash[$item['ivr_id']] = $item;
+		}
+		$check_ivr = true;
+	} else {
+		$check_ivr = false;
+	}
+
+	foreach ($results as $result) {
+		if (strpos($result['agentannounce'],"&") !== false) {
+			$compound_recordings[] = array(
+				                       	'extension' => $result['extension'],
+															 	'descr' => $result['descr'],
+															 	'error' => _("Agent Announce Msg"),
+														 	);
+		}
+		if ($result['ivr_id'] != 'none' && $result['ivr_id'] != '' && $check_ivr) {
+			if (strpos($ivr_hash[$result['ivr_id']]['announcement'],"&") !== false) {
+				$compound_recordings[] = array(
+				                       		'extension' => $result['extension'],
+															 		'descr' => $result['descr'],
+															 		'error' => sprintf(_("IVR Announce: %s"),$ivr_hash[$result['ivr_id']]['displayname']),
+														 		);
+			}
+		}
+	}
+	return $compound_recordings;
+}
+
+
+function queues_get($account, $queues_conf_only=false) {
 	global $db;
 	
     if ($account == "")
     {
 	    return array();
     }
-    
+
+	$account = q($account);
 	//get all the variables for the queue
-	$sql = "SELECT keyword,data FROM queues WHERE id = '$account'";
+	$sql = "SELECT keyword,data FROM queues_details WHERE id = $account";
 	$results = $db->getAssoc($sql);
+	if (empty($results)) {
+		return array();
+	}
 
 	//okay, but there can be multiple member variables ... do another select for them
-	$sql = "SELECT data FROM queues WHERE id = '$account' AND keyword = 'member' order by flags";
+	$sql = "SELECT data FROM queues_details WHERE id = $account AND keyword = 'member' order by flags";
 	$results['member'] = $db->getCol($sql);
 	
-	//queues.php looks for 'announcemenu', which is the same a context
-	$results['announcemenu'] = 	isset($results['context']) ? $results['context']:'';
-	
 	//if 'queue-youarenext=queue-youarenext', then assume we want to announce position
-	if(isset($results['queue-youarenext']) && $results['queue-youarenext'] == 'queue-youarenext') 
-		$results['announce-position'] = 'yes';
-	else
-		$results['announce-position'] = 'no';
+	if (!$queues_conf_only) {
+		if(isset($results['queue-youarenext']) && $results['queue-youarenext'] == 'queue-youarenext') {
+			$results['announce-position'] = 'yes';
+		} else {
+			$results['announce-position'] = 'no';
+		}
+	}
 	
 	//if 'eventmemberstatusoff=Yes', then assume we want to 'eventmemberstatus=no'
 	if(isset($results['eventmemberstatusoff'])) {
@@ -294,34 +500,47 @@
 		$results['eventmemberstatus'] = 'no';
 	}
 
-	//get CID Prefix
-	$sql = "SELECT args FROM extensions WHERE extension = '$account' AND context = 'ext-queues' AND application = 'SetCIDName'";
-	list($args) = $db->getRow($sql);
-	$prefix = explode('$',$args); //in table like prefix${CALLERID(name)}
-	$results['prefix'] = $prefix[0];	
-	
-	//get max wait time from Queue command
-	$sql = "SELECT args,descr FROM extensions WHERE extension = '$account' AND context = 'ext-queues' AND application = 'Queue'";
-	list($args, $descr) = $db->getRow($sql);
-	$maxwait = explode(',',$args);  //in table like queuenum,t,,,maxwait
-	$results['agentannounce'] = $maxwait[3];
-	$results['maxwait'] = $maxwait[4];
-	$results['name'] = $descr;
-	
-	$sql = "SELECT args FROM extensions WHERE extension = '$account' AND context = 'ext-queues' and application = 'Playback'";
-	list($args) = $db->getRow($sql);
-	$results['joinannounce'] = $args; 
-	
-	//get password from AddQueueMember command
-	$sql = "SELECT args FROM extensions WHERE extension = '$account*' AND context = 'ext-queues'";
-	list($args) = $db->getRow($sql);
-	$password = explode(',',$args); //in table like agent-add,account,password
-	$results['password'] = $password[2];
-	
-	//get the failover destination (desc=jump)
-	$sql = "SELECT args FROM extensions WHERE extension = '".$account."' AND descr = 'jump' AND context = 'ext-queues'";
-	list($args) = $db->getRow($sql);
-	$results['goto'] = $args; 
+	if ($queues_conf_only) {
+		$sql = "SELECT ivr_id FROM queues_config WHERE extension = $account";
+		$config = sql($sql, "getRow",DB_FETCHMODE_ASSOC);
+
+		// We need to strip off all but the first sound file of any compound sound files
+		//
+		$agentannounce_arr        = explode("&", $config['agentannounce']);
+		$results['agentannounce'] = $agentannounce_arr[0];
+	} else {
+		$sql = "SELECT * FROM queues_config WHERE extension = $account";
+		$config = sql($sql, "getRow",DB_FETCHMODE_ASSOC);
+
+		$results['prefix']        = $config['grppre'];
+		$results['alertinfo']     = $config['alertinfo'];
+		$results['agentannounce'] = $config['agentannounce'];
+		$results['maxwait']       = $config['maxwait'];
+		$results['name']          = $config['descr'];
+		$results['joinannounce']  = $config['joinannounce'];
+		$results['password']      = $config['password'];
+		$results['goto']          = $config['dest'];
+		$results['announcemenu']  = $config['ivr_id'];
+		$results['rtone']         = $config['ringing'];
+		$results['cwignore']      = $config['cwignore'];
+	}
+
+	$results['context'] = '';
+	$results['periodic-announce'] = '';
+
+	if ($config['ivr_id'] != 'none' && $config['ivr_id'] != '') {
+		if (function_exists('ivr_get_details')) {
+			$results['context'] = "ivr-".$config['ivr_id'];
+			$arr = ivr_get_details($config['ivr_id']);
+			if( isset($arr['announcement']) && $arr['announcement'] != '') {
+
+				// We need to strip off all but the first sound file of any compound sound files
+				//
+				$periodic_arr = explode("&", $arr['announcement']);
+				$results['periodic-announce'] = $periodic_arr[0];
+			}
+		}
+	}
 
 	return $results;
 }

Added: freepbx-modules/trunk/modules/queues/i18n/it_IT/LC_MESSAGES/queues.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/queues/i18n/it_IT/LC_MESSAGES/queues.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/queues/i18n/it_IT/LC_MESSAGES/queues.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/queues/i18n/it_IT/LC_MESSAGES/queues.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/queues/i18n/it_IT/LC_MESSAGES/queues.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/queues/i18n/it_IT/LC_MESSAGES/queues.po (added)
+++ freepbx-modules/trunk/modules/queues/i18n/it_IT/LC_MESSAGES/queues.po Sun May 18 19:52:05 2008
@@ -1,0 +1,502 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-02-01 16:40+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: Italian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: page.queues.php:85
+msgid "Warning! Extension"
+msgstr "Attenzione! L'interno"
+
+#: page.queues.php:85
+msgid "is not allowed for your account."
+msgstr "non è consentito al tuo account."
+
+#: page.queues.php:117 page.queues.php:151 page.queues.php:161
+msgid "Add Queue"
+msgstr "Aggiungi Coda"
+
+#: page.queues.php:131
+msgid "Queue"
+msgstr "Coda"
+
+#: page.queues.php:131
+msgid "deleted"
+msgstr "eliminata"
+
+#: page.queues.php:144
+msgid "Delete Queue"
+msgstr "Elimina Coda"
+
+#: page.queues.php:149
+msgid "Queue:"
+msgstr "Coda:"
+
+#: page.queues.php:161
+msgid "Edit Queue"
+msgstr "Modifica Coda"
+
+#: page.queues.php:166
+msgid "queue number:"
+msgstr "Numero coda:"
+
+#: page.queues.php:166
+msgid ""
+"Use this number to dial into the queue, or transfer callers to this number "
+"to put them into the queue.<br><br>Agents will dial this queue number plus * "
+"to log onto the queue, and this queue number plus ** to log out of the queue."
+"<br><br>For example, if the queue number is 123:<br><br><b>123* = log "
+"in<br>123** = log out</b>"
+msgstr "Utilizzare questo numero per chiamare la coda, o trasferire i chiamanti in questa coda. <br><br>Gli agenti dovranno chiamare questo numero di coda più asterisco (numero+*) per entrare, e numero più due volte asterisco (numero+**) per uscirne.<br><br>Per esempio, se il numero della coda è 123:<br><br><b>123* = log in<br>123** = log out</b>"
+
+#: page.queues.php:171
+msgid "queue name:"
+msgstr "Nome coda:"
+
+#: page.queues.php:171
+msgid "Give this queue a brief name to help you identify it."
+msgstr "Dare alla coda un nome breve per una facile identificazione."
+
+#: page.queues.php:175
+msgid "queue password:"
+msgstr "Password coda:"
+
+#: page.queues.php:175
+msgid ""
+"You can require agents to enter a password before they can log in to this "
+"queue.<br><br>This setting is optional."
+msgstr "Si può richiedere agli agenti di digitare una password prima di entrare in una coda.<br><br>Questa impostazione è opzionale."
+
+#: page.queues.php:179
+msgid "CID name prefix:"
+msgstr "Nome prefisso Identificativo:"
+
+#: page.queues.php:179
+msgid ""
+"You can optionally prefix the Caller ID name of callers to the queue. ie: If "
+"you prefix with \"Sales:\", a call from John Doe would display as \"Sales:"
+"John Doe\" on the extensions that ring."
+msgstr "Si può, come opzione, inserire un prefisso prima dell'Identificativo (CID) del chiamante della coda. Es: se si inserisce \"Vendite:\", una chiamata da Mario Rossi apparirà come \"Vendite: Mario Rossi\"."
+
+#: page.queues.php:183
+msgid "static agents"
+msgstr "Agenti statici"
+
+#: page.queues.php:183
+msgid ""
+"Static agents are extensions that are assumed to always be on the queue.  Static agents do not need to 'log in' to the queue, and cannot 'log out' of the queue.<br><br>List extensions to ring, one per line.<br><br>You can include an extension on a remote system, or an external number (Outbound Routing must contain a valid route for external numbers).<br><br>You can list agents defined in agents.conf by preceding the agent number with A, so agent 4002 would be listed as A4002. This is experimental and not supported. There are known issues, such as the inability for an agents.conf agent to do subsequent transfers to voicemail<br><br>In all cases, you can put a \",\" after the agent followed by a penalty value. Use penalties at your own risk, they are very broken in asterisk."
+msgstr "Gli agenti statici sono gli interni che appartengono sempre alla coda. Gli agenti statici non hanno bisogno di effettuare un 'login in' nella coda, e non possono effettuare 'log-out' dalla coda.<br><br>Inserire gli interni da far squillare, uno per riga.<br><br>Si possono includere interni di un sistema remoto, o un numero esterno (le rotte in uscita devono contenere uscite valide per i numeri esterni). Si possono anche inserire gli agenti definiti nel file agents.conf anteponendo la lettera A al nome (Es: agente 267 andrà inserito come A267). Questo è sperimentale e non supportato. Ci sono diversi problemi noti, per esempio un agente presente in agents.conf non puo' trasferire una chiamata ad una casella vocale.<br><br>In tutti i casi è possibile inserire \",\" seguito dallà penalità. Utilizzare le penalità con prudenza, hanno diversi problemi in asterisk.<br><br>"
+
+#: page.queues.php:190
+msgid "Queue Options"
+msgstr "Opzioni Coda"
+
+#: page.queues.php:193 page.queues.php:212
+msgid "Agent Announcement:"
+msgstr "Annuncio Agente:"
+
+#: page.queues.php:193
+msgid ""
+"Announcement played to the Agent prior to bridging in the caller <br><br> "
+"Example: \"the Following call is from the Sales Queue\" or \"This call is "
+"from the Technical Support Queue\".<br><br>To add additional recordings "
+"please use the \"System Recordings\" MENU to the left"
+msgstr "L'annuncio riprodotto prima che l'Agente si colleghi con il chiamante <br><br> Esempio: \"la seguente chiamata è dalla Coda Vendite\" o \"Questa chiamata è dalla Coda Supporto Tecnico\".<br><br>Per aggiungere altre registrazioni utilizzare il menu \"Registrazioni di Sistema\" sulla sinistra"
+
+#: page.queues.php:199 page.queues.php:457 page.queues.php:487
+msgid "None"
+msgstr "Nessuno"
+
+#: page.queues.php:212
+msgid ""
+"Announcement played to the Agent prior to bridging in the caller <br><br> "
+"Example: \"the Following call is from the Sales Queue\" or \"This call is "
+"from the Technical Support Queue\".<br><br>You must install and enable the "
+"\"Systems Recordings\" Module to edit this option"
+msgstr "L'annuncio riprodotto prima che l'Agente si colleghi con il chiamante <br><br> Esempio: \"la seguente chiamata è dalla Coda Vendite\" o \"Questa chiamata è dalla Coda Supporto Tecnico\".<br><br>Bisogna prima installare e attivare il modulo \"Registrazioni di Sistema\" per modificare questa opzione."
+
+#: page.queues.php:224
+msgid "Hold Music Category:"
+msgstr "Categoria Musica di Attesa:"
+
+#: page.queues.php:224
+msgid ""
+"Music (or Commercial) played to the caller while they wait in line for an "
+"available agent.<br><br>  This music is defined in the \"On Hold Music\" "
+"Menu to the left."
+msgstr "Categoria Musica di attesa:<span>Musica (o informazioni commerciali) da far ascoltare al chiamante quando è in attesa per un agente disponibile.<br><br> Questa musica è impostabile dal Menu \"Musica di attesa\" sulla sinistra."
+
+#: page.queues.php:242
+msgid "Ringing tone instead of MOH:"
+msgstr "Squillo invece che Musica:"
+
+#: page.queues.php:242
+msgid ""
+"Enabling this option make callers hear a ringing tone instead of Music on "
+"Hold.<br/>If this option is enabled, settings of the previous drop down are "
+"ignored."
+msgstr "Attivando questa opzione i chiamanti ascolteranno uno squillo invece che la Musica di Attesa.<br/>Se si attiva, le impostazioni precedenti saranno ignorate."
+
+#: page.queues.php:248
+msgid "max wait time:"
+msgstr "Tempo massimo di attesa:"
+
+#: page.queues.php:248
+msgid ""
+"The maximum number of seconds a caller can wait in a queue before being "
+"pulled out.  (0 for unlimited)."
+msgstr "Il numero massimo di secondi che un chiamante può aspettare in coda prima che sia buttato fuori. (0 per illimitato)."
+
+#: page.queues.php:255
+msgid "Unlimited"
+msgstr "Illimitato"
+
+#: page.queues.php:264
+msgid "max callers:"
+msgstr "Massimo chiamanti"
+
+#: page.queues.php:264
+msgid "Maximum number of people waiting in the queue (0 for unlimited)"
+msgstr "Il numero massimo di persone che possono aspettare nelle code (0 per illimitato)"
+
+#: page.queues.php:277
+msgid "join empty:"
+msgstr "Raggiungere vuote:"
+
+#: page.queues.php:277
+msgid ""
+"If you wish to allow callers to join queues that currently have no agents, "
+"set this to yes"
+msgstr "Se si vuole permettere ai chiamanti di raggiungere le code che non hanno agenti, impostare questo su Sì"
+
+#: page.queues.php:282 page.queues.php:296 page.queues.php:388
+#: page.queues.php:402 page.queues.php:430 page.queues.php:442
+msgid "Yes"
+msgstr "Si"
+
+#: page.queues.php:282 page.queues.php:296 page.queues.php:377
+#: page.queues.php:388 page.queues.php:402 page.queues.php:431
+#: page.queues.php:443
+msgid "No"
+msgstr "No"
+
+#: page.queues.php:291
+msgid "leave when empty:"
+msgstr "Lasciare quando vuote"
+
+#: page.queues.php:291
+msgid ""
+"If you wish to remove callers from the queue if there are no agents present, "
+"set this to yes"
+msgstr "Impostare SI se si vuole rimuovere i chiamanti dalle code quando non ci sono agenti presenti."
+
+#: page.queues.php:306
+msgid "ring strategy:"
+msgstr "Strategia di quillo:"
+
+#: page.queues.php:308
+msgid "ringall"
+msgstr ""
+
+#: page.queues.php:308
+msgid "ring all available agents until one answers (default)"
+msgstr "chiama tutti gli agenti disponibili fino a quando uno non risponde (predefinito)"
+
+#: page.queues.php:309
+msgid "roundrobin"
+msgstr ""
+
+#: page.queues.php:309
+msgid "take turns ringing each available agent"
+msgstr "chiama a turno tutti gli agenti disponibili"
+
+#: page.queues.php:310
+msgid "leastrecent"
+msgstr ""
+
+#: page.queues.php:310
+msgid "ring agent which was least recently called by this queue"
+msgstr "chiama l'agente che ha ricevuto meno chiamate in questa coda"
+
+#: page.queues.php:311
+msgid "fewestcalls"
+msgstr ""
+
+#: page.queues.php:311
+msgid "ring the agent with fewest completed calls from this queue"
+msgstr "chiama l'agente con il minor numero di chiamate completate in questa coda"
+
+#: page.queues.php:312
+msgid "random"
+msgstr ""
+
+#: page.queues.php:312
+msgid "ring random agent"
+msgstr "chiama un agente a caso"
+
+#: page.queues.php:313
+msgid "rrmemory"
+msgstr ""
+
+#: page.queues.php:313
+msgid "round robin with memory, remember where we left off last ring pass"
+msgstr "fa girare le chiamate ma memorizzando dove l'ultima volta è passata senza risposta"
+
+#: page.queues.php:330
+msgid "agent timeout:"
+msgstr "Timeout agenti:"
+
+#: page.queues.php:330
+msgid ""
+"The number of seconds an agents phone can ring before we consider it a "
+"timeout."
+msgstr "Il numero di secondi che il telefono dell'agente squilla prima che venga considerato irragiungibile."
+
+#: page.queues.php:343
+msgid "retry:"
+msgstr "Riprova:"
+
+#: page.queues.php:343
+msgid "The number of seconds we wait before trying all the phones again"
+msgstr "Il numero di secondi prima che riprova ancora tutti i telefoni"
+
+#: page.queues.php:356
+msgid "wrap-up-time:"
+msgstr "Wrap-up-time:"
+
+#: page.queues.php:356
+msgid ""
+"After a successful call, how many seconds to wait before sending a "
+"potentially free agent another call (default is 0, or no delay)"
+msgstr "Dopo una chiamata avvenuta con successo, quanti secondi aspettare prima di inviare un'altra chiamata ad un agente potenzialmente libero (predefinito 0, nessuna attesa)"
+
+#: page.queues.php:369
+msgid "call recording:"
+msgstr "Registra chiamate:"
+
+#: page.queues.php:369
+msgid ""
+"Incoming calls to agents can be recorded. (saved to /var/spool/asterisk/"
+"monitor)"
+msgstr "Le chiamate entranti agli agenti possono essere registrate. (salvate in /var/spool/asterisk/monitor)"
+
+#: page.queues.php:374
+msgid "wav49"
+msgstr ""
+
+#: page.queues.php:375
+msgid "wav"
+msgstr ""
+
+#: page.queues.php:376
+msgid "gsm"
+msgstr ""
+
+#: page.queues.php:383
+msgid "event when called:"
+msgstr "Evento quando si chiama:"
+
+#: page.queues.php:383
+msgid ""
+"When this option is set to YES, the following manager events will be "
+"generated: AgentCalled, AgentDump, AgentConnect and AgentComplete."
+msgstr "Quando questa impostazione è attivata, saranno generati i seguenti eventi del manager: AgentCalled, AgentDump, AgentConnect e AgentComplete"
+
+#: page.queues.php:397
+msgid "member status off:"
+msgstr "Disattiva stato membri"
+
+#: page.queues.php:397
+msgid ""
+"When if this is option is set to NO, the following manager event will be "
+"generated: QueueMemberStatus"
+msgstr "Quando si imposta NO, saranno generati i seguenti eventi del manager: QueueMemberStatus"
+
+#: page.queues.php:410
+msgid "Caller Announcements"
+msgstr "Annuncio Chiamanti"
+
+#: page.queues.php:412
+msgid "Frequency:"
+msgstr "Frequenza:"
+
+#: page.queues.php:412
+msgid ""
+"How often to announce queue position, estimated holdtime, and/or voice menu "
+"to the caller (0 to Disable Announcements)."
+msgstr "Quanto spesso annunciare al chiamante la posizione in coda, il tempo stimato di attesa, e/o il menu IVR selezionato (0 per disabilitarlo)"
+
+#: page.queues.php:425
+msgid "Announce Position:"
+msgstr "Annuncio Posizione:"
+
+#: page.queues.php:425
+msgid "Announce position of caller in the queue?"
+msgstr "Annunciare la posizione del chiamante in coda?"
+
+#: page.queues.php:437
+msgid "Announce Hold Time:"
+msgstr "Annuncio Tempo di attesa:"
+
+#: page.queues.php:437
+msgid ""
+"Should we include estimated hold time in position announcements?  Either "
+"yes, no, or only once; hold time will not be announced if <1 minute"
+msgstr "Includere il tempo di attesa stimato? Possibile solo sì, no, una volta sola; non verrà annunciato se inferiore al minuto"
+
+#: page.queues.php:444
+msgid "Once"
+msgstr "Una volta"
+
+#: page.queues.php:451
+msgid "Voice Menu:"
+msgstr "Menu IVR:"
+
+#: page.queues.php:451
+msgid ""
+"After announcing Position and/or Hold Time, you can optionally present an "
+"existing Digital Receptionist Voice Menu.<br><br>This voicemenu must only "
+"contain single-digit 'dialed options'."
+msgstr "Dopo aver annunciato la posizione e/o il tempo di attesa, si può come opzione presentare un menu IVR esistente.<br><br>Questo menu deve contenere solo una possibilità."
+
+#: page.queues.php:466
+msgid "Menu ID "
+msgstr "ID Menu"
+
+#: page.queues.php:481 page.queues.php:499
+msgid "Join Announcement:"
+msgstr "Annuncio Raggiungimento:"
+
+#: page.queues.php:481
+msgid ""
+"Announcement played to callers once prior to joining the queue.<br><br>To "
+"add additional recordings please use the \"System Recordings\" MENU to the "
+"left"
+msgstr "L'annuncio da riprodure una volta prima di entrare nella coda.<br><br>Per aggiungere ulteriori registrazioni utilizzare il menu \"Registrazioni di Sistema\" nel MENU di sinistra"
+
+#: page.queues.php:499
+msgid ""
+"Announcement played to callers once prior to joining the queue.<br><br>You "
+"must install and enable the \"Systems Recordings\" Module to edit this option"
+msgstr "Annuncio Raggiungimento:<span>Annuncio riprodotto ai chiamanti prima di raggiungere la coda.<br><br>Per aggiungere registrazioni addizionali, utilizzare il MENU \"Registrazioni di Sistema\""
+
+#: page.queues.php:508
+msgid "Fail Over Destination"
+msgstr "Destinazione dopo fallimento"
+
+#: page.queues.php:544
+msgid ""
+"Custom Goto contexts must contain the string \"custom\".  ie: custom-app,s,1"
+msgstr ""
+
+#: page.queues.php:550
+msgid "Queue Number must not be blank"
+msgstr "Il Numero della coda non può essere lasciato vuoto"
+
+#: page.queues.php:554
+msgid "Queue Number can not be 0"
+msgstr "Il Numero della coda non può essere 0"
+
+#: page.queues.php:558
+msgid "Queue numbers with more than one digit cannot begin with 0"
+msgstr "I numeri delle code che hanno più cifre non possono iniziare con 0"
+
+#: page.queues.php:563
+msgid "Queue name must not be blank"
+msgstr "Il nome della coda non può essere lasciato vuoto"
+
+#: page.queues.php:566
+msgid ""
+"Queue name cannot start with a number, and can only contain letters and "
+"numbers"
+msgstr "Il nome della coda non può iniziare con un numero, e può contenere solo lettere e numeri"
+
+msgid "Submit Changes"
+msgstr "Invia"
+
+msgid "Core"
+msgstr "Sistema"
+
+msgid "Conferences"
+msgstr "Conferenze"
+
+msgid "Phonebook Directory"
+msgstr "Rubrica"
+
+msgid "Queues"
+msgstr "Code"
+
+msgid "Ring Groups"
+msgstr "Gruppi di chiamata"
+
+msgid "Speed dial functions"
+msgstr "Selezione breve"
+
+msgid "Time Conditions"
+msgstr "Condizioni Temporali"
+
+msgid "Custom Contexts"
+msgstr "Contesti Personalizzati"
+
+msgid "Extended Routing"
+msgstr "Rotte specifiche"
+
+msgid "Custom App<span><br>ADVANCED USERS ONLY<br><br>Uses Goto() to send caller to a custom context.<br><br>The context name should start with \"custom-\", and be in the format custom-context,extension,priority. Example entry:<br><br><b>custom-myapp,s,1</b><br><br>The <b>[custom-myapp]</b> context would need to be created and included in extensions_custom.conf</span>"
+msgstr "Applicazione Personalizzata<span>SOLO UTENTI AVANZATI<br>Utilizzare Goto() per inviare la chiamata verso un contesto personalizzato.<br><br>Il nome del contesto deve iniziare per \"custom-\" e deve essere nel formato custom-contesto,extension,priorità. Esempio: <br><br><b>custom-app,s,1</b><br><br><b>Il contesto [custom-app] </b> deve poi essere creato e incluso nel file extensions_custom.conf</span>"
+
+msgid "Voicemail"
+msgstr "Casella Vocale"
+
+msgid "Extensions"
+msgstr "Interni"
+
+msgid "Day Night Mode"
+msgstr "Controllo Giorno Notte"
+
+msgid "Terminate Call"
+msgstr "Termina Chiamata"
+
+msgid "member status:"
+msgstr "Stato membri:"
+
+msgid "When if this is option is set to YES, the following manager event will be generated: QueueMemberStatus"
+msgstr "Se impostato su SI, verrà generato il seguente evento manager: QueueMemberStatus"
+
+msgid "Music on Hold Class:"
+msgstr "Classe Musica di Attesa:"
+
+msgid "Music (or Commercial) played to the caller while they wait in line for an available agent. Choose \"inherit\" if you want the MoH class to be what is currently selected, such as by the inbound route.<br><br>  This music is defined in the \"Music on Hold\" Menu to the left."
+msgstr "Musica (o avviso Commerciale) da riprodurre al chiamante mentre è in attesa. Segliere \"inherit\" per lasciare la classe corrente, se si è già selezionata una nella rotta in entrata.<br><br> La musica è impostabile nel menu di sinistra \"Musica di Attesa\"."
+
+msgid "Caller Position Announcements"
+msgstr "Annuncio Posizione Chiamanti"
+
+msgid "Periodic Announcements"
+msgstr "Annunci Periodici"
+
+msgid "IVR Break Out Menu:"
+msgstr "Menu IVR di Uscita:"
+
+msgid "You can optionally present an existing IVR as a 'break out' menu.<br><br>This IVR must only contain single-digit 'dialed options'. The Recording set for the IVR will be played at intervals specified in 'Repeat Frequency', below."
+msgstr "Si puo' presentare un menu IVR esistente come opzione di 'uscita'.<br><br>Questo IVR deve contenere una solo opzione di chiamata. La registrazione audio dell'IVR sarà riprodotta ad intervalli specificati in 'Frequenza di Ripetizione', qui sotto."
+
+msgid "Repeat Frequency:"
+msgstr "Frequenza di Ripetizione:"
+
+msgid "How often to announce a voice menu to the caller (0 to Disable Announcements)."
+msgstr "Quanto spesso si deve riprodurre il menu al chiamante (0 per Disabilitare gli Annunci)."
+
+msgid "Clean & Remove duplicates"
+msgstr "Pulisci & Rimuovi duplicati"

Modified: freepbx-modules/trunk/modules/queues/install.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/queues/install.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/queues/install.php (original)
+++ freepbx-modules/trunk/modules/queues/install.php Sun May 18 19:52:05 2008
@@ -1,7 +1,17 @@
 <?php
-
 global $db;
-global $amp_conf;
+
+if (! function_exists("out")) {
+	function out($text) {
+		echo $text."<br />";
+	}
+}
+
+if (! function_exists("outn")) {
+	function outn($text) {
+		echo $text;
+	}
+}
 
 $results = array();
 $sql = "SELECT args, extension, priority FROM extensions WHERE context = 'ext-queues' AND descr = 'jump'";
@@ -23,20 +33,271 @@
 	}
 }
 
-// Version 2.2.11 change (#1659)
+// Version 2.2.14 change - bump up priority on Goto because of inserted alert-info
 //
-$results = $db->query("ALTER TABLE `queues` CHANGE `id` `id` VARCHAR( 45 ) NOT NULL DEFAULT '-1'");
+
+$results = $db->query("UPDATE extensions SET priority = '7' WHERE context = 'ext-queues' AND priority = '6' AND application = 'Goto' AND descr = 'jump'");
 if(DB::IsError($results)) {
 	echo $results->getMessage();
 	return false;
 }
 
-// Version 2.2.13 change (#2277)
-//
-$results = $db->query("ALTER TABLE `queues` CHANGE `keyword` `keyword` VARCHAR( 30 ) NOT NULL");
-if(DB::IsError($results)) {
-	echo $results->getMessage();
-	return false;
-}
+	/** 2.4.0 Migrate away from legacy extensions table and queues table to queues_config and queues_details
+	*/
+
+	$return_code = true;
+
+	outn(_("Checking for legacy queues table.."));
+	$sql = "SELECT * FROM `queues`";
+	$results = $db->query($sql);
+	if (DB::IsError($results)) {
+		out(_("NO table found, no migration to do just create tables"));
+		// Must not be a table so don't try to migrate
+		$migrate_queues_config = false;
+		$migrate_queues_details = false;
+	} else {
+		out(_("OK"));
+		$migrate_queues_config = true;
+		$migrate_queues_details = true;
+	}
+
+	// Create/Migrate the queues_details table, don't put IF NOT EXISTS so we
+	// can get the status in the error
+	//
+	$sql = "
+	CREATE TABLE `queues_details` (
+		`id` varchar( 45 ) NOT NULL default '-1',
+		`keyword` varchar( 30 ) NOT NULL default '',
+		`data` varchar( 150 ) NOT NULL default '',
+		`flags` int( 1 ) NOT NULL default '0',
+		PRIMARY KEY ( `id` , `keyword` , `data` )
+	)";
+
+	outn(_("Creating queues_details.."));
+	$results = $db->query($sql);
+	if (DB::IsError($results)) {
+		$migrate_queues_details = false;
+		if ($results->getCode() == DB_ERROR_ALREADY_EXISTS) {
+			out(_("already exists"));
+		} else {
+			out(_("ERROR: could not create table"));
+			$return_code = false;
+		}
+	} else if ($migrate_queues_details) {
+		out(_("OK"));
+		// Successfully created table so migrate the data next
+		//
+		$sql = "
+		INSERT INTO `queues_details`
+		SELECT *
+		FROM `queues` 
+		WHERE
+		keyword NOT IN ('rtone', 'account', 'context')
+		";
+
+		outn(_("Migrating to queues_details.."));
+		$results = $db->query($sql);
+		if (DB::IsError($results)) {
+			out(_("ERROR: could not migrate to queues_details"));
+			$return_code = false;
+		} else {
+			out(_("OK"));
+		}
+	} else {
+		out(_("OK"));
+	}
+	// Finished migrating to queues_details
+
+	// Create the queues_config table, don't put IF NOT EXISTS so we
+	// can get the status in the error
+	//
+	$sql = "
+	CREATE TABLE queues_config (
+	  extension varchar(20) NOT NULL default '',
+	  descr varchar(35) NOT NULL default '',
+	  grppre varchar(100) NOT NULL default '',
+	  alertinfo varchar(254) NOT NULL default '',
+	  joinannounce varchar(254) NOT NULL default '',
+	  ringing tinyint(1) NOT NULL default '0',
+	  agentannounce varchar(254) NOT NULL default '',
+	  maxwait varchar(8) NOT NULL default '',
+	  `password` varchar(20) NOT NULL default '',
+	  ivr_id varchar(8) NOT NULL default '0',
+	  dest varchar(50) NOT NULL default '',
+	  cwignore tinyint(1) NOT NULL default '0',
+	PRIMARY KEY  (extension)
+	)";
+
+	outn(_("Creating queues_config.."));
+	$results = $db->query($sql);
+	if (DB::IsError($results)) {
+		$migrate_queues_config = false;
+		if ($results->getCode() == DB_ERROR_ALREADY_EXISTS) {
+			out(_("already exists"));
+		} else {
+			out(_("ERROR: could not create table"));
+			$return_code = false;
+		}
+	} else if ($migrate_queues_config) {
+		out(_("OK"));
+		// Successfully created table so migrate the data next
+		//
+		$got_items = true;
+		outn(_("Migrating data to queues_config.."));
+		$sql = "SELECT id, data context FROM queues WHERE keyword = 'context'";
+		$context_results = $db->getAll($sql, DB_FETCHMODE_ASSOC);
+		if(DB::IsError($context_results)) {
+			out(_("ERROR: accessing queues table obtaining context info, aborting"));
+			$return_code = false;
+			$got_items = false;
+		} 
+		$sql = "SELECT id, data rtone FROM queues WHERE keyword = 'rtone'";
+		$rtone_results = $db->getAll($sql, DB_FETCHMODE_ASSOC);
+		if(DB::IsError($context_results)) {
+			out(_("ERROR: accessing queues table obtaining rtone info, aborting"));
+			$return_code = false;
+			$got_items = false;
+		} 
+		if ($got_items) {
+			// Got context & rtone, make a hash and then  get the list of IDs
+			//
+			$context_hash = array();
+			foreach ($context_results as $item) {
+				$context_hash[$item['id']] = $item['context'];
+			}
+			$rtone_hash = array();
+			foreach ($rtone_results as $item) {
+				$rtone_hash[$item['id']] = $item['rtone'];
+			}
+			$sql = "SELECT DISTINCT id FROM `queues`";
+			$queue_ids = $db->getAll($sql, DB_FETCHMODE_ASSOC);
+			if(DB::IsError($queue_ids)) {
+				out(_("ERROR: accessing queues table obtaining id list, aborting"));
+				$return_code = false;
+			} else {
+				// Got ids, now we need to go through and get info from legacy table
+				// but first lets create a hash with the context info
+				foreach ($queue_ids as $item) {
+					if (isset($context_hash[$item['id']])) {
+						$queue_ids_hash[$item['id']]['ivr_id'] = ltrim('ivr-',$context_hash[$item['id']]);
+					} else {
+						$queue_ids_hash[$item['id']]['ivr_id'] = '';
+					}
+					if (isset($rtone_hash[$item['id']])) {
+						$queue_ids_hash[$item['id']]['rtone'] = $rtone_hash[$item['id']];
+					} else {
+						$queue_ids_hash[$item['id']]['rtone'] = '0';
+					}
+				}
+				// Now we have a queue_ids_hash with each unique id and the state of ivr_id. The
+				// remaining information comes from the legacy extensions table
+				//
+				foreach ($queue_ids as $item) {
+					$account = $item['id']; // don't run through addslashes() here
+
+					$ivr_id = isset($queue_ids_hash['account']['ivr_id']) ? $queue_ids_hash['account']['ivr_id'] : '';
+					$ivr_id = addslashes($ivr_id);
+					$rtone  = isset($queue_ids_hash['account']['rtone']) ? $queue_ids_hash['account']['rtone'] : '';
+					$rtone  = addslashes($rtone);
+
+					// get CID Prefix
+					//
+					$sql = "SELECT args FROM extensions WHERE extension = '$account' AND context = 'ext-queues' AND application = 'SetCIDName'";
+					list($args) = $db->getRow($sql);
+					$prefix = explode('$',$args); //in table like prefix${CALLERID(name)}
+					$grppre = isset($prefix[0]) ?	$prefix[0] : '';	
+					$grppre = addslashes($grppre);
+
+					// get ALERT_INFO
+					//
+					$sql = "SELECT args FROM extensions WHERE extension = '$account' AND context = 'ext-queues' AND application = 'SetVar' AND args LIKE '__ALERT_INFO=%'";
+					list($args) = $db->getRow($sql);
+					$alertinfo = substr($args,strlen("__ALERT_INFO="));
+					$alertinfo = isset($alertinfo) ? addslashes($alertinfo) : '';
+
+					// get maxwait time, agentannounce and name from Queue command
+					//
+					$sql = "SELECT args,descr FROM extensions WHERE extension = '$account' AND context = 'ext-queues' AND application = 'Queue'";
+					list($args, $descr) = $db->getRow($sql);
+					$maxwait = explode(',',$args);  //in table like queuenum,t,,,maxwait
+
+					$agentannounce = isset($maxwait[3]) ? $maxwait[3] : '';
+					$agentannounce = addslashes($agentannounce);
+					$maxwait       = isset($maxwait[4]) ? $maxwait[4] : '';
+					$maxwait       = addslashes($maxwait);
+					$descr         = isset($descr) ? addslashes($descr) : '';
+
+					// get joinannounce from Playback command
+					//
+					$sql = "SELECT args FROM extensions WHERE extension = '$account' AND context = 'ext-queues' and application = 'Playback'";
+					list($args) = $db->getRow($sql);
+					$joinannounce = isset($args) && $args !== NULL ? addslashes($args) : ''; 
+					
+
+					// get password from AddQueueMember command
+					//
+					$sql = "SELECT args FROM extensions WHERE extension = '$account*' AND context = 'ext-queues'";
+					list($args) = $db->getRow($sql);
+					$password_arr = explode(',',$args); //in table like agent-add,account,password
+					$password = isset($password_arr[2]) ? $password_arr[2] : '';
+					$password = addslashes($password);
+
+					// get the failover destination (desc=jump)
+					//
+					$sql = "SELECT args FROM extensions WHERE extension = '".$account."' AND descr = 'jump' AND context = 'ext-queues'";
+					list($args) = $db->getRow($sql);
+					$dest = isset($args) ? addslashes($args) : '';
+
+					// insert cwignore new to 2.4
+					//
+					$cwignore = '0';
+					$account = addslashes($account);
+
+					// Got everything we need for this id (account) so insert it into the queues_config table
+					$sql = 
+					"INSERT INTO queues_config (extension, descr, grppre, alertinfo, joinannounce, ringing, agentannounce, maxwait, password, ivr_id, dest, cwignore)
+         	VALUES 
+					('$account', '$descr', '$grppre', '$alertinfo', '$joinannounce', '$rtone', '$agentannounce', '$maxwait', '$password', '$ivr_id', '$dest', '$cwignore')";
+					$results = $db->query($sql);
+					if (DB::IsError($results)) {
+						outn(sprintf(_("ERROR: inserting data for row %s: %s.."),$account,$results->getMessage()));
+						$return_code = false;
+					}
+				}
+			}
+			if ($return_code) {
+				out(_("OK"));
+			} else {
+				out(_("ERROR were encountered"));
+			}
+		}
+	} else {
+		out(_("OK"));
+	}
+	// Finished migrating to queues_config
+
+	// Now if all went well, we will remove the old queues table and entries in the extensions table
+	//
+	if ($return_code) {
+		outn(_("Dropping old queues table.."));
+		$sql = "DROP TABLE IF EXISTS queues";
+		$results = $db->query($sql);
+		if (DB::IsError($results)) {
+			out(sprintf(_("WARNING FAILED %s"),$results->getMessage()));
+		} else {
+			out(_("OK"));
+		}
+
+		outn(_("removing queues data extensions table.."));
+		$sql = "DELETE FROM extensions WHERE context = 'ext-queues'";
+		$results = $db->query($sql);
+		if (DB::IsError($results)) {
+			out(sprintf(_("WARNING FAILED %s"),$results->getMessage()));
+		} else {
+			out(_("OK"));
+		}
+	} else {
+		return $return_code;
+	}
 
 ?>

Modified: freepbx-modules/trunk/modules/queues/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/queues/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/queues/module.xml (original)
+++ freepbx-modules/trunk/modules/queues/module.xml Sun May 18 19:52:05 2008
@@ -1,17 +1,22 @@
 <module>
 	<rawname>queues</rawname>
 	<name>Queues</name>
-	<version>2.2.13.7</version>
+	<version>2.4.0.6</version>
 	<type>setup</type>
 	<category>Inbound Call Control</category>
 	<description>
 		Creates a queue where calls are placed on hold and answered on a first-in, first-out basis. Many options are available, including ring strategy for agents, caller announcements, max wait times, etc. 
 	</description>
 	<changelog>
-		*2.2.13.7* #2636 Queues Options member status allways show No
-		*2.2.13.6* #2605 IVR breakout select box picking wrong IVR
-		*2.2.13.5* #2528 add context = 'ext-queues' when getting destination statement
-		*2.2.13.4* initialize qpannounce, may cause queue db errors with IVR breakouts that have no sound file
+		*2.4.0.6* added depends on 2.4.0
+		*2.4.0.5* #2637, monitor-join=yes not supported in asterisk 1.6
+		*2.4.0.4* #2636 Queues Options member status allways show No
+		*2.4.0.3* #2579 added strict to joinempty and leavewhenempy, #2627 ringing box ignored
+		*2.4.0.2* #2528 add context = 'ext-queues' when getting destination statement
+		*2.4.0.1* added out() and outn() to install script
+		*2.4.0* Migration from legacy tables, added queues_conf class, Extension/dest registry, #2282, #2487, it translations
+		*2.2.14.1* initialize qpannounce, may cause queue db errors with IVR breakouts that have no sound file
+		*2.2.14* Add Alert-Info setting to queues
 		*2.2.13.3* Agent Timeout 0 makes results in default, but should be Unlimited fixed
 		*2.2.13.2* #2313 fix error introduced by #2172, Agent Announce not being saved
 		*2.2.13.1* #2172 deprecated use of |, #2193 hard coded moh path
@@ -34,10 +39,14 @@
 		*2.2.3* Change _NODEST to __NODEST for some scenarios that require infinite inheritance
 		*2.2.2* Disallow Queue 0 (#1487)
 		*2.2.1* Add NODEST to tell children NOT to go to destinations (like voicemail or other) - helps with followme in a queue
-		*2.2* First release for FreePBX 2.2 - Fixed compatibility issue with new UI</changelog>
+		*2.2* First release for FreePBX 2.2 - Fixed compatibility issue with new UI
+	</changelog>
+	<depends>
+		<version>2.4.0</version>
+	</depends>
 	<menuitems>
 		<queues>Queues</queues>
 	</menuitems>
-	<location>release/2.3/queues-2.2.13.6.tgz</location>
-	<md5sum>bb64f26b354c38824cc9fa974e96a77b</md5sum>
+	<location>release/2.4/queues-2.4.0.5.tgz</location>
+	<md5sum>f3ec6e10e8c6a483a52272e2a2f2e459</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/queues/page.queues.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/queues/page.queues.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/queues/page.queues.php (original)
+++ freepbx-modules/trunk/modules/queues/page.queues.php Sun May 18 19:52:05 2008
@@ -1,4 +1,4 @@
-<?php /* $Id: page.queues.php 5573 2008-01-12 18:36:56Z p_lindheimer $ */
+<?php /* $Id: page.queues.php 5594 2008-01-14 22:59:31Z p_lindheimer $ */
 //Copyright (C) 2004 Coalescent Systems Inc. (info at coalescentsystems.ca)
 //
 //This program is free software; you can redistribute it and/or
@@ -22,8 +22,11 @@
 isset($_REQUEST['password'])?$password = $_REQUEST['password']:$password='';
 isset($_REQUEST['agentannounce'])?$agentannounce = $_REQUEST['agentannounce']:$agentannounce='';
 isset($_REQUEST['prefix'])?$prefix = $_REQUEST['prefix']:$prefix='';
+isset($_REQUEST['alertinfo'])?$alertinfo = $_REQUEST['alertinfo']:$alertinfo='';
 isset($_REQUEST['joinannounce'])?$joinannounce = $_REQUEST['joinannounce']:$joinannounce='';
 $maxwait = isset($_REQUEST['maxwait'])?$_REQUEST['maxwait']:'';
+$cwignore = isset($_REQUEST['cwignore'])?$_REQUEST['cwignore']:'0';
+$rtone = isset($_REQUEST['rtone'])?$_REQUEST['rtone']:'0';
 
 if (isset($_REQUEST['goto0']) && isset($_REQUEST[$_REQUEST['goto0']."0"])) {
 	$goto = $_REQUEST[$_REQUEST['goto0']."0"];
@@ -88,9 +91,15 @@
 		//if submitting form, update database
 		switch ($action) {
 			case "add":
-				queues_add($account,$name,$password,$prefix,$goto,$agentannounce,$members,$joinannounce,$maxwait);
-				needreload();
-				redirect_standard();
+				$conflict_url = array();
+				$usage_arr = framework_check_extension_usage($account);
+				if (!empty($usage_arr)) {
+					$conflict_url = framework_display_extension_usage_alert($usage_arr);
+				} else {
+					queues_add($account,$name,$password,$prefix,$goto,$agentannounce,$members,$joinannounce,$maxwait,$alertinfo,$cwignore);
+					needreload();
+					redirect_standard();
+				}
 			break;
 			case "delete":
 				queues_del($account);
@@ -99,7 +108,7 @@
 			break;
 			case "edit":  //just delete and re-add
 				queues_del($account);
-				queues_add($account,$name,$password,$prefix,$goto,$agentannounce,$members,$joinannounce,$maxwait);
+				queues_add($account,$name,$password,$prefix,$goto,$agentannounce,$members,$joinannounce,$maxwait,$alertinfo,$cwignore);
 				needreload();
 				redirect_standard('extdisplay');
 			break;
@@ -145,16 +154,27 @@
 				</form>";
 ?>
 
+<?php if (!empty($conflict_url)) {
+      	echo "<h5>"._("Conflicting Extensions")."</h5>";
+      	echo implode('<br .>',$conflict_url);
+      }
+?>
 <?php if ($extdisplay != '') { ?>
 	<h2><?php echo _("Queue:")." ". $extdisplay; ?></h2>
 <?php } else { ?>
 	<h2><?php echo _("Add Queue"); ?></h2>
 <?php } ?>
 
-<?php		if ($extdisplay != ''){ ?>
-
-	<p><?php echo $delButton ?></p>
-<?php		} ?>
+<?php		if ($extdisplay != '') { 
+					echo $delButton;
+					$usage_list = framework_display_destination_usage(queues_getdest($extdisplay));
+					if (!empty($usage_list)) {
+?>
+						<a href="#" class="info"><?php echo $usage_list['text']?>:<span><?php echo $usage_list['tooltip']?></span></a>
+<?php
+					}
+				} 
+?>
 	<form autocomplete="off" name="editQ" action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
 	<input type="hidden" name="display" value="<?php echo $dispnum?>">
 	<input type="hidden" name="action" value="<?php echo (($extdisplay != '') ? 'edit' : 'add') ?>">
@@ -164,27 +184,56 @@
 <?php		if ($extdisplay != ''){ ?>
 		<input type="hidden" name="account" value="<?php echo $extdisplay; ?>">
 <?php		} else { ?>
-		<td><a href="#" class="info"><?php echo _("queue number:")?><span><?php echo _("Use this number to dial into the queue, or transfer callers to this number to put them into the queue.<br><br>Agents will dial this queue number plus * to log onto the queue, and this queue number plus ** to log out of the queue.<br><br>For example, if the queue number is 123:<br><br><b>123* = log in<br>123** = log out</b>")?></span></a></td>
+		<td><a href="#" class="info"><?php echo _("Queue Number:")?><span><?php echo _("Use this number to dial into the queue, or transfer callers to this number to put them into the queue.<br><br>Agents will dial this queue number plus * to log onto the queue, and this queue number plus ** to log out of the queue.<br><br>For example, if the queue number is 123:<br><br><b>123* = log in<br>123** = log out</b>")?></span></a></td>
 		<td><input type="text" name="account" value=""></td>
 <?php		} ?>
 	</tr>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("queue name:")?><span><?php echo _("Give this queue a brief name to help you identify it.")?></span></a></td>
+
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Queue Name:")?><span><?php echo _("Give this queue a brief name to help you identify it.")?></span></a></td>
 		<td><input type="text" name="name" value="<?php echo (isset($name) ? $name : ''); ?>"></td>
 	</tr>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("queue password:")?><span><?php echo _("You can require agents to enter a password before they can log in to this queue.<br><br>This setting is optional.")?></span></a></td>
+
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Queue Password:")?><span><?php echo _("You can require agents to enter a password before they can log in to this queue.<br><br>This setting is optional.")?></span></a></td>
 		<td><input type="text" name="password" value="<?php echo (isset($password) ? $password : ''); ?>"></td>
 	</tr>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("CID name prefix:")?><span><?php echo _("You can optionally prefix the Caller ID name of callers to the queue. ie: If you prefix with \"Sales:\", a call from John Doe would display as \"Sales:John Doe\" on the extensions that ring.")?></span></a></td>
+
+	<tr>
+		<td><a href="#" class="info"><?php echo _("CID Name Prefix:")?><span><?php echo _("You can optionally prefix the Caller ID name of callers to the queue. ie: If you prefix with \"Sales:\", a call from John Doe would display as \"Sales:John Doe\" on the extensions that ring.")?></span></a></td>
 		<td><input size="4" type="text" name="prefix" value="<?php echo (isset($prefix) ? $prefix : ''); ?>"></td>
 	</tr>
-	<tr>
-		<td valign="top"><a href="#" class="info"><?php echo _("static agents") ?>:<span><br><?php echo _("Static agents are extensions that are assumed to always be on the queue.  Static agents do not need to 'log in' to the queue, and cannot 'log out' of the queue.<br><br>List extensions to ring, one per line.<br><br>You can include an extension on a remote system, or an external number (Outbound Routing must contain a valid route for external numbers).<br><br>You can list agents defined in agents.conf by preceding the agent number with A, so agent 4002 would be listed as A4002. This is experimental and not supported. There are known issues, such as the inability for an agents.conf agent to do subsequent transfers to voicemail<br><br>In all cases, you can put a \",\" after the agent followed by a penalty value. Use penalties at your own risk, they are very broken in asterisk.") ?><br><br></span></a></td>
-		<td valign="top">&nbsp;
-			<textarea id="members" cols="15" rows="<?php  $rows = count($member)+1; echo (($rows < 5) ? 5 : (($rows > 20) ? 20 : $rows) ); ?>" name="members"><?php foreach ($member as $mem) { $premem = ""; if (substr($mem,0,5) == "Agent") {$premem = "A";}; $mem = $premem.rtrim(ltrim(strstr($mem,"/"),"/"),"@from-internal");echo substr($mem,0,(strpos($mem,"@")!==false?strpos($mem,"@"):strpos($mem,","))).substr($mem,strrpos($mem, ","))."\n"; }?></textarea><br>
-			<input type="submit" style="font-size:10px;" value="<?php echo _("Clean & Remove duplicates") ?>" />
+
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Alert Info")?><span><?php echo _('ALERT_INFO can be used for distinctive ring with SIP devices.')?></span></a>:</td>
+		<td><input type="text" name="alertinfo" size="30" value="<?php echo (isset($alertinfo)?$alertinfo:'') ?>"></td>
+	</tr>
+
+	<tr>
+		<td valign="top"><a href="#" class="info"><?php echo _("Static Agents") ?>:<span><br><?php echo _("Static agents are extensions that are assumed to always be on the queue.  Static agents do not need to 'log in' to the queue, and cannot 'log out' of the queue.<br><br>List extensions to ring, one per line.<br><br>You can include an extension on a remote system, or an external number (Outbound Routing must contain a valid route for external numbers).<br><br>You can list agents defined in agents.conf by preceding the agent number with A, so agent 4002 would be listed as A4002. This is experimental and not supported. There are known issues, such as the inability for an agents.conf agent to do subsequent transfers to voicemail<br><br>In all cases, you can put a \",\" after the agent followed by a penalty value. Use penalties at your own risk, they are very broken in asterisk.") ?><br><br></span></a></td>
+		<td valign="top">
+			<textarea id="members" cols="15" rows="<?php  $rows = count($member)+1; echo (($rows < 5) ? 5 : (($rows > 20) ? 20 : $rows) ); ?>" name="members"><?php foreach ($member as $mem) { $premem = ""; if (substr($mem,0,5) == "Agent") {$premem = "A";}; $mem = $premem.rtrim(ltrim(strstr($mem,"/"),"/"),"@from-internal");echo substr($mem,0,(strpos($mem,"@")!==false?strpos($mem,"@"):strpos($mem,","))).substr($mem,strrpos($mem, ","))."\n"; }?></textarea>
+		</td>
+	</tr>
+
+	<tr>
+		<td>
+		<a href=# class="info"><?php echo _("Extension Quick Pick")?>
+			<span>
+				<?php echo _("Choose an extension to append to the end of the static agents list above.")?>
+			</span>
+		</a>
+		</td>
+		<td>
+			<select onChange="insertExten();" id="insexten">
+				<option value=""><?php echo _("(pick extension)")?></option>
+	<?php
+				$results = core_users_list();
+				foreach ($results as $result) {
+					echo "<option value='".$result[0]."'>".$result[0]." (".$result[1].")</option>\n";
+				}
+	?>
+			</select>
 		</td>
 	</tr>
 
@@ -197,14 +246,43 @@
 			<?php
 				$tresults = recordings_list();
 				$default = (isset($agentannounce) ? $agentannounce : 'None');
+
+				$compound_recordings = false;
+				$is_error = false;
+
 				echo '<option value="None">'._("None").'</option>';
 				if (isset($tresults[0])) {
 					foreach ($tresults as $tresult) {
-						echo '<option value="'.$tresult[2].'"'.($tresult[2] == $default ? ' SELECTED' : '').'>'.$tresult[1]."</option>\n";
+						if (strpos($tresult[2],"&") === false) {
+							echo '<option value="'.$tresult[2].'"'.($tresult[2] == $default ? ' SELECTED' : '').'>'.$tresult[1]."</option>\n";
+						} else {
+							$compound_recordings = true;
+							echo '<option style="color:red" value="'.$tresult[2].'"'.($tresult[2] == $default ? ' SELECTED' : '').'>'.$tresult[1]." (**)</option>\n";
+							if ($tresult[2] == $default) {
+								$is_error = true;
+							}
+						}
 					}
 				}
 			?>		
 			</select>		
+			<?php
+			if ($compound_recordings) {
+			?>
+				<small><a style="color:red"  href="#" class="info"><?php echo ($is_error ? _("(**) ERRORS") : _("(**) Warning Potential Errors"))?>
+					<span> 
+						<?php 
+							if ($is_error) {
+								echo _("ERROR: You have configured a compound annoucement in your selection. These are annoucements composed of multiple concatenated sound files. The Queue system is not able to play such sound files. Your announcement file will be concatentated and only the first sound file will be played.");
+							} else {
+								echo _("There are compound annoucements in your selection. These are annoucements composed of multiple concatenated sound files. The Queue system is not able to play such sound files. If you choose one of these annoucements your announcement will be concatentated and only the first sound file will be played.");
+							}
+						?>
+					</span></small>
+				</a>
+			<?php
+			}
+			?>
 		</td>
 	</tr>
 
@@ -240,30 +318,42 @@
 		</td>
 	</tr>
 <?php } ?>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("Ringing tone instead of MOH:")?><span><?php echo _("Enabling this option make callers hear a ringing tone instead of Music on Hold.<br/>If this option is enabled, settings of the previous drop down are ignored.")?></span></a></td>
+
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Ringing Instead of MoH:")?><span><?php echo _("Enabling this option make callers hear a ringing tone instead of Music on Hold.<br/>If this option is enabled, settings of the previous drop down are ignored.")?></span></a></td>
 		<td>
 			<input name="rtone" type="checkbox" value="1" <?php echo (isset($rtone) && $rtone == 1 ? 'checked' : ''); ?> />
 		</td>
 	</tr>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("max wait time:")?><span><?php echo _("The maximum number of seconds a caller can wait in a queue before being pulled out.  (0 for unlimited).")?></span></a></td>
+
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Max Wait Time:")?><span><?php echo _("The maximum number of seconds a caller can wait in a queue before being pulled out.  (0 for unlimited).")?></span></a></td>
 		<td>
 			<select name="maxwait"/>
 			<?php
 				$default = (isset($maxwait) ? $maxwait : 0);
-				for ($i=0; $i <= 1200; $i+=30) {
+				for ($i=0; $i < 60; $i+=10) {
 					if ($i == 0)
 						echo '<option value="">'._("Unlimited").'</option>';
 					else
 						echo '<option value="'.$i.'"'.($i == $maxwait ? ' SELECTED' : '').'>'.queues_timeString($i,true).'</option>';
 				}
-			?>		
-			</select>		
-		</td>
-	</tr>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("max callers:")?><span><?php echo _("Maximum number of people waiting in the queue (0 for unlimited)")?></span></a></td>
+				for ($i=60; $i < 300; $i+=30) {
+					echo '<option value="'.$i.'"'.($i == $maxwait ? ' SELECTED' : '').'>'.queues_timeString($i,true).'</option>';
+				}
+				for ($i=300; $i < 1200; $i+=60) {
+					echo '<option value="'.$i.'"'.($i == $maxwait ? ' SELECTED' : '').'>'.queues_timeString($i,true).'</option>';
+				}
+				for ($i=1200; $i <= 3600; $i+=300) {
+					echo '<option value="'.$i.'"'.($i == $maxwait ? ' SELECTED' : '').'>'.queues_timeString($i,true).'</option>';
+				}
+			?>		
+			</select>		
+		</td>
+	</tr>
+
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Max Callers:")?><span><?php echo _("Maximum number of people waiting in the queue (0 for unlimited)")?></span></a></td>
 		<td>
 			<select name="maxlen"/>
 			<?php 
@@ -275,13 +365,14 @@
 			</select>		
 		</td>
 	</tr>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("join empty:")?><span><?php echo _("If you wish to allow callers to join queues that currently have no agents, set this to yes")?></span></a></td>
+
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Join Empty:")?><span><?php echo _("If you wish to allow callers to join queues that currently have no agents, set this to yes. Set to strict if callers cannot join a queue with no members or only unavailable members")?></span></a></td>
 		<td>
 			<select name="joinempty"/>
 			<?php
 				$default = (isset($joinempty) ? $joinempty : 'yes');
-				$items = array('yes'=>_("Yes"),'no'=>_("No"));
+				$items = array('yes'=>_("Yes"),'strict'=>_("Strict"),'no'=>_("No"));
 				foreach ($items as $item=>$val) {
 					echo '<option value="'.$item.'" '. ($default == $item ? 'SELECTED' : '').'>'.$val;
 				}
@@ -289,13 +380,14 @@
 			</select>		
 		</td>
 	</tr>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("leave when empty:")?><span><?php echo _("If you wish to remove callers from the queue if there are no agents present, set this to yes")?></span></a></td>
+
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Leave When Empty:")?><span><?php echo _("If you wish to remove callers from the queue if there are no agents present, set this to yes. Set to strict if callers cannot join a queue with no members or only unavailable members")?></span></a></td>
 		<td>
 			<select name="leavewhenempty"/>
 			<?php
 				$default = (isset($leavewhenempty) ? $leavewhenempty : 'no');
-				$items = array('yes'=>_("Yes"),'no'=>_("No"));
+				$items = array('yes'=>_("Yes"),'strict'=>_("Strict"),'no'=>_("No"));
 				foreach ($items as $item=>$val) {
 					echo '<option value="'.$item.'" '. ($default == $item ? 'SELECTED' : '').'>'.$val;
 				}
@@ -303,9 +395,10 @@
 			</select>		
 		</td>
 	</tr>
-	<tr>
-		<td>
-			<a href="#" class="info"><?php echo _("ring strategy:")?>
+
+	<tr>
+		<td>
+			<a href="#" class="info"><?php echo _("Ring Strategy:")?>
 				<span>
 					<b><?php echo _("ringall")?></b>:  <?php echo _("ring all available agents until one answers (default)")?><br>
 					<b><?php echo _("roundrobin")?></b>: <?php echo _("take turns ringing each available agent")?><br>
@@ -328,8 +421,9 @@
 			</select>
 		</td>
 	</tr>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("agent timeout:")?><span><?php echo _("The number of seconds an agent's phone can ring before we consider it a timeout. Unlimited or other timeout values may still be limited by system ringtime or individual extension defaults.")?></span></a></td>
+
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Agent Timeout:")?><span><?php echo _("The number of seconds an agent's phone can ring before we consider it a timeout. Unlimited or other timeout values may still be limited by system ringtime or individual extension defaults.")?></span></a></td>
 		<td>
 			<select name="timeout"/>
 			<?php
@@ -342,6 +436,7 @@
 			</select>		
 		</td>
 	</tr>
+
 	<tr>
 		<td><a href="#" class="info"><?php echo _("retry:")?><span><?php echo _("The number of seconds we wait before trying all the phones again")?></span></a></td>
 		<td>
@@ -355,8 +450,9 @@
 			</select>		
 		</td>
 	</tr>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("wrap-up-time:")?><span><?php echo _("After a successful call, how many seconds to wait before sending a potentially free agent another call (default is 0, or no delay)")?></span></a></td>
+
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Wrap-Up-Time:")?><span><?php echo _("After a successful call, how many seconds to wait before sending a potentially free agent another call (default is 0, or no delay)")?></span></a></td>
 		<td>
 			<select name="wrapuptime"/>
 			<?php
@@ -368,8 +464,9 @@
 			</select>		
 		</td>
 	</tr>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("call recording:")?><span><?php echo _("Incoming calls to agents can be recorded. (saved to /var/spool/asterisk/monitor)")?></span></a></td>
+
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Call Recording:")?><span><?php echo _("Incoming calls to agents can be recorded. (saved to /var/spool/asterisk/monitor)")?></span></a></td>
 		<td>
 			<select name="monitor-format"/>
 			<?php
@@ -382,8 +479,9 @@
 			</select>		
 		</td>
 	</tr>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("event when called:")?><span><?php echo _("When this option is set to YES, the following manager events will be generated: AgentCalled, AgentDump, AgentConnect and AgentComplete.")?></span></a></td>
+
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Event When Called:")?><span><?php echo _("When this option is set to YES, the following manager events will be generated: AgentCalled, AgentDump, AgentConnect and AgentComplete.")?></span></a></td>
 		<td>
 			<select name="eventwhencalled"/>
 			<?php
@@ -396,8 +494,9 @@
 			</select>
 		</td>
 	</tr>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("member status:")?><span><?php echo _("When if this is option is set to YES, the following manager event will be generated: QueueMemberStatus")?></span></a></td>
+
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Member Status:")?><span><?php echo _("When if this is option is set to YES, the following manager event will be generated: QueueMemberStatus")?></span></a></td>
 		<td>
 			<select name="eventmemberstatus"/>
 			<?php
@@ -410,6 +509,22 @@
 			</select>
 		</td>
 	</tr>
+
+	<tr>
+		<td><a href="#" class="info"><?php echo _("Skip Busy Agents:")?><span><?php echo _("When set to Yes, agents who are on an occupied phone will be skipped as if the line were returning busy. This means that Call Waiting or multi-line phones will not be presented with the call and in the various hunt style ring strategies, the next agent will be attempted.")?></span></a></td>
+		<td>
+			<select name="cwignore"/>
+			<?php
+				$default = (isset($cwignore) ? $cwignore : 'no');
+				$items = array('1'=>_("Yes"),'0'=>_("No"));
+				foreach ($items as $item=>$val) {
+					echo '<option value="'.$item.'" '. ($default == $item ? 'SELECTED' : '').'>'.$val;
+				}
+			?>
+			</select>
+		</td>
+	</tr>
+
 	<tr><td colspan="2"><br><h5><?php echo _("Caller Position Announcements")?><hr></h5></td></tr>
 	<tr>
 		<td><a href="#" class="info"><?php echo _("Frequency:")?><span><?php echo _("How often to announce queue position and estimated holdtime (0 to Disable Announcements).")?></span></a></td>
@@ -424,7 +539,8 @@
 			</select>		
 		</td>
 	</tr>
-<tr>
+
+	<tr>
 		<td><a href="#" class="info"><?php echo _("Announce Position:")?><span><?php echo _("Announce position of caller in the queue?")?></span></a></td>
 		<td>
 			<select name="announceposition"/>
@@ -436,6 +552,7 @@
 			</select>		
 		</td>
 	</tr>
+
 	<tr>
 		<td><a href="#" class="info"><?php echo _("Announce Hold Time:")?><span><?php echo _("Should we include estimated hold time in position announcements?  Either yes, no, or only once; hold time will not be announced if <1 minute")?> </span></a></td>
 		<td>
@@ -450,7 +567,7 @@
 		</td>
 	</tr>
 
-<tr><td colspan="2"><br><h5><?php echo _("Periodic Announcements")?><hr></h5></td></tr>
+	<tr><td colspan="2"><br><h5><?php echo _("Periodic Announcements")?><hr></h5></td></tr>
 
 	
 <?php if(function_exists('ivr_list')) { //only include if IVR module is enabled ?>
@@ -466,20 +583,47 @@
 			//query for exisiting aa_N contexts
 			$unique_aas = ivr_list();		
 			
+			$compound_recordings = false;
+			$is_error = false;
 			if (isset($unique_aas)) {
 				foreach ($unique_aas as $unique_aa) {
 					$menu_id = $unique_aa['ivr_id'];
 					$menu_name = $unique_aa['displayname'];
-					echo '<option value="'.$menu_id.'" '.((strcasecmp($default,"ivr-".$menu_id) != 0) ? '' : 'SELECTED').'>'.($menu_name ? $menu_name : _("Menu ID ").$menu_id);
+					if (strpos($unique_aa['announcement'],"&") === false) {
+						echo '<option value="'.$menu_id.'" '.($default == $menu_id ? 'SELECTED' : '').'>'.($menu_name ? $menu_name : _("Menu ID ").$menu_id)."</option>\n";
+					} else {
+						$compound_recordings = true;
+						echo '<option style="color:red" value="'.$menu_id.'" '.($default == $menu_id ? 'SELECTED' : '').'>'.($menu_name ? $menu_name : _("Menu ID ").$menu_id)." (**)</option>\n";
+						if ($menu_id == $default) {
+							$is_error = true;
+						}
+					}
 				}
 			}
-		
 			?>
 			</select>
+			<?php
+			if ($compound_recordings) {
+			?>
+				<small><a style="color:red"  href="#" class="info"><?php echo ($is_error ? _("(**) ERRORS") : _("(**) Warning Potential Errors"))?>
+					<span> 
+						<?php 
+							if ($is_error) {
+								echo _("ERROR: You have selected an IVR's that use Announcements created from compound sound files. The Queue is not able to play these announcements. This IVR's recording will be truncated to use only the first sound file. You can correct the problem by selecting a different annoucement for this IVR that is not from a compound sound file. The IVR itself can play such files, but the Queue subsystem can not");
+							} else {
+								echo _("You have IVR's that use Announcements created from compound sound files. The Queue is not able to play these announcements. If you choose one of these the recording used with be truncated to use only the first sound file. You can choose this IVR now and then correct the problem by selecting a different annoucement for your IVR that is not from a compound sound file. The IVR itself can play such files, but the Queue subsystem can not");
+							}
+						?>
+					</span></small>
+				</a>
+			<?php
+			}
+			?>
+
 		</td>
 	</tr>
 	
-<tr>
+	<tr>
 		<td><a href="#" class="info"><?php echo _("Repeat Frequency:")?><span><?php echo _("How often to announce a voice menu to the caller (0 to Disable Announcements).")?></span></a></td>
 		<td>
 			<select name="pannouncefreq"/>
@@ -526,15 +670,10 @@
 		</td>
 	</tr>
 <?php } ?>
+
 	<tr><td colspan="2"><br><h5><?php echo _("Fail Over Destination")?><hr></h5></td></tr>
-
 	<?php 
-	//get goto for this group - note priority 6
-	// ***FIXME*** If you change this to use it's own DB, fix IVR upgrades, it manually updates
-	// pri6 in extensions/ext-queues.
-	$goto = legacy_args_get($extdisplay,6,'ext-queues');
 	echo drawselects($goto,0);
-	
 	?>
 	
 	<tr>
@@ -544,6 +683,20 @@
 
 <script language="javascript">
 <!--
+
+function insertExten() {
+	exten = document.getElementById('insexten').value;
+
+	grpList=document.getElementById('members');
+	if (grpList.value[ grpList.value.length - 1 ] == "\n") {
+		grpList.value = grpList.value + exten + ',0';
+	} else {
+		grpList.value = grpList.value + '\n' + exten + ',0';
+	}
+
+	// reset element
+	document.getElementById('insexten').value = '';
+}
 
 function checkQ(theForm) {
         $queuename = theForm.name.value;
@@ -557,8 +710,7 @@
                 whichitem++;
         }
 
-        $account = theForm.account.value;
-        if ($account == "") {
+				if (!isInteger(theForm.account.value)) {
                 <?php echo "alert('"._("Queue Number must not be blank")."')"?>;
                 bad="true";
         }
@@ -583,8 +735,3 @@
 <?php		
 } //end if action == delGRP
 ?>
-
-
-
-
-

Added: freepbx-modules/trunk/modules/queues/uninstall.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/queues/uninstall.php?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/queues/uninstall.php (added)
+++ freepbx-modules/trunk/modules/queues/uninstall.php Sun May 18 19:52:05 2008
@@ -1,0 +1,8 @@
+<?php
+
+global $db;
+
+sql('DROP TABLE IF EXISTS queues_details');
+sql('DROP TABLE IF EXISTS queues_config');
+
+?>

Modified: freepbx-modules/trunk/modules/recordings/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/recordings/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/recordings/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/recordings/functions.inc.php Sun May 18 19:52:05 2008
@@ -12,7 +12,6 @@
 	
 	$modulename = "recordings";
 	$appcontext = "app-recordings";
-	$contextname = 'ext-recordings';
 	
 	switch($engine) {
 		case "asterisk":
@@ -42,16 +41,6 @@
 					//$ext->add($appcontext, $fc_check, '', new ext_goto('1', 'docheck'));
 				}
 			}
-
-		/* Create a context for recordings as destinations */
-		$recordings =  recordings_list();
-		if (is_array($recordings)) {
-			foreach ($recordings as $r) {
-				$ext->add($contextname, 'recording-'.$r[0], '', new ext_answer());
-				$ext->add($contextname, 'recording-'.$r[0], '', new ext_playback($r[2]));
-				$ext->add($contextname, 'recording-'.$r[0], '', new ext_hangup());
-			}
-		}
 		break;
 	}
 }			

Added: freepbx-modules/trunk/modules/recordings/i18n/it_IT/LC_MESSAGES/recordings.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/recordings/i18n/it_IT/LC_MESSAGES/recordings.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/recordings/i18n/it_IT/LC_MESSAGES/recordings.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/recordings/i18n/it_IT/LC_MESSAGES/recordings.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/recordings/i18n/it_IT/LC_MESSAGES/recordings.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/recordings/i18n/it_IT/LC_MESSAGES/recordings.po (added)
+++ freepbx-modules/trunk/modules/recordings/i18n/it_IT/LC_MESSAGES/recordings.po Sun May 18 19:52:05 2008
@@ -1,0 +1,154 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-02-01 17:34+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: Italian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: page.recordings.php:67
+msgid "Failed to create"
+msgstr "Impossibile creare"
+
+#: page.recordings.php:78 page.recordings.php:110
+msgid "System Recording"
+msgstr "Registrazione di Sistema"
+
+#: page.recordings.php:78
+msgid "Saved"
+msgstr "Salvato"
+
+#: page.recordings.php:98
+msgid "Unable to locate"
+msgstr "Impossibile trovare"
+
+#: page.recordings.php:98
+msgid "with a a valid suffix"
+msgstr "con un suffisso valido"
+
+#: page.recordings.php:110
+msgid "Updated"
+msgstr "Aggiornato"
+
+#: page.recordings.php:132 page.recordings.php:206 page.recordings.php:318
+msgid "System Recordings"
+msgstr "Registrazioni di Sistema"
+
+#: page.recordings.php:133 page.recordings.php:260
+msgid "Add Recording"
+msgstr "Aggiungi Registrazione"
+
+#: page.recordings.php:134
+msgid "Step 1: Record or upload"
+msgstr "Fase 1: Registrazione o caricamento"
+
+#: page.recordings.php:136
+msgid "Using your phone,"
+msgstr "Utilizzando il proprio telefono,"
+
+#: page.recordings.php:136 page.recordings.php:180
+msgid "dial"
+msgstr "chiamare"
+
+#: page.recordings.php:137
+msgid "Start speaking at the tone. Hangup when finished."
+msgstr "Parlare dopo il segnale acustico. Riagganciare quando terminato."
+
+#: page.recordings.php:138
+msgid "and speak the message you wish to record."
+msgstr "e registrare il messaggio."
+
+#: page.recordings.php:143
+msgid ""
+"If you wish to make and verify recordings from your phone, please enter your "
+"extension number here:"
+msgstr "Se si desidera registrare o ascoltare una registrazione da telefono, immettere il numero del proprio interno:"
+
+#: page.recordings.php:150
+msgid "any supported asterisk format."
+msgstr "in uno dei formati supportati da asterisk."
+
+#: page.recordings.php:150
+msgid ""
+"Note that if you're using .wav, (eg, recorded with Microsoft Recorder) the "
+"file <b>must</b> be PCM Encoded, 16 Bits, at 8000Hz"
+msgstr "Se si utilizza il formato .wav (registrato per esempio con il Registratore di Microsoft Windows) il file <b>deve</b> essere del formato PCM, 16Bit, 8000Hz"
+
+#: page.recordings.php:169
+msgid "Successfully uploaded"
+msgstr "Caricato con successo"
+
+#: page.recordings.php:179
+msgid "Step 2: Verify"
+msgstr "Fase 2: Verifica"
+
+#: page.recordings.php:180
+msgid "After recording or uploading,"
+msgstr "Dopo la registrazione o il caricamento,"
+
+#: page.recordings.php:180
+msgid "to listen to your recording."
+msgstr "per ascoltare il messaggio"
+
+#: page.recordings.php:181
+msgid "If you wish to re-record your message, dial"
+msgstr "Se si vuole registrare nuovamente il messaggio, chiamare"
+
+#: page.recordings.php:182
+msgid "Step 3: Name"
+msgstr "Fase 3: Nome"
+
+#: page.recordings.php:184
+msgid "Step 2: Name"
+msgstr "Fase 2: Nome"
+
+#: page.recordings.php:188
+msgid "Name this Recording"
+msgstr "Nome"
+
+#: page.recordings.php:194
+msgid "Click \"SAVE\" when you are satisfied with your recording"
+msgstr "Fare click su \"SALVA\" quando terminato"
+
+#: page.recordings.php:207
+msgid "Edit Recording"
+msgstr "Modifica Registrazione"
+
+#: page.recordings.php:261 page.recordings.php:319
+msgid "Built-in Recordings"
+msgstr "Registrazioni interne"
+
+#: page.recordings.php:320
+msgid "Select System Recording:"
+msgstr "Selezionare la Registrazione di Sistema:"
+
+#: page.recordings.php:352
+msgid "Move Up"
+msgstr "Sposta Su"
+
+#: page.recordings.php:357
+msgid "Move Down"
+msgstr "Sposta Giù"
+
+#: page.recordings.php:359
+msgid "Delete"
+msgstr "Elimina"
+
+msgid "Save"
+msgstr "Salva"
+
+msgid "Go"
+msgstr "Vai"
+
+msgid "Alternatively, upload a recording"
+msgstr "In alternativa, carica una registrazione"

Modified: freepbx-modules/trunk/modules/recordings/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/recordings/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/recordings/module.xml (original)
+++ freepbx-modules/trunk/modules/recordings/module.xml Sun May 18 19:52:05 2008
@@ -1,13 +1,15 @@
 <module>
 	<rawname>recordings</rawname>
 	<name>Recordings</name>
-	<version>3.3.5.4</version>
+	<version>3.3.6.1</version>
 	<candisable>no</candisable>
 	<canuninstall>no</canuninstall>
 	<type>setup</type>
 	<category>Internal Options &amp; Configuration</category>
 	<description>Creates and manages system recordings, used by many other modules (eg, IVR).</description>
 	<changelog>
+		*3.3.6.1* #2591, enhance code so bad directory copy errors are reported
+		*3.3.6* it translations, removed legacy ext-recordings left in error
 		*3.3.5.4* #2426 remove non-functioning download link
 		*3.3.5.3* #2409 syntax error in audio.php could cause playback problems
 		*3.3.5.2* #2016 allow amportal.conf AMPLAYKEY override hardcoded crypt key
@@ -23,10 +25,11 @@
 		*3.2.3* Fix for possible wrong recording being selected
 		*3.2.2* Fix for PHP5 not picking up ast recording path
 		*3.2.1* Resolved issue with wrong recording being selected when there's more than one encoding of file (eg, foo.wav and foo.gsm)
-		*3.2* First release for FreePBX 2.2 - Fixed compatibility issue with new UI</changelog>
+		*3.2* First release for FreePBX 2.2 - Fixed compatibility issue with new UI
+	</changelog>
 	<menuitems>
 		<recordings>System Recordings</recordings>
 	</menuitems>
-	<location>release/2.3/recordings-3.3.5.3.tgz</location>
-	<md5sum>1b2afe48ae31f169a6504d1c12468263</md5sum>
+	<location>release/2.4/recordings-3.3.6.tgz</location>
+	<md5sum>60443b1fd56ce4b9c4299235d58c817d</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/recordings/page.recordings.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/recordings/page.recordings.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/recordings/page.recordings.php (original)
+++ freepbx-modules/trunk/modules/recordings/page.recordings.php Sun May 18 19:52:05 2008
@@ -1,5 +1,5 @@
 <?php 
-/* $Id: page.recordings.php 4898 2007-08-19 04:53:32Z p_lindheimer $ */
+/* $Id: page.recordings.php 5658 2008-02-09 18:46:02Z p_lindheimer $ */
 //Copyright (C) 2004 Coalescent Systems Inc. (info at coalescentsystems.ca)
 //
 //Re-written by Rob Thomas <xrobau at gmail.com> 20060318.
@@ -73,7 +73,7 @@
 				echo $recordings_save_path."{$dest}ivrrecording.$suffix<br><br>";
 				echo "make sure you uploaded or recorded a file with the entered extension<hr>";
 			} else {
-				exec("cp " . $recordings_save_path . "{$dest}ivrrecording.$suffix " . $astsnd."custom/{$filename}.$suffix", $outarray, $ret);
+				exec("cp " . $recordings_save_path . "{$dest}ivrrecording.$suffix " . $astsnd."custom/{$filename}.$suffix 2>&1", $outarray, $ret);
 				if (!$ret) {
 					$isok = recordings_add($rname, "custom/{$filename}.$suffix");
 				} else {
@@ -170,7 +170,7 @@
 	</p>
 	<p>
 	<form enctype="multipart/form-data" name="upload" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST"/>
-		<?php echo _('Alternatively, upload a recording in')?> <?php echo _("any supported asterisk format.")?> <?php echo _("Note that if you're using .wav, (eg, recorded with Microsoft Recorder) the file <b>must</b> be PCM Encoded, 16 Bits, at 8000Hz")?></span></a>:<br>
+		<?php echo _("Alternatively, upload a recording in")?> <?php echo _("any supported asterisk format.")?> <?php echo _("Note that if you're using .wav, (eg, recorded with Microsoft Recorder) the file <b>must</b> be PCM Encoded, 16 Bits, at 8000Hz")?></span></a>:<br>
 		<input type="hidden" name="display" value="recordings">
 		<input type="hidden" name="action" value="recordings_start">
                 <input type="hidden" name="usersnum" value="<?php echo $usersnum ?>">
@@ -236,7 +236,11 @@
 	}?>
 	<?php 
 	echo "<a href=config.php?display=recordings&amp;action=delete&amp;usersnum=".urlencode($num);
-	echo "&amp;id=$id>Remove Recording</a> <i style='font-size: x-small'>(Note, does not delete file from computer)</i>";
+	echo "&amp;id=$id>";
+	echo _("Remove Recording");
+	echo "</a> <i style='font-size: x-small'>(";
+	echo _("Note, does not delete file from computer");
+	echo ")</i>";
 	?>
 	<form name="prompt"  action="<?php $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return rec_onsubmit();">
 	<input type="hidden" name="action" value="edited">
@@ -246,16 +250,16 @@
 	<table>
 	<tr><td colspan=2><hr></td></tr>
 	<tr>
-		<td><a href="#" class="info">Change Name<span>This changes the short name, visible on the right, of this recording</span></a></td>
+		<td><a href="#" class="info"><?php echo _("Change Name");?><span><?php echo _("This changes the short name, visible on the right, of this recording");?></span></a></td>
 		<td><input type="text" name="rname" value="<?php echo $this_recording['displayname'] ?>"></td>
 	</tr>
 	<tr>
-	    	<td><a href="#" class="info">Descriptive Name<span>This is displayed, as a hint, when selecting this recording in Queues, Digital Receptionist, etc</span></a></td>
+	    	<td><a href="#" class="info"><?php echo _("Descriptive Name");?><span><?php echo _("This is displayed, as a hint, when selecting this recording in Queues, Digital Receptionist, etc");?></span></a></td>
 	    	<td>&nbsp;<textarea name="notes" rows="3" cols="40"><?php echo $this_recording['description'] ?></textarea></td>
 	</tr>
 	</table>
 	<hr />
-	Files:<br />
+	<?php echo _("Files");?>:<br />
 	<table>
 	<?php 
 	$rec = recordings_get($id);

Modified: freepbx-modules/trunk/modules/ringgroups/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/ringgroups/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/ringgroups/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/ringgroups/functions.inc.php Sun May 18 19:52:05 2008
@@ -1,4 +1,4 @@
-<?php /* $Id: functions.inc.php 4638 2007-08-02 20:11:09Z p_lindheimer $ */
+<?php /* $Id: functions.inc.php 5281 2007-11-25 08:06:37Z p_lindheimer $ */
 
 // The destinations this module provides
 // returns a associative arrays with keys 'destination' and 'description'
@@ -18,6 +18,27 @@
 		return $extens;
 	else
 		return null;
+}
+
+function ringgroups_getdest($exten) {
+	return array("ext-group,$exten,1");
+}
+
+function ringgroups_getdestinfo($dest) {
+	if (substr(trim($dest),0,10) == 'ext-group,') {
+		$grp = explode(',',$dest);
+		$grp = $grp[1];
+		$thisgrp = ringgroups_get($grp);
+		if (empty($thisgrp)) {
+			return array();
+		} else {
+			return array('description' => 'Ring Group '.$grp.': '.$thisgrp['description'],
+			             'edit_url' => 'config.php?display=ringgroups&extdisplay=GRP-'.urlencode($grp),
+								  );
+		}
+	} else {
+		return false;
+	}
 }
 
 /* 	Generates dialplan for ringgroups
@@ -173,6 +194,53 @@
 		return array();
 }
 
+function ringgroups_check_extensions($exten=true) {
+	$extenlist = array();
+	if (is_array($exten) && empty($exten)) {
+		return $extenlist;
+	}
+	$sql = "SELECT grpnum ,description FROM ringgroups ";
+	if (is_array($exten)) {
+		$sql .= "WHERE grpnum in ('".implode("','",$exten)."')";
+	}
+	$results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
+
+	foreach ($results as $result) {
+		$thisexten = $result['grpnum'];
+		$extenlist[$thisexten]['description'] = _("Ring Group: ").$result['description'];
+		$extenlist[$thisexten]['status'] = 'INUSE';
+		$extenlist[$thisexten]['edit_url'] = 'config.php?display=ringgroups&extdisplay=GRP-'.urlencode($thisexten);
+	}
+	return $extenlist;
+}
+
+function ringgroup_check_destinations($dest=true) {
+	global $active_modules;
+
+	$destlist = array();
+	if (is_array($dest) && empty($dest)) {
+		return $destlist;
+	}
+	$sql = "SELECT grpnum, postdest, description FROM ringgroups ";
+	if ($dest !== true) {
+		$sql .= "WHERE postdest in ('".implode("','",$dest)."')";
+	}
+	$results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
+
+	//$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup';
+
+	foreach ($results as $result) {
+		$thisdest = $result['postdest'];
+		$thisid   = $result['grpnum'];
+		$destlist[] = array(
+			'dest' => $thisdest,
+			'description' => 'Ringroup: '.$result['description'].'('.$thisid.')',
+			'edit_url' => 'config.php?display=ringgroups&extdisplay=GRP-'.urlencode($thisid),
+		);
+	}
+	return $destlist;
+}
+
 function ringgroups_get($grpnum) {
 	$results = sql("SELECT grpnum, strategy, grptime, grppre, grplist, annmsg, postdest, description, alertinfo, needsconf, remotealert, toolate, ringing FROM ringgroups WHERE grpnum = '".str_replace("'", "''", $grpnum)."'","getRow",DB_FETCHMODE_ASSOC);
 	return $results;

Modified: freepbx-modules/trunk/modules/ringgroups/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/ringgroups/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/ringgroups/module.xml (original)
+++ freepbx-modules/trunk/modules/ringgroups/module.xml Sun May 18 19:52:05 2008
@@ -1,13 +1,15 @@
 <module>
 	<rawname>ringgroups</rawname>
 	<name>Ring Groups</name>
-	<version>2.2.16.2</version>
+	<version>2.4.0.1</version>
 	<type>setup</type>
 	<category>Inbound Call Control</category>
 	<description>
 		Creates a group of extensions that all ring together. Extensions can be rung all at once, or in various 'hunt' configurations. Additionally, external numbers are supported, and there is a call confirmation option where the callee has to confirm if they actually want to take the call before the caller is transferred.
 	</description>
 	<changelog>
+		*2.4.0.1* added depends on 2.4.0
+		*2.4.0* Extension/dest registry, extension quickpick, added hunt strategy with confirmation, it trans, formatting changes
 		*2.2.16.2* #2193 moh path hardcoded
 		*2.2.16.1* bump for rc1
 		*2.2.16* #1961 changed to allow leading 0 extensions
@@ -31,10 +33,14 @@
 		*2.2.3* Clarification on help message if you want to ring follow-me and other non-extension numbers
 		*2.2.2* Forgot to add default starting RG number as 600
 		*2.2.1* Cleanup of the UI, remove workaround of formatting bugs with previous UI
-		*2.2* First release for FreePBX 2.2 - Fixed compatibility issue with new UI</changelog>
+		*2.2* First release for FreePBX 2.2 - Fixed compatibility issue with new UI
+	</changelog>
+	<depends>
+		<version>2.4.0</version>
+	</depends>
 	<menuitems>
 		<ringgroups>Ring Groups</ringgroups>
 	</menuitems>
-	<location>release/2.3/ringgroups-2.2.16.1.tgz</location>
-	<md5sum>2a295dd349cf30ab1cf3f1d93fff96f7</md5sum>
+	<location>release/2.4/ringgroups-2.4.0.tgz</location>
+	<md5sum>77be2567e18c82e5ac078e9288c239d2</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/ringgroups/page.ringgroups.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/ringgroups/page.ringgroups.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/ringgroups/page.ringgroups.php (original)
+++ freepbx-modules/trunk/modules/ringgroups/page.ringgroups.php Sun May 18 19:52:05 2008
@@ -1,4 +1,4 @@
-<?php /* $Id: page.ringgroups.php 4911 2007-08-21 04:47:57Z p_lindheimer $ */
+<?php /* $Id: page.ringgroups.php 5340 2007-12-04 19:10:53Z p_lindheimer $ */
 //Copyright (C) 2004 Coalescent Systems Inc. (info at coalescentsystems.ca)
 //
 //This program is free software; you can redistribute it and/or
@@ -68,9 +68,15 @@
 	} else {
 		//add group
 		if ($action == 'addGRP') {
-			if (ringgroups_add($account,$strategy,$grptime,implode("-",$grplist),$goto,$description,$grppre,$annmsg,$alertinfo,$needsconf,$remotealert,$toolate,$ringing)) {
+
+			$conflict_url = array();
+			$usage_arr = framework_check_extension_usage($account);
+			if (!empty($usage_arr)) {
+				$conflict_url = framework_display_extension_usage_alert($usage_arr);
+
+			} elseif (ringgroups_add($account,$strategy,$grptime,implode("-",$grplist),$goto,$description,$grppre,$annmsg,$alertinfo,$needsconf,$remotealert,$toolate,$ringing)) {
 				needreload();
-				redirect_standard('extdisplay');
+				redirect_standard();
 			}
 		}
 		
@@ -141,6 +147,14 @@
 			
 		echo "<h2>"._("Ring Group").": ".ltrim($extdisplay,'GRP-')."</h2>";
 		echo "<p>".$delButton."</p>";
+
+		$usage_list = framework_display_destination_usage(ringgroups_getdest(ltrim($extdisplay,'GRP-')));
+		if (!empty($usage_list)) {
+		?>
+			<a href="#" class="info"><?php echo $usage_list['text']?>:<span><?php echo $usage_list['tooltip']?></span></a>
+		<?php
+		}
+
 	} else {
 		$grplist = explode("-", '');;
 		$strategy = '';
@@ -154,6 +168,11 @@
 		$toolate = '';
 		$ringing = '';
 
+		if (!empty($conflict_url)) {
+			echo "<h5>"._("Conflicting Extensions")."</h5>";
+			echo implode('<br .>',$conflict_url);
+		}
+
 		echo "<h2>"._("Add Ring Group")."</h2>";
 	}
 	?>
@@ -173,12 +192,14 @@
 				<td><input size="5" type="text" name="account" value="<?php  if ($gresult[0]==0) { echo "600"; } else { echo $gresult[0] + 1; } ?>"></td>
 <?php 		} ?>
 			</tr>
+
 			<tr>
 		    <td> <a href="#" class="info"><?php echo _("Group Description:")?>:<span><?php echo _("Provide a descriptive title for this Ring Group.")?></span></a></td>
 				<td><input size="20" maxlength="35" type="text" name="description" value="<?php echo htmlspecialchars($description); ?>"></td>
 			</tr>
-			<tr>
-				<td> <a href="#" class="info"><?php echo _("Ring strategy:")?>
+
+			<tr>
+				<td> <a href="#" class="info"><?php echo _("Ring Strategy:")?>
 				<span>
 					<b><?php echo _("ringall")?></b>:  <?php echo _("Ring all available channels until one answers (default)")?><br>
 					<b><?php echo _("hunt")?></b>: <?php echo _("Take turns ringing each available extension")?><br>
@@ -200,122 +221,153 @@
 					</select>
 				</td>
 			</tr>
-			<tr>
-				<td valign="top"><a href="#" class="info"><?php echo _("Extension list")?>:<span><br><?php echo _("List extensions to ring, one per line.<br><br>You can include an extension on a remote system, or an external number by suffixing a number with a pound (#).  ex:  2448089# would dial 2448089 on the appropriate trunk (see Outbound Routing)<br><br>Extensions will ring the actual extension. If you want them to be sent down channel local (to ring follow-me, other ringgroups, queues, etc. then put a pound (#) at the end. Be careful!")?><br><br></span></a></td>
+
+			<tr>
+				<td>
+					<a href=# class="info"><?php echo _("Ring Time (max 60 sec)")?>
+						<span>
+							<?php echo _("Time in seconds that the phones will ring. For all hunt style ring strategies, this is the time for each iteration of phone(s) that are rung")?>
+						</span>
+					</a>
+				</td>
+				<td><input size="4" type="text" name="grptime" value="<?php  echo $grptime?$grptime:20 ?>"></td>
+			</tr>
+
+			<tr>
+				<td valign="top"><a href="#" class="info"><?php echo _("Extension List")?>:<span><br><?php echo _("List extensions to ring, one per line, or use the Extension Quick Pick below to insert them here.<br><br>You can include an extension on a remote system, or an external number by suffixing a number with a '#'.  ex:  2448089# would dial 2448089 on the appropriate trunk (see Outbound Routing)<br><br>Extensions (without a '#' will not ring a user's Follow-Me. To dial Follow-Me, Queues and other numbers that are not extensions, put a '#' at the end.")?><br><br></span></a></td>
 				<td valign="top">
 <?php
 		$rows = count($grplist)+1; 
 		($rows < 5) ? 5 : (($rows > 20) ? 20 : $rows);
 ?>
-					<textarea id="grplist" cols="15" rows="<?php  echo $rows ?>" name="grplist"><?php echo implode("\n",$grplist);?></textarea><br>
-					
-					<input type="submit" style="font-size:10px;" value="<?php echo _("Clean & Remove duplicates")?>" />
-				</td>
-			</tr>
-			<tr>
-				<td><a href="#" class="info"><?php echo _("CID name prefix")?>:<span><?php echo _('You can optionally prefix the Caller ID name when ringing extensions in this group. ie: If you prefix with "Sales:", a call from John Doe would display as "Sales:John Doe" on the extensions that ring.')?></span></a></td>
-				<td><input size="4" type="text" name="grppre" value="<?php  echo $grppre ?>"></td>
-			</tr>
-
-
-			<tr>
-				<td><?php echo _("Ring time (max 60 sec)")?>:</td>
-				<td><input size="4" type="text" name="grptime" value="<?php  echo $grptime?$grptime:20 ?>"></td>
-			</tr>
+					<textarea id="grplist" cols="15" rows="<?php  echo $rows ?>" name="grplist"><?php echo implode("\n",$grplist);?></textarea>
+				</td>
+			</tr>
+
+			<tr>
+				<td>
+				<a href=# class="info"><?php echo _("Extension Quick Pick")?>
+					<span>
+						<?php echo _("Choose an extension to append to the end of the extension list above.")?>
+					</span>
+				</a>
+				</td>
+				<td>
+					<select onChange="insertExten();" id="insexten">
+						<option value=""><?php echo _("(pick extension)")?></option>
+	<?php
+						$results = core_users_list();
+						foreach ($results as $result) {
+							echo "<option value='".$result[0]."'>".$result[0]." (".$result[1].")</option>\n";
+						}
+	?>
+					</select>
+				</td>
+			</tr>
+
 <?php if(function_exists('recordings_list')) { //only include if recordings is enabled?>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("Announcement:")?><span><?php echo _("Message to be played to the caller before dialing this group.<br><br>To add additional recordings please use the \"System Recordings\" MENU to the left")?></span></a></td>
-		<td>
-			<select name="annmsg"/>
-			<?php
-				$tresults = recordings_list();
-				$default = (isset($annmsg) ? $annmsg : '');
-				echo '<option value="">'._("None")."</option>";
-				if (isset($tresults[0])) {
-					foreach ($tresults as $tresult) {
-						echo '<option value="'.$tresult[2].'"'.($tresult[2] == $default ? ' SELECTED' : '').'>'.$tresult[1]."</option>\n";
-					}
-				}
-			?>		
-			</select>		
-		</td>
-	</tr>
+			<tr>
+				<td><a href="#" class="info"><?php echo _("Announcement:")?><span><?php echo _("Message to be played to the caller before dialing this group.<br><br>To add additional recordings please use the \"System Recordings\" MENU to the left")?></span></a></td>
+				<td>
+					<select name="annmsg"/>
+					<?php
+						$tresults = recordings_list();
+						$default = (isset($annmsg) ? $annmsg : '');
+						echo '<option value="">'._("None")."</option>";
+						if (isset($tresults[0])) {
+							foreach ($tresults as $tresult) {
+								echo '<option value="'.$tresult[2].'"'.($tresult[2] == $default ? ' SELECTED' : '').'>'.$tresult[1]."</option>\n";
+							}
+						}
+					?>		
+					</select>		
+				</td>
+			</tr>
 <?php }	else { ?>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("Announcement:")?><span><?php echo _("Message to be played to the caller before dialing this group.<br><br>You must install and enable the \"Systems Recordings\" Module to edit this option")?></span></a></td>
-		<td>
-			<?php
-				$default = (isset($annmsg) ? $annmsg : '');
-			?>
-			<input type="hidden" name="annmsg" value="<?php echo $default; ?>"><?php echo ($default != '' ? $default : 'None'); ?>
-		</td>
-	</tr>
+			<tr>
+				<td><a href="#" class="info"><?php echo _("Announcement:")?><span><?php echo _("Message to be played to the caller before dialing this group.<br><br>You must install and enable the \"Systems Recordings\" Module to edit this option")?></span></a></td>
+				<td>
+					<?php
+						$default = (isset($annmsg) ? $annmsg : '');
+					?>
+					<input type="hidden" name="annmsg" value="<?php echo $default; ?>"><?php echo ($default != '' ? $default : 'None'); ?>
+				</td>
+			</tr>
 <?php } if (function_exists('music_list')) { ?>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("Play Music On Hold?")?><span><?php echo _("If you select a Music on Hold class to play, instead of 'Ring', they will hear that instead of Ringing while they are waiting for someone to pick up.")?></span></a></td>
-		<td>
-			<select name="ringing"/>
-			<?php
-				$tresults = music_list($amp_conf['ASTVARLIBDIR']."/mohmp3");
-				$cur = (isset($ringing) ? $ringing : 'Ring');
-				echo '<option value="Ring">'._("Ring")."</option>";
-				if (isset($tresults[0])) {
-					foreach ($tresults as $tresult) {
-						echo '<option value="'.$tresult.'"'.($tresult == $cur ? ' SELECTED' : '').'>'.$tresult."</option>\n";
-					}
-				}
-			?>		
-			</select>		
-		</td>
-	</tr>
+			<tr>
+				<td><a href="#" class="info"><?php echo _("Play Music On Hold?")?><span><?php echo _("If you select a Music on Hold class to play, instead of 'Ring', they will hear that instead of Ringing while they are waiting for someone to pick up.")?></span></a></td>
+				<td>
+					<select name="ringing"/>
+					<?php
+						$tresults = music_list($amp_conf['ASTVARLIBDIR']."/mohmp3");
+						$cur = (isset($ringing) ? $ringing : 'Ring');
+						echo '<option value="Ring">'._("Ring")."</option>";
+						if (isset($tresults[0])) {
+							foreach ($tresults as $tresult) {
+								echo '<option value="'.$tresult.'"'.($tresult == $cur ? ' SELECTED' : '').'>'.$tresult."</option>\n";
+							}
+						}
+					?>		
+					</select>		
+				</td>
+			</tr>
 <?php } ?>
 			
-	<tr>
-		<td><a href="#" class="info"><?php echo _("Alert Info")?><span><?php echo _('ALERT_INFO can be used for distinctive ring with SIP devices.')?></span></a>:</td>
-		<td><input type="text" name="alertinfo" size="10" value="<?php echo ($alertinfo)?$alertinfo:'' ?>"></td>
-	</tr>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("Confirm Calls")?><span><?php echo _('Enable this if you\'re calling external numbers that need confirmation - eg, a mobile phone may go to voicemail which will pick up the call. Enabling this requires the remote side push 1 on their phone before the call is put through. This feature only works with the ringall ring strategy')?></span></a>:</td>
-		<td> <?php if (!function_exists('recordings_list')) { echo _("System Recordings not installed. Option Disabled"); } else { ?>
-			<input type="checkbox" name="needsconf" value="CHECKED" <?php echo $needsconf ?>  /></td>
+			<tr>
+				<td><a href="#" class="info"><?php echo _("CID Name Prefix")?>:<span><?php echo _('You can optionally prefix the Caller ID name when ringing extensions in this group. ie: If you prefix with "Sales:", a call from John Doe would display as "Sales:John Doe" on the extensions that ring.')?></span></a></td>
+				<td><input size="4" type="text" name="grppre" value="<?php  echo $grppre ?>"></td>
+			</tr>
+
+			<tr>
+				<td><a href="#" class="info"><?php echo _("Alert Info")?><span><?php echo _('ALERT_INFO can be used for distinctive ring with SIP devices.')?></span></a>:</td>
+				<td><input type="text" name="alertinfo" size="20" value="<?php echo ($alertinfo)?$alertinfo:'' ?>"></td>
+			</tr>
+
+			<tr>
+				<td><a href="#" class="info"><?php echo _("Confirm Calls")?><span><?php echo _('Enable this if you\'re calling external numbers that need confirmation - eg, a mobile phone may go to voicemail which will pick up the call. Enabling this requires the remote side push 1 on their phone before the call is put through. This feature only works with the ringall ring strategy')?></span></a>:</td>
+				<td>
+					<input type="checkbox" name="needsconf" value="CHECKED" <?php echo $needsconf ?>  />
+				</td>
+			</tr>
+
+<?php if(function_exists('recordings_list')) { //only include if recordings is enabled?>
+			<tr>
+				<td><a href="#" class="info"><?php echo _("Remote Announce:")?><span><?php echo _("Message to be played to the person RECEIVING the call, if 'Confirm Calls' is enabled.<br><br>To add additional recordings use the \"System Recordings\" MENU to the left")?></span></a></td>
+				<td>
+					<select name="remotealert"/>
+					<?php
+						$tresults = recordings_list();
+						$default = (isset($remotealert) ? $remotealert : '');
+						echo '<option value="">'._("Default")."</option>";
+						if (isset($tresults[0])) {
+							foreach ($tresults as $tresult) {
+								echo '<option value="'.$tresult[2].'"'.($tresult[2] == $default ? ' SELECTED' : '').'>'.$tresult[1]."</option>\n";
+							}
+						}
+					?>		
+					</select>		
+				</td>
+			</tr>
+
+			<tr>
+				<td><a href="#" class="info"><?php echo _("Too-Late Announce:")?><span><?php echo _("Message to be played to the person RECEIVING the call, if the call has already been accepted before they push 1.<br><br>To add additional recordings use the \"System Recordings\" MENU to the left")?></span></a></td>
+				<td>
+					<select name="toolate"/>
+					<?php
+						$tresults = recordings_list();
+						$default = (isset($toolate) ? $toolate : '');
+						echo '<option value="">'._("Default")."</option>";
+						if (isset($tresults[0])) {
+							foreach ($tresults as $tresult) {
+								echo '<option value="'.$tresult[2].'"'.($tresult[2] == $default ? ' SELECTED' : '').'>'.$tresult[1]."</option>\n";
+							}
+						}
+					?>		
+					</select>		
+				</td>
+			</tr>
 <?php } ?>
-	</tr>
-<?php if(function_exists('recordings_list')) { //only include if recordings is enabled?>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("Remote Announce:")?><span><?php echo _("Message to be played to the person RECEIVING the call, if 'Confirm Calls' is enabled.<br><br>To add additional recordings use the \"System Recordings\" MENU to the left")?></span></a></td>
-		<td>
-			<select name="remotealert"/>
-			<?php
-				$tresults = recordings_list();
-				$default = (isset($remotealert) ? $remotealert : '');
-				echo '<option value="">'._("Default")."</option>";
-				if (isset($tresults[0])) {
-					foreach ($tresults as $tresult) {
-						echo '<option value="'.$tresult[2].'"'.($tresult[2] == $default ? ' SELECTED' : '').'>'.$tresult[1]."</option>\n";
-					}
-				}
-			?>		
-			</select>		
-		</td>
-	</tr>
-	<tr>
-		<td><a href="#" class="info"><?php echo _("Too-Late Announce:")?><span><?php echo _("Message to be played to the person RECEIVING the call, if the call has already been accepted before they push 1.<br><br>To add additional recordings use the \"System Recordings\" MENU to the left")?></span></a></td>
-		<td>
-			<select name="toolate"/>
-			<?php
-				$tresults = recordings_list();
-				$default = (isset($toolate) ? $toolate : '');
-				echo '<option value="">'._("Default")."</option>";
-				if (isset($tresults[0])) {
-					foreach ($tresults as $tresult) {
-						echo '<option value="'.$tresult[2].'"'.($tresult[2] == $default ? ' SELECTED' : '').'>'.$tresult[1]."</option>\n";
-					}
-				}
-			?>		
-			</select>		
-		</td>
-	</tr>
-<?php } ?>
+
 			<tr><td colspan="2"><br><h5><?php echo _("Destination if no answer")?>:<hr></h5></td></tr>
 
 <?php 
@@ -336,6 +388,20 @@
 ?>
 <script language="javascript">
 <!--
+
+function insertExten() {
+	exten = document.getElementById('insexten').value;
+
+	grpList=document.getElementById('grplist');
+	if (grpList.value[ grpList.value.length - 1 ] == "\n") {
+		grpList.value = grpList.value + exten;
+	} else {
+		grpList.value = grpList.value + '\n' + exten;
+	}
+
+	// reset element
+	document.getElementById('insexten').value = '';
+}
 
 function checkGRP(theForm) {
 	var msgInvalidGrpNum = "<?php echo _('Invalid Group Number specified'); ?>";
@@ -344,7 +410,7 @@
 	var msgInvalidTime = "<?php echo _('Invalid time specified'); ?>";
 	var msgInvalidGrpTimeRange = "<?php echo _('Time must be between 1 and 60 seconds'); ?>";
 	var msgInvalidDescription = "<?php echo _('Please enter a valid Group Description'); ?>";
-	var msgInvalidRingStrategy = "<?php echo _('You must choose ringall or ringall-prim ring strategy when using Confirm Calls'); ?>";
+	var msgInvalidRingStrategy = "<?php echo _('Only ringall, ringallv2, hunt and the respective -prim versions are supported when confirmation is checked'); ?>";
 
 	// set up the Destination stuff
 	setDestinations(theForm, 1);
@@ -375,7 +441,7 @@
 			return warnInvalid(theForm.grptime, msgInvalidGrpTimeRange);
 	}
 
-	if (theForm.needsconf.checked && theForm.strategy.value.substring(0,7) != "ringall") {
+	if (theForm.needsconf.checked && (theForm.strategy.value.substring(0,7) != "ringall" && theForm.strategy.value.substring(0,4) != "hunt")) {
 		return warnInvalid(theForm.needsconf, msgInvalidRingStrategy);
 	}
 

Modified: freepbx-modules/trunk/modules/speeddial/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/speeddial/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/speeddial/module.xml (original)
+++ freepbx-modules/trunk/modules/speeddial/module.xml Sun May 18 19:52:05 2008
@@ -1,8 +1,9 @@
 <module>
 	<rawname>speeddial</rawname>
 	<name>Speed dial functions</name>
-	<version>1.0.4.2</version>
+	<version>2.4.0</version>
 	<changelog>
+		*2.4.0* bump for 2.4
 		*1.0.4.2* #2329 add WaitExten after background
 		*1.0.4.1* bump for rc1
 		*1.0.4* #2049 remove use of speedial-clean, allow leading 0s
@@ -15,6 +16,6 @@
 	<depends>
 		<module>phonebook</module>
 	</depends>
-	<location>release/2.3/speeddial-1.0.4.1.tgz</location>
-	<md5sum>f9d72c28b47b47dd2a6facd96b308227</md5sum>
+	<location>release/2.3/speeddial-1.0.4.2.tgz</location>
+	<md5sum>7803f7c72d836bfcd20d2c1378f21394</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/timeconditions/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/timeconditions/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/timeconditions/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/timeconditions/functions.inc.php Sun May 18 19:52:05 2008
@@ -13,6 +13,30 @@
 		return $extens;
 	} else {
 		return null;
+	}
+}
+
+function timeconditions_getdest($exten) {
+	return array('timeconditions,'.$exten.',1');
+}
+
+function timeconditions_getdestinfo($dest) {
+	global $active_modules;
+
+	if (substr(trim($dest),0,15) == 'timeconditions,') {
+		$exten = explode(',',$dest);
+		$exten = $exten[1];
+		$thisexten = timeconditions_get($exten);
+		if (empty($thisexten)) {
+			return array();
+		} else {
+			//$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup';
+			return array('description' => 'Time Conditon : '.$thisexten['displayname'],
+			             'edit_url' => 'config.php?display=timeconditions&itemid='.urlencode($exten),
+								  );
+		}
+	} else {
+		return false;
 	}
 }
 
@@ -36,6 +60,45 @@
 			}
 		break;
 	}
+}
+
+function timeconditions_check_destinations($dest=true) {
+	global $active_modules;
+
+	$destlist = array();
+	if (is_array($dest) && empty($dest)) {
+		return $destlist;
+	}
+	$sql = "SELECT timeconditions_id, displayname, truegoto, falsegoto FROM timeconditions ";
+	if ($dest !== true) {
+		$sql .= "WHERE (truegoto in ('".implode("','",$dest)."') ) OR (falsegoto in ('".implode("','",$dest)."') )";
+	}
+	$results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
+
+	$type = isset($active_modules['timeconditions']['type'])?$active_modules['timeconditions']['type']:'setup';
+
+	foreach ($results as $result) {
+		$thisdest    = $result['truegoto'];
+		$thisid      = $result['timeconditions_id'];
+		$description = 'Timecondition: '.$result['displayname'];
+		$thisurl     = 'config.php?display=timeconditions&itemid='.urlencode($thisid);
+		if ($dest === true || $dest = $thisdest) {
+			$destlist[] = array(
+				'dest' => $thisdest,
+				'description' => $description,
+				'edit_url' => $thisurl,
+			);
+		}
+		$thisdest = $result['falsegoto'];
+		if ($dest === true || $dest = $thisdest) {
+			$destlist[] = array(
+				'dest' => $thisdest,
+				'description' => $description,
+				'edit_url' => $thisurl,
+			);
+		}
+	}
+	return $destlist;
 }
 
 //get the existing meetme extensions

Added: freepbx-modules/trunk/modules/timeconditions/i18n/it_IT/LC_MESSAGES/timeconditions.mo
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/timeconditions/i18n/it_IT/LC_MESSAGES/timeconditions.mo?rev=5750&op=file
==============================================================================
Binary file - no diff available.

Propchange: freepbx-modules/trunk/modules/timeconditions/i18n/it_IT/LC_MESSAGES/timeconditions.mo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: freepbx-modules/trunk/modules/timeconditions/i18n/it_IT/LC_MESSAGES/timeconditions.po
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/timeconditions/i18n/it_IT/LC_MESSAGES/timeconditions.po?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/timeconditions/i18n/it_IT/LC_MESSAGES/timeconditions.po (added)
+++ freepbx-modules/trunk/modules/timeconditions/i18n/it_IT/LC_MESSAGES/timeconditions.po Sun May 18 19:52:05 2008
@@ -1,0 +1,234 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-08-12 15:21+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Francesco Romano\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: page.timeconditions.php:49 page.timeconditions.php:124
+#: page.timeconditions.php:133
+msgid "Add Time Condition"
+msgstr "Aggiungi Condizione Temporale"
+
+#: page.timeconditions.php:60
+msgid "Server time:"
+msgstr "Ora Server:"
+
+#: page.timeconditions.php:114
+msgid "Time Condition"
+msgstr "Condizione Temporale"
+
+#: page.timeconditions.php:114
+msgid "deleted"
+msgstr "eliminata"
+
+#: page.timeconditions.php:124
+msgid "Time Condition:"
+msgstr "Condizione Temporale:"
+
+#: page.timeconditions.php:126
+msgid "Delete Time Condition"
+msgstr "Elimina Condizione Temporale"
+
+#: page.timeconditions.php:133
+msgid "Edit Time Condition"
+msgstr "Modifica Condizione Temporale"
+
+#: page.timeconditions.php:140
+msgid "Time Condition name:"
+msgstr "Nome Condizione Temporale:"
+
+#: page.timeconditions.php:140
+msgid "Give this Time Condition a brief name to help you identify it."
+msgstr "Assegnare un nome breve per una facile identificazione."
+
+#: page.timeconditions.php:144
+msgid "Time to match:"
+msgstr "Corrispondenza:"
+
+#: page.timeconditions.php:144
+msgid ""
+"time range|days of week|days of month|months<br><br>you can use an * as a "
+"wildcard.<br><br>ex: <b>9:00-17:00|mon-fri|*|*</b>"
+msgstr "Intervallo ora|giorni della settimana|giorni del mese|mesi<br><br>si può utilizzare * come carattere jolly.<br><br>es: <b>9:00-17:00|mon-fri|*|*</b><br><br>(mon,tue,wed,thu,fri,sat,sun=<br>lun,mar,mer,gio,ven,sab,dom)"
+
+#: page.timeconditions.php:155
+msgid "Time to start:"
+msgstr "Ora iniziale:"
+
+#: page.timeconditions.php:198
+msgid "Time to finish:"
+msgstr "Ora finale:"
+
+#: page.timeconditions.php:237
+msgid "Week Day Start:"
+msgstr "Giorno della settimana iniziale:"
+
+#: page.timeconditions.php:247 page.timeconditions.php:286
+msgid "Monday"
+msgstr "Lunedì"
+
+#: page.timeconditions.php:251 page.timeconditions.php:290
+msgid "Tuesday"
+msgstr "Martedì"
+
+#: page.timeconditions.php:255 page.timeconditions.php:294
+msgid "Wednesday"
+msgstr "Mercoledì"
+
+#: page.timeconditions.php:259 page.timeconditions.php:298
+msgid "Thursday"
+msgstr "Giovedì"
+
+#: page.timeconditions.php:263 page.timeconditions.php:302
+msgid "Friday"
+msgstr "Venerdì"
+
+#: page.timeconditions.php:267 page.timeconditions.php:306
+msgid "Saturday"
+msgstr "Sabato"
+
+#: page.timeconditions.php:271 page.timeconditions.php:310
+msgid "Sunday"
+msgstr "Domenica"
+
+#: page.timeconditions.php:276
+msgid "Week Day finish:"
+msgstr "Giorno della settimana finale:"
+
+#: page.timeconditions.php:315
+msgid "Month Day start:"
+msgstr "Giorno del mese iniziale:"
+
+#: page.timeconditions.php:340
+msgid "Month Day finish:"
+msgstr "Giorno del mese finale:"
+
+#: page.timeconditions.php:357
+msgid "Month start:"
+msgstr "Mese iniziale:"
+
+#: page.timeconditions.php:375 page.timeconditions.php:433
+msgid "January"
+msgstr "Gennaio"
+
+#: page.timeconditions.php:379 page.timeconditions.php:437
+msgid "February"
+msgstr "Febbraio"
+
+#: page.timeconditions.php:383 page.timeconditions.php:441
+msgid "March"
+msgstr "Marzo"
+
+#: page.timeconditions.php:387 page.timeconditions.php:445
+msgid "April"
+msgstr "Aprile"
+
+#: page.timeconditions.php:391 page.timeconditions.php:449
+msgid "May"
+msgstr "Maggio"
+
+#: page.timeconditions.php:395 page.timeconditions.php:453
+msgid "June"
+msgstr "Giugno"
+
+#: page.timeconditions.php:399 page.timeconditions.php:457
+msgid "July"
+msgstr "Luglio"
+
+#: page.timeconditions.php:403 page.timeconditions.php:461
+msgid "August"
+msgstr "Agosto"
+
+#: page.timeconditions.php:407 page.timeconditions.php:465
+msgid "September"
+msgstr "Settembre"
+
+#: page.timeconditions.php:411 page.timeconditions.php:469
+msgid "October"
+msgstr "Ottobre"
+
+#: page.timeconditions.php:414 page.timeconditions.php:473
+msgid "November"
+msgstr "Novembre"
+
+#: page.timeconditions.php:418 page.timeconditions.php:477
+msgid "December"
+msgstr "Dicembre"
+
+#: page.timeconditions.php:424
+msgid "Month finish:"
+msgstr "Mese finale:"
+
+#: page.timeconditions.php:483
+msgid "Destination if time matches"
+msgstr "Destinazione se la condizione esiste"
+
+#: page.timeconditions.php:493
+msgid "Destination if time does not match"
+msgstr "Destinazione se la condizione non esiste"
+
+msgid "Voicemail"
+msgstr "Casella Vocale"
+
+msgid "Extensions"
+msgstr "Interni"
+
+msgid "Day Night Mode"
+msgstr "Controllo Giorno Notte"
+
+msgid "Terminate Call"
+msgstr "Termina Chiamata"
+
+msgid "Core"
+msgstr "Sistema"
+
+msgid "Conferences"
+msgstr "Conferenze"
+
+msgid "Phonebook Directory"
+msgstr "Rubrica"
+
+msgid "Queues"
+msgstr "Code"
+
+msgid "Ring Groups"
+msgstr "Gruppi di chiamata"
+
+msgid "Speed dial functions"
+msgstr "Selezione breve"
+
+msgid "Time Conditions"
+msgstr "Condizioni Temporali"
+
+msgid "Custom Contexts"
+msgstr "Contesti Personalizzati"
+
+msgid "Extended Routing"
+msgstr "Rotte specifiche"
+
+msgid "Custom App<span><br>ADVANCED USERS ONLY<br><br>Uses Goto() to send caller to "
+"a custom context.<br><br>The context name should start with \"custom-\", and be in "
+"the format custom-context,extension,priority. Example "
+"entry:<br><br><b>custom-myapp,s,1</b><br><br>The <b>[custom-myapp]</b> context would "
+"need to be created and included in extensions_custom.conf</span>"
+msgstr "Applicazione Personalizzata<span>SOLO UTENTI AVANZATI<br>Utilizzare Goto() "
+"per inviare la chiamata verso un contesto personalizzato.<br><br>Il nome del "
+"contesto deve iniziare per \"custom-\" e deve essere nel formato "
+"custom-contesto,extension,priorità. Esempio: "
+"<br><br><b>custom-app,s,1</b><br><br><b>Il contesto [custom-app] </b> deve poi "
+"essere creato e incluso nel file extensions_custom.conf</span"
+
+msgid "Submit Changes"
+msgstr "Invia"

Modified: freepbx-modules/trunk/modules/timeconditions/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/timeconditions/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/timeconditions/module.xml (original)
+++ freepbx-modules/trunk/modules/timeconditions/module.xml Sun May 18 19:52:05 2008
@@ -1,13 +1,15 @@
 <module>
 	<rawname>timeconditions</rawname>
 	<name>Time Conditions</name>
-	<version>2.4.3.1</version>
+	<version>2.4.4.1</version>
 	<type>setup</type>
 	<category>Inbound Call Control</category>
 	<description>
 		Creates a condition where calls will to one of two destinations (eg, an extension, IVR, ring group..) based on the time and/or date. This can be used for example to ring a receptionist during the day, or go directly to an IVR at night.
 	</description>
 	<changelog>
+		*2.4.4.1* added depends on 2.4.0
+		*2.4.4* Extension/dest registry, it translation
 		*2.4.3.1* bump for rc1
 		*2.4.3* Added SQLite3 support, fixed ticket http://freepbx.org/trac/ticket/1774
 		*2.4.2* merge findmefollow/core extension destinations if any
@@ -15,9 +17,12 @@
 		*2.4* Upgrading module version to assist with trixbox upgrades, that have 2.3.1 already, so this needs to be higher. No other changes.	
 		*2.3* First release for FreePBX 2.2 - Fixed compatibility issue with new UI
 	</changelog>
+	<depends>
+		<version>2.4.0</version>
+	</depends>
 	<menuitems>
 		<timeconditions>Time Conditions</timeconditions>
 	</menuitems>
-	<location>release/2.3/timeconditions-2.4.3.tgz</location>
-	<md5sum>6f9c4e81c33290d3655ce2aa935b2aa5</md5sum>
+	<location>release/2.4/timeconditions-2.4.4.tgz</location>
+	<md5sum>2d6c3d2dd0486c5023002529d995dc19</md5sum>
 </module>

Modified: freepbx-modules/trunk/modules/timeconditions/page.timeconditions.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/timeconditions/page.timeconditions.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/timeconditions/page.timeconditions.php (original)
+++ freepbx-modules/trunk/modules/timeconditions/page.timeconditions.php Sun May 18 19:52:05 2008
@@ -123,8 +123,16 @@
 
 	<h2><?php echo ($itemid ? _("Time Condition:")." ". $itemid : _("Add Time Condition")); ?></h2>
 <?php		if ($itemid){ ?>
-	<p><a href="<?php echo $delURL ?>"><?php echo _("Delete Time Condition")?> <?php echo $itemid; ?></a></p>
-<?php		} ?>
+	<a href="<?php echo $delURL ?>"><?php echo _("Delete Time Condition")?> <?php echo $itemid; ?></a>
+<?php
+					$usage_list = framework_display_destination_usage(timeconditions_getdest($itemid));
+					if (!empty($usage_list)) {
+?>
+						<br /><a href="#" class="info"><?php echo $usage_list['text']?>:<span><?php echo $usage_list['tooltip']?></span></a>
+<?php
+					}
+			} 
+?>
 	<form autocomplete="off" name="edit" action="<?php $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return edit_onsubmit();">
 	<input type="hidden" name="display" value="<?php echo $dispnum?>">
 	<input type="hidden" name="action" value="<?php echo ($itemid ? 'edit' : 'add') ?>">

Added: freepbx-modules/trunk/modules/vmblast/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/vmblast/functions.inc.php?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/vmblast/functions.inc.php (added)
+++ freepbx-modules/trunk/modules/vmblast/functions.inc.php Sun May 18 19:52:05 2008
@@ -1,0 +1,310 @@
+<?php /* $Id: functions.inc.php 3396 2006-12-21 02:40:16Z p_lindheimer $ */
+
+// The destinations this module provides
+// returns a associative arrays with keys 'destination' and 'description'
+function vmblast_destinations() {
+	//get the list of vmblast
+	$results = vmblast_list();
+	
+	// return an associative array with destination and description
+	if (isset($results)) {
+		foreach($results as $result){
+				$thisgrp = vmblast_get(ltrim($result['0']));
+				$extens[] = array('destination' => 'vmblast-grp,'.ltrim($result['0']).',1', 'description' => $thisgrp['description'].' <'.ltrim($result['0']).'>');
+		}
+	}
+	
+	if (isset($extens)) 
+		return $extens;
+	else
+		return null;
+}
+
+function vmblast_getdest($exten) {
+	return array("vmblast-grp,$exten,1");
+}
+
+function vmblast_getdestinfo($dest) {
+	if (substr(trim($dest),0,12) == 'vmblast-grp,') {
+		$grp = explode(',',$dest);
+		$grp = $grp[1];
+		$thisgrp = vmblast_get($grp);
+		if (empty($thisgrp)) {
+			return array();
+		} else {
+			return array('description' => 'Voicemail Group '.$grp.': '.$thisgrp['description'],
+			             'edit_url' => 'config.php?display=vmblast&extdisplay=GRP-'.urlencode($grp),
+								  );
+		}
+	} else {
+		return false;
+	}
+}
+
+/* 	Generates dialplan for vmblast We call this with retrieve_conf
+*/
+function vmblast_get_config($engine) {
+	global $ext;  // is this the best way to pass this?
+	switch($engine) {
+		case "asterisk":
+			$ext->addInclude('from-internal-additional','vmblast-grp');
+			$contextname = 'vmblast-grp';
+			$vmlist = vmblast_list();
+
+			if (function_exists('recordings_list')) { 
+				$recordings_installed = true;
+				$got_recordings = false;
+			} else {
+				$recordings_installed = false;
+			}
+
+			if (is_array($vmlist)) {
+				foreach($vmlist as $item) {
+					$grpnum = ltrim($item['0']);
+					$grp = vmblast_get($grpnum);
+					$grplist = $grp['grplist'];
+					$ext->add($contextname, $grpnum, '', new ext_macro('user-callerid'));
+					$ext->add($contextname, $grpnum, '', new ext_answer(''));
+					$ext->add($contextname, $grpnum, '', new ext_wait('1'));
+
+					if (isset($grp['password']) && trim($grp['password']) != "" && ctype_digit(trim($grp['password']))) {
+						$ext->add($contextname, $grpnum, '', new ext_authenticate($grp['password']));
+					}
+
+					$ext->add($contextname, $grpnum, '', new ext_setvar('GRPLIST',''));
+					foreach ($grplist as $exten) {
+						$ext->add($contextname, $grpnum, '', new ext_macro('get-vmcontext',$exten));
+						$ext->add($contextname, $grpnum, '', new ext_setvar('GRPLIST','${GRPLIST}&'.$exten.'@${VMCONTEXT}'));
+					}
+
+					// Add a message and confirmation so they know what group they are in
+					//
+					if ($grp['audio_label'] == -2) {
+						$ext->add($contextname, $grpnum, '', new ext_goto('1','1','app-vmblast'));
+					} elseif ($grp['audio_label'] == -1 || !$recordings_installed) {
+						$ext->add($contextname, $grpnum, '', new ext_setvar('DIGITS',$grpnum));
+						$ext->add($contextname, $grpnum, '', new ext_goto('digits','vmblast','app-vmblast'));
+					} else {
+						if (!$got_recordings) {
+							$recordings = recordings_list();
+							$got_recordings = true;
+							$recording_hash = array();
+							foreach ($recordings as $recording) {
+								$recording_hash[$recording[0]] = $recording[2];
+							}
+						}
+						if (isset($recording_hash[$grp['audio_label']])) {
+							$ext->add($contextname, $grpnum, '', new ext_setvar('MSG',$recording_hash[$grp['audio_label']]));
+							$ext->add($contextname, $grpnum, '', new ext_goto('msg','vmblast','app-vmblast'));
+						} else {
+							$ext->add($contextname, $grpnum, '', new ext_setvar('DIGITS',$grpnum));
+							$ext->add($contextname, $grpnum, '', new ext_goto('digits','vmblast','app-vmblast'));
+						}
+					}
+				}
+				$contextname = 'app-vmblast';
+				$ext->add($contextname, 'vmblast', 'digits', new ext_execif('$["${DIGITS}" != ""]','SayDigits','${DIGITS}'));
+				$ext->add($contextname, 'vmblast', 'msg', new ext_execif('$["${MSG}" != ""]','Background','${MSG}'));
+				$ext->add($contextname, 'vmblast', '', new ext_background('if-correct-press&digits/1'));
+				$ext->add($contextname, 'vmblast', '', new ext_waitexten('20'));
+				$ext->add($contextname, 'vmblast', '', new ext_playback('sorry-youre-having-problems&goodbye'));
+				$ext->add($contextname, 'vmblast', '', new ext_hangup(''));
+
+				$ext->add($contextname, '1', '', new ext_vm('${GRPLIST:1},s'));
+				$ext->add($contextname, '1', '', new ext_hangup(''));
+			}
+		break;
+	}
+}
+
+function vmblast_check_extensions($exten=true) {
+	$extenlist = array();
+	if (is_array($exten) && empty($exten)) {
+		return $extenlist;
+	}
+	$sql = "SELECT grpnum ,description FROM vmblast ";
+	if (is_array($exten)) {
+		$sql .= "WHERE grpnum in ('".implode("','",$exten)."')";
+	}
+	$results = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
+
+	foreach ($results as $result) {
+		$thisexten = $result['grpnum'];
+		$extenlist[$thisexten]['description'] = _("Voicemail Group: ").$result['description'];
+		$extenlist[$thisexten]['status'] = 'INUSE';
+		$extenlist[$thisexten]['edit_url'] = 'config.php?display=vmblast&extdisplay=GRP-'.urlencode($thisexten);
+	}
+	return $extenlist;
+}
+
+function vmblast_add($grpnum,$grplist,$description,$audio_label= -1, $password = '', $default_group=0) {
+	global $db;
+
+	if (is_array($grplist)) {
+		$xtns = $grplist;
+	} else {
+		$xtns = explode("\n",$grplist);
+	}
+
+	foreach ($xtns as $key => $value) {
+		$xtns[$key] = addslashes(trim($value));
+	}
+		// Sanity check input.
+
+	$compiled = $db->prepare("INSERT INTO vmblast_groups (grpnum, ext) values ('$grpnum',?)");
+	$result   = $db->executeMultiple($compiled,$xtns);
+	if(DB::IsError($result)) {
+		die_freepbx($result->getDebugInfo()."<br><br>".'error adding to vmblast_groups table');	
+	}
+	$sql = "INSERT INTO vmblast (grpnum, description, audio_label, password) VALUES (".$grpnum.", '".str_replace("'", "''", $description)."', '$audio_label', '".str_replace("'","''", $password)."')";
+	$results = sql($sql);
+
+	if ($default_group) {
+		sql("DELETE FROM `admin` WHERE variable = 'default_vmblast_grp'");
+		sql("INSERT INTO `admin` (variable, value) VALUES ('default_vmblast_grp', '$grpnum')");
+	} else {
+		sql("DELETE FROM `admin` WHERE variable = 'default_vmblast_grp' AND value = '$grpnum'");
+	}
+	return true;
+}
+
+function vmblast_del($grpnum) {
+	$results = sql("DELETE FROM vmblast WHERE grpnum = '$grpnum'","query");
+	$results = sql("DELETE FROM vmblast_groups WHERE grpnum = '$grpnum'","query");
+	sql("DELETE FROM `admin` WHERE variable = 'default_vmblast_grp' AND value = '$grpnum'");
+}
+
+function vmblast_list() {
+	$results = sql("SELECT grpnum, description FROM vmblast ORDER BY grpnum","getAll",DB_FETCHMODE_ASSOC);
+	foreach ($results as $result) {
+		if (isset($result['grpnum']) && checkRange($result['grpnum'])) {
+			$grps[] = array($result['grpnum'], $result['description']);
+		}
+	}
+	if (isset($grps))
+		return $grps;
+	else
+		return null;
+}
+
+function vmblast_get($grpnum) {
+	global $db;
+
+	$results = sql("SELECT grpnum, description, audio_label, password FROM vmblast WHERE grpnum = '$grpnum'","getRow",DB_FETCHMODE_ASSOC);
+	$grplist = $db->getCol("SELECT ext FROM vmblast_groups WHERE grpnum = '$grpnum'");
+	if(DB::IsError($grplist)) {
+		die_freepbx($grplist->getDebugInfo()."<br><br>".'selecting from vmblast_groups table');	
+	}
+	$results['grplist'] = $grplist;
+
+	$sql = "SELECT * FROM admin WHERE variable='default_vmblast_grp' AND value='$grpnum'";
+	$default_group = $db->getRow($sql, DB_FETCHMODE_ASSOC);
+	if(DB::IsError($default_group)) {
+		$results['default_group'] = 0;
+	} else {
+		$results['default_group'] = empty($default_group) ? 0 : $default_group['value'];
+	}
+	
+	return $results;
+}
+
+function vmblast_check_default($extension) {
+	$sql = "SELECT ext FROM vmblast_groups WHERE ext = '$extension' AND grpnum = (SELECT value FROM admin WHERE variable = 'default_vmblast_grp' limit 1)";
+	$results = sql($sql,"getAll");
+	return (count($results) ? 1 : 0);
+}
+
+function vmblast_set_default($extension, $value) {
+	$default_group = sql("SELECT value FROM `admin` WHERE variable = 'default_vmblast_grp' limit 1", "getOne");
+	if ($default_group == '') {
+		return false;
+	}
+	sql("DELETE FROM vmblast_groups WHERE ext = '$extension' AND grpnum = '$default_group'");
+	if ($value == 1) {
+		sql("INSERT INTO vmblast_groups (grpnum, ext) VALUES ('$default_group', '$extension')");
+	}
+}
+
+function vmblast_configpageinit($pagename) {
+	global $currentcomponent;
+
+	$action = isset($_REQUEST['action'])?$_REQUEST['action']:null;
+	$extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null;
+	$extension = isset($_REQUEST['extension'])?$_REQUEST['extension']:null;
+	$tech_hardware = isset($_REQUEST['tech_hardware'])?$_REQUEST['tech_hardware']:null;
+
+	// We only want to hook 'users' or 'extensions' pages.
+	if ($pagename != 'users' && $pagename != 'extensions') {
+		return true;
+	}
+
+	if ($tech_hardware != null || $pagename == 'users') {
+		vmblast_applyhooks();
+		$currentcomponent->addprocessfunc('vmblast_configprocess', 8);
+	} elseif ($action=="add") {
+		// We don't need to display anything on an 'add', but we do need to handle returned data.
+		$currentcomponent->addprocessfunc('vmblast_configprocess', 8);
+	} elseif ($extdisplay != '') {
+		// We're now viewing an extension, so we need to display _and_ process.
+		vmblast_applyhooks();
+		$currentcomponent->addprocessfunc('vmblast_configprocess', 8);
+	}
+}
+
+function vmblast_applyhooks() {
+	global $currentcomponent;
+
+	// Add the 'process' function - this gets called when the page is loaded, to hook into 
+	// displaying stuff on the page.
+	$currentcomponent->addoptlistitem('vmblast_group', '0', _("Exclude"));
+	$currentcomponent->addoptlistitem('vmblast_group', '1', _("Include"));
+	$currentcomponent->setoptlistopts('vmblast_group', 'sort', false);
+
+	$currentcomponent->addguifunc('vmblast_configpageload');
+}
+
+// This is called before the page is actually displayed, so we can use addguielem().
+function vmblast_configpageload() {
+	global $currentcomponent;
+
+	// Init vars from $_REQUEST[]
+	$action = isset($_REQUEST['action']) ? $_REQUEST['action']:null;
+	$extdisplay = isset($_REQUEST['extdisplay']) ? $_REQUEST['extdisplay']:null;
+	
+	// Don't display this stuff it it's on a 'This xtn has been deleted' page.
+	if ($action != 'del') {
+
+		$default_group = sql("SELECT value FROM `admin` WHERE variable = 'default_vmblast_grp'", "getOne");
+		$section = _("Default Group Inclusion");
+		if ($default_group != "") {
+			$in_default_vmblast_grp = vmblast_check_default($extdisplay);
+			$currentcomponent->addguielem($section, new gui_selectbox('in_default_vmblast_grp', $currentcomponent->getoptlist('vmblast_group'), $in_default_vmblast_grp, _('Default VMblast Group'), _('You can include or exclude this extension/user from being part of the default voicemail blast group when creating or editing. Choosing this option will be ignored if the user does not have a voicemial box.'), false));
+		} 
+	}
+}
+
+function vmblast_configprocess() {
+	global $db;
+
+	//create vars from the request
+	//
+	$action = isset($_REQUEST['action'])?$_REQUEST['action']:null;
+	$ext = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null;
+	$extn = isset($_REQUEST['extension'])?$_REQUEST['extension']:null;
+	$vm_enabled = isset($_REQUEST['vm']) && $_REQUEST['vm'] == 'enabled' ? true : false;
+	$in_default_vmblast_grp = isset($_REQUEST['in_default_vmblast_grp'])?$_REQUEST['in_default_vmblast_grp']:false;
+
+	$extdisplay = ($ext==='') ? $extn : $ext;
+	
+	if (($action == "add" || $action == "edit") && $vm_enabled) {
+		if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) {
+			if ($in_default_vmblast_grp !== false) {
+				vmblast_set_default($extdisplay, $in_default_vmblast_grp);
+			}
+		}
+	} elseif ($extdisplay != '' && ($action == "del" || ($action == "edit" && !$vm_enabled))) {
+		$sql = "DELETE FROM vmblast_groups WHERE ext = '$extdisplay'";
+		sql($sql);
+	}
+}
+?>

Added: freepbx-modules/trunk/modules/vmblast/install.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/vmblast/install.php?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/vmblast/install.php (added)
+++ freepbx-modules/trunk/modules/vmblast/install.php Sun May 18 19:52:05 2008
@@ -1,0 +1,69 @@
+<?php
+
+// TODO:
+// TODO: MOVE TABLE CREATIONS INTO HERE
+// TODO:
+
+global $db;
+
+echo "Upgrading vmblast to add audio_label field..";
+$sql = "SELECT audio_label FROM vmblast";
+$confs = $db->getRow($sql, DB_FETCHMODE_ASSOC);
+if (!DB::IsError($confs)) { // no error... Already done
+	echo "Not Required<br />";
+} else {
+	$sql = "ALTER TABLE vmblast ADD audio_label INT ( 11 ) NOT NULL DEFAULT -1";
+	$results = $db->query($sql);
+	if(DB::IsError($results)) {
+	        die($results->getMessage());
+	}
+	echo "Done<br />";
+}
+
+echo "Upgrading vmblast to add password field..";
+$sql = "SELECT password FROM vmblast";
+$confs = $db->getRow($sql, DB_FETCHMODE_ASSOC);
+if (!DB::IsError($confs)) { // no error... Already done
+	echo "Not Required<br />";
+} else {
+	$sql = "ALTER TABLE vmblast ADD password VARCHAR ( 20 ) NOT NULL";
+	$results = $db->query($sql);
+	if(DB::IsError($results)) {
+	        die($results->getMessage());
+	}
+	echo "Done<br />";
+}
+
+// Drop grplist field but first pull it's data and put in new table
+//
+echo "Dropping grplist..";
+$sql = 'SELECT grpnum, grplist FROM vmblast';
+$confs = $db->getAll($sql, DB_FETCHMODE_ASSOC);
+if (!DB::IsError($confs)) { 
+	$list = array();
+	foreach ($confs as $group) {
+		$grplist = explode('&',$group['grplist']);
+		foreach ($grplist as $exten) {
+			$list[] = array($group['grpnum'],addslashes(trim($exten)));
+		}
+	}
+	$compiled = $db->prepare("INSERT INTO vmblast_groups (grpnum, ext) values (?,?)");
+	$result   = $db->executeMultiple($compiled, $list);
+	if(DB::IsError($result)) {
+		echo "error populating vmblast_groups table<br />";	
+		return false;
+	} else {
+		echo "populated new table<br />Dropping old grplist field";
+		$sql = "ALTER TABLE `vmblast` DROP `grplist`";
+		$results = $db->query($sql);
+		if(DB::IsError($results)) {
+			echo "failed to drop field<br />";
+		} else {
+			echo "OK<br />";
+		}
+	}
+} else {
+	echo "Not Needed<br />";
+}
+
+?>

Added: freepbx-modules/trunk/modules/vmblast/install.sql
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/vmblast/install.sql?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/vmblast/install.sql (added)
+++ freepbx-modules/trunk/modules/vmblast/install.sql Sun May 18 19:52:05 2008
@@ -1,0 +1,15 @@
+CREATE TABLE IF NOT EXISTS `vmblast` 
+( 
+	`grpnum` INT( 11 ) NOT NULL , 
+	`description` VARCHAR( 35 ) NOT NULL , 
+	`audio_label` INT( 11 ) NOT NULL DEFAULT -1 , 
+	`password` VARCHAR( 20 ) NOT NULL , 
+	PRIMARY KEY  (`grpnum`) 
+); 
+
+CREATE TABLE IF NOT EXISTS vmblast_groups 
+(
+	grpnum  VARCHAR(50), 
+	ext VARCHAR(25),
+	PRIMARY KEY (grpnum , ext)
+);

Added: freepbx-modules/trunk/modules/vmblast/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/vmblast/module.xml?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/vmblast/module.xml (added)
+++ freepbx-modules/trunk/modules/vmblast/module.xml Sun May 18 19:52:05 2008
@@ -1,0 +1,32 @@
+<module>
+	<rawname>vmblast</rawname>
+	<name>VoiceMail Blasting</name>
+	<version>2.4.3.2</version>
+	<type>setup</type>
+	<category>Internal Options &amp; Configuration</category>
+	<description>
+		Creates a group of extensions that Calls a group of voicemail boxes and allows you to leave a Msg for them all at once. 
+	</description>
+	<changelog>
+		*2.4.3.2* added depends on 2.4.0
+		*2.4.3.1* #2632 red bar addressed now also
+		*2.4.3* #2632 audio_lable, password, default_group not saved on initial config, and fix odd refresh behavior after add
+		*2.4.2* #2630 fixed errors requiring register_globals=on to be set in php.ini
+		*2.4.1* add beep only, no confirmation option to vmblast audio label
+		*2.4.0* first official version imported into 2.4 branch
+		*1.2.0* change to use proper multi-select list, fix bug in js validation of empty list, add default vmblast group
+		*1.1.2* add vmblast_group table and migrate from old grplist field
+		*1.1.1* fixed a couple SQL bugs, improved dialplan so you can skip annoucement and messages immeditiately (except if saydigits used)
+		*1.1.0* add audio label, password protect, fix bug for javascript validation to work, add extension/dest registry support
+		*1.0.2* increase grouplist field to varchar(255) to increase the vmblast list
+		*1.0.l* fix: context, redisplay of groups, get proper vm contexts, beep before leaving msg
+	</changelog>
+	<menuitems>
+		<vmblast>VoiceMail Blasting</vmblast>
+	</menuitems>
+	<depends>
+		<version>2.4.0</version>
+	</depends>
+	<location>release/2.4/vmblast-2.4.3.1.tgz</location>
+	<md5sum>5a3bda975d73d926a12cc214e85a1e84</md5sum>
+</module>

Added: freepbx-modules/trunk/modules/vmblast/page.vmblast.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/vmblast/page.vmblast.php?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/vmblast/page.vmblast.php (added)
+++ freepbx-modules/trunk/modules/vmblast/page.vmblast.php Sun May 18 19:52:05 2008
@@ -1,0 +1,269 @@
+<?php 
+//This program is free software; you can redistribute it and/or
+//modify it under the terms of the GNU General Public License
+//as published by the Free Software Foundation; either version 2
+//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 General Public License for more details.
+
+$dispnum = 'vmblast'; //used for switch on config.php
+
+$action         = isset($_REQUEST['action'])        ? $_REQUEST['action']      : '';
+
+//the extension we are currently displaying
+$account        = isset($_REQUEST['account'])       ? $_REQUEST['account']     : '';
+$extdisplay     = isset($_REQUEST['extdisplay'])    ? $_REQUEST['extdisplay']  : (($account != '')?'GRP-'.$account:'');
+$description    = isset($_REQUEST['description'])   ? $_REQUEST['description'] : '';
+$audio_label    = isset($_REQUEST['audio_label'])   ? $_REQUEST['audio_label'] : -1;
+$password       = isset($_REQUEST['password'])      ? $_REQUEST['password']    : '';
+$default_group  = isset($_REQUEST['default_group']) ? $_REQUEST['default_group'] : '0';
+$vmblast_list   = isset($_REQUEST['vmblast_list'])  ? $_REQUEST['vmblast_list']  : '';
+
+// do if we are submitting a form
+if(isset($_REQUEST['action'])){
+	//check if the extension is within range for this user
+	if (isset($account) && !checkRange($account)){
+		echo "<script>javascript:alert('". _("Warning! Extension")." ".$account." "._("is not allowed for your account").".');</script>";
+	} else {
+		//add group
+		if ($action == 'addGRP') {
+
+			$conflict_url = array();
+			$usage_arr = framework_check_extension_usage($account);
+			if (!empty($usage_arr)) {
+				$conflict_url = framework_display_extension_usage_alert($usage_arr);
+			} else if (vmblast_add($account,$vmblast_list,$description,$audio_label,$password,$default_group)) {
+				$_REQUEST['action'] = 'delGRP';
+				needreload();
+				redirect_standard('extdisplay');
+			}
+		}
+		
+		//del group
+		if ($action == 'delGRP') {
+			vmblast_del($account);
+			needreload();
+			redirect_standard();
+		}
+		
+		//edit group - just delete and then re-add the extension
+		if ($action == 'editGRP') {
+			vmblast_del($account);	
+			vmblast_add($account,$vmblast_list,$description,$audio_label,$password,$default_group);
+			needreload();
+			redirect_standard('extdisplay');
+		}
+	}
+}
+?>
+</div>
+
+<div class="rnav"><ul>
+    <li><a id="<?php  echo ($extdisplay=='' ? 'current':'') ?>" href="config.php?display=<?php echo urlencode($dispnum)?>"><?php echo _("Add VMBlast Group")?></a></li> <?php 
+//get unique ring groups
+$gresults = vmblast_list();
+
+if (isset($gresults)) {
+	foreach ($gresults as $gresult) {
+		echo "<li><a id=\"".($extdisplay=='GRP-'.$gresult[0] ? 'current':'')."\" href=\"config.php?display=".urlencode($dispnum)."&extdisplay=".urlencode("GRP-".$gresult[0])."\">".$gresult[1]." ({$gresult[0]})</a></li>";
+	}
+}
+?>
+</ul></div>
+
+<div class="content">
+<?php 
+if ($action == 'delGRP') {
+	echo '<br><h3>'._("VMBlast Group").' '.$account.' '._("deleted").'!</h3><br><br><br><br><br><br><br><br>';
+} else {
+	if ($extdisplay) {
+		// We need to populate grplist with the existing extension list.
+		$thisgrp = vmblast_get(ltrim($extdisplay,'GRP-'));
+		$grplist     = $thisgrp['grplist'];
+		$description = $thisgrp['description'];
+		$audio_label = $thisgrp['audio_label'];
+		$password    = $thisgrp['password'];
+		$default_group = $thisgrp['default_group'];
+		unset($thisgrp);
+		
+		$delButton = "
+			<form name=delete action=\"{$_SERVER['PHP_SELF']}\" method=POST>
+				<input type=\"hidden\" name=\"display\" value=\"{$dispnum}\">
+				<input type=\"hidden\" name=\"account\" value=\"".ltrim($extdisplay,'GRP-')."\">
+				<input type=\"hidden\" name=\"action\" value=\"delGRP\">
+				<input type=submit value=\""._("Delete Group")."\">
+			</form>";
+			
+		echo "<h2>"._("VMBlast Group").": ".ltrim($extdisplay,'GRP-')."</h2>";
+		echo "<p>".$delButton."</p>";
+
+		$usage_list = framework_display_destination_usage(vmblast_getdest(ltrim($extdisplay,'GRP-')));
+		if (!empty($usage_list)) {
+		?>
+			<a href="#" class="info"><?php echo $usage_list['text']?>:<span><?php echo $usage_list['tooltip']?></span></a>
+		<?php
+		}
+
+	} else {
+		$grplist = array();
+		$strategy = '';
+		$ringing = '';
+
+		if (!empty($conflict_url)) {
+			echo "<h5>"._("Conflicting Extensions")."</h5>";
+			echo implode('<br .>',$conflict_url);
+		}
+		echo "<h2>"._("Add VMBlast Group")."</h2>";
+	}
+	?>
+			<form name="editGRP" action="<?php  $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return checkGRP(editGRP);">
+			<input type="hidden" name="display" value="<?php echo $dispnum?>">
+			<input type="hidden" name="action" value="<?php echo ($extdisplay ? 'editGRP' : 'addGRP'); ?>">
+			<table>
+			<tr>
+				<td colspan="2"><h5><?php  echo ($extdisplay ? _("Edit VMBlast Group") : _("Add VMBlast Group")) ?><hr></h5>
+				</td>
+			</tr>
+			<tr>
+<?php
+				if ($extdisplay) { 
+
+?>
+				<input size="5" type="hidden" name="account" value="<?php  echo ltrim($extdisplay,'GRP-'); ?>">
+<?php 	} else { ?>
+				<td><a href="#" class="info"><?php echo _("VMBlast Number")?>:<span><?php echo _("The number users will dial to voicemail boxes in this VMBlast group")?></span></a></td>
+				<td><input size="5" type="text" name="account" value="<?php  if ($gresult[0]==0) { echo "500"; } else { echo $gresult[0] + 1; } ?>"></td>
+<?php 		} ?>
+			</tr>
+
+			<tr>
+				<td> <a href="#" class="info"><?php echo _("Group Description:")?>:<span><?php echo _("Provide a descriptive title for this VMBlast Group.")?></span></a></td>
+				<td><input size="20" maxlength="35" type="text" name="description" value="<?php echo htmlspecialchars($description); ?>"></td>
+			</tr>
+
+<?php if(function_exists('recordings_list')) { //only include if recordings is enabled?>
+			<tr>
+				<td><a href="#" class="info"><?php echo _("Audio Label:")?><span><?php echo _("Play this message to the caller so they can confirm they have dialed the proper voice mail group number, or have the system simply read the group number.")?></span></a></td>
+				<td>
+					<select name="audio_label"/>
+					<?php
+						$tresults = recordings_list();
+						$default = (isset($audio_label) ? $audio_label : -1);
+						echo '<option value="-1">'._("Read Group Number")."</option>";
+						echo '<option value="-2"'.(($default == -2) ? ' SELECTED':'').'>'._("Beep Only - No Confirmation")."</option>";
+						if (isset($tresults[0])) {
+							foreach ($tresults as $tresult) {
+								echo '<option value="'.$tresult[0].'"'.($tresult[0] == $default ? ' SELECTED' : '').'>'.$tresult[1]."</option>\n";
+							}
+						}
+					?>		
+					</select>		
+				</td>
+			</tr>
+<?php }	else { ?>
+			<tr>
+				<td><a href="#" class="info"><?php echo _("Audio Label:")?><span><?php echo _("The group number will be played to the caller so they can confirm they have dialed the proper voice mail group number.<br><br>You must install and enable the \"Systems Recordings\" Module to edit this option and choose from recordings.")?></span></a></td>
+				<td>
+					<?php
+						$default = (isset($audio_label) ? $audio_label : -1);
+					?>
+					<input type="hidden" name="audio_label" value="<?php echo $default; ?>"><?php echo ($default != -1 ? $default : _('Read Group Number')); ?>
+				</td>
+			</tr>
+<?php } 
+?>
+			<tr>
+				<td><a href="#" class="info"><?php echo _("Optional Password")?>:<span><?php echo _('You can optionally include a password to authenticate before providing access to this group voicemail list.')?></span></a></td>
+				<td><input size="12" type="text" name="password" value="<?php  echo $password ?>">
+				</td>
+			</tr>
+
+			<tr>
+				<td valign='top'><a href='#' class='info'><?php echo _("Voicemail Box List:")."<span><br>"._("Select voice mail boxes to add to this group. Use Ctrl key to select multiple..") ?> 
+	<br><br></span></a>
+				</td>
+				<td valign="top"> 
+					<select multiple="multiple" name="vmblast_list[]" id="xtnlist" >
+						<?php 
+						$results = core_users_list();
+						if (!is_array($results)) $results = array();
+						foreach ($results as $result) {
+							if ($result[2] != 'novm') {
+								echo '<option value="'.$result[0].'" ';
+								if (array_search($result[0], $grplist) !== false) echo ' selected="selected" ';
+								echo '>'.$result[0].' ('.$result[1].')</option>';
+							}
+						}
+						?>
+					</select>
+				<br>
+				</td>
+			</tr>
+
+			<tr>
+				<td>
+					<a href='#' class='info'><?php echo _("Default VMBlast Group") ?> 
+						<span> <?php echo _("Each PBX system can have a single Default Voicemail Blast Group. If specified, extensions can be automatically added (or removed) from this default group in the Extensions (or Users) tab.<br />Making this group the default will uncheck the option from the current default group if specified.") ?> </span>
+					</a>
+				</td>
+				<td>
+					<input type='checkbox' name='default_group' id="default_group" value='1' <?php if ($default_group) { echo 'CHECKED'; } ?>>
+				</td>
+
+			<tr>
+			<td colspan="2"><br><h6><input name="Submit" type="submit" value="<?php echo _("Submit Changes")?>"></h6></td>		
+			
+			</tr>
+			</table>
+			</form>
+<?php 		
+		} //end if action == delGRP
+		
+
+?>
+<script language="javascript">
+<!--
+
+function checkGRP(theForm) {
+	var msgInvalidGrpNum = "<?php echo _('Invalid Group Number specified'); ?>";
+	var msgInvalidGrpNumStartWithZero = "<?php echo _('Group numbers with more than one digit cannot begin with 0'); ?>";
+	var msgInvalidExtList = "<?php echo _('Please enter an extension list.'); ?>";
+	var msgInvalidDescription = "<?php echo _('Please enter a valid Group Description'); ?>";
+	var msgInvalidPassword = "<?php echo _('Please enter a valid numeric password, only numbers are allowed'); ?>";
+	var msgInvalidExtList = "<?php echo _('Please select at least one extension'); ?>";
+
+	// form validation
+	defaultEmptyOK = false;
+	if (!isInteger(theForm.account.value)) {
+		return warnInvalid(theForm.account, msgInvalidGrpNum);
+	} else if (theForm.account.value.indexOf('0') == 0 && theForm.account.value.length > 1) {
+		return warnInvalid(theForm.account, msgInvalidGrpNumStartWithZero);
+	}
+
+	defaultEmptyOK = true;
+	if (!isInteger(theForm.password.value))
+		return warnInvalid(theForm.password, msgInvalidPassword);
+	
+	defaultEmptyOK = false;	
+	if (!isAlphanumeric(theForm.description.value))
+		return warnInvalid(theForm.description, msgInvalidDescription);
+	
+	var selected = 0;
+	for (var i=0; i < theForm.xtnlist.options.length; i++) {
+		if (theForm.xtnlist.options[i].selected) selected += 1;
+	}
+	if (selected < 1) {
+    theForm.xtnlist.focus();
+		alert(msgInvalidExtList);
+		return false;
+	}
+
+	return true;		
+}
+
+//-->
+</script>
+

Added: freepbx-modules/trunk/modules/vmblast/uninstall.sql
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/vmblast/uninstall.sql?rev=5750&op=file
==============================================================================
--- freepbx-modules/trunk/modules/vmblast/uninstall.sql (added)
+++ freepbx-modules/trunk/modules/vmblast/uninstall.sql Sun May 18 19:52:05 2008
@@ -1,0 +1,3 @@
+
+DROP TABLE IF EXISTS vmblast;
+DROP TABLE IF EXISTS vmblast_groups;

Modified: freepbx-modules/trunk/modules/voicemail/functions.inc.php
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/voicemail/functions.inc.php?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/voicemail/functions.inc.php (original)
+++ freepbx-modules/trunk/modules/voicemail/functions.inc.php Sun May 18 19:52:05 2008
@@ -30,6 +30,7 @@
 
 function voicemail_myvoicemail($c) {
 	global $ext;
+	global $core_conf;
 
 	$id = "app-vmmain"; // The context to be included
 
@@ -45,6 +46,12 @@
 	$ext->add($id, $c, '', new ext_macro('hangupcall')); // $cmd,n,Macro(user-callerid)
 	$ext->add($id, $c, 'mbexist', new ext_vmmain('${AMPUSER}@${VMCONTEXT}'),'check',101); // n,VoiceMailMain(${VMCONTEXT})
 	$ext->add($id, $c, '', new ext_macro('hangupcall')); // $cmd,n,Macro(user-callerid)
+
+	// Now add to sip_general_addtional.conf
+	//
+	if (isset($core_conf) && is_a($core_conf, "core_conf")) {
+		$core_conf->addSipGeneral('vmexten',$c);
+	}
 }
 
 function voicemail_dialvoicemail($c) {
@@ -56,6 +63,7 @@
 
 	$ext->add($id, $c, '', new ext_answer('')); // $cmd,1,Answer
 	$ext->add($id, $c, '', new ext_wait('1')); // $cmd,n,Wait(1)
+	$ext->add($id, $c, '', new ext_macro('user-callerid')); // $cmd,n,Macro(user-callerid)
 	$ext->add($id, $c, '', new ext_vmmain('')); // n,VoiceMailMain(${VMCONTEXT})
 	$ext->add($id, $c, '', new ext_macro('hangupcall'));
 
@@ -212,9 +220,9 @@
 		$currentcomponent->addguielem($section, new gui_radio('saycid', $currentcomponent->getoptlist('vmyn'), $vmops_saycid, _('Play CID'), _("Read back caller's telephone number prior to playing the incoming message, and just after announcing the date and time the message was left.")));
 		$currentcomponent->addguielem($section, new gui_radio('envelope', $currentcomponent->getoptlist('vmyn'), $vmops_envelope, _('Play Envelope'), _("Envelope controls whether or not the voicemail system will play the message envelope (date/time) before playing the voicemail message. This settng does not affect the operation of the envelope option in the advanced voicemail menu.")));
 		$currentcomponent->addguielem($section, new gui_radio('delete', $currentcomponent->getoptlist('vmyn'), $vmops_delete, _('Delete Vmail'), _("If set to \"yes\" the message will be deleted from the voicemailbox (after having been emailed). Provides functionality that allows a user to receive their voicemail via email alone, rather than having the voicemail able to be retrieved from the Webinterface or the Extension handset.  CAUTION: MUST HAVE attach voicemail to email SET TO YES OTHERWISE YOUR MESSAGES WILL BE LOST FOREVER.")));
-		$currentcomponent->addguielem($section, new gui_textbox('options', $options, _('VM Options'), sprintf(_('Separate options with pipe ( | )%sie: review=yes|maxmessage=60'),"<br /><br />")));
-		$currentcomponent->addguielem($section, new gui_textbox('vmcontext', $vmcontext, _('VM Context'), _('This is the Voicemail Context which is normally set to default. Do not change unless you understand the implications.'), "frm_${display}_isVoiceMailEnabled() && isEmpty()", $msgInvalidVMContext, false));
-		$currentcomponent->addguielem($section, new gui_selectbox('vmx_state', $currentcomponent->getoptlist('vmxena'), $vmx_state, 'VmX Locater&trade;', _('Enable/Disable the VmX Locater feature for this user. When enabled all settings are controlled by the user in the User Portal (ARI). Disabling will not delete any existing user settings but will disable access to the feature'), false));
+		$currentcomponent->addguielem($section, new gui_textbox('options', $options, _('VM Options'), sprintf(_("Separate options with pipe ( | )%sie: review=yes|maxmessage=60"),"<br /><br />")));
+		$currentcomponent->addguielem($section, new gui_textbox('vmcontext', $vmcontext, _('VM Context'), _("This is the Voicemail Context which is normally set to default. Do not change unless you understand the implications."), "frm_${display}_isVoiceMailEnabled() && isEmpty()", $msgInvalidVMContext, false));
+		$currentcomponent->addguielem($section, new gui_selectbox('vmx_state', $currentcomponent->getoptlist('vmxena'), $vmx_state, 'VmX Locater&trade;', _("Enable/Disable the VmX Locater feature for this user. When enabled all settings are controlled by the user in the User Portal (ARI). Disabling will not delete any existing user settings but will disable access to the feature"), false));
 	}
 }
 
@@ -227,8 +235,15 @@
 	//if submitting form, update database
 	switch ($action) {
 		case "add":
-			voicemail_mailbox_add($extdisplay, $_REQUEST);
-			needreload();
+			if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) {
+				$usage_arr = framework_check_extension_usage($_REQUEST['extension']);
+				if (!empty($usage_arr)) {
+					$GLOBALS['abort'] = true;
+				} else {
+					voicemail_mailbox_add($extdisplay, $_REQUEST);
+					needreload();
+				}
+			}
 		break;
 		case "del":
 			// call remove before del, it needs to know context info
@@ -238,10 +253,12 @@
 			needreload();
 		break;
 		case "edit":
-			voicemail_mailbox_del($extdisplay);
-			if ( $vm != 'disabled' )
-				voicemail_mailbox_add($extdisplay, $_REQUEST);
-			needreload();
+			if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) {
+				voicemail_mailbox_del($extdisplay);
+				if ( $vm != 'disabled' )
+					voicemail_mailbox_add($extdisplay, $_REQUEST);
+				needreload();
+			}
 		break;
 	}
 }

Modified: freepbx-modules/trunk/modules/voicemail/module.xml
URL: http://svn.debian.org/wsvn/pkg-voip/freepbx-modules/trunk/modules/voicemail/module.xml?rev=5750&op=diff
==============================================================================
--- freepbx-modules/trunk/modules/voicemail/module.xml (original)
+++ freepbx-modules/trunk/modules/voicemail/module.xml Sun May 18 19:52:05 2008
@@ -1,10 +1,12 @@
 <module>
 	<rawname>voicemail</rawname>
 	<name>Voicemail</name>
-	<version>2.0.3.4</version>
+	<version>2.4.0.1</version>
 	<candisable>no</candisable>
 	<canuninstall>no</canuninstall>
 	<changelog>
+		*2.4.0.1* added depends on 2.4.0
+		*2.4.0* #2457 vm dial code to vmexten in sip_general_additional.conf, make hooks abort if extension confilct, misc fixes
 		*2.0.3.4* Fix some labeling and make localization friendly
 		*2.0.3.3* #2232 call to VoiceMailMain() need ${AMPUSER} was fixed wrong
 		*2.0.3.2* bump for rc1
@@ -33,6 +35,6 @@
 	<description>This module allows you to configure Voicemail for a user or extension</description>
 	<type>setup</type>
 	<category>Basic</category>
-	<location>release/2.3/voicemail-2.0.3.3.tgz</location>
-	<md5sum>6a2ec22f303465579eb20d40e22a71f2</md5sum>
+	<location>release/2.4/voicemail-2.4.0.tgz</location>
+	<md5sum>26e1f518bd9a8ed554941b91b306cc2f</md5sum>
 </module>




More information about the Pkg-voip-commits mailing list