[asterisk-bugs] [JIRA] (ASTERISK-20532) AGI script fork()s, Asterisk doesn't keep processing the dialplan when parent dies

Jonathan Harris (JIRA) noreply at issues.asterisk.org
Sat Jul 1 02:12:57 CDT 2017


    [ https://issues.asterisk.org/jira/browse/ASTERISK-20532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=237600#comment-237600 ] 

Jonathan Harris commented on ASTERISK-20532:
--------------------------------------------

Oh wow - thank you Omri for finding this fix and I'm SO glad Marcello on the mailing list pointed me towards this. I struggled for about 6 hours in total looking for a way to async some AGI, finally to be told to use fork in python, and it didn't work as expected.

Well, if this isn't a bug, then "behaviour which differs dramatically from that which is expected" would definitely be the tag.

This fix works for me and needs to be laser-etched into the first page about everything ever written about AGI! THanks.

> AGI script fork()s, Asterisk doesn't keep processing the dialplan when parent dies
> ----------------------------------------------------------------------------------
>
>                 Key: ASTERISK-20532
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-20532
>             Project: Asterisk
>          Issue Type: Improvement
>      Security Level: None
>          Components: Resources/res_agi
>    Affects Versions: 1.8.13.1
>         Environment: Debian 6 64bits
>            Reporter: Omri Bahumi
>            Assignee: Rusty Newton
>            Severity: Minor
>         Attachments: agi_problematic.py, agi_workaround.py
>
>
> When an AGI script forks, Asterisk won't keep processing the dialplan when the parent dies.
> By looking at the AGI code I've noticed it waits for an EOF on the stdout file descriptor, and not for the process to die.
> Attached two Python AGI scripts (uses pyst-0.4.38).
> Problematic example: you'll notice the dialplan stops processing until both the parent and child exit (hence closing stdout fd).
> Workaround example: the execution continues when the parent exits and the child closes stdout, not waiting for the entire script execution to terminate.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list