VICIfast
Guides & tutorials

How to Use the cm_send_url.agi Call Menu Script

cm_send_url.agi fires a URL defined in a VICIdial Settings Container from inside a Call Menu, letting you push call data to an external system without an agent.

VICIfast Support
··3 min read
How to Use the cm_send_url.agi Call Menu Script

VICIdial's Dispo Call URL fires a webhook when an agent sets a disposition, but sometimes you need to push data to an external system during an IVR flow before any agent is involved. That is what cm_sc_send_url.agi does. It retrieves a URL stored in a Settings Container and fires it, carrying lead and call data as URL-encoded variables, from inside a Call Menu Call menu. A Settings Container is a named key-value store in VICIdial that holds configuration data, URLs, and routing parameters outside the main dialplan Settings container.

The script requires that the call already has a lead_id associated with it. Without a lead_id, the script falls through to the D option in the Call Menu. If the Settings Container is not found, the call goes to option C. After a successful URL send, the call routes to option B. This makes the three-way B/C/D structure mandatory: you must configure all three options in the Call Menu, even if B and C point to the same destination.

Setting up the Settings Container

In Admin > Settings Containers, create a container with any ID you choose — for example test_cm_url. Inside that container, define the URL to send. The URL can reference most of the same variables available in Dispo Call URL fields, including lead fields, talk_time, talk_time_min, and ivr_time. The user and status fields use the last vicidial_agent_log entry for that call.

A typical URL in the container might look like a standard webhook endpoint with lead data interpolated into query parameters. Because the container stores the URL rather than embedding it in the dialplan, you can update the endpoint without touching the Call Menu or the Asterisk configuration.

Wiring the script into the Call Menu

The script takes a single argument: the container ID. In Admin > Call Menus, set the prompt field of the relevant option to include the script call. There are two ways to wire it. The first is in the prompt field, piped after a silence file:

sip-silence|cm_sc_send_url.agi,test_cm_url

The second is in a Call Menu AGI option, where you set Route to AGI and enter the script name and argument in the AGI field:

cm_sc_send_url.agi,test_cm_url

A related variant, cm_sc_send_url_status.agi, extends this by accepting a second argument for GET or POST and a third argument for a lead status to set after the URL fires. For example, to POST to the container URL and set the lead's status to BGOOD:

cm_sc_send_url_status.agi,test_cm_url---POST---BGOOD

How the URL send flow works

flowchart TD
  A[Call arrives with lead_id assigned] --> B[Call Menu triggers AGI]
  B --> C[cm_sc_send_url.agi runs]
  C --> D{Settings Container found?}
  D -- No --> E[Route to option C]
  D -- Yes --> F{lead_id defined?}
  F -- No --> G[Route to option D]
  F -- Yes --> H[Fire URL from container]
  H --> I[Route to option B]

One practical note: the call needs to carry a lead_id before it reaches this script. The most reliable way to guarantee that is to run cm_phonesearch.agi or cm_lookup.agi in an earlier Call Menu step so the call is tagged to a matching lead record before the URL send fires. If the call arrives from an outbound campaign via an in-group transfer, the lead_id is already on the call.

For calls transferred in from a VICIdial in-group using the Action Transfer CID feature, set the In-Group's Action Transfer CID field to CUSTOMERCLOSER. This ensures the lead_id is carried on the call leg that reaches the Call Menu, which the script needs to tag its URL variables correctly.

This pattern is useful for CRM integrations CRM and webhook-based lead scoring: a caller who self-selects through a menu, gets their lead record looked up, and then automatically pushes their IVR choices to your backend system before they ever talk to an agent IVR (interactive voice response). The URL sends their talk_time, ivr_time, and any lead fields your webhook endpoint expects, all without custom Asterisk dialplan code.

For the full walkthrough of attaching an AGI script to a Call Menu through the admin panel, see How to Add an AGI to a Call Menu. The full API and AGI context is in the VICIdial API and AGI overview.

Every VICIfast plan ships a production-ready VICIdial server with Call Menus, Settings Containers, and AGI scripting active in under 40 seconds.

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. “How to Use the cm_send_url.agi Call Menu Script”. VICIfast LLC, June 28, 2026. Retrieved from https://vicifast.com/blog/use-cm-send-url-agi

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.