diff --git a/build-images.sh b/build-images.sh index 93ece7c8d..f151d917b 100644 --- a/build-images.sh +++ b/build-images.sh @@ -100,7 +100,7 @@ images+=("${repobase}/${reponame}") ## NethCTI Client ## ############################# reponame="nethvoice-cti-ui" -container=$(buildah from ghcr.io/nethesis/nethvoice-cti:v0.13.5) +container=$(buildah from ghcr.io/nethesis/nethvoice-cti:v0.13.7) # Commit the image buildah commit "${container}" "${repobase}/${reponame}" diff --git a/freepbx/initdb.d/update.php b/freepbx/initdb.d/update.php index 50f149005..3c026809a 100644 --- a/freepbx/initdb.d/update.php +++ b/freepbx/initdb.d/update.php @@ -73,4 +73,6 @@ $stmt->execute(); $stmt = $db->prepare("INSERT IGNORE INTO `asterisk`.`admin` (`variable`, `value`) VALUES ('NETHVOICE_HOST',?)"); $stmt->execute([$_ENV['NETHVOICE_HOST']]); - +// Add Audio Test feature code +$stmt = $db->prepare("INSERT IGNORE INTO `featurecodes` (`modulename`,`featurename`,`description`,`helptext`,`defaultcode`,`customcode`,`enabled`,`providedest`) VALUES ('nethcti3','audio_test','Audio Test','NethVoice CTI Audio Test','*41',NULL,1,0)"); +$stmt->execute(); diff --git a/freepbx/var/www/html/freepbx/admin/modules/nethcti3/Nethcti3.class.php b/freepbx/var/www/html/freepbx/admin/modules/nethcti3/Nethcti3.class.php index cf6c1074c..3b4a2f88d 100644 --- a/freepbx/var/www/html/freepbx/admin/modules/nethcti3/Nethcti3.class.php +++ b/freepbx/var/www/html/freepbx/admin/modules/nethcti3/Nethcti3.class.php @@ -180,7 +180,7 @@ public function getQueuesConfiguration() { public function getFeaturecodesConfiguration() { try { $result = array(); - $codes_to_pick = array("pickup","confbridge_conf","que_toggle","dnd_toggle","incall_audio"); //Add here more codes + $codes_to_pick = array("pickup","confbridge_conf","que_toggle","dnd_toggle","incall_audio","audio_test"); //Add here more codes $featurecodes = featurecodes_getAllFeaturesDetailed(); foreach ($featurecodes as $featurcode) { if (in_array($featurcode['featurename'],$codes_to_pick)) { diff --git a/freepbx/var/www/html/freepbx/admin/modules/nethcti3/functions.inc.php b/freepbx/var/www/html/freepbx/admin/modules/nethcti3/functions.inc.php index 4d3020836..fd2b748c6 100644 --- a/freepbx/var/www/html/freepbx/admin/modules/nethcti3/functions.inc.php +++ b/freepbx/var/www/html/freepbx/admin/modules/nethcti3/functions.inc.php @@ -32,7 +32,7 @@ function nethcti3_get_config($engine) { /*Configure conference*/ $defaultVal = $amp_conf['ASTCONFAPP']; $amp_conf['ASTCONFAPP'] = 'app_confbridge'; - $query='SELECT featurename,IF(customcode IS NULL OR customcode = "",defaultcode,customcode) as defaultcode FROM featurecodes WHERE ( modulename="nethcti3" OR modulename="donotdisturb" ) AND ( featurename="confbridge_conf" OR featurename="incall_audio" OR featurename="dnd_on" OR featurename="dnd_off" OR featurename="dnd_toggle") AND enabled="1"'; + $query='SELECT featurename,IF(customcode IS NULL OR customcode = "",defaultcode,customcode) as defaultcode FROM featurecodes WHERE ( modulename="nethcti3" OR modulename="donotdisturb" ) AND ( featurename="confbridge_conf" OR featurename="incall_audio" OR featurename="audio_test" OR featurename="dnd_on" OR featurename="dnd_off" OR featurename="dnd_toggle") AND enabled="1"'; $codes = array(); foreach ($db->getAll($query) as $feature) { $codes[$feature[0]] = $feature[1]; @@ -70,6 +70,18 @@ function nethcti3_get_config($engine) { $ext->add($context2, $exten2, '', new ext_playback('nethcti/incall_audio/file-${EXTEN}')); $ext->add($context2, $exten2, '', new ext_hangup()); } + if (isset($codes['audio_test']) && $codes['audio_test'] != '') { + $exten=$codes['audio_test']; + $context='audio-test'; + $ext->addInclude('ext-test', $context); + $ext->add($context, $exten, '', new ext_noop('Audio Test')); + $ext->add($context, $exten, '', new ext_set('CONNECTEDLINE(name-charset,i)','utf8')); + $ext->add($context, $exten, '', new ext_set('CONNECTEDLINE(name,i)',_("Audio Test"))); + $ext->add($context, $exten, '', new ext_set('CONNECTEDLINE(num,i)',$exten)); + $ext->add($context, $exten, '', new ext_answer()); + $ext->add($context, $exten, '', new ext_playback('silence/2')); + $ext->add($context, $exten, '', new ext_hangup()); + } /* add user and admin profile to confbridge_additional.conf */ if (isset($conferences_conf) && is_a($conferences_conf, "conferences_conf")) { /* get default language */ diff --git a/mariadb/docker-entrypoint-initdb.d/50_asterisk.featurecodes.sql b/mariadb/docker-entrypoint-initdb.d/50_asterisk.featurecodes.sql index fda4546c7..8a87ab5ee 100644 --- a/mariadb/docker-entrypoint-initdb.d/50_asterisk.featurecodes.sql +++ b/mariadb/docker-entrypoint-initdb.d/50_asterisk.featurecodes.sql @@ -54,8 +54,9 @@ INSERT INTO `featurecodes` (`modulename`,`featurename`,`description`,`helptext`, ("infoservices","echotest","Echo Test","","*43","",1,1), ("infoservices","speakextennum","Speak Your Exten Number","","*65","",1,0), ("infoservices","speakingclock","Speaking Clock","","*60","",1,1), -("nethcti3","incall_audio","Incall Audio","NethCTI 3 Incall Audio","1987",NULL,1,0), -("nethcti3","confbridge_conf","Conference","NethCTI 3 conference","987",NULL,1,0), +("nethcti3","audio_test","Audio Test","NethVoice CTI Audio Test","*41",NULL,1,0), +("nethcti3","incall_audio","Incall Audio","NethVoice CTI Incall Audio","1987",NULL,1,0), +("nethcti3","confbridge_conf","Conference","NethVoice CTI conference","987",NULL,1,0), ("paging","intercom-off","User Intercom Disallow","","*55","",1,0), ("paging","intercom-on","User Intercom Allow","","*54","",1,0), ("paging","intercom-prefix","Intercom prefix","","*80","",1,0),