Overview


The purpose of this IVR is to announce either balance or maximum call duration, depending on application settings. The Play Balance IVR application authorizes accounts by CLI only. Trusted Numbers are not supported.


Call routing setup


  1. Add vendor connection. Set the Asterisk's host/port in the Destination field of Vendor Connection (ex: 192.168.0.100:5062).
  2. Set the CLD Translation Rule for the connection to the value s/.*/balance/
  3. Add route to this connection and specify the Play Balance Extension number.


* - don't forget to change IP 192.168.0.100 to the IP of your sippy environment.

Configuration options


None of application specific options exists.


CLD based options


earlymedia Use early media mode till the destination has answered
cld<DEST> Announce the maximum allowed call duration to the specified destination DEST. If the duration is unlimited then no duration is announced. (new in 1.7)
nobalance Do not announce balance. Useful with cld option. (available post 1.7.1).
nopin Never ask PIN
onlow<sum> Play balance only if the user's balance less then the sum. Format of the sum see in the example below. The use of earlymedia option together with this option is often a good idea.
planminutes Play service plan minutes instead of a sum of plan minutes and duration calculated by tariff. This option does not affect actual maximum duration of a call which is a sum of plan minutes and duration calculated by tariff. NOTE : that option will not work without specifying cld<DEST> in the CLD Translation Rule.


Examples of CLD translation rule: 


  s/.*/balance_earlymedia_nopin/
  s/.*/balance_earlymedia_onlow10.23USD/
  s/^/balance_nobalance_earlymedia_cld/
  s/^/balance_nobalance_nopin_cld1_planminutes/ - plays the available amount of service plan minutes for '1' prefix


Database usage


The application uses the accounts table for authentication purposes and to retrieve the value of the user's balance. It also uses the xrates and currencies tables to convert between currencies.


Announce minutes instead of balance


Insert a new parameters into ivr_config:

INSERT INTO ivr_config (section, option, value, i_ivr_instance) VALUES ('callingcard', 'onlyminutesduration', 'true', 2);

 

i_ivr_instance - unique value, use value 2 or higher


In the CLD translation rule 'instanceX' parameter with corresponding value must be inserted, e.g.


s/^/balance_earlymedia_cld/


turns into
s/^/balance_nobalance_earlymedia_instance2_cld/