[Home]

Summary:ASTERISK-11866: [patch] Value of AGISTATUS is set to SUCCESS even though the agi program could not be executed
Reporter:Fabian Mueller (fmueller)Labels:
Date Opened:2008-04-16 17:04:54Date Closed:2008-04-17 12:30:50
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_agi
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20080416__bug12462.diff.txt
Description:This is the context:

[default]
exten => 69,1,Answer()
exten => 69,2,AGI(this-does-not-exist)
exten => 69,3,Noop(${AGISTATUS})
exten => 69,4,Hangup()

The called AGI-program does not exist so I expect AGISTATUS to be set to FAILURE. But it is set to SUCCESS.

*CLI>     -- Executing [69@default:1] Answer("SIP/111-081fb288", "") in new stack
   -- Executing [69@default:2] AGI("SIP/111-081fb288", "this-does-not-exist") in new stack
   -- Launched AGI Script /var/lib/asterisk/agi-bin/this-does-not-exist
AGI Tx >> agi_request: this-does-not-exist
AGI Tx >> agi_channel: SIP/111-081fb288
AGI Tx >> agi_language: en
AGI Tx >> agi_type: SIP
AGI Tx >> agi_uniqueid: 1208383260.0
AGI Tx >> agi_callerid: 111
AGI Tx >> agi_calleridname: unknown
AGI Tx >> agi_callingpres: 0
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: 69
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: default
AGI Tx >> agi_extension: 69
AGI Tx >> agi_priority: 2
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >>
AGI Rx << verbose "Failed to execute '/var/lib/asterisk/agi-bin/this-does-not-exist': No such file or directory" 2
 ==  this-does-not-exist: Failed to execute '/var/lib/asterisk/agi-bin/this-does-not-exist': No such file or directory
AGI Tx >> 200 result=1
   -- AGI Script this-does-not-exist completed, returning 0
   -- Executing [69@default:3] NoOp("SIP/111-081fb288", "SUCCESS") in new stack
   -- Executing [69@default:4] Hangup("SIP/111-081fb288", "") in new stack
 == Spawn extension (default, 69, 4) exited non-zero on 'SIP/111-081fb288'

*CLI>

Thanks for your feedback.
Comments:By: Tilghman Lesher (tilghman) 2008-04-16 18:29:34

Please try this patch.  This should make it correctly return a failure status when the executable does not exist.

By: Donny Kavanagh (donnyk) 2008-04-16 20:20:53

Corydon, is there a reason we should not address this the same way it was fixed in trunk? with the exception of returning AGI_RESULT_FAILURE as opposed to AGI_RESULT_NOTFOUND as trunk does.

By: Tilghman Lesher (tilghman) 2008-04-16 20:53:28

The main reason I wouldn't do it that way is that there are other reasons for why an execute might fail, other than the file not existing, which is all that the trunk version does.  The file might not be in an executable format, for example.  And there's no easy way to know that, other than attempting to execute it and failing.

By: Fabian Mueller (fmueller) 2008-04-17 05:11:31

The provided patch fixes that problem. Thanks.

By: Digium Subversion (svnbot) 2008-04-17 07:51:39

Repository: asterisk
Revision: 114195

U   branches/1.4/res/res_agi.c

------------------------------------------------------------------------
r114195 | tilghman | 2008-04-17 07:51:37 -0500 (Thu, 17 Apr 2008) | 8 lines

Add special case for when the agi cannot be executed, to comply with the documentation that
we return failure in that case.
(closes issue ASTERISK-11866)
Reported by: fmueller
Patches:
      20080416__bug12462.diff.txt uploaded by Corydon76 (license 14)
Tested by: fmueller

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=114195

By: Digium Subversion (svnbot) 2008-04-17 07:54:05

Repository: asterisk
Revision: 114196

_U  trunk/
U   trunk/res/res_agi.c

