Page 1 of 1

Two Entries... Need to understand the meaning of both

PostPosted: Mon Jan 12, 2009 6:20 am
by kolucoms6

exten => _9X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9X.,2,Dial(SIP/${EXTEN:1}@sip||tTor)
exten => _9X.,3,Hangup()



exten => _[1-8]X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _[1-8]X.,2,Dial(SIP/${EXTEN}@sip||tTor)
exten => _[1-8]X.,3,Hangup()


Two Entries are there in extension.conf file ... Need to understand the meaning of both

Kindly help me

PostPosted: Mon Jan 12, 2009 2:00 pm
by okli

PostPosted: Mon Jan 12, 2009 2:17 pm
by williamconley
http://www.voip-info.org/wiki/index.php ... sions.conf

An extension can be one of three types:

1) Literal:
    5551212
    5551212#500
    *15551212
    (these are items present on he keyboard)
2) Predefined
    i : Invalid
    s : Start
    h : Hangup
    t : Timeout
    T : AbsoluteTimeout
    a : Asterisk extension
    o : Operator
3) Pattern (this is where _ comes in)
    exten => _10X,1,Answer()
    exten => _10X,2,Playback(hello-world)
    exten => _10X,3,Hangup()

the above will match any three digit number starting with "10", such as "101", "108", etc, but not "110" and not "1000". The "_" indicates that it is a pattern, "1" & "0" are literals, and therefor must be present, and the rules for asterisk are written that "X" represents any other single digit.

You can find a more details listing of the "rules" for pattern matching at:

http://www.the-asterisk-book.com/unstab ... regex.html

However, I must point out that this is an asterisk question much more than a Vicidial question. Glad to help, but you need to be using some basic asterisk learning resources if you want to learn this. It would take an awful long time on this site to learn asterisk. Places such as the two links in this posting and asteriskguru.com have a rather large (and growing) reference and learning area for asterisk's basic functions. And yes, knowing those will help a LOT as your Vicidial server becomes your friend.

PostPosted: Mon Jan 12, 2009 2:31 pm
by kolucoms6
Ok Gr8

But in my extension.conf file , why do I need 2 para as mentioned above and why not one as



exten => _[1-9]X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _[1-9]X.,2,Dial(SIP/${EXTEN}@sip||tTor)
exten => _[1-9]X.,3,Hangup()


Is this correct ?

Also, If I use want to use "sip1" , I can use Dial Prefix as 9 and for "sip" as [1-8] then I can have both para as mentioned in first post

exten => _9X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9X.,2,Dial(SIP/${EXTEN:1}@sip1||tTor)
exten => _9X.,3,Hangup()


exten => _[1-8]X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _[1-8]X.,2,Dial(SIP/${EXTEN}@sip||tTor)
exten => _[1-8]X.,3,Hangup()

Possible and correct ?

PostPosted: Mon Jan 12, 2009 6:41 pm
by williamconley
:1 strips off one digit and then dials. the other entry did not have :1. So a number dialed with 9 at the beginning is treated differently that any other leading number by stripping off the 9.

PostPosted: Tue Jan 13, 2009 1:26 am
by kolucoms6

:1



ahh I got it.

I missed that :1.