[asterisk-users] Tracking Call Time While in Dial()

Steve Edwards asterisk.org at sedwards.com
Sat Jul 12 18:05:02 CDT 2008


On Sat, 12 Jul 2008, Douglas Garstang wrote:

> The person I am working is building a calling card. They want to allow 
> the user to recharge their account when their time runs out (without 
> hanging up the current call). I got no idea how to implement that. In 
> addition, they don't want to charge the user for the time they spend 
> recharging their account. So, they need to track multiple timers for the 
> call.

Would this work?

Hack up meetme to add an option to time out after x seconds, set 
MEETME_STATUS to "TIMEOUT" and return to the dialplan. You can follow the 
"w" option to figure out how to pass the seconds. Then in meetme's main 
loop (in conf_run()), just check for when its time to leave.

Use dial()'s G option to put both the caller (with the timeout) and the 
callee into a meetme.

When the caller times out, the callee will hear the music on hold ("please 
wait until the other party returns").

The caller can top up and then return to the meetme. You can accumulate 
the time the caller is in the meetme.

What happens if the caller can't top up and hangs up. Who pays for the 
callee leg? Would you need a second timer to abort the callee?

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards      sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                             Fax: +1-760-731-3000



More information about the asterisk-users mailing list