SIP消息分为两种,request与response,SIP消息无论是request还是response在格式上是相同的,格式为:
generic-message: start-line
*message-header
CRLF
[message-body]
start-line = request-line/response-line
request消息与response消息的关键区别在于start-line上。
request-line
request-line = method sp request-uri sp sip-version CRLF
method:
sip规范定义了六种method:registration用来向服务器注册的消息,invite、ack、cancel用来创建会话的消息,bye用来结束会话的消息,options用来查询服务器性能的消息。