[Asterisk-Users] Re: Working with an ongoing call

Adam Goryachev mailinglists at websitemanagers.com.au
Thu Jul 21 06:47:10 MST 2005


On Thu, 2005-07-21 at 09:22 -0400, Waldo Rubinstein wrote:
> On Jul 21, 2005, at 9:04 AM, Eivind Trondsen wrote:
> >>> 1) send sound to the caller of an ongoing call
> >>> 2) retain control so the call can be terminated based on a timer (or
> >>> whatever)
> >>> Any tips would be greatly appreciated! Thanks in advance.
> >> Use the manager API to terminate the call if their credit reaches  
> >> zero,
> >> connect and process active channels on an regular basis (as  
> >> needed), use
> >> the AGI to reduce the credit by the needed amount at the end of  
> >> the call
> >> (from h extension, or g option to Dial).
> That's an interesting approach. I have a general question that arose  
> from your comment. You suggest using the h extension (or g option of  
> Dial) to reduce credit. What would happen if asterisk is restarted or  
> crashes with ongoing calls? Is there any trace of those calls in  
> order to reduce the time used? I assume you can't always guarantee  
> all calls will be handled gracefully.

Well, I almost said it, but I figured by extrapolation people 
might work it out by themselves... Since you are checking the calls in
progress on a regular basis, you might as well deduct the credit from
the account on a regular basis as well. Then at completion of the call,
the h extension simply charges for the time that hasn't yet been charged.
Or, your software that watches and listens to the manager API slowly
reduces the credit (say every 30 seconds) and then when it sees the call
end (or asterisk crash) it charges the last portion of the call...

> > Thanks Adam. This helps some, but I'm still not sure how you mean  
> > for me to acheive 1). I would have to perform a Dial-command no matter 
> > what, so I guess I would have to make an interruption from the 
> > manager API, but I don't manage to find a command that will 
> > acomplish that.

Either use the dial parameters to play a sound on a regular basis, eg,
you could play $UNIQUEID every 30 seconds, then your other software
which is watching the manage interface and deducting money every 30
seconds can change the content of that file once you want the user to
start to hear something different.... see the L option to dial.

Alternatively, you need to be more creative and put the two calls into a
meetme conference, then add your third channel (see the local channel
driver) which simply plays whatever audio you need (or in fact this
could be some AGI/etc)...

These are just some comments I felt like making, I've never had to do
this, and this is not necesarily how I would do it if I did need to (ie,
if I was being paid to do this, I'd think about it more before
implementing it, but for now, I can shoot my mouth off without any
concern of needing to deliver on what I've said can be done).

Regards,
Adam





More information about the asterisk-users mailing list