Giter Club home page Giter Club logo

Comments (5)

zaf avatar zaf commented on July 17, 2024

Hello,

the script handles playback here using STREAM FILE. As it is now it only works for single digits. I think your best chance is to edit the AGI script and modify the playback() sub to suit your needs.

from asterisk-googletts.

taphawane avatar taphawane commented on July 17, 2024

Hello,

I tried to edit the file, and located exactly where I need to edit. but I'm not familiar with way how the AGi is used in the file.
The function i am use to are $agi->get_data(filename, timeout, maxdigit); which is php agi.
in the cripte I don't know which function I replace with "$res = playback("$cachedir/$filename", $intkey);"

I know that I need to edit in these paragraph of line.

Stream file from cache if it exists

	if (-r "$cachedir/$filename.$fexten") {
		console_log("File already in cache.") if ($debug);
		$res = playback("$cachedir/$filename", $intkey);
		die  if ($res < 0);
		last if ($res > 0);
		next;

and

Playback and save file in cache

$res = playback($tmpname, $intkey);
die if ($res < 0);
if ($usecache) {
	console_log("Saving file $filename to cache") if ($debug);
	move("$tmpname.$fexten", "$cachedir/$filename.$fexten");

from asterisk-googletts.

felipecrs avatar felipecrs commented on July 17, 2024

@zaf I'm really sorry to bring this again after all these years, but... is there any chance you can help me make the modifications needed to accept more than one digit? I'm playing with this for some hours already and I haven't got any far.

I'm using your AGI script to build a menu for my Home Assistant, in which I ask for a password in the very beginning. That's the reason why I want to accept more than one digit.

from asterisk-googletts.

zaf avatar zaf commented on July 17, 2024

You don't really have to modify the script for that. Just write your dialplan in a way that plays the message and then waits for input from the user using for instance Read().

from asterisk-googletts.

felipecrs avatar felipecrs commented on July 17, 2024

Thank you, that's what I was doing, but the problem is that by doing that I have to wait until the message is played before entering the number.

However I fixed it in another way. I ask the user to press 0 before entering the password, which then I initiate a Read(). It's working great!

from asterisk-googletts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.