Quantcast
Channel: FreePBX Community Forums - Latest posts
Viewing all 228094 articles
Browse latest View live

Voice pjsip quality issue

$
0
0

Experiment. Start with simpler codecs, like g722 and aLaw (since you’re not in the US). You can try different codecs, but remember that you only get a vote on one leg of the entire conversation (the one from your PBX to your phones). The rest of the parameters are negotiated with servers and providers’ equipment that you have no control over.

Once you’ve got a codec set that works on the local phones, connect it up. Things like cell phones and remote PBX systems will communicate and negotiate the “best” codec (typically aLaw or uLaw) and set up the environment from there.


Global time condition day/night toggle

$
0
0

Not a full GUI solution…

You could make a callflow control that you don’t use directly in your routing.

Build an override context on your [from-trunk] context tied to the state of that call flow (Normal/Override)
if status = Normal then ignore and continue on, otherwise play your global closed message instead of going to the [ext-did]s.

That should allow them a one stop toggle (via the GUI or feature code) without having to change your existing inbound routes or time conditions.

TTS Engine Custom - Google Cloud Text To Speech - WaveNet and Standard

$
0
0

WaveNet voices
The Cloud Text-to-Speech API also offers a group of premium voices generated using a WaveNet model, the same technology used to produce speech for Google Assistant, Google Search, and Google Translate. WaveNet technology provides more than just a series of synthetic voices: it represents a new way of creating synthetic speech.

Important remark

The following procedures were performed in a test environment, the propolys-tts.agi file will be modified and then FreePBX will alert you as per the text below;

Module: “Text To Speech”, File: "/var/www/html/admin/modules/tts/agi-bin/propolys-tts.agi altered"



Create Custom Engine:

cd /opt/
git clone https://github.com/googleapis/nodejs-text-to-speech.git
npm install --save @google-cloud/text-to-speech
npm install
npm install optimist
npm install child_process

cd /opt/nodejs-text-to-speech/samples

vim quickstart.js

