[asterisk-bugs] [JIRA] (ASTERISK-21903) [patch] Return proper result upon error when running some AGI commands

Ariel Wainer (JIRA) noreply at issues.asterisk.org
Wed Jun 12 13:43:03 CDT 2013


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

Ariel Wainer commented on ASTERISK-21903:
-----------------------------------------

Michael, tested the patch against the current version (11.4.0), and it works as expected:
{quote}
<SIP/192.168.200.3-00000001>AGI Rx << GET OPTION "content/static/18/welcome" """" "100"
[Jun 12 15:32:03] WARNING[17521][C-00000001]: file.c:701 ast_openstream_full: File content/static/18/welcome does not exist in any format
<SIP/192.168.200.3-00000001>AGI Tx >> 200 result=-1 endpos=0
[Jun 12 15:32:03] WARNING[17521][C-00000001]: res_agi.c:2069 handle_getoption: Unable to open content/static/18/welcome
{quote}

Also tried to patch 1.8.10 which is the current packaged version in ubuntu 12.04, but the patch failed to apply:
{quote}
~/tmp/asterisk-1.8.10.1~dfsg$ sudo patch --verbose  -p0<47585_asterisk-21903-return-stream-res_11.diff 
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: res/res_agi.c
|===================================================================
|--- res/res_agi.c      (revision 391551)
|+++ res/res_agi.c      (working copy)
--------------------------
Patching file res/res_agi.c using Plan A...
Hunk #1 FAILED at 2007.
Hunk #2 FAILED at 2065.
2 out of 2 hunks FAILED -- saving rejects to file res/res_agi.c.rej
{quote}

                
> [patch] Return proper result upon error when running some AGI commands
> ----------------------------------------------------------------------
>
>                 Key: ASTERISK-21903
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-21903
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_agi
>    Affects Versions: 1.8.22.0, 11.4.0
>            Reporter: Ariel Wainer
>            Assignee: 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 file, 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