VICIfast
Operations

agi-3way_press_outside.agi: the script that runs the outside agent's press-1 prompt

The second script in the press-1 chain plays the prompt, watches for the keypress, and decides whether the outside agent gets connected, declined, or accepted.

VICIfast Support
··3 min read
agi-3way_press_outside.agi: the script that runs the outside agent's press-1 prompt

Once a 3-way press-1 call has been launched, something has to actually greet the outside agent, ask them to press 1, and then decide what happens next. That is the job of agi-3way_press_outside.agi, the second of the two AGI (Asterisk Gateway Interface) scripts behind the feature. The first script gets the outside agent ringing; this one runs on their leg of the call.

What it controls

This script runs on the outside agent's channel after they pick up. It plays the spoken prompt and watches for the keypress, then routes the call based on what the outside agent does. The whole point of press-1 is to make sure a human, not a voicemail box or an empty room, is on the far end before the customer is connected into the Three-way call.

It takes a stage argument that tells it which moment of the call it is handling. There are three:

  • answered: the outside agent has just picked up the phone. The prompt is about to play.
  • declined: the outside agent did not press 1 in time, so the call is hung up.
  • accepted: the outside agent pressed 1 and is sent through to the agent.

The dialplan context

The script lives in its own context, xfer_press_dialplan, that the call is sent into. The s extension answers the channel, logs a couple of variables for tracing, then calls AGI(agi-3way_press_outside.agi,answered---20) where 20 is how long to wait. After that it plays the prompt audio in pieces, an outside-sales clip, a press-1 clip, and a now clip, with a Wait of 10 seconds for the keypress. If nothing comes, the Dialplan calls the script again with the declined stage and hangs up.

The call_3way_id variable that gets logged near the top of the context is how VICIdial ties this leg back to the original session. If you ever debug a press-1 call that connected the wrong parties, that id is the thread to pull. The press-1 itself is just a DTMF digit, so anything that mangles tones between the carrier and the dialer can cause a real human to be marked as declined.

The accept or decline decision

sequenceDiagram
  participant Outside as Outside Agent
  participant Dialplan
  participant PressOutside as agi-3way_press_outside
  participant Agent
  Outside->>Dialplan: Answers the phone
  Dialplan->>PressOutside: Stage answered
  Dialplan->>Outside: Play outside-sales press-1 now
  alt Pressed 1 in time
    Outside->>Dialplan: Sends DTMF 1
    Dialplan->>PressOutside: Stage accepted
    PressOutside->>Agent: Connect outside agent
  else No keypress
    Dialplan->>PressOutside: Stage declined
    PressOutside->>Outside: Hang up the call
  end

Tuning is mostly about the two waits. The answered timeout passed to the script and the Wait after the prompt should leave a real person enough time to react, but not so long that a dead line sits there ringing into silence. A good starting point is a prompt that states who is calling, asks for the keypress, and then waits roughly ten seconds, which is what the sample context does. If your outside agents keep getting declined while swearing they pressed the key, lengthen the post-prompt Wait before you touch anything else. The other thing to verify is that the prompt audio files actually exist in your audio store, because a missing clip plays as silence and the agent never hears the instruction to press the key.

This is the second required script of two. Its partner, agi-3way_press_agent.agi, launches the outbound leg; without both in place the feature does nothing. For the why-and-when, see our overview of 3-way press-1 calls, and the bigger handoff picture in the transfers and closers guide.

Getting the prompts, the timeouts, and both AGI scripts lined up is fiddly to do from scratch. A managed setup ships it ready to use. See our pricing for the details.

About VICIfast LLC

VICIfast LLC operates a managed VICIdial hosting + BYOI service for outbound and inbound call centers. We run the dialers, the carriers, the recordings pipeline, and the compliance plumbing so operators don’t have to.

Citing this article

VICIfast Engineering. “agi-3way_press_outside.agi: the script that runs the outside agent's press-1 prompt”. VICIfast LLC, June 24, 2026. Retrieved from https://vicifast.com/blog/vicidial-agi-3way-press-outside

Have questions?

Related posts

You might be interested in

VICIfast newsletter

Liked this? Get the next one in your inbox.

We ship the kind of stuff you just read — concrete, numbers-first, no drip. One email when a new post goes live. Unsubscribe in one click.

Comments

Comments are reviewed before they appear. We never publish your email.

No comments yet — be the first.