asterisk2billing.org
http://forum.asterisk2billing.org/

say_balance_after_auth only below certain balance
http://forum.asterisk2billing.org/viewtopic.php?f=23&t=6276
Page 1 of 1

Author:  snoozer [ Thu Sep 24, 2009 2:19 pm ]
Post subject:  say_balance_after_auth only below certain balance

hello,

i like to be able to announce the remaining credit on an account to a user only if the balance is below a set amount. is that possible ? so far i have only say_balance_after_auth = YES enabled and it will announce the credit every time. alternatively is there a way to create an extension which is telling me my balance if i dial it ?

any suggestions are welcome.

kind regards
Jan

Author:  areski [ Thu Sep 24, 2009 11:09 pm ]
Post subject:  Re: say_balance_after_auth only below certain balance

The 2 options are possible, the first ones request minor changes and I would advice to add a parameter for this need.
say_balance_credit_lower = 5 euro
then doing the needed changes in a2billing.php AGI you might achieve this.

the second option will request to rewrite a new mode on the AGI which will request more code writing.

Yours,
/Areski

Author:  jroper [ Fri Sep 25, 2009 8:37 am ]
Post subject:  Re: say_balance_after_auth only below certain balance

Assuning these are VoIP customers, You could also create an extension in the a2billing context that called a different agi-conf that read out the balance when you dialed 123.

Code:
[a2billing]
exten => _x.,1,deadagi(a2billing.php|1)
exten => _x.,2,hangup

exten => 123,1,deadagi(a2billing.php|2)
exten => 123,2,hangup


Alternatively, if these were call through customers, and you are using 1.4, you could create a DID with a destination of local/balance@read-balance, and the code in the asterisk dialplan would be something like -

Code:
[read-balance]
exten => balance,1,deadagi(a2billing.php|2)
exten => balance,2,hangup


Joe

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/