Trying to understand syntax/variables In Asterisk

We have an asterisk preconfigured setup at work.

There are certain variables ( I guess they are variables ) I don’t know where were defined/initialized and how extensions.conf accesses there values.

I’m not even sure If they’re variables. I’m Just new to Asterisk and would like to get a better understanding of what I’m looking at.

For example:

exten => makecall,1,NoOp( DialOut ${DST1} )
exten => makecall,2,Dial(SIP/${DST1}@mtnsat-outbound,30,S(${AVALSEC}))
exten => makecall,3,Hangup

or

exten => makecallEMC,1,NoOp( DialOut ${DST1} )
exten => makecallEMC,2,Dial(SIP/${DST1}@mtnsat-outbound,30,S(${AVALSEC}))
exten => makecallEMC,3,Hangup

I don’t see “makecall” or “makecallEMC” defined anywhere In extensions.conf and there Is no Include file In extensions.conf either.

I’m a bit confused and would appreciate any Info regarding the above.

Thank you.

Your code is has the following variables in it:

${DST1} which appears to be a destination to dial

and (${AVALSEC} which appears to be a limit on the duration of the call.

makecall and makecallEMC are Extensions,not variables.

Hi. Thanks.
I guess my next question is why are names being used for extensions and how are they defined? How I can I see what makecall or makecallEMC translate to.

They are defined in your extensions.conf as you said.

Both extensions dial out a call to whatever number is in the variable DST1 with a call-limit of AVALSEC.
exten => makecall,1,NoOp( DialOut ${DST1} )
exten => makecall,2,Dial(SIP/${DST1}@mtnsat-outbound,30,S(${AVALSEC}))
exten => makecall,3,Hangup

exten => makecallEMC,1,NoOp( DialOut ${DST1} )
exten => makecallEMC,2,Dial(SIP/${DST1}@mtnsat-outbound,30,S(${AVALSEC}))
exten => makecallEMC,3,Hangup

The code is the same between them, only the extension name is different.

Both of those extensions require the two variabels (DST1 and AVALSEC) to be populated before they can be used to dial anything so they may be in called as part of a macro, subroutine or external logic.

Hi. Problem Is there not In extensions.conf. makecall and makecallEMC are not In there.

That’s why It’s confusing.

Where did you get the code that you pasted then if it’s not from your extensions.conf?

Sorry. I guess i’m not getting It.

the code Is In extensions.conf but I thought makecall and makecallemc need to be defined somewhere.

For example makecall = _1NXXXNXXXX

Nope. They are literally in there as named extensions.

Extensions can be a numeric, alpha, or alphanumeric string.

All of these are valid extensions:
7
1001
hello
bob42

You can have pattern matches for your extensions as well if they are prefixed with the _ character

_bob[1-3] would match the extensions
bob1
bob2
bob3

Your example extension
_1NXXXNXXXX

Matches number starting with a 1, followed by a single digit in the range of 2-9 followed by three digits in the range 0-9, followed by a single digit in the range of 2-9 and then four digits in the range of 0-9.

https://wiki.asterisk.org/wiki/display/AST/Pattern+Matching

There are some special extensions too
https://wiki.asterisk.org/wiki/display/AST/Special+Dialplan+Extensions

Ok…
A number such as 1234 or the characters X,N etc make sense to me because they match the exact number or a pattern.

What does a name match?

Thats what i dont get.

It matches the name. In SIP you can dial “jcolp” for example. You can also specify it in a Goto() or to a Local channel. An extension isn’t limited to being just a number.

I know I may be getting annoying at this point but …
makecall in this case is supposed to match any dialled number for outbound calls but it doesnt match anything except ‘makecall’. Is this working because It’s the last section of the extensions.conf and runs as a final option ?

I don’t understand the question. It’s not written to match any dialed number. It will only ever match ‘makecall’. That’s a fundamental way the dialplan works, so it’s not because it’s the last section of extensions.conf.

Ok. That’s pretty clear. There must be another extension i missed that matches all outgoing calls.

Thank you both. Have a nice day !

If you know what context your calls originate from you can use the ‘dialplan show’ command on the console to see what is executed when that number is called.

Try ‘dialplan show 5203825968@internal’ assuming internal is the context your phones are in.

Ok… finally figured out with all the assistance.

An authentication script is using makecall as a Goto().

Thank you for your time and assistance !