๐Ÿ† Omniagent API Hackathon ยท Judging underway โ€” Winners announced June 15
Deploy Your OmniagentChannels

SIP

Let your agent answer incoming phone calls over SIP

SIP connections require dedicated capacity. The default quota is 0 โ€” you must request SIP quota before creating connections.

SIP integration lets your Omniagent answer incoming phone calls. You register a SIP extension with the Omniagent API, and every call to that extension is picked up by your agent โ€” the same agent you can deploy to WebRTC and WebSockets.

Unlike WebRTC and WebSocket connections โ€” which are created per session โ€” SIP is a persistent setup. You configure it once, and the agent answers calls continuously until you remove the configuration.

SIP quota

To request SIP quota, call POST /public/quota-requests:

curl -X POST https://companion-api.napster.com/public/quota-requests \
  -H "X-Api-Key: $NAPSTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "quotaType": "sipPods",
    "requestedValue": 2,
    "reason": "Production SIP deployment for customer support line"
  }'
ParameterTypeRequiredDescription
quotaTypestringYesThe type of quota to request. Use "sipPods" for SIP.
requestedValueintegerYesThe number of concurrent SIP connections you need.
reasonstringNoA description of your use case. Helps expedite the review.

The request is reviewed by the Napster team. Once approved, the requested number of concurrent SIP connections becomes your maximum. You can check the status of your requests with GET /public/quota-requests.

How it works

SIP uses three resources that you manage separately:

ResourceWhat it defines
AgentWho answers the call โ€” the companion, voice, language, tools, FAQs, knowledge, and provider settings. Agents are channel-agnostic and can be used across SIP, WebRTC, and WebSocket.
SIP Channel ConfigSIP-specific overrides โ€” configures human handoff. Can optionally override the agent's default resources and provider settings for SIP calls.
SIP ConnectionWhere to listen for calls โ€” the SIP credentials (server, port, domain, username, password, transport) that connect to your telephony provider.

A SIP Connection links to an Agent. One agent can serve multiple connections โ€” for example, the same agent answering on different phone numbers or extensions.

Agent (companion + voice + config)
  โ””โ”€โ”€ SIP Channel Config (human handoff)
        โ”œโ”€โ”€ SIP Connection A (extension 101)
        โ”œโ”€โ”€ SIP Connection B (extension 102)
        โ””โ”€โ”€ SIP Connection C (extension 103)

Setting up SIP

Create an Agent

Define which companion answers and how it behaves. The agent holds the base configuration that applies across all channels.

curl -X POST https://companion-api.napster.com/public/agents \
  -H "X-Api-Key: $NAPSTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "companionId": "comp_abc123",
    "name": "Support Agent",
    "voiceId": "alloy",
    "language": "en",
    "functions": ["fn_order_status", "fn_returns"],
    "faqCollections": ["faq_support"],
    "knowledgeBaseId": "kb_product_docs",
    "providerSettings": {
      "temperature": 0.7,
      "turnDetection": {
        "threshold": 0.9,
        "silence_duration_ms": 500
      }
    }
  }'

Response:

{
  "id": "agent_abc123",
  "companionId": "comp_abc123",
  "name": "Support Agent",
  "voiceId": "alloy",
  "language": "en",
  "functions": ["fn_order_status", "fn_returns"],
  "faqCollections": ["faq_support"],
  "knowledgeBaseId": "kb_product_docs",
  "providerSettings": {
    "temperature": 0.7,
    "turnDetection": {
      "threshold": 0.9,
      "silence_duration_ms": 500
    }
  },
  "created": 1710000000
}
ParameterTypeRequiredDescription
companionIdstringYesThe companion that answers calls.
namestringNoA label for this agent.
voiceIdstringConditionalThe voice for speech output (e.g. alloy, echo, shimmer). Required for companions, not required for digital twins.
languagestringNoLock the agent to a specific language using an ISO code (e.g. en, es). If omitted, defaults to English but can switch when asked.
functionsstring[]NoTool IDs to attach.
faqCollectionsstring[]NoFAQ collection IDs.
knowledgeBaseIdstringNoKnowledge collection ID.
providerSettingsobjectYesModel and audio settings โ€” temperature, turnDetection, noiseReduction. See Configuration for details.

Set up the SIP channel

This step is required even if you don't need human handoff โ€” it registers the SIP channel for the agent under your API key. Without it, SIP connections cannot route calls to the agent.

This uses PUT โ€” it creates the channel config if it doesn't exist, or updates it if it does.

curl -X PUT https://companion-api.napster.com/public/agents/agent_abc123/channels/sip \
  -H "X-Api-Key: $NAPSTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "humanHandoff": {
      "enabled": true,
      "transferExtension": "200"
    }
  }'

Response:

{
  "id": "chanconfig_abc123",
  "apiKeyId": "key_abc123",
  "channelType": "sip",
  "humanHandoff": {
    "enabled": true,
    "transferExtension": "200"
  },
  "created": 1710000001
}
ParameterTypeRequiredDescription
humanHandoffobjectNoConfigure live agent transfer. See Human handoff below.
functionsstring[]NoOverride the agent's default tool IDs for SIP calls.
faqCollectionsstring[]NoOverride the agent's default FAQ collection IDs for SIP calls.
knowledgeBaseIdstringNoOverride the agent's default knowledge collection for SIP calls.
providerSettingsobjectNoOverride the agent's default provider settings for SIP calls.

The channel config fields for functions, faqCollections, knowledgeBaseId, and providerSettings are optional overrides. If omitted, the agent's base configuration is used.

