[Asterisk-Dev] AGI script looping not killed by Asterisk
Jared Mauch
jared at puck.Nether.net
Mon Oct 13 07:41:27 MST 2003
you want to read the error code from fgets and break out of your
for loop in that case.
- Jared
On Mon, Oct 13, 2003 at 04:33:33PM +0200, Areski wrote:
> Hi all,
>
>
> I did a small AGI script looping all the time (see the source below).
> But Asterisk don't stop the process when I hangup...
> I launch asterisk in this way : /usr/sbin/asterisk -vvv -c
>
> And looking to the source app_agi.c, it's seem that * should stop this
> process with a SIGHUP...
>
>
> Someone have an idea, why that doesn't work in the good way ?!?
>
> Cheers,
> Areski
>
>
> int main()
> { char line[80];
> /* use line buffering */
> setlinebuf(stdout);
> setlinebuf(stderr);
> /* read and ignore AGI environment */
> while (1) {
> fgets(line,80,stdin);
> if (strlen(line) <= 1) break;
> }
> for (;;){
>
> printf("STREAM FILE GB_5 \"\"\n");
> fgets(line,80,stdin);
> fputs(line,stderr);
>
> printf("SAY DIGITS 154642 \"\"\n");
> fgets(line,80,stdin);
> fputs(line,stderr);
> sleep(2);
> }
>
> return 0;
> }
>
>
>
>
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
--
Jared Mauch | pgp key available via finger from jared at puck.nether.net
clue++; | http://puck.nether.net/~jared/ My statements are only mine.
More information about the asterisk-dev
mailing list