2

Here is how the AGI goes:

  1. Call from AParty lands on the AGI, say firstAGI.agi
  2. AGI prompts user for input
  3. On pressing 1 I need to put this call on hold and dial the BParty using call (callfile) which lands on another AGI say secondAGI.agi
  4. SecondAGI prompts BParty for user input too.
  5. On pressing 1 need to bridge the on-hold call of AParty and this BParty.

    Now I need help on following issues:

    1. How to make first call on hold? (Can a busy while loop do this job?)
    2. How to bridge both channels?
    3. How the first call (aparty) can come to know that other user (bparty) has pressed other than 1?
shabby
  • 3,002
  • 3
  • 39
  • 59
viki
  • 125
  • 2
  • 10

1 Answers1

0

The docs for the library you're using are here.

It sounds like you're building a queue of some kind, with options.

  1. To simulate hold, just play music with playMusicOnHold, then use waitForDigit() with a set timeout (say 2 seconds) at the end of your while loop. If you don't have any "waiting logic" in your while loop, you can skip the loop and use the exec(Dial) instead. You'd only use a loop if you were waiting for some business logic (such as a call to a database of agents) to return a value (such as an agent extension to dial).
  2. You don't need to use a call file to call the 2nd party. Just use exec() with the command "Dial". Use the "m" option so that the calling party doesn't hear ringing, but instead continues to hear the hold music.
  3. Use announces (Dial() option A()) to play an audio file based on the result of your calls to waitForDigit() so that the called party hears a message such as "user pressed 3 for billing" before he/she is connected to the caller.
QuickDanger
  • 1,032
  • 11
  • 18
  • when i use Dial command instead of creating callfile it directly connects with aparty. I mean both calls bridge directly neither aparty is set to hold nor i can take option from bparty – viki Aug 04 '15 at 06:31
  • Can you post your AGI that you're using so far, and I can suggest edits to align it with my answer? -- use a site like pastebin and link to it in your original question if you would please. – QuickDanger Aug 04 '15 at 19:29