[asterisk-bugs] [JIRA] (ASTERISK-21903) Add return code to AGI for some errors

Michael L. Young (JIRA) noreply at issues.asterisk.org
Wed Jun 12 12:53:03 CDT 2013


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

Michael L. Young commented on ASTERISK-21903:
---------------------------------------------

Ariel,

Well, I can see where this can cause confusion.

It looks like 200 is to say that the command was run successfully; or rather that the command was found.  That part was successful.  Now, the fact that the command was unable to complete the task should be made clear by the 'result' code that is part of the result line.

It looks like currently, it always returns 0.  In looking at other commands throughout the code, I would say that it should be returning 'result=-1' when there is an error streaming the file.
                
> Add return code to AGI for some errors
> --------------------------------------
>
>                 Key: ASTERISK-21903
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-21903
>             Project: Asterisk
>          Issue Type: Improvement
>      Security Level: None
>          Components: . I did not set the category correctly.
>    Affects Versions: 11.4.0
>            Reporter: Ariel Wainer
>            Severity: Minor
>         Attachments: asterisk-21903-return-stream-res_11.diff
>
>
> When playing audio files from an AGI script, if for some reason Asterisk fails to play the fail, currently there is no way to tell from the script.
> To illustrate, this is the debug transcript from an AGI script trying to play an non-existent file:
> {quote}
> <SIP/192.168.200.3-0000007d>AGI Rx << GET OPTION "content/00/3000" ""*0#"" "1000"
> [Jun 12 10:48:12] WARNING[24554]: file.c:663 ast_openstream_full: File content/00/3000 does not exist in any format
> <SIP/192.168.200.3-0000007d>AGI Tx >> 200 result=0 endpos=0
> [Jun 12 10:48:12] WARNING[24554]: res_agi.c:2003 handle_getoption: Unable to open content/00/3000
> {quote}
> Since Asterisk didn't succeed to execute the command, the return code 200 doesn't make sense. I think it should be 404 if the file does not exists or 503 if it doesn't the right permission, to continue with the HTTP analogy.
> Even a basic code 500 for anything else than success would be useful.
> Best regards,
> Ari

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list