[Home]

Summary:ASTERISK-12114: [patch] Gosub invoked from AGI should do something
Reporter:Tilghman Lesher (tilghman)Labels:
Date Opened:2008-05-29 20:42:55Date Closed:2008-05-30 11:05:10
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_stack
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20080529__agi_gosub.diff.txt
( 1) 20080530__bug12760.diff.txt
Description:As reported by Tim Ringenbach on the -dev list, if you call Gosub from an AGI, it should actually do something.  So I've created this patch to app_stack that creates a native AGI command called Gosub, that now behaves as expected.
Comments:By: Tim Ringenbach at Asteria Solutions Group (tim_ringenbach) 2008-05-30 08:33:45

Doesn't work for me. I was testing against r119238.
First it went to the wrong place, then it crashed.

*CLI>   == Using SIP RTP CoS mark 5
   -- Executing [2223@default:1] AGI("SIP/192.168.2.101-08247f00", "test-gosub.php") in new stack
   -- Launched AGI Script /var/lib/asterisk/agi-bin/test-gosub.php
<SIP/192.168.2.101-08247f00>AGI Tx >> agi_request: test-gosub.php
<SIP/192.168.2.101-08247f00>AGI Tx >> agi_channel: SIP/192.168.2.101-08247f00
<SIP/192.168.2.101-08247f00>AGI Tx >> agi_language: en
<SIP/192.168.2.101-08247f00>AGI Tx >> agi_type: SIP
<SIP/192.168.2.101-08247f00>AGI Tx >> agi_uniqueid: 1212155233.0
<SIP/192.168.2.101-08247f00>AGI Tx >> agi_version: SVN-trunk-r119207M
<SIP/192.168.2.101-08247f00>AGI Tx >> agi_callerid: tim
<SIP/192.168.2.101-08247f00>AGI Tx >> agi_calleridname: 12345678888
<SIP/192.168.2.101-08247f00>AGI Tx >> agi_callingpres: 0
<SIP/192.168.2.101-08247f00>AGI Tx >> agi_callingani2: 0
<SIP/192.168.2.101-08247f00>AGI Tx >> agi_callington: 0
<SIP/192.168.2.101-08247f00>AGI Tx >> agi_callingtns: 0
<SIP/192.168.2.101-08247f00>AGI Tx >> agi_dnid: 2223
<SIP/192.168.2.101-08247f00>AGI Tx >> agi_rdnis: unknown
<SIP/192.168.2.101-08247f00>AGI Tx >> agi_context: default
<SIP/192.168.2.101-08247f00>AGI Tx >> agi_extension: 2223
<SIP/192.168.2.101-08247f00>AGI Tx >> agi_priority: 1
<SIP/192.168.2.101-08247f00>AGI Tx >> agi_enhanced: 0.0
<SIP/192.168.2.101-08247f00>AGI Tx >> agi_accountcode:
<SIP/192.168.2.101-08247f00>AGI Tx >> agi_threadid: -1233470576
<SIP/192.168.2.101-08247f00>AGI Tx >>
<SIP/192.168.2.101-08247f00>AGI Rx << Gosub default 2222 1
<SIP/192.168.2.101-08247f00>AGI Tx >> 100 result=0 Trying...
[May 30 08:47:13] WARNING[22476]: pbx.c:3501 __ast_pbx_run: SIP/192.168.2.101-08247f00 already has PBX structure??
 == Starting SIP/192.168.2.101-08247f00 at default,2222,0 failed so falling back to exten 's'
   -- Executing [s@default:1] Wait("SIP/192.168.2.101-08247f00", "1") in new stack
   -- Executing [s@default:2] Answer("SIP/192.168.2.101-08247f00", "") in new stack
   -- Executing [s@default:3] Set("SIP/192.168.2.101-08247f00", "TIMEOUT(digit)=5") in new stack
   -- Digit timeout set to 5.000
   -- Executing [s@default:4] Set("SIP/192.168.2.101-08247f00", "TIMEOUT(response)=10") in new stack
   -- Response timeout set to 10.000
   -- Executing [s@default:5] BackGround("SIP/192.168.2.101-08247f00", "demo-congrats") in new stack
   -- <SIP/192.168.2.101-08247f00> Playing 'demo-congrats.gsm' (language 'en')
 == Spawn extension (default, s, 5) exited non-zero on 'SIP/192.168.2.101-08247f00'
<(null)>AGI Tx >> 200 result=0 Gosub complete
<v>AGI Rx << Gosub default 2222 1 test
Segmentation fault                                                                                                                                                              


dialplan show default
[ Context 'default' created by 'pbx_config' ]
 '2222' =>         1. Playback(hello-world)                      [pbx_config]
                   2. NoOp(${ARG1} ${ARG2})                      [pbx_config]
                   3. Return()                                   [pbx_config]
 '2223' =>         1. Agi(test-gosub.php)                        [pbx_config]
 Include =>        'demo'                                        [pbx_config]


cat test-gosub.php
#!/usr/bin/php -q
<?

echo "Gosub default 2222 1\n";
sleep(10);
echo "Gosub default 2222 1 test\n";
sleep(10);

?>

By: Tilghman Lesher (tilghman) 2008-05-30 09:11:21

Okay, new patch uploaded.  Found a weird little thing in ast_pbx_run, but I've taken care of that now.

By: Digium Subversion (svnbot) 2008-05-30 11:04:24

Repository: asterisk
Revision: 119296

U   trunk/CHANGES
U   trunk/apps/app_dial.c
U   trunk/apps/app_stack.c
U   trunk/include/asterisk/agi.h

------------------------------------------------------------------------
r119296 | tilghman | 2008-05-30 11:04:18 -0500 (Fri, 30 May 2008) | 8 lines

Add native AGI command GOSUB, as invoking Gosub with EXEC does not work
properly.
(closes issue ASTERISK-12114)
Reported by: Corydon76
Patches:
      20080530__bug12760.diff.txt uploaded by Corydon76 (license 14)
Tested by: tim_ringenbach, Corydon76

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

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

By: Digium Subversion (svnbot) 2008-05-30 11:05:10

Repository: asterisk
Revision: 119297

_U  branches/1.6.0/
U   branches/1.6.0/CHANGES
U   branches/1.6.0/apps/app_dial.c
U   branches/1.6.0/apps/app_stack.c
U   branches/1.6.0/include/asterisk/agi.h

------------------------------------------------------------------------
r119297 | tilghman | 2008-05-30 11:05:09 -0500 (Fri, 30 May 2008) | 16 lines

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

........
r119296 | tilghman | 2008-05-30 11:10:46 -0500 (Fri, 30 May 2008) | 8 lines

Add native AGI command GOSUB, as invoking Gosub with EXEC does not work
properly.
(closes issue ASTERISK-12114)
Reported by: Corydon76
Patches:
      20080530__bug12760.diff.txt uploaded by Corydon76 (license 14)
Tested by: tim_ringenbach, Corydon76

........

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

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