Skip to navigation

Resources

View as MarkdownOpen in Claude

A Resource is the part of your SignalWire Space that handles a call or message. An AI Agent that holds a conversation is a Resource. So is a SWML Script that runs call logic, a Subscriber whose devices ring, and a Video Room that several people join.

People and code reach a Resource through an Address: a phone number, a SIP URI, or a name such as /public/support. The Resource decides what happens, and the Address decides how someone gets there.

Keeping the two apart lets you change either side without touching the other. You can point a phone number at a new Resource and callers keep dialing the same number, or give one Resource a phone number, a SIP URI, and a web entry point that all run the same logic.

Addresses: how someone reaches it ResourceAI Agent: Ada What happensthe agent answers and books the ride Phone number+12025550123 SIP Addresssip:*@bayview-public.dapp.signalwire.com Alias/public/ada

How a call reaches a Resource

Every inbound call or message follows the same path:

  1. Someone dials an Address. A caller on the phone network dials a phone number, a private branch exchange (PBX) or carrier sends a SIP call to a SIP Address, and a browser, script, or another Resource dials an alias.
  2. SignalWire looks up the Address and finds its handler, the one Resource assigned to it. A phone number gives you two Addresses, one for calls and one for messages, so each can go to a different Resource.
  3. The handler runs. What it does depends on its type: an AI Agent holds the conversation, a SWML Script runs its document, a Relay Application delivers the call to your server, and a Subscriber rings that user’s devices.

Consider Bayview Taxi. Its dispatcher, Ada, is an AI Agent Resource. Riders reach Ada by calling the company’s phone number or by pressing a call button on its website, which dials /public/ada, the alias SignalWire created with the Resource. Both Addresses have Ada as their handler, so every rider gets the same conversation however they got there. When Bayview builds a new version of Ada, it assigns the phone number to the new Resource and re-creates /public/ada on it, so riders never notice the change.

What each part controls

PartWhat it controls
AddressWho can reach the Resource and how: the phone number, SIP URI, or alias someone dials
ContextWhether an alias is open to anyone (public) or only to your authenticated users (private)
ResourceWhat happens when the call or message arrives, set by the Resource’s type and configuration

Resource types

Every Resource has a type, and the type decides what the Resource does with a call or message. These are the most common types:

TypeWhat it doesChoose it when
AI AgentHolds automated conversations with your callers, using the prompt, voice, and functions you give itA conversation should be handled by AI
SWML ScriptControls calls and messages with a SWML document in JSON or YAML, stored in your Space or served from your own URLYou want to describe call or message logic as a document
Call FlowRoutes calls with logic you build in the visual Call Flow BuilderYou’d rather draw the logic than write it
Relay ApplicationHands calls and messages to your own server over a real-time WebSocket connection from the Server SDKsYour own code should control each call as it happens
SubscriberRepresents a user of your application, with sign-in credentials and devices that ring when the user is calledA person should receive the call on their browser, app, or SIP phone
Video RoomGives participants a shared room to join by video, audio, or bothSeveral people should meet in one place
SIP CredentialGives your SIP phones and softphones a username and password to register with and place calls fromYou have SIP devices that should connect to your Space
SIP GatewayConnects your Space to an external SIP networkCalls should reach SIP infrastructure outside SignalWire
FreeSWITCH ConnectorSends traffic from SignalWire to your own FreeSWITCH infrastructureYou run FreeSWITCH and want SignalWire to send calls to it

Most types can take calls. Messages go to Resources that run messaging logic, such as SWML Scripts created for messaging and Relay Applications.

Resources and Addresses

A Resource can carry any number of Addresses, and each Address hands its calls to one Resource. Deleting an Address never deletes the Resource behind it.

SignalWire gives every new Resource one alias so it’s reachable right away. The alias name is a URL-safe form of the Resource name, so an AI Agent named Support Agent that you add in the Dashboard is reachable at /public/support-agent. Whether that first alias is public or private depends on the Resource type, as Aliases lists. If the name is already taken in the alias’s context, SignalWire adds a short random suffix. Renaming the Resource later keeps the alias it already has.

To take calls from the phone network or from SIP systems outside SignalWire, give the Resource a phone number or a SIP Address. The Addresses page covers each Address type and how contexts decide who can dial them.

Create and manage Resources

In the SignalWire Dashboard, select My Resources in the left sidebar to list every Resource in your project, then select + Add to create one. Script lists the script types, such as SWML Script, and SIP asks you to choose SIP Credential or SIP Gateway. AI Agent asks for an Agent Name and an Agent URL. Open any Resource to find its settings on the Configuration tab and its Addresses on the Addresses & Phone Numbers tab, where you can also add more.

An AI Agent added in the Dashboard points to the public URL of an agent you build with the Server SDKs and host yourself. SignalWire checks that the URL returns a valid SWML document before it creates the Resource.

With the REST API, create or update a Resource through the endpoints for its type, such as Create SWML Script. The generic Resources endpoints work with every type: list Resources, retrieve or delete one by ID, and list a Resource’s Addresses.

Deleting a Resource also deletes its aliases. A Resource that is still assigned as a handler can’t be deleted. That covers the call or message handler of a phone number or WhatsApp number, the handler of a SIP Address, and the Resource a SIP Credential sends its calls to. Reassign those numbers and SIP Addresses, or point the SIP Credential at another Resource, then delete it.

Next steps