/**
 * Copyright 2018, Google, Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

'use strict';

// [START vision_quickstart]
var argv = require('optimist').argv;
var child_process = require('child_process');
const fs = require('fs');

// Imports the Google Cloud client library
const textToSpeech = require('@google-cloud/text-to-speech');

// Creates a client
const client = new textToSpeech.TextToSpeechClient();

// The text to synthesize
const text = argv.text;

// Construct the request
const request = {
  input: {text: text},
  // Select the language and SSML Voice Gender (optional)
  //voice: {languageCode: 'pt-BR', ssmlGender: 'en-US-Wavenet-F'},
  voice: {languageCode: 'en-US', name: 'en-US-Wavenet-F', ssmlGender: 'FEMALE'},
  // Select the type of audio encoding
  audioConfig: {audioEncoding: 'MP3'},
};

// Performs the Text-to-Speech request
client.synthesizeSpeech(request, (err, response) => {
  if (err) {
    console.error('ERROR:', err);
    return;
  }

  // Write the binary audio content to a local file
  fs.writeFile(argv.mp3, response.audioContent, 'binary', err => {
    if (err) {
      console.error('ERROR:', err);
      return;
    }
    console.log('Audio content written to file: output.mp3');
    var output = child_process.execSync('lame --decode ' + argv.mp3 + ' ' + '-b 8000' + ' ' + argv.wav + '.wav');
  });
});
// [END vision_quickstart]

/var/www/html/admin/modules/tts/agi-bin/propolys-tts.agi

#!/usr/bin/php -q
<?php
//	License for all code of this FreePBX module can be found in the license file inside the module directory
//	Copyright 2013 Schmooze Com Inc.
//  Xavier Ourciere xourciere[at]propolys[dot]com
//

$config = parse_amportal_conf( "/etc/amportal.conf" );

require_once "phpagi.php";
require_once "phpagi-asmanager.php";

$AGI = new AGI();
debug("TTS AGI Started", 1);
//Path of your google credentials
putenv("GOOGLE_APPLICATION_CREDENTIALS=/opt/nodejs-text-to-speech/samples/test.json");
$text = $argv[1];
$hash = md5($text);
$engine = $argv[2];
$enginebin = $argv[3];

$f = $AGI->get_full_variable('${CHANNEL(audionativeformat)}');
$nformat = $f['data'];
$format = array(
	"ext" => "wav",
	"rate" => "8000"
);

//amazing work my friend: https://github.com/stevenmirabito/asterisk-picotts/blob/master/picotts.agi#L251
switch(true) {
	case preg_match('/(silk|sln)12/',$nformat):
		$format = array(
			"ext" => "sln12",
			"rate" => "12000"
		);
	break;
	case preg_match('/(speex|slin|silk)16|g722|siren7/',$nformat):
		$format = array(
			"ext" => "sln16",
			"rate" => "16000"
		);
	break;
	case preg_match('/(speex|slin|celt)32|siren14/',$nformat):
		$format = array(
			"ext" => "sln32",
			"rate" => "32000"
		);
	break;
	case preg_match('/(celt|slin)44/',$nformat):
		$format = array(
			"ext" => "sln44",
			"rate" => "44000"
		);
	break;
	case preg_match('/(celt|slin)48/',$nformat):
		$format = array(
			"ext" => "sln48",
			"rate" => "48000"
		);
	break;
	default;
		$format = array(
			"ext" => "wav",
			"rate" => "8000"
		);
	break;
}

if (!isset($text))
{
	return 0;
}

if ( $retval != 0 ) {
	debug("ERROR: TTS engine binary not found.", 1);
	return $retval;
}

$soundsdir = $config["ASTVARLIBDIR"]."/sounds/tts";
if( !is_dir($soundsdir) ) mkdir($soundsdir, 0775);

$wavefile = $soundsdir."/$engine-tts-$hash.".$format['ext'];
$tmpwavefile = $soundsdir."/$engine-tts-temp-$hash.wav";
debug("Generated WAV file: $wavefile", 3);
$textfile = $soundsdir."/$engine-tts-$hash.txt";
debug("TXT file: $textfile", 3);

if ( !file_exists($wavefile) ) {
	debug("Text to speech wave file doesnt exist, lets create it.", 1);
	if ( false === ($fh = fopen($textfile, "w")) ) {
		debug("ERROR: Cannot open the file: $textfile", 1);
		return 1;
	}
	if ( false === fwrite($fh, $text) ) {
		debug("ERROR: Cannot write to file: $textfile", 1);
		return 1;
	}
	fclose($fh);
	debug("Executing $engine", 1);
	switch ($engine) {
		case 'text2wave':
			exec($enginebin." -f ".$format['rate']." -o $tmpwavefile $textfile");
			break;
		case 'flite':
			exec($enginebin." -f $textfile -o $tmpwavefile");
			break;
		case 'swift':
			exec($enginebin." -p audio/channels=1,audio/sampling-rate=".$format['rate']." -o $tmpwavefile -f $textfile");
			break;
		case 'pico':
			exec($enginebin." -o $tmpwavefile ".escapeshellarg(file_get_contents($textfile)));
			break;
		case 'node':
                        exec($enginebin." /opt/nodejs-text-to-speech/samples/quickstart.js --mp3=/var/lib/asterisk/sounds/tts/$engine-tts-$hash.mp3 --text='$text' --wav=/var/lib/asterisk/sounds/tts/$engine-tts-$hash");
			break;
		default:
			debug("$engine is not a valid engine!", 1);
		break;
	}
}
if(file_exists($tmpwavefile)) {
	exec("sox $tmpwavefile -q -r ".$format['rate']." -t raw $wavefile");
	unlink($tmpwavefile);
}

if(file_exists($wavefile)) {
	// Adding a wait because the first time the wave file is generated, it was not played
	$AGI->wait_for_digit(1000);
	debug("Streaming the generated wave.", 1);
	$AGI->stream_file("tts/".basename($wavefile,".".$format['ext']),'#');
} else {
	debug("File was not created!", 1);
}
debug("TTS AGI end", 1);

function parse_amportal_conf($filename) {
	$file = file($filename);
	$matches = array();
	$matchpattern = '/^\s*([a-zA-Z0-9]+)\s*=\s*(.*)\s*([;#].*)?/';
	foreach ($file as $line) {
		if (preg_match($matchpattern, $line, $matches)) {
			$conf[ $matches[1] ] = $matches[2];
		}
	}
	return $conf;
}

function debug($string, $level=3) {
	global $AGI;
	$AGI->verbose($string, $level);
}

More information:

https://cloud.google.com/text-to-speech/docs/wavenet


Inbound calls to Specific DIDs drop after 1 ring

$
0
0

We’ve started to see odd behavior on a few DIDs where the extension will ring once or twice on an inbound call, then the call drops on that extension, but the calling extension call remains open.

I’ve contacted the DID provider and they say they’re receiving a 401 from us. Anyone point to a possible cause?These have been working normally until today.

Thanks

No compatible codecs, not accepting this offer! Since Module updates

$
0
0

We are also seeing this issue, but so far only on FreePBX 13 systems. Trying to narrow down which module caused the issue.

No compatible codecs, not accepting this offer! Since Module updates

$
0
0

It seems to be affecting only FreePBX 13 with us as well.

With most of our carriers we set disallow=all and allow=ulaw on our trunks. Removing disallow=all and changing allow=all seems to fix the issue.

This is affecting every PBX 13 server we have with every carrier we have.

My Upgrade from 13 to 14 and current troubles

$
0
0

So anyone see the troubles on this?

No compatible codecs, not accepting this offer! Since Module updates

$
0
0

I am not sure if this is relevant but we just started to get this error on these servers today.

[2018-05-30 08:32:31] ERROR[59151] phone_message.c: Unable to build dialplan routing - invalid license
[2018-05-30 08:32:31] ERROR[59132] phone_message.c: Unable to build dialplan routing - invalid license
[2018-05-30 08:32:31] ERROR[59132] phone_message.c: Unable to build dialplan routing - invalid license
[2018-05-30 08:32:31] ERROR[6105] phone_message.c: Unable to build dialplan routing - invalid license
[2018-05-30 08:32:31] ERROR[6105] phone_message.c: Unable to build dialplan routing - invalid license
[2018-05-30 08:32:31] ERROR[59132] phone_message.c: Unable to build dialplan routing - invalid license
[2018-05-30 08:33:42] ERROR[61000] phone_message.c: Unable to build dialplan routing - invalid license
[2018-05-30 08:33:42] ERROR[60984] phone_message.c: Unable to build dialplan routing - invalid license
[2018-05-30 08:33:42] ERROR[60984] phone_message.c: Unable to build dialplan routing - invalid license
[2018-05-30 08:33:42] ERROR[6105] phone_message.c: Unable to build dialplan routing - invalid license
[2018-05-30 08:33:42] ERROR[6105] phone_message.c: Unable to build dialplan routing - invalid license
[2018-05-30 08:33:42] ERROR[60984] phone_message.c: Unable to build dialplan routing - invalid license
[2018-05-30 08:44:55] ERROR[5389] phone_message.c: Unable to build dialplan routing - invalid license
[2018-05-30 08:44:55] ERROR[5382] phone_message.c: Unable to build dialplan routing - invalid license
[2018-05-30 08:44:55] ERROR[5382] phone_message.c: Unable to build dialplan routing - invalid license
[2018-05-30 08:44:55] ERROR[5382] phone_message.c: Unable to build dialplan routing - invalid license
[2018-05-30 08:44:55] ERROR[6105] phone_message.c: Unable to build dialplan routing - invalid license
[2018-05-30 08:44:55] ERROR[6105] phone_message.c: Unable to build dialplan routing - invalid license


Calendar 14.0.2.4

$
0
0

The module update Calendar 14.0.2.4 no longer appears. Could someone elaborate the cause?

I am seeing some unusual behavior on my system (FreePBX 14.0.3.2). Not sure if there is any connection.

No compatible codecs, not accepting this offer! Since Module updates

$
0
0

Just thought I would through this out there too. We are getting this error on every FreePBX 14 server we have after module updates.

exit: 1
Unable to continue. Unable to locate the FreePBX BMO Class 'Core’A required module might be disabled or uninstalled. Recommended steps (run from the CLI): 1) fwconsole ma install core 2) fwconsole ma enable core in /var/www/html/admin/libraries/BMO/Self_Helper.class.php on line 213
#0 /var/www/html/admin/libraries/BMO/Self_Helper.class.php(106): FreePBX\Self_Helper->loadObject(‘Core’)
#1 /var/www/html/admin/libraries/BMO/Self_Helper.class.php(37): FreePBX\Self_Helper->autoLoad(‘Core’)
#2 /var/www/html/admin/modules/certman/Certman.class.php(39): FreePBX\Self_Helper->__get(‘Core’)
#3 /var/www/html/admin/libraries/BMO/Self_Helper.class.php(124): FreePBX\modules\Certman->__construct(Object(FreePBX))
#4 /var/www/html/admin/libraries/BMO/Self_Helper.class.php(37): FreePBX\Self_Helper->autoLoad(‘Certman’)
#5 /var/www/html/admin/libraries/BMO/Hooks.class.php(294): FreePBX\Self_Helper->__get(‘Certman’)
#6 /var/www/html/admin/libraries/BMO/Hooks.class.php(39): FreePBX\Hooks->preloadBMOModules()
#7 /var/lib/asterisk/bin/retrieve_conf(81): FreePBX\Hooks->updateBMOHooks()
#8 {main}

No compatible codecs, not accepting this offer! Since Module updates

$
0
0

In Self_Helper.class.php line 213:

Unable to locate the FreePBX BMO Class 'Core’A required module might be dis
abled or uninstalled. Recommended steps (run from the CLI): 1) fwconsole ma
install core 2) fwconsole ma enable core

No compatible codecs, not accepting this offer! Since Module updates

$
0
0

@masher81 Upgrade core and any other module you missed and all of your issues will be fixed.

No compatible codecs, not accepting this offer! Since Module updates

$
0
0

This is the command I use to update. fwconsole ma --quiet updateall

Shouldn’t this catch all of the modules?

No compatible codecs, not accepting this offer! Since Module updates

$
0
0

Yes but when you --quiet it you dont see the errors. You are basically ignoring errors.

No compatible codecs, not accepting this offer! Since Module updates

$
0
0

It appears that modules that were not there previously were attempted to be installed Sangomcrm and Zulu.


No compatible codecs, not accepting this offer! Since Module updates

$
0
0

Right now Core is disabled. You need to fix that first.

No compatible codecs, not accepting this offer! Since Module updates

$
0
0

Core is enabled.

]# fwconsole ma enable core
The following error(s) occured:

  • Module core is already enabled

This is an issue on the FreePBX 14 servers. What about the Codec issue on the FreePBX13 servers?

No compatible codecs, not accepting this offer! Since Module updates

$
0
0

I dont see any error on FreePBX 13 at this time with codecs. The way you see codecs is with “core show codecs audio”

No compatible codecs, not accepting this offer! Since Module updates

$
0
0

Are you sure your modules are all updated. It seems like you havent installed something.

No compatible codecs, not accepting this offer! Since Module updates

$
0
0

Here is the output from one of the servers with the codec issue.

asterisk]# fwconsole ma updateall
No repos specified, using: [standard,commercial,extended] from last GUI settings

Up to date.
Updating Hooks…Done
[root@uh-exp-pbx-01 asterisk]#

Viewing all 228094 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>