AgentsAgentBase

auto_map_sip_usernames

View as MarkdownOpen in Claude

Automatically register SIP usernames based on the agent’s name and route properties. This is a convenience method that derives common username variations so callers can reach the agent via SIP without manual registration.

The method registers:

  • A lowercase, alphanumeric version of the agent name (e.g., "support")
  • A lowercase, alphanumeric version of the route (e.g., "sales")
  • A vowel-removed abbreviation of the name when it is longer than 3 characters

enable_sip_routing() calls this method automatically when auto_map=True (the default). You only need to call auto_map_sip_usernames() directly if you disabled auto-mapping and want to trigger it later.

Parameters

None.

Returns

AgentBase — Returns self for method chaining.

Example

from signalwire import AgentBase
agent = AgentBase(name="Support Agent", route="/support")
agent.set_prompt_text("You are a support assistant.")
agent.enable_sip_routing(auto_map=False)
agent.auto_map_sip_usernames()
# Registers: "supportagent", "support", "spprtgnt"
agent.serve()

To register specific usernames instead, use register_sip_username():

agent.enable_sip_routing(auto_map=False)
agent.register_sip_username("helpdesk")
agent.register_sip_username("support")