I already know how to create databases/tables in MySQL. Adding data en updating them is also no problem.
What i need to do is:
Create a dial plan within asterisk for a bank (not commercial). The caller needs to be able to listen to his current balance, after entering a userid and usercode (this way he/she accesses there respective accounts). They also need to be able to do transactions (send money. to make this simple, they will only be able to do this with other account holders within their bank). Where as the balance of both the sender and receiver must be automatically updated. The caller also needs to be able to request to hear his last 3 transactions.
these are the tables that i’ve made:
customer_info => id, first_name, last_name, birthday, (telephone_number)
account_info => id, usercode, account_number, balance
transactions => id, account_sender, account_receiver, ammount, (date)
customer_info.id=account_info.id
both account_sender and account_receiver will correspond with account_info:
transacties.account_sender=account_info.account_number (nieuw balance=balance-ammount)
transacties.account_receiver=account_info.account_number (nieuw balance=balance+ammount)
transaction.date : i want to the date to be added automatically when the caller does a transaction.
the table transaction will hold every transaction of every account holder. we can than make a temporary table to hold the (last 3) transaction of a specific account holder.
I (might) need help with the queries, but mostly i need help with writing the dial plan in asterisk.
ps. use of func_odbc is not allowed.
i saw an example of a dial plan:
part of the dial plan:
exten => 10000,n,MYSQL(Connect connid 192.168.10.13 invite invite feng)
exten => 10000,n,MYSQL(Query resultid ${connid} SELECT \firstname\, \lastname\ FROM og_contacts WHERE \w_phone_number\='${CALLERID(name)}' OR \w_phone_number2\='${CALLERID(name)}' LIMIT 1)
exten => 10000,n,MYSQL(Fetch fetchid ${resultid} name lastname)
but i don’t understand it fully