Skip to content

didww/ai / skills/didww-to-ultravox

didww-to-ultravox

Verified

Connect a DIDWW phone number to an Ultravox Realtime voice agent over SIP. Use whenever the user wants an Ultravox agent on a real phone number via DIDWW, mentions pairing DIDWW with Ultravox, an account SIP domain, agent_ addresses, allowedCidrRanges, or debugging calls between the two. Covers the address-based routing model that makes Ultravox different from every number-import platform.

FileKindSize
.npmignoreother66 B
LICENSEother1.1 KB
README.mdmarkdown1.3 KB
SKILL.mdskill md5.9 KB
bin/install.jsexecutablescript5.3 KB
install.shexecutablescript1.0 KB
package.jsonmanifest833 B
publish.shexecutablescript604 B
scripts/connect.pyscript5.7 KB
test.shexecutablescript488 B
tests/test_connect.pyscript6.3 KB

tests/test_connect.py

View on GitHub
#!/usr/bin/env python3
"""Request-shape tests for scripts/connect.py (stubbed HTTP)."""
import contextlib, io, json, os, runpy, sys, urllib.error, urllib.request
sys.dont_write_bytecode = True
P = sys.argv[1] if len(sys.argv) > 1 else os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "scripts", "connect.py")
results = []
def check(name, ok, detail=""):
    results.append(bool(ok)); print(f"{'PASS' if ok else 'FAIL'}  {name}  {detail}")
def run_script(argv, env, canned, fail=None):
    """Run the script with stubbed HTTP; return (captured requests, output, exit code)."""
    reqs = []
    class R:
        def __init__(s, d): s.d = json.dumps(d).encode()
        def read(s): return s.d
        def __enter__(s): return s
        def __exit__(s, *a): pass
    def fake_urlopen(req, timeout=None):
        reqs.append({"url": req.full_url, "method": req.get_method(), "headers": {k.lower(): v for k, v in req.header_items()}, "body": json.loads(req.data) if req.data else None})
        if fail: raise urllib.error.HTTPError(req.full_url, fail, "err", {}, io.BytesIO(b'{"error":"stubbed failure"}'))
        return R(canned)
    old_env, old_argv, old_open = dict(os.environ), sys.argv, urllib.request.urlopen
    os.environ.update(env); sys.argv = [P] + argv; urllib.request.urlopen = fake_urlopen
    out = io.StringIO(); code = 0
    try:
        with contextlib.redirect_stdout(out), contextlib.redirect_stderr(out): runpy.run_path(P, run_name="__main__")
    except SystemExit as e:  # sys.exit("msg") prints msg only at interpreter exit; mirror that
        code = e.code if isinstance(e.code, int) else (0 if e.code is None else 1)
        if isinstance(e.code, str): out.write(e.code + "\n")
    finally:
        urllib.request.urlopen = old_open; sys.argv = old_argv; os.environ.clear(); os.environ.update(old_env)
    return reqs, out.getvalue(), code

