Dialplan going to wrong context

Hi,

I’m using Asterisk 11.7.0~dfsg-1ubuntu1

I’m facing an issue which I’m unable to understand, sometimes when I dial a call, instead of dialing, a context named “test” runs.

 -- Timeout on SIP/8002-000022ee
  == CDR updated on SIP/8002-000022ee
    -- Executing [t@outbound:1] Goto("SIP/8002-000022ee", "test,start,1") in new stack

outbound context in extensions.conf:

include => test

exten => _XXXX.,1,Set(CALLERID(num)=xxxxxxxx)
exten => _XXXX.,n,Macro(callrecout,${EXTEN})
exten => _XXXX.,n,Dial(SIP/909/${EXTEN},40,Tt)

output in asterisk:

== Using SIP RTP CoS mark 5

    -- Executing [190823233466@outbound:3] Macro("SIP/8002-000022ee", "callrecout,190823233466") in new stack
    -- Executing [s@macro-callrecout:1] Set("SIP/8002-000022ee", "chan=SIP/8002-000022ee") in new stack
    -- Executing [s@macro-callrecout:2] Set("SIP/8002-000022ee", "chan=SIP/8002") in new stack
    -- Executing [s@macro-callrecout:3] Set("SIP/8002-000022ee", "CDR(accountcode)=OUT") in new stack
    -- Executing [s@macro-callrecout:4] Set("SIP/8002-000022ee", "date=2017-04-11") in new stack
    -- Executing [s@macro-callrecout:5] Set("SIP/8002-000022ee", "time=09-50-31") in new stack
    -- Executing [s@macro-callrecout:6] NoOp("SIP/8002-000022ee", "SIP/8002") in new stack
    -- Executing [s@macro-callrecout:7] NoOp("SIP/8002-000022ee", "") in new stack
    -- Executing [s@macro-callrecout:8] Set("SIP/8002-000022ee", "MONITOR_FILENAME=/var/spool/asterisk/monitor/2017-04-11/OUTBOUND/SIP/8002---09-50-31---190823233466") in new stack
    -- Executing [s@macro-callrecout:9] NoOp("SIP/8002-000022ee", "/var/spool/asterisk/monitor/2017-04-11/OUTBOUND/SIP/8002---09-50-31---190823233466") in new stack
    -- Executing [s@macro-callrecout:10] Monitor("SIP/8002-000022ee", "wav,/var/spool/asterisk/monitor/2017-04-11/OUTBOUND/SIP/8002---09-50-31---190823233466,m") in new stack
    -- Timeout on SIP/8002-000022ee
  == CDR updated on SIP/8002-000022ee
    -- Executing [t@outbound:1] Goto("SIP/8002-000022ee", "test,start,1") in new stack
    -- Goto (test,start,1)
    -- Executing [start@test:1] Answer("SIP/8002-000022ee", "") in new stack
    -- Executing [start@test:2] Macro("SIP/8002-000022ee", "callrin,52") in new stack
    -- Executing [s@macro-callrin:2] Set("SIP/8002-000022ee", "CDR(accountcode)=INBOUND") in new stack
    -- Executing [s@macro-callrin:3] Set("SIP/8002-000022ee", "date=2017-04-11") in new stack
    -- Executing [s@macro-callrin:4] Set("SIP/8002-000022ee", "time=09-50-41") in new stack
    -- Executing [s@macro-callrin:5] Set("SIP/8002-000022ee", "MONITOR_FILENAME=/var/spool/asterisk/monitor/2017-04-11/INBOUND/xxxxxxxxxxxxx---09-50-41") in new stack
    -- Executing [s@macro-callrin:6] Monitor("SIP/8002-000022ee", "wav,/var/spool/asterisk/monitor/2017-04-11/INBOUND/xxxxxxxxxxxxx---09-50-41,m") in new stack
  == Using SIP RTP CoS mark 5
  == Using SIP RTP CoS mark 5
    -- Called SIP/3000
    -- Called SIP/3002
    -- SIP/3002-000022f0 is ringing
    -- SIP/3000-000022ef is ringing
  == Spawn extension (test, start, 3) exited non-zero on 'SIP/8002-000022ee'

Your call is ‘falling through’ to the timeout extension you are including with your include statement.

You likely have a ‘t’ extension in the test context that is doing this.

Remove the Include, or Remove the ‘t’ extension, Or End your pattern match extension with a Hangup.

I do not have ‘t’ extension in test context

[test]
exten => start,1,Answer
exten => start,n,Macro(callrin,52)
exten => start,n,Dial(SIP/3000&SIP/3002,30,Tt)
exten => start,n,Macro(vmtech,52)
exten => start,n,Playback(vm-goodbye)
exten => start,n,Hangup()

I only have this problem with one one particular trunk.
Why it is timing out?

issue a ‘dialplan show outbound’ and a ‘dialplan show t@outbound’ command and paste both here as code.

I think the issue with this particular trunk is it requires “0011102” to be dialed before the number, and I’m writing it the wrong way

this is the way I’m including the trunk in my outbound context

exten => _1NXXNXXXXXX,n,Dial(SIP/voxbeam/0011102${EXTEN},40,Tt)

It should go to the test context if number is not found in any context, so when someone dial a number the with more than 11 digits it goes to test context.

whereas if I include other trunk using:
exten => _XXXX.,n,Dial(SIP/Comms/${EXTEN},40,Tt)

It works fine

I should change

exten => _1NXXNXXXXXX,n,Dial(SIP/voxbeam/0011102${EXTEN},40,Tt)

to

exten => _XXXX.,n,Dial(SIP/voxbeam/0011102${EXTEN},40,Tt)