------------------------------------------------------------------------
r114196 | tilghman | 2008-04-17 07:54:05 -0500 (Thu, 17 Apr 2008) | 16 lines

Merged revisions 114195 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114195 | tilghman | 2008-04-17 07:56:38 -0500 (Thu, 17 Apr 2008) | 8 lines

Add special case for when the agi cannot be executed, to comply with the documentation that
we return failure in that case.
(closes issue ASTERISK-11866)
Reported by: fmueller
Patches:
      20080416__bug12462.diff.txt uploaded by Corydon76 (license 14)
Tested by: fmueller

........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=114196

By: Digium Subversion (svnbot) 2008-04-17 07:54:55

Repository: asterisk
Revision: 114197

_U  branches/1.6.0/
U   branches/1.6.0/res/res_agi.c

------------------------------------------------------------------------
r114197 | tilghman | 2008-04-17 07:54:54 -0500 (Thu, 17 Apr 2008) | 24 lines

Merged revisions 114196 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r114196 | tilghman | 2008-04-17 07:59:04 -0500 (Thu, 17 Apr 2008) | 16 lines

Merged revisions 114195 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114195 | tilghman | 2008-04-17 07:56:38 -0500 (Thu, 17 Apr 2008) | 8 lines

Add special case for when the agi cannot be executed, to comply with the documentation that
we return failure in that case.
(closes issue ASTERISK-11866)
Reported by: fmueller
Patches:
      20080416__bug12462.diff.txt uploaded by Corydon76 (license 14)
Tested by: fmueller

........

................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=114197

By: Digium Subversion (svnbot) 2008-04-17 12:30:50

Repository: asterisk
Revision: 114214

_U  team/group/multiparking/
U   team/group/multiparking/CHANGES
U   team/group/multiparking/Makefile
U   team/group/multiparking/apps/app_chanspy.c
U   team/group/multiparking/apps/app_externalivr.c
U   team/group/multiparking/apps/app_festival.c
U   team/group/multiparking/apps/app_ices.c
U   team/group/multiparking/apps/app_mp3.c
U   team/group/multiparking/apps/app_nbscat.c
U   team/group/multiparking/apps/app_zapras.c
U   team/group/multiparking/channels/chan_sip.c
U   team/group/multiparking/channels/chan_zap.c
U   team/group/multiparking/configs/sip.conf.sample
U   team/group/multiparking/doc/CODING-GUIDELINES
A   team/group/multiparking/doc/chan_sip-perf-testing.txt
U   team/group/multiparking/include/asterisk/app.h
U   team/group/multiparking/include/asterisk/astobj2.h
A   team/group/multiparking/include/asterisk/dlinkedlists.h
U   team/group/multiparking/include/asterisk/dsp.h
U   team/group/multiparking/include/asterisk/frame.h
U   team/group/multiparking/include/asterisk/lock.h
U   team/group/multiparking/include/asterisk/logger.h
U   team/group/multiparking/include/asterisk/sched.h
U   team/group/multiparking/main/app.c
U   team/group/multiparking/main/asterisk.c
U   team/group/multiparking/main/astobj2.c
U   team/group/multiparking/main/dsp.c
U   team/group/multiparking/main/event.c
U   team/group/multiparking/main/frame.c
U   team/group/multiparking/main/logger.c
U   team/group/multiparking/main/sched.c
U   team/group/multiparking/main/utils.c
U   team/group/multiparking/res/res_agi.c
U   team/group/multiparking/res/res_jabber.c
U   team/group/multiparking/res/res_musiconhold.c
A   team/group/multiparking/tests/test_dlinklists.c
U   team/group/multiparking/utils/Makefile
A   team/group/multiparking/utils/refcounter.c

------------------------------------------------------------------------
r114214 | mvanbaak | 2008-04-17 12:30:47 -0500 (Thu, 17 Apr 2008) | 189 lines