SIP = {"domain": "acct.sip.ultravox.ai", "allowedCidrRanges": ["1.2.3.0/24"], "fallbackHandler": {"url": "https://h/route", "secrets": ["SECRET123"]}}
AID = "3f2b6c1e-8a4d-4e2f-9b7a-1c2d3e4f5a6b"
reqs, out, code = run_script(["--help"], {"ULTRAVOX_API_KEY": "k"}, SIP)
check("--help exits 0 without calling the API", code == 0 and not reqs and "Usage" in out)
reqs, out, code = run_script(["--show"], {"ULTRAVOX_API_KEY": "k"}, SIP)
check("--show: one GET /api/sip with X-API-Key, prints the SIP domain, no PATCH", [(r["method"], r["url"]) for r in reqs] == [("GET", "https://api.ultravox.ai/api/sip")] and reqs[0]["headers"].get("x-api-key") == "k" and "acct.sip.ultravox.ai" in out and code == 0, [(r["method"], r["url"]) for r in reqs])
reqs, out, code = run_script(["--allow-cidr", "1.2.3.0/24", "--allow-cidr", "5.6.7.8/32", "--fallback-url", "https://h/route", "--allow-all-agents"], {"ULTRAVOX_API_KEY": "k"}, SIP)
p = reqs[1]["body"] if len(reqs) > 1 else {}
check("flags become one PATCH /api/sip with allowedCidrRanges, fallbackHandler{url}, allowAllAgents", len(reqs) == 2 and reqs[1]["method"] == "PATCH" and p.get("allowedCidrRanges") == ["1.2.3.0/24", "5.6.7.8/32"] and p.get("fallbackHandler") == {"url": "https://h/route"} and p.get("allowAllAgents") is True, json.dumps(p))
check("prints the agent_<id>@domain address shape", "agent_{agent_id}@acct.sip.ultravox.ai" in out)
reqs, out, code = run_script(["--show"], {"ULTRAVOX_API_KEY": "k"}, SIP)
check("--show redacts the fallback handler's signing secret", "SECRET123" not in out and "***" in out)
reqs, out, code = run_script(["--fallback-url", "https://h/route"], {"ULTRAVOX_API_KEY": "k"}, SIP)
check("update output redacts the generated secret too", "SECRET123" not in out and "--show-secrets" in out, out[-200:])
reqs, out, code = run_script(["--show", "--show-secrets"], {"ULTRAVOX_API_KEY": "k"}, SIP)
check("--show --show-secrets reveals it on request", "SECRET123" in out)
reqs, out, code = run_script(["--allow-agent", AID, "--allow-agent", AID.upper() + "=^\\+?33144556677$"], {"ULTRAVOX_API_KEY": "k"}, SIP)
p = reqs[1]["body"] if len(reqs) > 1 else {}
check("--allow-agent builds AgentAllowance objects {agentId, toUserPattern?}", p.get("allowedAgents") == [{"agentId": AID}, {"agentId": AID.upper(), "toUserPattern": "^\\+?33144556677$"}], json.dumps(p))
reqs, out, code = run_script(["--allow-agent", "agent_.*"], {"ULTRAVOX_API_KEY": "k"}, SIP)
check("--allow-agent with a non-UUID is refused before any API call", code != 0 and not reqs and "UUID" in out)
reqs, out, code = run_script(["--allow-didww"], {"ULTRAVOX_API_KEY": "k"}, SIP)
p = reqs[1]["body"] if len(reqs) > 1 else {}
check("--allow-didww sets DIDWW's signaling/media ranges", p.get("allowedCidrRanges") == ["46.19.208.0/21", "185.238.172.0/22"], json.dumps(p))
reqs, out, code = run_script(["--allow-cidr", "2a01:ad00::/32"], {"ULTRAVOX_API_KEY": "k"}, SIP)
check("IPv6 or malformed CIDR refused before any API call", code != 0 and not reqs)
reqs, out, code = run_script(["--allow-cidr"], {"ULTRAVOX_API_KEY": "k"}, SIP)
check("flag missing its value: clean error, no traceback, no API call", code != 0 and not reqs and "needs a value" in out and "Traceback" not in out)
reqs, out, code = run_script(["--allow-cdir", "1.2.3.0/24"], {"ULTRAVOX_API_KEY": "k"}, SIP)
check("misspelt flag is refused instead of silently ignored", code != 0 and not reqs and "Unknown argument" in out)
reqs, out, code = run_script(["--fallback-url", "http://h/route"], {"ULTRAVOX_API_KEY": "k"}, SIP)
check("plain http fallback URL refused", code != 0 and not reqs)
reqs, out, code = run_script(["--allow-all-agents"], {"ULTRAVOX_API_KEY": "k"}, dict(SIP, allowedCidrRanges=[]))
check("warns when allowedCidrRanges stays empty (DIDWW's calls not accepted)", "WARNING: allowedCidrRanges is empty" in out and "not accepted" in out)
reqs, out, code = run_script(["--allow-cidr", "0.0.0.0/0"], {"ULTRAVOX_API_KEY": "k"}, SIP)
check("--allow-cidr 0.0.0.0/0 refused", code != 0 and not reqs)
reqs, out, code = run_script(["--allow-all-agents"], {"ULTRAVOX_API_KEY": "k"}, dict(SIP, allowedCidrRanges=["0.0.0.0/0"]))
check("warns when the account already allows 0.0.0.0/0", "0.0.0.0/0" in out and "WARNING" in out)
reqs, out, code = run_script([], {"ULTRAVOX_API_KEY": "k"}, SIP)
check("no flags: reads, then refuses to PATCH nothing", code != 0 and len(reqs) == 1 and "Nothing to change" in out)
reqs, out, code = run_script(["--show"], {}, SIP)
check("refuses without ULTRAVOX_API_KEY", code != 0 and not reqs)

print(f"\n{sum(results)}/{len(results)} passed"); sys.exit(0 if all(results) else 1)
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall