[asterisk-bugs] [Asterisk 0013200]: Bridging channels too early when Macro is used to control callee leg

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Aug 1 03:00:08 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13200 
====================================================================== 
Reported By:                tapic
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13200
Category:                   Applications/app_dial
Reproducibility:            sometimes
Severity:                   major
Priority:                   normal
Status:                     new
Asterisk Version:           1.4.21.2 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-07-30 18:21 CDT
Last Modified:              2008-08-01 03:00 CDT
====================================================================== 
Summary:                    Bridging channels too early when Macro is used to
control callee leg
Description: 
Expected flow:
mikail calls 200.
mikail hears welcome.
mikail hears ringing. beri's phone start to ring.
beri picks up the phone and hears welcome.
beri presses a key.
if beri has pressed 5 then mikail and beri should start conversation -
else beri should be hanged up and mikail should continue to interact.
 
AGI script (FastAGI- runs on machine 10.10.1.41): 
 
AGI.StreamFile("welcome");
AGI.Execute("Dial", "SIP/beri|25|A(welcome)M(agentmacro)");
 
Dialplan:
 
[default]
exten =>  _273,1,Dial(SIP/beri)
exten =>  _275,1,Dial(SIP/mikail)
 
exten => _200,1,AGI(agi://10.10.1.41/customivr)
exten => _200,2,Hangup()
 
[macro-agentmacro]
exten => s,1,Read(ACCEPT||1)
exten => s,n,GotoIf($[${ACCEPT}=5]?yes:no) 
exten => s,n(no),Set(MACRO_RESULT=CONTINUE)
exten => s,n(yes),Set(test=1)
 
*CLI output :
  == Spawn extension (default, 200, 1) exited non-zero on
'SIP/mikail-081d9420'
    -- Executing [200 at default:1] AGI("SIP/mikail-081d9420",
"agi://10.10.1.41/customivr") in new stack
    -- Playing 'welcome' (escape_digits=) (sample_offset 0)
    -- AGI Script Executing Application: (Dial) Options:
(SIP/beri|25|A(welcome)M(agentmacro))
    -- Called beri
    -- SIP/beri-081e8b18 is ringing
    -- SIP/beri-081e8b18 answered SIP/mikail-081d9420
@@  -- <SIP/beri-081e8b18> Playing 'welcome' (language 'en')
    -- Executing [s at macro-agentmacro:1] Read("SIP/beri-081e8b18",
"ACCEPT|welcome|1") in new stack
    -- Accepting a maximum of 1 digits.
    -- <SIP/beri-081e8b18> Playing 'welcome' (language 'en')
    -- User entered '5'
    -- Executing [s at macro-agentmacro:2] GotoIf("SIP/beri-081e8b18",
"1?yes:no") in new stack
    -- Goto (macro-agentmacro,s,4)
    -- Executing [s at macro-agentmacro:4] Set("SIP/beri-081e8b18", "test=1")
in new stack
    -- Native bridging SIP/mikail-081d9420 and SIP/beri-081e8b18
  == Spawn extension (default, 200, 1) exited non-zero on
'SIP/mikail-081d9420'
 
line with @@ : this file does not play here although it says so. And
already bridged here, although it is expected to bridge after beri enters
5. After asterisk restart, everything works as expected for 1-2 times.
I have also seen :  ERROR[4883]: app_dial.c:1581 dial_exec_full: Could not
stop autoservice on calling channel if caller side hangups the phone.

Same result with the configuration below:

FastAGI:
AGI.StreamFile("welcome");  
AGI.Execute("Dial", "SIP/beri|25|M(agentmacro)");
 
[macro-agentmacro]
exten => s,1,Answer()
exten => s,n,Wait(1)
exten => s,n,Read(ACCEPT|welcome|1)
exten => s,n,GotoIf($[${ACCEPT}=5]?yes:no) 
exten => s,n(no),Set(MACRO_RESULT=CONTINUE)
exten => s,n(yes),Set(test=1)
 
*CLI
 
    -- Executing [200 at default:1] AGI("SIP/mikail-081e3090",
"agi://10.10.1.41/customivr") in new stack
    -- Playing 'welcome' (escape_digits=) (sample_offset 0)
    -- AGI Script Executing Application: (Dial) Options:
(SIP/beri|25|M(agentmacro))
    -- Called beri
    -- SIP/beri-081e8870 is ringing
    -- SIP/beri-081e8870 answered SIP/mikail-081e3090
@@  -- Executing [s at macro-agentmacro:1] Answer("SIP/beri-081e8870", "") in
new stack
    -- Executing [s at macro-agentmacro:2] Wait("SIP/beri-081e8870", "1") in
new stack
    -- Executing [s at macro-agentmacro:3] Read("SIP/beri-081e8870",
"ACCEPT|welcome|1") in new stack
    -- Accepting a maximum of 1 digits.
@@  -- <SIP/beri-081e8870> Playing 'welcome' (language 'en')
    -- User entered '5'
    -- Executing [s at macro-agentmacro:4] GotoIf("SIP/beri-081e8870",
"1?yes:no") in new stack
    -- Goto (macro-agentmacro,s,6)
    -- Executing [s at macro-agentmacro:6] Set("SIP/beri-081e8870", "test=1")
in new stack
    -- Native bridging SIP/mikail-081e3090 and SIP/beri-081e8870
  == Spawn extension (default, 200, 1) exited non-zero on
'SIP/mikail-081e3090'
 
bridging happens on 1st @@ line and welcome does not get played as said in
2nd @@ line.

 
Thank you for your help.

====================================================================== 

---------------------------------------------------------------------- 
 (0090955) tapic (reporter) - 2008-08-01 03:00
 http://bugs.digium.com/view.php?id=13200#c90955 
---------------------------------------------------------------------- 
thank you for the update.
The unexpected behavior is not observed in Asterisk 1.4.11.

How should I apply this patch? I could not find any information on the net
about applying patches to Asterisk. When I do wget in CLI in asterisk
source directory I get :

root at trcivr1:/usr/src/asterisk-1.4.21.2# wget
'http://bugs.digium.com/file_download.php?file_id=19738&type=bug' -O - |
patch -p0
--11:07:15-- 
http://bugs.digium.com/file_download.php?file_id=19738&type=bug
           => `-'
Resolving bugs.digium.com... 216.27.40.102
Connecting to bugs.digium.com|216.27.40.102|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7,876 (7.7K) [text/plain]

100%[=====================================================================================================================================>]
7,876         15.70K/s

11:07:16 (15.67 KB/s) - `-' saved [7876/7876]

can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: channels/chan_dahdi.c
|===================================================================
|--- channels/chan_dahdi.c      (revision 134653)
|+++ channels/chan_dahdi.c      (working copy)
--------------------------
File to patch: 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-08-01 03:00 tapic          Note Added: 0090955                          
======================================================================




More information about the asterisk-bugs mailing list