[Asterisk-Users] working on calling card for *

d hinton hint63 at charter.net
Thu Mar 20 09:29:48 MST 2003


hi
below is an outline, if you will, of the features/apps i'm planning on adding to asterisk. they will allow for pre-paid & calling card calls via an asterisk enabled system. if i'm correct, these can be added via common perl scripts doing mysql calls placing variables into the config files. now because i'm new to asterisk, i need to learn how asterisk works with scripts and also before i get started i need comments and suggestion about the process of the call, how the call will be handled by asterisk. also if any if this stuff is already set please let me know. ALL HELP WILL BE APPRECIATED!

well here's what i got:

Process of a Pre-Paid or Calling Card call;  Calls will arrive over multiple local t1's that are plugged into a zaptel based pci cards. the calls are then authenticated, compressed with the required compression (if needed) then routed either via the ethernet WAN port(VoIP) or via Long Distance T1's which are also connected to zaptel based pci cards. below is the process of a call;

<==== Pre Authenticated Main Menu ==>

Caller is prompted to select a preferred lang. 
=>To continue in Eng. press 1
=>To continue in Span. press 2
=>To continue in French press 3
set $language

Play access code prompt menu <===Access Code Prompt Menu

Caller enters 8-16 digit access code. set $Access_code

Compare access_code and also callerID if callerID_verifiacation is enabled. (check is made against info in MySQL db)

validate_account
return $validation="true" if validated or "false" if NOT validated
if $validation=false return to Access Code Prompt Menu (each CallerId should only get 3 tries for security)
if $validation=true then caller is presented with post authenticated menu:


<==== Start Post Authenticated Main Menu ==>
before playing post authenticated main message, we need to make check a few things
=>get_balance (to get the balance for that account) set $current_balance
=>announce $current_balance "Your current balance for this acount is: $current_balance"
if $current_balance > 1.000
Announce to user that they will need to recharge their acct before they can proceed
forward to recharge acct menu

else
=>play_post_authenticated_main_message


1. To place a State-State call please press 1,
=> play "please enter the State-State telephone number now"
=>set $destination
=>select best route for call $destination
if no route to $destunation found in db
announce ; "sorry, but we can not complete calls to that destination at this time, please try another destination"
return caller to post authenticated main menu

else

=>get_destination_rate (locate rate for a call to that destination) set $destination_rate
=>validate_destination (to see if the caller can call that destination and for how long) *************

return $max_call_duration (in seconds)


if $max_call_duration = < 120 seconds
Announce "call is less then 2 min, you will need to recharge acct before proceeding with this call"
forward to recharge acct menu

else
$1min_alart_time = ($max_call_duration - 60 seconds)
=>announce_max_call_duration
=>play "please hold while we connect your call" message
=>route call to destination
=>start_call_billling (when caller is connected to destination) 
if no connection announce why & return to post authnticated Menu
else continue with call for $1min_alart_time 

=>cut into call

=>play_1minute_alarm play message "you have one minute left for this call"

=>return caller to call for 60 seconds
=>hangup
=>stop_b_leg_billing (deduct the calls charge from the account & reset $current_balance) 
return to post authenticated main menu 



2. To place an international call please press 2
=> play "please enter the International telephone number now"
=>set $destination
=>select best route for call $destination
if no route to $destunation found in db
announce ; "sorry, but we can not complete calls to that destination at this time, please try another destination"
return caller to post authenticated main menu

else

=>get_destination_rate (locate rate for a call to that destination) set $destination_rate
=>validate_destination (to see if the caller can call that destination and for how long) *************

return $max_call_duration (in seconds)


if $max_call_duration = < 120 seconds
Announce "call is less then 2 min, you will need to recharge acct before proceeding with this call"
forward to recharge acct menu

else
$1min_alart_time = ($max_call_duration - 60 seconds)
=>announce_max_call_duration
=>play "please hold while we connect your call" message
=>route call to destination
=>start_call_billling (when caller is connected to destination) 
if no connection announce why & return to post authnticated Menu
else continue with call for $1min_alart_time 

=>cut into call

=>play_1minute_alarm play message "you have one minute left for this call"

=>return caller to call for 60 seconds
=>hangup
=>stop_b_leg_billing (deduct the calls charge from the account & reset $current_balance) 
return to post authenticated main menu 

3. To add funds to your account press 3 
3a. If this is your first time Charging over the phone or you need assistance press 1 (forward to sales rep)
3b. if you don't want to recharg your acct now press 2 to go back to the main menu
3c. To add funds now press 3
set OrderID
get Billing info from db and place in temp space
play--- 

=> to charge your account using a Master Card press 3
=>Enter your Master Card Credit Card Number set CCNumber
=>Enter your Master Card Experation Date set CCExpDate
=>Enter your Master Card digitcode from the back of your card set CCDigitCode
=>Enter the amount you wish to charge to your Master Card set CCChargeAmount


=>proccess credit card $return cc_approval=true or false
if $return cc_approval=false forward to sales rep
if $return cc_approval=true
add $CCChargeAmount to $current_balance and set new $current_balance
forward back to post authenticated main menu


=> to charge your account using a Visa Card press 4


=>Enter your Visa Credit Card Number set CCNumber
=>Enter your Visa Card Experation Date set CCExpDate
=>Enter your Visa Card 3 digitcode from the back of your card set CCDigitCode
=>Enter the amount you wish to charge to your Visa Card set CCChargeAmount


=>proccess credit card $return cc_approval=true or false (get the rest of the data from the db)
if $return cc_approval=false forward to sales rep
if $return cc_approval=true
add $CCChargeAmount to $current_balance and set new $current_balance
forward back to post authenticated main menu

4. To add an AutoDial Number Press 4


5. To Place an AutoDial Number Press 5

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20030320/86fa0920/attachment.htm


More information about the asterisk-users mailing list