[asterisk-bugs] [Asterisk 0012760]: [patch] Gosub invoked from AGI should do something

noreply at bugs.digium.com noreply at bugs.digium.com
Fri May 30 08:33:48 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12760 
====================================================================== 
Reported By:                Corydon76
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   12760
Category:                   Applications/app_stack
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     ready for testing
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 119072 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             05-29-2008 20:42 CDT
Last Modified:              05-30-2008 08:33 CDT
====================================================================== 
Summary:                    [patch] Gosub invoked from AGI should do something
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.
====================================================================== 

---------------------------------------------------------------------- 
 tim_ringenbach - 05-30-08 08:33  
---------------------------------------------------------------------- 
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 at 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 at default:1] Wait("SIP/192.168.2.101-08247f00", "1") in
new stack
    -- Executing [s at default:2] Answer("SIP/192.168.2.101-08247f00", "") in
new stack
    -- Executing [s at default:3] Set("SIP/192.168.2.101-08247f00",
"TIMEOUT(digit)=5") in new stack
    -- Digit timeout set to 5.000
    -- Executing [s at default:4] Set("SIP/192.168.2.101-08247f00",
"TIMEOUT(response)=10") in new stack
    -- Response timeout set to 10.000
    -- Executing [s at 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);

?> 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
05-30-08 08:33  tim_ringenbach Note Added: 0087537                          
======================================================================




More information about the asterisk-bugs mailing list