Merged revisions 114172,114174-114175,114181-114183,114185,114187-114188,114190,114192,114194,114196,114199,114201-114202,114205,114208,114212 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r114172 | murf | 2008-04-16 19:14:18 +0200 (Wed, 16 Apr 2008) | 1 line

Introducing doubly linked lists to trunk from branch team/murf/bug11210.
................
r114174 | qwell | 2008-04-16 19:31:02 +0200 (Wed, 16 Apr 2008) | 14 lines

Blocked revisions 114173 via svnmerge

........
r114173 | qwell | 2008-04-16 12:30:09 -0500 (Wed, 16 Apr 2008) | 7 lines

Fix "fallthrough" behavior here, so config options in a previously configured user don't override settings in general.

(closes issue ASTERISK-11863)
Reported by: tzafrir
Patches:
     chanzap_users_sections.diff uploaded by tzafrir (license 46)

........

................
r114175 | murf | 2008-04-16 19:45:28 +0200 (Wed, 16 Apr 2008) | 1 line

Introducing various astobj2 enhancements, chief being a refcount tracing feature, and various documentation updates in astobj2.h, and the addition of standalone utility, refcounter, that will filter the trace output for unbalanced, unfreed objects. This comes from the team/murf/bug11210 branch.
................
r114181 | tilghman | 2008-04-16 22:00:27 +0200 (Wed, 16 Apr 2008) | 10 lines

Blocked revisions 114180 via svnmerge

........
r114180 | tilghman | 2008-04-16 14:59:37 -0500 (Wed, 16 Apr 2008) | 3 lines

Backport revisions for latest vpb drivers to 1.4
(Closes issue ASTERISK-11862)

........

................
r114182 | murf | 2008-04-16 22:09:39 +0200 (Wed, 16 Apr 2008) | 1 line

Introducing a small upgrade to the ast_sched_xxx  facility, to keep it from eating up lots of cpu cycles. See CHANGES. From the team/murf/bug11210 branch.
................
r114183 | murf | 2008-04-16 22:28:08 +0200 (Wed, 16 Apr 2008) | 1 line

Introducing a small optimization to event_unsubscribe; events now use a Doubly-Linked list for events, gives fast deletions, for the sake of channel driver mwi events. From team/murf/bug11210.
................
r114185 | kpfleming | 2008-04-16 22:47:30 +0200 (Wed, 16 Apr 2008) | 14 lines

Merged revisions 114184 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114184 | kpfleming | 2008-04-16 15:46:38 -0500 (Wed, 16 Apr 2008) | 6 lines

use the ZT_SET_DIALPARAMS ioctl properly by initializing the structure to all zeroes in case it contains fields that we don't write values into (which it does as of Zaptel 1.4.10)

(closes issue ASTERISK-11861)
Reported by: fnordian


........

................
r114187 | murf | 2008-04-16 22:54:41 +0200 (Wed, 16 Apr 2008) | 1 line

A small enhancement-- I added the routine log_show_lock to utils.c, which if the mentioned lock has been acquired, this routine will log to the console the normal info about that lock you'd see from the CLI when you do a 'core show locks'. It's solely for debug-- if the lock is NOT acquired, there is no output. I use it to show 'unexpected' locks, to see where/why a lock is pre-locked. This command is to be called from points of interest, like just before a trylock, and helps to spot fleeting, highly temporal locks that normally are not locked...
................
r114188 | tilghman | 2008-04-17 00:57:54 +0200 (Thu, 17 Apr 2008) | 2 lines

Standardized routines for forking processes (keeps all the specialized code in one place).

................
r114190 | murf | 2008-04-17 01:53:27 +0200 (Thu, 17 Apr 2008) | 1 line

