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

IPBX和话机对接

时间:2017-07-30 15:50:54      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:length   0.12   mod   发送   配置   分析   class   nbsp   没有   

某厂家的话机和IPBX进行对接问题:

1.      该话机作为主叫方,呼叫能够正常建立

2.      该话机作为被叫方。呼叫无法建立,IPBX发送INVITE消息给该话机,该话机回复400

具体消息例如以下:

IPBX->P1

INVITEsip:302@172.16.251.157 SIP/2.0

Via:SIP/2.0/UDP 172.16.250.127:5060;branch=4694cb8a

From:"301" <sip:301@172.16.250.127>;tag=288bc0ba

Contact:<sip:301@172.16.250.127:5060>

To:<sip:302@172.16.251.157>

Call-ID:14391754550e6c0a8658dc0efb4864da89@7ffa10ac

CSeq:2200 INVITE

Max-Forwards:70

Content-Type:application/sdp

Content-Length:319

 

v=0

o=root1184156554 1184156554 IN IP4 172.16.250.127

s=session

c=IN IP4172.16.250.127

t=0 0

m=audio25118 RTP/AVP 0 8 18 101

a=rtpmap:0PCMU/8000

a=rtpmap:8PCMA/8000

a=rtpmap:18G729/8000

a=rtpmap:101telephone-event/8000

a=fmtp:1010-15

 

P1->IPBX

SIP/2.0 400 Bad Request

Via: SIP/2.0/UDP 172.16.250.127:5060;branch=4694cb8a

From: "301"<sip:301@172.16.250.127>;tag=288bc0ba

Contact:<sip:301@172.16.250.127:5060>

To: <sip:302@172.16.251.157>

Call-ID:14391754550e6c0a8658dc0efb4864da89@7ffa10ac

CSeq: 2200 INVITE

Max-Forwards: 70

Content-Type: application/sdp

Content-Length: 319

 

v=0

o=root 1184156554 1184156554 IN IP4172.16.250.127

s=session

c=IN IP4 172.16.250.127

t=0 0

m=audio 25118 RTP/AVP 0 8 18 101

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:18 G729/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-15

 

依据如上消息进行分析branch=4694cb8a没有添加z9hG4bK值(该值的添加设置到事物的处理详见事物处理),因此推断IPBX支持的是RFC2543协议,话机支持的是RFC3261协议。

具体处理过程例如以下:

1. 依据上述的分析,查看话机是否支持RFC2543协议

2. 查看话机配置页,发现有RFC2543和RFC3261协议选项,因此,选择RFC2543重新启动话机

3. 话机重新启动后。发现作为被叫呼叫还是建立不起来

4. 在IPBX上的branch简单添加z9hG4bK值后,呼叫正常建立

5. 从以上分析发现,该厂商的话机仅仅是简单的推断branch中是否存在z9hG4bK值,没有严格的依照RFC3261协议中的事物来进行处理

6. 到此。和该话机对接成功。成功的消息详见以下

 

IPBX->P1

INVITE sip:8501@172.16.251.157:5060 SIP/2.0

Via: SIP/2.0/UDP172.16.250.191:5060;branch=z9hG4bK1c1ac64a;rport

Max-Forwards: 70

From: " 8500"<sip:8500@172.16.250.191>;tag=as76dfef91

To: <sip:8501@172.16.251.157:5060>

Contact:<sip:8500@172.16.250.191:5060>

Call-ID: 4b99a0636512f93430c4e9dd58fa9832@172.16.250.191:5060

CSeq: 102 INVITE

Content-Type: application/sdp

Content-Length: 233

 

v=0

o=root 628132733 628132733 IN IP4172.16.250.191

s=BPBX 2.0.0.0

c=IN IP4 172.16.250.191

t=0 0

m=audio 18088 RTP/AVP 8 101

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000

 

P1->IPBX

SIP/2.0 200 OK

Via: SIP/2.0/UDP172.16.250.191:5060;branch=z9hG4bK1c1ac64a;rport

From: " 8500"<sip:8500@172.16.250.191>;tag=as76dfef91

To:<sip:8501@172.16.251.157:5060>;tag=169336615

Call-ID: 4b99a0636512f93430c4e9dd58fa9832@172.16.250.191:5060

CSeq: 102 INVITE

Contact:<sip:8501@172.16.251.157:5060>

Content-Type: application/sdp

Content-Length: 217

 

v=0

o=802 30033847 10069422 IN IP4172.16.251.157

s=AC

c=IN IP4 172.16.251.157

t=0 0

m=audio 10028 RTP/AVP 8 101

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-15

a=ptime:20

a=sendrecv

IPBX和话机对接

标签:length   0.12   mod   发送   配置   分析   class   nbsp   没有   

原文地址:http://www.cnblogs.com/wzjhoutai/p/7259154.html

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