Writing scenarios with Claude
Claude, the AI assistant of Anthropic, can write a scenario from a description of the call flow, for example a client that registers with authentication, calls 2000, sends the digits 1234 and hangs up after 20 seconds. The program comes with a skill that teaches Claude the scenario format, the keywords and the sample scenarios. With it Claude starts from the sample closest to the request, writes the scenario and its header comment, checks it, and when it is asked for both sides, plays them against each other on this computer before it hands them over. Claude is a separate product: it needs an account at claude.ai, and SIP Inspector does not send anything to it.
| Where | What is installed | How to use it |
|---|---|---|
| Claude Code (command line) | .claude/skills/sip-inspector-scenarios in the program folder | Open a terminal in the program folder, start claude and describe the scenario. The skill is found by itself. |
| claude.ai (browser, desktop app) | sip-inspector-scenarios.skill in the program folder | Settings/Capabilities: turn on code execution, then upload the file under Skills. Attach the closest sample scenario to the chat. |
In Claude Code the skill uses the folder of the program: it reads the samples in scenarios, saves the new scenario there and can run the CLI to test it, so the program folder must be one that the user can write to. In claude.ai Claude cannot see the program, so it checks the scenario but cannot run it; run it with the CLI or the GUI.
The skill has two scripts that can also be used without Claude (Python 3, nothing else to install):
python3 .claude/skills/sip-inspector-scenarios/scripts/check_scenario.py scenarios/my_call.txt
python3 .claude/skills/sip-inspector-scenarios/scripts/loopback_test.py --root . \
--server Reg_call_server.txt --client Reg_call_client.txt
- check_scenario.py reads a scenario as the program does and reports what would be ignored or refused (a block with two commands, a goto without its label, an assertion that cannot be read) and what the other side would likely reject (no tag in From, a CSeq with the wrong method, a body without Content-Length: [len], an SDP without an a=rtpmap).
--outlineprints the call flow. - loopback_test.py starts the server scenario, plays the client scenario against it on 127.0.0.1 and reports PASS or FAIL for both sides. It needs the registered CLI.
--pause-ms 2000shortens the pauses for a quick run.