[Asterisk-Users] Any way to _always_ execute certain commands in a dialplan context?

Kris Boutilier Kris.Boutilier at scrd.bc.ca
Fri Sep 3 19:45:38 MST 2004


Hmmm... try this then:

[foo-context-companya]
exten => _.,1,DigitTimeout(2)	;2 second pause signifies end of dialing
exten => _.,2,SetVar(target=${EXTEN})
exten => _.,3,SetVar(companyCIDNum=18005551212)
exten => _.,4,SetVar(companyCIDName=companya)
exten => _.,5,Goto(step2${dialed},1}

include => tollfree
include => local


[foo-context-companyb]
exten => _.,1,DigitTimeout(2)	;2 second pause after dialing
exten => _.,2,SetVar(target=${EXTEN})
exten => _.,3,SetVar(companyCIDNum=18775551212)
exten => _.,4,SetVar(companyCIDName=companyb)
exten => _.,5,Goto(step2${exten},1}

include => tollfree
include => local


; Generic includes (could be in seperate file)
[tollfree]
exten => _step291800.,1,SetCIDNum(companyCIDNum)
exten => _step291800.,2,SetCIDName(companyCIDName)
exten => _step291800.,3,Dial(resource/${target})

[local]
exten => _step29.,1,SetCIDNum(companyCIDNum)
exten => _step29.,2,SetCIDName(companyCIDName)
exten => _step29.,3,Dial(resource/${target})

However this means an enblock/predialing environment rather than the
conventional free running pattern matcher - fine if the outbound resource
has really fast call setup (such as PRI) but not so good if you're doing
inband DTMF a 2 digits per second, such as normal analog lines. In that case
you'd need lots of nasty audio-handholding so people don't get too confused
with the silence on the line during the call setup... which is where I'm at.


:-)

-----Original Message-----
From: Kevin P. Fleming [mailto:kpfleming at backtobasicsmgmt.com]
Sent: September 3, 2004 10:46 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [Asterisk-Users] Any way to _always_ execute certain
commands in a dialplan context?


Kris Boutilier wrote:

> [foo-context]
> ; This needs to match the criteria for tollfree, say a 91800 prefix
> exten => _91800.,1,SetCIDNum(123)
> exten => _91800.,2,SetCIDName(XYZ)
> exten => _91800.,3,Goto(tollfree,${EXTEN},1)

This is the direction I started going; however, I need to implement this 
for multiple clients, and I'm not keen on duplicating the pattern 
matching in separate contexts for each client. That's why I was trying 
to find a solution that would let me use an "included" context, but 
still provide commands to be executed if that included context found a 
match. I may work on coding this up, as I think it could be very useful.

{clip}



More information about the asterisk-users mailing list