registerRoutingCallback
Register a callback for dynamic request routing. When a request arrives at
path, the callback inspects the POST body and decides whether to redirect the
request to a different route or let normal SWML serving continue.
This is primarily used for SIP-based routing where the destination depends on
the incoming SIP URI. For routing on agent name alone, use
enableSipRouting() instead.
Parameters
callback
Receives the parsed request body and, optionally, the request headers.
Return a route string to redirect the request there (HTTP 307, preserving
the POST body), or return null or undefined to serve this agent’s own
SWML.
path
HTTP path where the routing endpoint is registered. Normalized to start with
/, with trailing slashes stripped.
Returns
AgentBase — Returns this for method chaining.