Asterisk with prepaid card

i am trying to create something like a prepaid card number.
where i can create prepaid cards and assign credits to it, then this credit must be reduced after each minute of a call.

so i should be able to create cards, assign credits, credits get reduced every minute.
this should only work for a specific trunk.

is it easier for me to customize a SQL report from the CDR and use it ?

or should I install some billing software? is freeRadius a good example? a2billing?

so what do u propose guys? first or second choice? what are the pros and cons of each choice?

any help would be appreciated.

If you cant code and doesn’t know the Asterisk dial plan logic use a2billing, if not you can use the L option of the dial command and MYSQL to complete this project.

1 Like

So just to make it clear, a2billing is a software that allows me to do what i need and it supports pjsip channel?

And yes i think i can code.
I believe i need to create sql database, it has to be a real time database. Then start an event where if could count minutes and so on which then i can reduce the credits while call is still going? Something like that i guess

it does not support PJSIP,

count the time real time is harder, better set the time limit before dialing using the L option and the destination number and the amount of minutes for that particular customer

1 Like

Ohhh thanks.
So i think it s a doable thing after all.
I need to set L option(which i still not familiar with)
Which sets for me time limit.
And this will trigger a flag(m assuming), where then i have the right to hang up the call!

Quick sample

[inbound]
exten=>200,1,set(LIMIT_WARNING_FILE=beep)
same=>n,Set(LIMIT_PLAYAUDIO_CALLER=yes)
same=>n,Set(LIMIT_PLAYAUDIO_CALLEE=yes)
same=>n,Set(LIMIT_TIMEOUT_FILE=demo-thanks)
same=>n,Dial(Local/200@mymusic,L(60000:30000:10000))

[mymusic]
exten=>200,1,Answer()
same=>n,MusicOnHold(default)

Limit call to 60 seconds, play a beep every 10 seconds, and at the end play the asterisk-demo thanks message to caller and calleed

1 Like

M so grateful.

I will try it next week and let u know what happens.

Thanks again

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.