This is the scariest commit I've done in a long time. This is the astobj2-ification of chan_sip. I've tested a number of scenarios like crazy. It used to have 4x the call setup/teardown performance of trunk, but now it's roughly at parity. I will attempt to find the bottlenecks and get it back to the 4x mark. The changes made were somewhat invasive, but the value to the community of these upgrades outweighs waiting further for more testing. Every change being made to chan_sip was lousing this code up when we tried to merge. Peers, Users, Dialogs, are all now astobj2 objects, indexed via hashtables. Refcounting is used to track objects and free them at the bitter end of their lives. Please file issues on bugs.digium.com, and PLEASE, please, please be patient. One natural advantage to all the hash-table work is that loading large sip.conf files full of thousands of peers now goes much faster. One more please: PLEASE help thrash this code and test it.
................
r114192 | seanbright | 2008-04-17 12:55:05 +0200 (Thu, 17 Apr 2008) | 9 lines

Merged revisions 114191 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114191 | seanbright | 2008-04-17 06:51:20 -0400 (Thu, 17 Apr 2008) | 1 line

Make sure we have enough room for the recording's filename.
........

................
r114194 | seanbright | 2008-04-17 14:25:23 +0200 (Thu, 17 Apr 2008) | 1 line

Update the CHANGES file with yesterday's ChanSpy change.  Sorry Kevin, just saw your e-mail.
................
r114196 | tilghman | 2008-04-17 14:59:04 +0200 (Thu, 17 Apr 2008) | 16 lines

Merged revisions 114195 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114195 | tilghman | 2008-04-17 07:56:38 -0500 (Thu, 17 Apr 2008) | 8 lines

Add special case for when the agi cannot be executed, to comply with the documentation that
we return failure in that case.
(closes issue ASTERISK-11866)
Reported by: fmueller
Patches:
      20080416__bug12462.diff.txt uploaded by Corydon76 (license 14)
Tested by: fmueller

........

................
r114199 | phsultan | 2008-04-17 15:46:17 +0200 (Thu, 17 Apr 2008) | 10 lines

Merged revisions 114198 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114198 | phsultan | 2008-04-17 15:42:23 +0200 (Thu, 17 Apr 2008) | 2 lines

Use keepalives effectively in order diagnose bug ASTERISK-11838.

........

................
r114201 | murf | 2008-04-17 16:45:16 +0200 (Thu, 17 Apr 2008) | 1 line

Thanks to snuff for finding these omissions
................
r114202 | tilghman | 2008-04-17 17:12:52 +0200 (Thu, 17 Apr 2008) | 2 lines

fileio.h does not exist; io.h does, though.

................
r114205 | russell | 2008-04-17 18:25:29 +0200 (Thu, 17 Apr 2008) | 11 lines

Merged revisions 114204 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114204 | russell | 2008-04-17 11:23:45 -0500 (Thu, 17 Apr 2008) | 3 lines

Fix the bininstall target to install from subdirs, as well.
(closes issue AST-8, patch from bmd at switchvox)

........

................
r114208 | mmichelson | 2008-04-17 18:40:12 +0200 (Thu, 17 Apr 2008) | 20 lines

Merged revisions 114207 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114207 | mmichelson | 2008-04-17 11:28:03 -0500 (Thu, 17 Apr 2008) | 12 lines

It was possible for a reference to a frame which was part of a freed DSP to still be
referenced, leading to memory corruption and eventual crashes. This code change ensures
that the dsp is freed when we are finished with the frame. This change is very similar
to a change Russell made with translators back a month or so ago.

(closes issue ASTERISK-11443)
Reported by: destiny6628
Patches:
     11999.patch uploaded by putnopvut (license 60)
Tested by: destiny6628, victoryure


........

................
r114212 | mmichelson | 2008-04-17 18:51:09 +0200 (Thu, 17 Apr 2008) | 11 lines

Blocked revisions 114211 via svnmerge

........
r114211 | mmichelson | 2008-04-17 11:50:46 -0500 (Thu, 17 Apr 2008) | 4 lines

Add prototype for ast_dsp_frame_freed. I'm not sure how this was
compiling before...


........

................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=114214