近期在跟踪SIP问题,顺道把各个业务流程记录于此,方便后续查阅.

  • SIPA - SIP客户端A
  • SIPB - SIP客户端B
  • SERVER - SIP服务器

注册注销流程

SIPA                          SERVER
 |                               |
 |                               |
 |   --------REGISTER------->    |
 |                               |
 |   <---------401-----------    |
 |                               |
 |                               |
 |   -----REGISTER(Auth)---->    |
 |                               |
 |   <-----------OK----------    |
 |                               |
 |                               |

呼叫流程

SIPA                          SERVER                           SIPB
 |                               |                              |
 |                               |                              |
 |   ---------INVITE-------->    |                              |
 |                               |                              |
 |   <---------Trying--------    |                              |
 |                               |   ---------INVITE-------->   |
 |                               |                              |
 |                               |   <---------Trying--------   |
 |                               |                              |
 |                               |                              |
 |                               |                              |
 |                               |   <---------Ringing-------   |
 |   <---------Ringing-------    |                              |
 |                               |                              |
 |                               |   <-----------OK----------   |
 |   <-----------OK----------    |                              |
 |                               |                              |
 |   -----------ACK--------->    |                              |
 |                               |   -----------ACK--------->   |
 |                               |                              |
 |                               |                              |

变更会话(如切换音视频等)

SIPA                          SERVER                           SIPB
 |                               |                              |
 |                               |                              |
 |   ---------INVITE-------->    |                              |
 |                               |                              |
 |   <---------Trying--------    |                              |
 |                               |   ---------INVITE-------->   |
 |                               |                              |
 |                               |   <---------Trying--------   |
 |                               |                              |
 |                               |                              |
 |                               |   <-----------OK----------   |
 |   <-----------OK----------    |                              |
 |                               |                              |
 |   -----------ACK--------->    |                              |
 |                               |   -----------ACK--------->   |
 |                               |                              |
 |                               |                              |

挂断

SIPA                          SERVER                           SIPB
 |                               |                              |
 |                               |                              |
 |   ----------BYE---------->    |                              |
 |                               |   ----------BYE---------->   |
 |                               |                              |
 |                               |   <-----------OK----------   |
 |   <-----------OK----------    |                              |
 |                               |                              |
 |                               |                              |