See https://github.com/eisenzopf/bridgefu (which depends on rvoip it seems)
It looks like you're pretty much spot on.