[asterisk-bugs] [JIRA] (ASTERISK-29018) Channel redirect might be missed if redirected channel is executing dialplan

Patrick Wakano (JIRA) noreply at issues.asterisk.org
Tue Aug 4 02:37:43 CDT 2020


Patrick Wakano created ASTERISK-29018:
-----------------------------------------

             Summary: Channel redirect might be missed if redirected channel is executing dialplan
                 Key: ASTERISK-29018
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29018
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Core/Channels, Core/PBX
    Affects Versions: 16.8.0
            Reporter: Patrick Wakano
            Severity: Minor


When using the Channel Redirect feature (either the dialplan app ChannelRedirect or the CLI channel redirect) it has been observed that the redirection might just not work in case the channel being redirected is executing something else in the dialplan.
Take for example the dialplan below just to simulate the issue. If while the channel is looping, the channel redirect command is issued for that channel from the CLI, the redirect might simply not work and the channel keeps executing the loop.
Given the channel redirect is an explicit action to alter the channel execution, I think it should always override whatever dialplan execution the channel is doing, so it should just terminate the current priority and then immediately go to where the channel redirect determined. However there are cases where the next dialplan priority gets executed and so the redirection silently fails to happen even tough it says the redirection was successful.
The problem does not happen every time, it seems to be a 30% chance of having the issue for the example below.
{noformat}
[pstn-outgoing]
exten => 8888,1,Answer()
same => n,Set(i=0)
same => n,While($[${i} < 10000])
same => n,Set(Dummy=${PRIORITY})
same => n,Set(i=$[${i}+1])
same => n,EndWhile
same => n,NoOp(Loop end)
same => n,Hangup()
same => n(end),NoOp(Terminated)
same => n,Hangup()
{noformat}

Logs:
{noformat}
    -- Executing [8888 at pstn-outgoing:4] Set("SIP/9000-0000000f", "Dummy=4") in new stack
    -- Executing [8888 at pstn-outgoing:5] Set("SIP/9000-0000000f", "i=69") in new stack
    -- Executing [8888 at pstn-outgoing:6] EndWhile("SIP/9000-0000000f", "") in new stack
    -- Executing [8888 at pstn-outgoing:3] While("SIP/9000-0000000f", "1") in new stack
    -- Executing [8888 at pstn-outgoing:4] Set("SIP/9000-0000000f", "Dummy=4") in new stack
    -- Executing [8888 at pstn-outgoing:5] Set("SIP/9000-0000000f", "i=70") in new stack
    -- Executing [8888 at pstn-outgoing:6] EndWhile("SIP/9000-0000000f", "") in new stack
    -- Executing [8888 at pstn-outgoing:3] While("SIP/9000-0000000f", "1") in new stack
    -- Executing [8888 at pstn-outgoing:4] Set("SIP/9000-0000000f", "Dummy=4") in new stack
pstn8*CLI> channel redirect SIP/9000-0000000f pstn-outgoing,8888,end
Channel 'SIP/9000-0000000f' successfully redirected to pstn-outgoing,8888,end
    -- Executing [8888 at pstn-outgoing:5] Set("SIP/9000-0000000f", "i=287") in new stack
    -- Executing [8888 at pstn-outgoing:6] EndWhile("SIP/9000-0000000f", "") in new stack
    -- Executing [8888 at pstn-outgoing:3] While("SIP/9000-0000000f", "1") in new stack
    -- Executing [8888 at pstn-outgoing:4] Set("SIP/9000-0000000f", "Dummy=4") in new stack
    -- Executing [8888 at pstn-outgoing:5] Set("SIP/9000-0000000f", "i=288") in new stack
    -- Executing [8888 at pstn-outgoing:6] EndWhile("SIP/9000-0000000f", "") in new stack
    -- Executing [8888 at pstn-outgoing:3] While("SIP/9000-0000000f", "1") in new stack
    -- Executing [8888 at pstn-outgoing:4] Set("SIP/9000-0000000f", "Dummy=4") in new stack
    -- Executing [8888 at pstn-outgoing:5] Set("SIP/9000-0000000f", "i=289") in new stack
.....
    -- Executing [8888 at pstn-outgoing:5] Set("SIP/9000-0000000f", "i=9997") in new stack
    -- Executing [8888 at pstn-outgoing:6] EndWhile("SIP/9000-0000000f", "") in new stack
    -- Executing [8888 at pstn-outgoing:3] While("SIP/9000-0000000f", "1") in new stack
    -- Executing [8888 at pstn-outgoing:4] Set("SIP/9000-0000000f", "Dummy=4") in new stack
    -- Executing [8888 at pstn-outgoing:5] Set("SIP/9000-0000000f", "i=9998") in new stack
    -- Executing [8888 at pstn-outgoing:6] EndWhile("SIP/9000-0000000f", "") in new stack
    -- Executing [8888 at pstn-outgoing:3] While("SIP/9000-0000000f", "1") in new stack
    -- Executing [8888 at pstn-outgoing:4] Set("SIP/9000-0000000f", "Dummy=4") in new stack
    -- Executing [8888 at pstn-outgoing:5] Set("SIP/9000-0000000f", "i=9999") in new stack
    -- Executing [8888 at pstn-outgoing:6] EndWhile("SIP/9000-0000000f", "") in new stack
    -- Executing [8888 at pstn-outgoing:3] While("SIP/9000-0000000f", "1") in new stack
    -- Executing [8888 at pstn-outgoing:4] Set("SIP/9000-0000000f", "Dummy=4") in new stack
    -- Executing [8888 at pstn-outgoing:5] Set("SIP/9000-0000000f", "i=10000") in new stack
    -- Executing [8888 at pstn-outgoing:6] EndWhile("SIP/9000-0000000f", "") in new stack
    -- Executing [8888 at pstn-outgoing:3] While("SIP/9000-0000000f", "0") in new stack
    -- Executing [8888 at pstn-outgoing:7] NoOp("SIP/9000-0000000f", "Loop end") in new stack
    -- Executing [8888 at pstn-outgoing:8] Hangup("SIP/9000-0000000f", "") in new stack
  == Spawn extension (pstn-outgoing, 8888, 8) exited non-zero on 'SIP/9000-0000000f'
pstn8*CLI> 
{noformat}




--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list