Create a SIP Connection

Provide the SIP credentials from your telephony provider and link them to the agent. This deploys a listener that registers with your SIP server and starts accepting calls.

curl -X POST https://companion-api.napster.com/public/sip-connections \
  -H "X-Api-Key: $NAPSTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agentId": "agent_abc123",
    "name": "Main Support Line",
    "settings": {
      "server": "sip.your-provider.com",
      "port": 5060,
      "domain": "your-provider.com",
      "username": "your-sip-username",
      "password": "your-sip-password",
      "transport": "TCP",
      "callerId": "support-line-01"
    }
  }'

Response:

{
  "id": "sipconn_abc123",
  "agentId": "agent_abc123",
  "name": "Main Support Line",
  "settings": {
    "server": "sip.your-provider.com",
    "port": 5060,
    "domain": "your-provider.com",
    "username": "your-sip-username",
    "transport": "TCP",
    "callerId": "support-line-01"
  },
  "status": {
    "lifecycleStatus": "Pending",
    "sipStatus": null,
    "message": null,
    "lastRefreshed": 1710000005
  },
  "created": 1710000005
}
ParameterTypeRequiredDescription
agentIdstringYesThe agent to use for incoming calls on this connection.
namestringNoA label for this connection.
settings.serverstringYesYour SIP provider's server address.
settings.portintegerYesThe SIP server port (typically 5060).
settings.domainstringYesThe SIP domain.
settings.usernamestringYesYour SIP account username.
settings.passwordstringYesYour SIP account password. Only sent on creation โ€” not returned in responses.
settings.transportstringYesThe transport protocol (e.g. TCP).
settings.callerIdstringNoA unique identifier for this connection on your SIP server. Not a phone number shown to callers.

Check connection status

After creating a connection, the Omniagent API deploys a listener and registers it with your SIP server. The status object tracks two independent states:

  1. lifecycleStatus โ€” whether the listener itself is deployed and running.
  2. sipStatus โ€” whether the listener has successfully registered with your SIP provider.

Both must be healthy for the agent to receive calls.

curl -X POST https://companion-api.napster.com/public/sip-connections/sipconn_abc123/status \
  -H "X-Api-Key: $NAPSTER_API_KEY"

Response:

{
  "status": {
    "lifecycleStatus": "Running",
    "sipStatus": "online",
    "message": null,
    "lastRefreshed": 1710000010
  },
  "created": 1710000005
}

Lifecycle status

Tracks whether the listener is deployed and running.

ValueDescription
PendingThe listener is being provisioned.
RunningThe listener is up and operational.
FailedThe listener failed to start. Check status.message for details.
ErrorThe listener encountered a runtime error. Check status.message for details.
UnknownThe state could not be determined.

SIP status

Tracks the SIP registration state. This is only relevant once lifecycleStatus is Running.

ValueDescription
registeringThe listener is running but has not yet registered with your SIP provider.
onlineRegistered and ready to receive calls.
callingRegistered and an active call is in progress.

Once lifecycleStatus is Running and sipStatus is online, your agent is live โ€” incoming calls to your SIP extension are answered by the companion.

Troubleshoot registration errors

If lifecycleStatus is Running but sipStatus stays on registering and never transitions to online, the listener is up but failing to register with your SIP provider. Use the errors endpoint to retrieve recent error logs for the connection.

curl https://companion-api.napster.com/public/sip-connections/sipconn_abc123/errors \
  -H "X-Api-Key: $NAPSTER_API_KEY"

Response:

[
  {
    "timestamp": "2025-03-10T12:00:05Z",
    "message": "SIP registration failed: 401 Unauthorized",
    "code": 401
  }
]
FieldTypeDescription
timestampstringWhen the error occurred.
messagestringA human-readable description of the error.
codeintegerThe error or SIP response code.

Common issues include incorrect credentials (401), unreachable server, or wrong transport protocol. Double-check the settings on your SIP Connection if registration fails.

Human handoff

The humanHandoff setting lets the agent transfer a call to a live person over SIP. When enabled, the agent can initiate a SIP transfer to the extension you specify.

Human handoff is configured on the SIP channel config (the same PUT call used during channel setup). You can include it when you first create the channel config, or add it later by updating the same endpoint:

curl -X PUT https://companion-api.napster.com/public/agents/agent_abc123/channels/sip \
  -H "X-Api-Key: $NAPSTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "humanHandoff": {
      "enabled": true,
      "transferExtension": "200"
    }
  }'
ParameterTypeRequiredDescription
humanHandoff.enabledbooleanNoSet to true to allow the agent to transfer calls.
humanHandoff.transferExtensionstringNoThe SIP extension to transfer the call to.

When enabled is true and a transferExtension is set, the agent can transfer the caller during the conversation.

Managing your agent

For listing, updating, and deleting agents and channel configs, see Managing Your Agent.

Managing SIP Connections

You can list, update, and delete your SIP connections:

# List all SIP connections
curl https://companion-api.napster.com/public/sip-connections \
  -H "X-Api-Key: $NAPSTER_API_KEY"

# Update a SIP connection
curl -X PATCH https://companion-api.napster.com/public/sip-connections/sipconn_abc123 \
  -H "X-Api-Key: $NAPSTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Support Line"
  }'

# Delete a SIP connection
curl -X DELETE https://companion-api.napster.com/public/sip-connections/sipconn_abc123 \
  -H "X-Api-Key: $NAPSTER_API_KEY"

Deleting a connection stops the listener and unregisters from your SIP server.

On this page