SIP是否提供了启动stream并返回错误的机制?

想象一下,你正在浏览一个不存在的HTTP URL。 你会得到一个经常包含解释体的404。

现在想象一下,您正在使用SIP拨打VoIP,并使用不存在的收件人。 是否有可能返回一个错误,并build立一个说明audio消息的RTPstream?

是的,如果你在https://www.ietf.org/rfc/rfc3261.txt查看RFC,它就可以解释如何做到这一点。

20.18错误信息

Error-Info头域提供了一个指向错误状态响应的附加信息的指针。

SIP UACs have user interface capabilities ranging from pop-up windows and audio on PC softclients to audio-only on "black" phones or endpoints connected via gateways. Rather than forcing a server generating an error to choose between sending an error status code with a detailed reason phrase and playing an audio recording, the Error-Info header field allows both to be sent. The UAC then has the choice of which error indicator to render to the caller. 

UAC可以将Error-Info头域中的SIP或SIPS URI视为redirect中的联系人,并生成新的INVITE,从而导致录制的通告会话正在build立。 非SIP URI可以被呈现给用户。

例子:

  SIP/2.0 404 The number you have dialed is not in service Error-Info: <sip:[email protected]> 

因此,客户端将在SIP响应中接收到404,并且将被告知连接到sip:[email protected]的消息。