码迷,mamicode.com
首页 > 其他好文 > 详细

无条件前传

时间:2015-05-19 13:09:08      阅读:311      评论:0      收藏:0      [点我收藏+]

标签:作者qq 鸣人370905569   sip   

该项服务允许一个用户对于他的呼入呼叫可以转到另一个号码。使用该业务时对该用户号码的所有呼叫,不管被叫用户是在什么状态,都自动转到一个预先指定的号码

例如:用户3000设置无条件前传3001;用户2000呼叫3000,此时3001振铃,显示主叫号码2000。详细消息流程如下:


A (2000)          IPBX               C(3001)

|----invite(3000)-->------|------invite(3001)--->-----|

|----<--200OK -------------|----<--200OK---------------|

|----------ACK--->----------|-----------ACK-->------------|

|------------RTP-------------|------------RTP---------------|


 

(1)    A(2000)呼叫B(3000)

(2)    用户A的invite请求到底IPBX,IPBX对被叫号码3000进行分析

(3)    被叫号码3000设置无条件前传号码3001

(4)    IPBX转发invite请求给用户3001

(5)    被叫3001摘机,并回复200OK消息给IPBX

(6)    IPBX收到200OK,并转发给主叫方

(7)    主叫方收到200OK,回复确认消息ACK

(8)    IPBX转发ACK确认消息给用户C

 

 

主叫方2000呼叫用户3000

INVITEsip:3000@172.161.10.8:5060;transport=udp SIP/2.0

Via: SIP/2.0/UDP172.161.10.79:5060;rport;branch=z9hG4bK664046211

From: "2000"<sip:2000@172.161.10.8:5060;user=phone>;tag=1696473636

To: <sip:3000@172.161.10.8>

Call-ID: 742673760@172.161.10.79:5060

CSeq: 38 INVITE

Contact:<sip:2000@172.161.10.79:5060>

Max-Forwards: 30

Allow: INVITE, ACK, BYE, CANCEL, OPTIONS,NOTIFY, REFER, REGISTER, MESSAGE

Content-Type: application/sdp

Content-Length:   295

 

v=0

o=ower 1376039693 1376039693 IN IP4172.161.10.79

s= ower

c=IN IP4 172.161.10.79

t=0 0

m=audio 62830 RTP/AVP 0 8 18 3 4 101

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:18 G729/8000

a=rtpmap:3 GSM/8000

a=rtpmap:4 G723/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-15

 

 

IPBX收到主叫方的呼叫请求,并分析被叫号码3000,发现被叫码号3000设置无条件前传号码3001;IPBX发送呼叫请求给被叫号码3001

INVITE sip:3001@172.161.10.3 SIP/2.0

Via: SIP/2.0/UDP172.161.10.8:5060;branch=z9hG4bK77f8c784

Supported: 100rel

Allow: INVITE, ACK, CANCEL, BYE, UPDATE,REFER, PRACK, REGISTER, INFO

From: "2000"<sip:2000@172.161.10.3>;tag=0b2a58bb

Contact: <sip:2000@172.161.10.8:5060>

To: <sip:3001@172.161.10.3>

Call-ID:1376039727002cc015416297db@172.161.10.8

CSeq: 1435 INVITE

Max-Forwards: 70

Supported: timer

Session-Expires: 90

Content-Type: application/sdp

Content-Length: 308

 

v=0

o=root 2012792708 2012792709 IN IP4172.161.10.8

s=session

c=IN IP4 172.161.10.8

t=0 0

m=audio 15920 RTP/AVP 0 8 18 3 4 101

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:18 G729/8000

a=rtpmap:3 GSM/8000

a=rtpmap:4 G723/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=ptime:10

 

3001收到IPBX发送的呼叫请求,摘机后向IPBX发送200OK

SIP/2.0 200 OK

Via: SIP/2.0/UDP172.161.10.8:5060;branch=z9hG4bK77f8c784

From: "2000"<sip:2000@172.161.10.3>;tag=0b2a58bb

To:<sip:3001@172.161.10.3>;tag=310e43c7c

Call-ID:1376039727002cc015416297db@172.161.10.8

CSeq: 1435 INVITE

Contact: <sip:3001@172.161.10.3:5060>

Content-Type: application/sdp

Content-Length: 199

 

v=0

o=root 1426816092 1426816092 IN IP4172.161.10.3

s=session

c=IN IP4 172.161.10.3

t=0 0

m=audio 15530 RTP/AVP 0 101

a=rtpmap:0 PCMU/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

 

IPBX收到被叫方发送的摘机响应后,并转发200OK响应给主叫方

SIP/2.0 200 OK

Via: SIP/2.0/UDP172.161.10.79:5060;rport;branch=z9hG4bK664046211

From: "2000"<sip:2000@172.161.10.8:5060;user=phone>;tag=1696473636

To:<sip:3000@172.161.10.8>;tag=7e5f4f914

Call-ID: 742673760@172.161.10.79:5060

CSeq: 38 INVITE

Contact: <sip:3000@172.161.10.8:5060>

Content-Type: application/sdp

Content-Length: 211

 

v=0

o=root 1410984694 1410984694 IN IP4172.161.10.8

s=session

c=IN IP4 172.161.10.8

t=0 0

m=audio 10276 RTP/AVP 0 101

a=rtpmap:0 PCMU/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=ptime:10

 

主叫方2000收到IPBX发送的摘机响应后,回复确认消息ACK给IPBX

ACK sip:3000@172.161.10.8:5060 SIP/2.0

Via: SIP/2.0/UDP172.161.10.79:5060;branch=z9hG4bK57319558

From: "2000"<sip:80001@172.161.10.8:5060;user=phone>;tag=1696473636

To: <sip:3000@172.161.10.8>;tag=7e5f4f914

Call-ID: 742673760@172.161.10.79:5060

CSeq: 38 ACK

Max-Forwards: 30

Content-Length: 0

 

 

IPBX收到主叫方发送的摘机确认消息ACK,并转发给被叫方,至此通话建立成功,可以进行语音通话

ACK sip:3001@172.161.10.3:5060 SIP/2.0

Via: SIP/2.0/UDP172.161.10.8:5060;branch=z9hG4bK77f8c784

From: "2000"<sip:2000@172.161.10.3>;tag=0b2a58bb

To: <sip:3001@172.161.10.3>;tag=310e43c7c

Call-ID:1376039727002cc015416297db@172.161.10.8

CSeq: 1435 ACK

Max-Forwards: 70

Content-Length: 0

 


无条件前传

标签:作者qq 鸣人370905569   sip   

原文地址:http://blog.csdn.net/wh8_2011/article/details/45842153

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!