How do I connect a caller to a third party, but announce the call to the third party before connecting?

I’m developing a pay-per-minute call service with database integration via AGI/PHP scripting. I’ve got the integration part down pretty well, but I’m confused as to how to go about connecting clients with providers in a way that doesn’t expose either party’s personal information (e.g. CID info). Also, I must be able to track the time that the two parties are connected (for accurate billing).

Basically, here’s a rundown of the call flow:

  • A client requests to talk to a provider on the app
  • The app generates a 6-digit access code to be used when they call the 800 number
  • The client calls the hotline and enters the access code
  • The server connects to database via AGI and retrieves the provider’s mobile number associated with the access code
  • The server calls the provider and announces that “user so-and-so is on the line.” User so-and-so only hears music on hold at this point
  • The provider presses a key (e.g. pound) to accept the call or another to decline
  • The server announces something like “Your call is being connected, billing will begin now” to both parties
  • The server connects both parties and gets out of the way, yet begins timing the call until the channel is dropped
  • When the call has ended, the timer value is recorded to the database via AGI

Any ideas? I have scoured the internet for hours and have not been able to find any examples even remotely close to what I want to do.

I would appreciate any help anyone can offer, or if anyone has any examples and has done something similar to this in the past.

Local channels is probably going to be the best option. Call comes in, you send it out over a local channel using the correct Dial() options to do confirmation so you can play the announcement to the callee before the call is bridged, give them the option to press 1 to connect or 2 to ignore and then play back a message to both when the call is connected.

I made something similar for a customer a while ago, I will share the dial plan with you

Ok, I’ll check it out and share my results!

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