# How does EAGI work?

**URL:** <https://community.asterisk.org/t/how-does-eagi-work/81267>\
**Category:** Asterisk APIs\
**Created:** [October 15, 2019, 3:24am UTC](https://community.asterisk.org/t/how-does-eagi-work/81267 "2019-10-15T03:24:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JasonOmarion](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jasonomarion/32/3995_2.png) [@JasonOmarion](https://community.asterisk.org/u/JasonOmarion)\
**Post date:** [October 15, 2019, 3:24am UTC](https://community.asterisk.org/t/how-does-eagi-work/81267/1 "2019-10-15T03:24:49Z")

</div>

Hi everyone!

I tried to use speech recognition NodeJS script for my calls with EAGI application.  
I start it like this:

```auto
exten => s,1,EAGI(my_super_script.js,${some_VAR})
exten => s,n,Goto(${result},1)

```

And it starts well.  
In script.js I get an audio stream from fd 3, and it works well too:

```auto
const audio = fs.createReadStream( null, { 'fd' : 3 } );

```

BUT! If I do something from EAGI script.js like:

```auto
console.log('NoOp "ASTERISK IS THE BEST!"');
console.log('SET VARIABLE test 123123123');

```

I’ll lose my audio stream from asterisk unfortunately. So the question is:  
Is it normal that audio stream from fd3 will stop if we execute some application from EAGI script? Or my script is doing something wrong???

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [November 14, 2019, 3:24am UTC](https://community.asterisk.org/t/how-does-eagi-work/81267/2 "2019-11-14T03:24:55Z")

</div>

Closed on November 14, 2019, 3:24am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
