2017-02-12 26 views
2

我试图在使用PJSIP的iOS应用程序中获取SRTP。我有TLS工作,没有SRTP我可以拨打和接听电话。但是,对于SRTP,我在INVITE上收到了这个奇怪的488错误。它无法初始化媒体。SRTP问题:PJSIP初始化媒体通道时出错:此处不可接受[status = 170488]

我读过关于编解码器的其他文章。但是我已经确保Asterisk服务器使用的代码和我的iOS应用程序使用PJSIP库编译的代码是相同的。我在这里看到的唯一的事情是我启用了加密并且PJSIP不喜欢它。有什么想法吗?

INVITE sip:[REDACTED]@[REDACTED]:47229;transport=TLS;ob SIP/2.0 

Via: SIP/2.0/TLS [REDACTED]:5161;rport;branch=z9hG4bKPj8ea1a332-0748-438f-ae74-5d17b038891d;alias 

From: "Test" <sip:[email protected]>;tag=7c3663cb-b5f5-4762-8526-8425d18b2466 

To: <sip:[REDACTED]@[REDACTED];ob> 

Contact: <sip:[email protected][REDACTED]:5161;transport=TLS> 

Call-ID: f454ef36-01ea-4f29-9482-4a10768bf1b7 

CSeq: 24942 INVITE 

Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER 

Supported: 100rel, timer, replaces, norefersub, path 

Session-Expires: 1800 

Min-SE: 90 

Max-Forwards: 70 

User-Agent: FPBX-AsteriskNOW-13.0.190.12(13.13.1) 

Content-Type: application/sdp 

Content-Length: 398 



v=0 

o=- 1582453973 1582453973 IN IP4 172.31.18.138 

s=Asterisk 

c=IN IP4 [REDACTED] 

t=0 0 

m=audio 11410 RTP/AVP 3 110 9 97 101 

a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:84m7hqGvMjTU21xzkhBS3RQpQQjJ+aep0VwSlhx+ 

a=rtpmap:3 GSM/8000 

a=rtpmap:110 speex/8000 

a=rtpmap:9 G722/8000 

a=rtpmap:97 iLBC/8000 

a=rtpmap:101 telephone-event/8000 

a=fmtp:101 0-16 

a=ptime:20 

a=maxptime:60 

a=sendrecv 


--end msg-- 
19:10:11.601 pjsua_call.c .Incoming Request msg INVITE/cseq=24942 (rdata0x1421f0540) 
19:10:11.603 tsx0x1421fe0a8 ...Transaction created for Request msg INVITE/cseq=24942 (rdata0x1421f0540) 
19:10:11.603 tsx0x1421fe0a8 ..Incoming Request msg INVITE/cseq=24942 (rdata0x1421f0540) in state Null 
19:10:11.603 tsx0x1421fe0a8 ...State changed from Null to Trying, event=RX_MSG 
19:10:11.603 dlg0x1421fd8a8 ....Transaction tsx0x1421fe0a8 state changed to Trying 
19:10:11.603 dlg0x1421fd8a8 ..UAS dialog created 
19:10:11.603 dlg0x1421fd8a8 ..Module mod-invite added as dialog usage, data=0x141de7588 
19:10:11.603 dlg0x1421fd8a8 ...Session count inc to 3 by mod-invite 
19:10:11.603 inv0x1421fd8a8 ..UAS invite session created for dialog dlg0x1421fd8a8 
19:10:11.603 dlg0x1421fd8a8 ...Session count inc to 3 by mod-pjsua 
19:10:11.603 pjsua_media.c ..Call 0: initializing media.. 
19:10:11.603 pjsua_call.c ..Error initializing media channel: Not Acceptable Here [status=170488] 
19:10:11.604  endpoint ..Response msg 488/INVITE/cseq=24942 (tdta0x1421fe800) created 
19:10:11.604 dlg0x1421fd8a8 ...Sending Response msg 488/INVITE/cseq=24942 (tdta0x1421fe800) 
19:10:11.606 tsx0x1421fe0a8 ...Sending Response msg 488/INVITE/cseq=24942 (tdta0x1421fe800) in state Trying 
19:10:11.606 pjsua_core.c ....TX 429 bytes Response msg 488/INVITE/cseq=24942 (tdta0x1421fe800) to TLS [REDACTED]:5161: 
SIP/2.0 488 Not Acceptable Here 

Via: SIP/2.0/TLS [REDACTED]:5161;rport=5161;received=[REDACTED];branch=z9hG4bKPj8ea1a332-0748-438f-ae74-5d17b038891d;alias 

Call-ID: f454ef36-01ea-4f29-9482-4a10768bf1b7 

From: "Test" <sip:[email protected]>;tag=7c3663cb-b5f5-4762-8526-8425d18b2466 

To: <sip:[REDACTED]@[REDACTED];ob>;tag=5oFGceZO4ZaKpLFEg7piOrM7IV2yeDLT 

CSeq: 24942 INVITE 

Content-Length: 0 




--end msg-- 

回答

1

万一有其他人有这个问题。我会告诉你为我解决了这个问题。

On myterisk in my endpoint(pjsip show endpoint myendpoint)setting我把media_encryption_optimistic设置为true。当我把这个设置为false一切开始工作。

我不知道为什么,如何在星号表示打开此项。但我确认在所有的流量确实使用wireshark检查实际的语音数据加密。

如果有人知道为什么会这样,这需要设置为false它会帮助我更好地理解这一点。但现在我已经起来跑步了。

0

488 /这里不能接受

我也得到我的服务器同样的问题,atlast我找到去了解,这是因为编解码器,使用权编解码器或 禁用编解码器解决方案 非常适合你。