sippy/b2bua ? reverse-engineered prompt
Reverse engineered prompt
Build me a Python SIP back to back user agent that follows RFC3261 and can sit between callers and a SIP gateway or switch. I want it to handle full call state, forward call legs, and be able to show the SIP messages while running in a simple foreground mode so I can test it easily. It should support lots of simultaneous calls, generate call records, and make it easy to plug in optional media relay and AAA features later if needed.
Please include a small working example I can run right away, clear setup instructions, and basic tests. If there are any current library or protocol details you need to check, look up the latest docs online. Keep the code clean and flexible so it could be used as the base for a real softswitch style service, and make sure it can also work with secure websocket clients for WebRTC style calling if that fits naturally.
Are you gonna build this?
make sure you review the code using coderabbit