[asterisk-users] Prompt for PIN After dialing

Daniel Tryba daniel at tryba.nl
Fri Sep 2 10:37:37 CDT 2011


On Fri, Sep 02, 2011 at 11:14:57AM -0400, Brandon Phelps wrote:
> We would like to change our dialplan a bit so that after a user dials a 
> number (any number, including domestic, international, internal) Asterisk 
> firsts prompts the user for a PIN before actually allowing the call to go 
> through.
> 
> I know I could setup an IVR that would accomplish this but I'd prefer not 
> to have the users first call an internal extension before they dial out.  I 
> want them to be able to dial the destination number directly, have asterisk 
> intercept and prompt for password, then either allow the call or play a 
> .gsm file and hangup if the PIN is incorrect.
> 
> We are using AELs, and not the exten,x,x format.

Never used AEL myself but with the old format it should not be very
hard:

exten => _X.,n,Set(CDR(accountcode)=)
exten => _X.,n,Authenticate(something,a)
exten => _X.,n,GotoIf($["${CDR(accountcode)}" > ""]?dial:fail)
exten => _X.,n(dial),Dial(SIP/${EXTEN}@trunk)
exten => _X.,n,Hangup()
exten => _X.,n(fail),Playback(notauthorized)
exten => _X.,n,Congestion()

Add prompts and maybe Answer where needed.

-- 

   Daniel Tryba



More information about the asterisk-users mailing list