sip入门(5)

2019-03-16 19:35

NOTIFY sip:pafnuty@lecturehall21.academy.ru SIP/2.0

Via SIP/2.0/TCP dist.probablilty.org:5060;branch=z9hG4bK4321 Max-Forwards: 70

To: P. L. Chebychev ;tag=21171 From: M. Poisson ;tag=25140 Call-ID: 58dkfj34924lk34452k592520 CSeq: 1026 NOTIFY

Allow: ACK, INVITE, CANCEL, BYE, NOTIFY, SUBSCRIBE, MESSAGE Allow-Events: dialog

Contact: Subscription-State: active;expires=3600 Event: presence

Content-Type: application/cpim-pidf+xml Content-Length: 244

closed

Chebychev 发送 200 OK 响应 NOTIFY SIP/2.0 200 OK

Via SIP/2.0/TCP dist.probablilty.org:5060 ;branch=z9hG4bK4321;received=24.32.1.3

To: P. L. Chebychev ;tag=21171 From: M. Poisson ;tag=25140 Call-ID: 58dkfj34924lk34452k592520 CSeq: 1026 NOTIFY Content-Length: 0

之后,当 Poisson 登陆后,再次发送 NOTIFY 消息

NOTIFY sip:pafnuty@lecturehall21.academy.ru SIP/2.0

Via SIP/2.0/TCP dist.probablilty.org:5060;branch=z9hG4bK334241 Max-Forwards: 70

To: P. L. Chebychev ;tag=21171 From: M. Poisson ;tag=25140 Call-ID: 58dkfj34924lk34452k592520 CSeq: 1027 NOTIFY

Allow: ACK, INVITE, CANCEL, BYE, NOTIFY, SUBSCRIBE, MESSAGE Allow-Events: presence

Contact: Subscription-State: active;expires=1800 Event: presence

Content-Type: application/cpim-pidf+xml Content-Length: 325

open

sip:s.possion@dist.probability.org;transport=tcp

Chebychev 发 200 OK 确认 SIP/2.0 200 OK

Via SIP/2.0/TCP dist.probablilty.org:5060 ;branch=z9hG4bK334241;received=24.32.1.3

To: P. L. Chebychev ;tag=21171 From: M. Poisson ;tag=25140 Call-ID: 58dkfj34924lk34452k592520 CSeq: 1027 NOTIFY Content-Length: 0

现在 Chebychev 已经知道 Possion 在线了,开始发送及时消息。 MESSAGE sip:s.possion@dist.probability.org SIP/2.0

Via SIP/2.0/TCP lecturehall21.academy.ru:5060;branch=z9hG4bK3gtr2 Max-Forwards: 70

To: M. Poisson

From: P. L. Chebychev ;tag=4542 Call-ID: 9dkei93vjq1ei3 CSeq: 15 MESSAGE

Allow: ACK, INVITE, CANCEL, BYE, NOTIFY, SUBSCRIBE, MESSAGE Content-Type: text/plain Content-Length: 9

Hi There!

注意到这里,MESSAGE 是独立与会话的,它不属于任何会话。每个消息都含有一个新的 Call-ID 和 From tag。200 OK 用来确认收到该信息。 SIP/2.0 200 OK Via SIP/2.0/TCP

lecturehall21.academy.ru:5060;branch=z9hG4bK3gtr2;received=19.34.3.1 To: M. Poisson ;tag=2321 From: P. L. Chebychev ;tag=4542 Call-ID: 9dkei93vjq1ei3 CSeq: 15 MESSAGE Content-Length: 0 Possion 开始回复消息

MESSAGE sip:chebychev@academy.ru SIP/2.0

Via SIP/2.0/TCP dist.probablilty.org:5060;branch=z9hG4bK4526245 Max-Forwards: 70

To: P. L. Chebychev

From: M. Poisson ;tag=14083 Call-ID: lk34452k592520 CSeq: 2321 MESSAGE

Allow: ACK, INVITE, CANCEL, BYE, NOTIFY, SUBSCRIBE, MESSAGE Content-Type: text/plain Content-Length: 30

Well, hello there to you, too! 收到消息后,发 200 OK SIP/2.0 200 OK Via SIP/2.0/TCP

dist.probablilty.org:5060;branch=z9hG4bK4526245;received=24.32.1.3 To: P. L. Chebychev ;tag=mc3bg5q77wms From: M. Poisson ;tag=14083 Call-ID: lk34452k592520 CSeq: 2321 MESSAGE Content-Length: 0

SIP 编程开发介绍

我们的系统是建立在 Trillium TAPA 架构之上的,有关 TAPA 架构请参阅相关文档,这里就不具体介绍了。今天我们的任务是学习如何建立 SIP 网络构架,也就是如何编程开发。

SIP 协议是独立于下层协议的传输机制。它可以通过 TCP 传,也可以通过 UDP 传。它自己本身提供了一套可靠方案,而使用 UDP 允许将 SIP 消息做为广播形式发送。 SIP 网络主要由两个组件组成:

? ?

用户代理 (User Agent - UA) 网络服务 (Network Server - NS)

下面是一段关于两组件的英文说明,比较容易读懂。 User Agent

A SIP user agent is an entity capable of initiating and terminating calls. It consists of a SIP protocol client ( the User Agent Client - UAC ), and a SIP protocol server ( the User Agent Server - UAS ). The UAC initiates and sends SIP requests to a SIP server. The UAS returns responses to SIP requests received on behalf of a physical user. It may accept, redirect, or refuse a call. NetWork Server

A network server is forwarding entity in the network. A Network server can be a proxy, redirect, or a registrar server, or a combination of these.

A proxy server receives a request, determines which possible server(s) to send it to, and then forwards or services the request. It acts as an intermediate routing entity that receives requests and forwards them after suitable modifications. Other functions of the proxy may include call supplementary services, policy enforcement and record keeping, authentication and authorization, and firewall or NAT traversal support.

A redirect server receives a request, resolves the received address into one or more new addresses, and returns these addresses to the client. It does not initiate SIP requests or accept calls.

A registrar server records and maintains a database of SIP addresses associated with SIP endpoints and provides an address translation service to redirect and proxy servers. It is typically co-located with either a proxy or a redirect server. However, a stand-alone registrar implementation is also possible.


sip入门(5).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:DAC曲线

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: