not including context

Home » Asterisk Users » not including context
Asterisk Users 11 Comments

Hello,

I have the following in dialplan :

[TrunkAccounts]

exten => 32380837,1,GoTo(777701,32380837,1)
exten => 32380838,1,GoTo(777701,32380838,1)
exten => 32380839,1,GoTo(777701,32380839,1)

[CheckOnNet]

include => TrunkAccounts

But when a call for 32380837 enters CheckOnNet, it is not found. How come ??

11 thoughts on - not including context

  • Jonas Kellens wrote:

    dialplan show TrunkAccounts

    Make sure the sort order is what you’re expecting.

    Doug

  • Hello,

    The order is correct for as far as I’m sure.

    [TrunkAccounts]

    exten => 32380837,1,GoTo(777701,32380837,1)
    exten => 32380838,1,GoTo(777701,32380838,1)
    exten => 32380839,1,GoTo(777701,32380839,1)

    [CheckOnNet]

    include => TrunkAccounts

    exten => _3215555[0-3],1,GoTo(context1,${EXTEN},1)

    exten => 32146666,1,GoTo(context2,${EXTEN},1)

    exten => _XXXXXXXX.,1,NoOp()
    exten => _XXXXXXXX.,n,Return()

    This is what I see on the CLI :

    /[Jan 13 14:30:01] — Executing [s@macro-uit789:47]
    Gosub(“SIP/yoc1-00005a3c”, “CheckOnNet,//32380837,1”) in new stack
    [Jan 13 14:30:01] — Executing [32380837@CheckOnNet:1]
    NoOp(“SIP/yoc1-00005a3c”, “”) in new stack
    [Jan 13 14:30:01] — Executing [32380837//@CheckOnNet:2]
    Return(“SIP/yoc1-00005a3c”, “”) in new stack/

    So the context TrunkAccounts is not included.

    Do you know why ?

    Jonas.

  • Does reloading the dialplan (dialplan reload) give any useful output
    relating to these two contexts?

  • I include this context in 2 other contexts :

    [Jan 13 14:19:12] VERBOSE[4220] config.c: [Jan 13 14:19:12] == Parsing
    ‘/etc/asterisk/extensions.conf’: [Jan 13 14:19:12] VERBOSE[4220]
    config.c: [Jan 13 14:19:12] == Found

    [Jan 13 14:19:12] VERBOSE[4220] pbx.c: [Jan 13 14:19:12] —
    Including context ‘TrunkAccounts’ in context ‘PROVIDERin’

    [Jan 13 14:19:12] VERBOSE[4220] pbx.c: [Jan 13 14:19:12] —
    Registered extension context ‘CheckOnNet’ (0x2aaacc40d260) in local
    table 0xd0ba610; registrar: pbx_config
    [Jan 13 14:19:12] VERBOSE[4220] pbx.c: [Jan 13 14:19:12] —
    Including context ‘TrunkAccounts’ in context ‘CheckOnNet’

    Nothing special here it seems…

    Everything works fine when including context ‘TrunkAccounts’ in context
    ‘PROVIDERin’. Here it functions as expected.

    But it does not work the same in context ‘CheckOnNet’.

    Extra question : is there a difference between the “context” PROVIDERin
    and the “procedure” (sub) CheckOnNet ??

  • Jonas Kellens wrote:

    Meaning I want to see the dialplan order of that context. I’m guessing
    that’s your inbound context. With includes that also include sub-contexts.

    Usually, there is something ordered differently then expected.

    Also, what version of Asterisk?

    Doug

  • Asterisk 1.6.2.22

    It is impossible to post all of this information… However, this is the
    context CheckOnNet :


    ‘_32962’ => 1. GoTo(solutions,${EXTEN},1) [pbx_config]
    ‘_3295[0-9]’ => 1. GoTo(step,${EXTEN},1) [pbx_config]
    ‘_XXXXXXXX.’ => 1. NoOp()
    [pbx_config]
    2. Return()
    [pbx_config]
    Include => ‘TrunkAccounts’
    [pbx_config]

    -= 252 extensions (253 priorities) in 1 context. =-

    Does this mean the Return() comes before Asterisk looks into the context
    [TrunkAccounts] ??

  • Jonas Kellens wrote:

    No, I believe the includes are read first, but the order in important.

    Since you may be matching against another context that may cause
    failure. For example, I have the following in a internal context:

    Include => ‘analog-extensions’
    [pbx_config]
    Include => ‘sip-utilities’
    [pbx_config]
    Include => ‘internal-extensions’
    [pbx_config]
    Include => ‘dial-local’
    [pbx_config]
    Include => ‘dial-ld’
    [pbx_config]
    Include => ‘incoming’
    [pbx_config]
    Include => ‘fall-through’
    [pbx_config]

    If I had fall-through first, it’d cause lots of issues.

    Doug

  • Le 13/01/2012 14:32, Jonas Kellens a √©crit :

    Are you sure about your _XXXXXXXX. exten? Typo in the mail? It means 9
    and more digits but your extensions are 8 digits …

    Include are always treated *after* context command. If _XXXXXXXX. is
    right, something is wrong with Asterisk as it should treat
    TrunkAccounts. If _XXXXXXX. (8 digits or more) is what you have in
    yourdialplan, than the behavior of Asterisk is OK

    Try

    [TrunkAccounts]

    exten => 32380837,1,GoTo(777701,32380837,1)
    exten => 32380838,1,GoTo(777701,32380838,1)
    exten => 32380839,1,GoTo(777701,32380839,1)

    [TrunkNotTreated]

    exten => _XXXXXXXX.,1,NoOp()
    exten => _XXXXXXXX.,n,Return()

    [CheckOnNet]

    include => TrunkAccounts
    include => TrunkNotTreated

    exten => _3215555[0-3],1,GoTo(context1,${EXTEN},1)
    exten => 32146666,1,GoTo(context2, ${EXTEN} ,1)

    […]