Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] exten versus EXTEN


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
hawat.thufir at gmail.com
Guest





PostPosted: Mon Apr 06, 2015 10:09 pm    Post subject: [asterisk-users] exten versus EXTEN Reply with quote

p 176 has exten => 1NXXNXXXXXXX,1,Dial(SIP/${EXTEN}@myprovider)


how is "exten" distinct from "EXTEN"? What is this line of code doing?

https://wiki.asterisk.org/wiki/display/AST/Asterisk+Standard+Channel+Variables

says that EXTEN is the current extension.


In ruby, you this:

H = Hash["a" => 100, "b" => 200]

The => is a mapping, or at least that's my understanding. What does it
mean in Asterisk? I didn't
fully appreciate that Asterisk is, apparently, its own language.




thanks,

Thufir

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
asterisk.org at sedwar...
Guest





PostPosted: Mon Apr 06, 2015 10:56 pm    Post subject: [asterisk-users] exten versus EXTEN Reply with quote

On Mon, 6 Apr 2015, thufir wrote:

Quote:
p 176 has exten => 1NXXNXXXXXXX,1,Dial(SIP/${EXTEN}@myprovider)

how is "exten" distinct from "EXTEN"? What is this line of code doing?

This is a line of 'classic' dialplan (as opposed to AEL, Lua, or ...).

It defines a single step in the dialplan.

It 'says' if the extension matches the pattern 1NXXNXXXXXXX, dial
myprovider using the SIP protocol and pass the value of the current
extension.

exten is not case sensitive. exten is the same as EXTEN. If you write
EXTEN, Asterisk will clobber it ('dialplan save') and rewrite it as exten
so you might as well just use exten.

Quote:
https://wiki.asterisk.org/wiki/display/AST/Asterisk+Standard+Channel+Variables

says that EXTEN is the current extension.

You can reference the current value of EXTEN like:

same = n,verbose(The current value of EXTEN is ${EXTEN})

Another good reason to use exten so you won't confuse 'the next guy' who
has to maintain your code.

Quote:
In ruby, you this:

H = Hash["a" => 100, "b" => 200]

The => is a mapping, or at least that's my understanding. What does it mean
in Asterisk? I didn't
fully appreciate that Asterisk is, apparently, its own language.

'=>' is the same as '=' when used in the dialplan. Personally, I always
use '=' as the dialplan doesn't seem to be the place for some object
oriented mumbo-jumbo -- at least to my 'C programmer till I die' eyes.

--
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards sedwards@sedwards.com Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services