Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using PIN code for dialing out external number

Status
Not open for further replies.

lexer

Programmer
Jun 13, 2006
432
VE
Hi

I'm trying to configure asterisk for asking users to enter a PIN code after dialing out a external number, I want to check if the user PIN code has rights for making the call that is attempting (for example long distance), The PIN code is located in a Mysql Dababase:
What I'm trying to do is something like this:

- Users dial 9 + external number
-The number is saved in a variable
-The user is asked to enter the PIN code
-I run agiphp script that check if the PIN code exists and has rights for the type of number dialed (No problem with this script)
-I send the call out for DAHDI channel 1 or restrict the call if the PIN used has not permision

I dont have any problems with the agiphp mysql script, What I'm trying to do in the dial plan is the following:

exten => _9X.,n,Set(OUTGOINGNUMBER=${EXTEN:1}); saved dialed number in OUTGOINGNUMBER
exten => _9X.,Read(pin,astcc-digit-account-number&astcc-followed-by-the-pound-key); ask for PIN
same => n,Playback("one-moment-please")
same => n,AGI(ckeckpinlevel.php,${pin}${OUTGOINGNUMBER}); check if PIN has rights
same => n,GotoIf($[${EXISTS(${permisionok)}]?call); If has pemition goto call
same => n,Congestion(2); User PIN is restricted
same => n,Hangup
same => n(call),Dial(DAHDI/1/${OUTGOINGNUMBER}); Dialing external number


I dont know If this is the way to do it?
Please, Any ideas?
 
What distribution are you using?

FreePBX has route passwords, PIN sets, and PIN set Pro as a paid option. The PIN sets can be applied by outbound route and seen in the CDR.

Clowns to the left of me, jokers to the right, here I am, stuck in the middle with you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top