[Asterisk-Users] Re: DISA and authcodes (was: t410p)
John Todd
jtodd at loligo.com
Fri Jan 30 19:01:57 MST 2004
[moved from -dev, as the thread is better suited for -users]
At 5:10 PM -0600 1/30/04, James Sharp wrote:
> > I've pretty much got the routing covered at this point, I'm just not sure
>> how to get the Asterisk system to answer and give me dialtone immediately.
>> Any ideas or recommendations would be greatly appreciated.
>
>app_disa will give answer and give you dial tone, wait for an
>authentication code, then dump you into a context where you can make your
>outgoing calls. Unfortunately, it needs a "#" at the end of the
>authentication code.
>
>A quick glance at the code suggests that it could be changed to expect a
>fixed 7 digit access code.
It would be easy enough just to cut the first seven digits off the
number and run it through a comparison pass, and not use the
authentication routines at all.
;
; for North American numbers...
;
[main1]
;
; Take any number, and give it to the DISA. The DISA
; just then takes anything typed in within the (unchangeable)
; timer values, and hands it off to main2 to be post-processed.
; I include the standard i,h,t values for pedantic reasons.
;
exten => _X.,1,DISA(no-password,main2)
exten => _X.,2,Hangup
;
exten => h,1,Hangup
exten => i,1,Congestion
exten => i,2,Hangup
exten => t,1,Congestion
exten => t,2,Hangup
;
;
[main2]
;
; Now, set the AUTHCODE to be the first seven digits of EXTEN
;
exten => _XXXXXXX1XXXXXXXXXX,1,SetVar(AUTHCODE=${EXTEN:0:7})
;
; ...and then forward this call out to a new context and extension,
; where the new extension is the 7th through 17th digit of the old EXTEN,
; which should translate into 1-123-456-7890 or whatever it was that
; the user entered as the desired destination phone number.
;
exten => _XXXXXXX1XXXXXXXXXX,2,Goto(main-dial-routine,${EXTEN:7:17},1)
;
exten => h,1,Hangup
exten => i,1,Congestion
exten => i,2,Hangup
exten => t,1,Congestion
exten => t,2,Hangup
;
; end of example
This would end up (if the user entered the appropriate 7 digits and
1-npa-xxx-yyyy phone number) with passing the authentication code to
the main-dial-routine contained in ${AUTHCODE} and the ${EXTEN} set
to the number dialed.
You could also use the "Cut" application to perform a similar purpose
to my example using substring identifiers, if you wanted to put a
pound or star (or for those telephonically exotic among you, the
A/B/C/D) key separator in between the passcode digits and the phone
number.
JT
More information about the asterisk-users
mailing list