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

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

To register specific usernames instead, use register_sip_username():

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