488 Not Acceptable Here-SDP加密未解密问题
问题描述
外呼呼叫失败,返回 488 Not Acceptable Here 错误。
错误现象
FreeSWITCH日志分析
1 2 3 4 5 6 7 8 9 10 11
| 2026-03-31 10:37:30.834935 89.60% [DEBUG] sofia.c:7547 Channel sofia/external/80000001@192.168.254.55:18627 entering state [ready][200] 2026-03-31 10:37:30.834935 89.60% [DEBUG] switch_core_media.c:5652 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[PCMA:8:8000:20:64000:1] 2026-03-31 10:37:30.834935 89.60% [DEBUG] switch_core_media.c:5707 Audio Codec Compare [PCMA:8:8000:20:64000:1] ++++ is saved as a match ... 2026-03-31 10:37:30.834935 89.60% [DEBUG] switch_core_media.c:4346 Save audio Candidate cid: 1 proto: udp type: host addr: 192.168.206.1:58589 2026-03-31 10:37:30.834935 89.60% [DEBUG] switch_core_media.c:4346 Save audio Candidate cid: 1 proto: udp type: host addr: 192.168.232.223:58590 2026-03-31 10:37:30.834935 89.60% [DEBUG] switch_core_media.c:4346 Save audio Candidate cid: 1 proto: udp type: host addr: 192.168.44.1:58591 2026-03-31 10:37:30.834935 89.60% [DEBUG] switch_core_media.c:4444 sofia/internal/13900000008@crm.example.internal no suitable candidates found. 2026-03-31 10:37:30.834935 89.60% [NOTICE] switch_channel.c:3993 Hangup sofia/internal/13900000008@crm.example.internal [CS_EXECUTE] [INCOMPATIBLE_DESTINATION] 2026-03-31 10:37:30.834935 89.60% [DEBUG] switch_ivr_originate.c:3848 sofia/internal/13900000008@crm.example.internal Media Establishment Failed. 2026-03-31 10:37:30.834935 89.60% [NOTICE] switch_ivr_originate.c:3850 Hangup sofia/external/80000001@192.168.254.55:18627 [CS_CONSUME_MEDIA] [INCOMPATIBLE_DESTINATION]
|
INVITE 信令详情
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| INVITE sip:8881090@webrtc.example.internal SIP/2.0 Route: <sip:192.168.254.222;transport=ws;lr> Via: SIP/2.0/WSS webrtc.example.internal;branch=z9hG4bK7777967 Max-Forwards: 69 To: <sip:8881090@webrtc.example.internal> From: <sip:1811118080@webrtc.example.internal>;tag=8rtdllh7m5 Call-ID: giegu8ab3jro7b6gekrr CSeq: 8504 INVITE Contact: <sip:1811118080@webrtc.example.internal;transport=ws;ob;ob> Content-Type: application/sdp Session-Expires: 180 Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY Supported: timer,ice,replaces,outbound User-Agent: sipTest 1.0.1 Content-Length: 1395
v=0 o=- 5585731218338766882 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE 0 a=extmap-allow-mixed a=msid-semantic: WMS ef606e66-725c-423a-8192-158b67ffc33f m=audio 50758 UDP/TLS/RTP/SAVPF 8 111 63 13 110 126 c=IN IP4 192.168.236.11 a=rtcp:9 IN IP4 0.0.0.0 a=candidate:1894424415 1 udp 2113937151 192.168.236.11 50758 typ host generation 0 network-cost 999 a=ice-ufrag:REDACTED a=ice-pwd:REDACTED a=ice-options:trickle a=fingerprint:sha-256 EE:04:2B:5C:57:63:4A:84:38:4A:FD:E6:4B:75:A4:74:51:89:4D:D2:AC:76:4C:A8:EE:5C:25:60:DD:49:4B:06 a=setup:actpass a=mid:0 a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid a=sendrecv a=msid:ef606e66-725c-423a-8192-158b67ffc33f 117d244c-33dd-4877-ade5-bb6771e6338f a=rtcp-mux a=rtcp-rsize a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 minptime=10;useinbandfec=1 a=rtpmap:63 red/48000/2 a=fmtp:63 111/111 a=rtpmap:9 G722/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:13 CN/8000 a=rtpmap:110 telephone-event/48000 a=rtpmap:126 telephone-event/8000 a=ssrc:948283732 cname:UpTPAOIS9jMZeqIo a=ssrc:948283732 msid:ef606e66-725c-423a-8192-158b67ffc33f 117d244c-33dd-4877-ade5-bb6771e6338f
|
关键 SDP 特征:
m=audio 50758 UDP/TLS/RTP/SAVPF - 使用 DTLS-SRTP 加密
a=fingerprint:sha-256 - DTLS 指纹
a=candidate - ICE 候选地址
关键错误信息
根本原因
问题定位过程
- 初步判断:488错误通常是SDP协商问题
- 日志分析:外部通道(sofia/external)正常,内部通道(sofia/internal)媒体建立失败
- 深入排查:检查发现上游传过来的SDP是加密状态
- 最终确认:edge-thunk 节点启动的是
rtpproxy 而不是 rtpengine
技术原理
1 2 3 4 5 6 7 8 9 10 11
| ┌─────────────┐ 加密SDP ┌─────────────┐ │ 上游FS │ ──────────────────> │ rtpproxy │ └─────────────┘ └─────────────┘ │ ▼ ❌ 不支持解密 │ ▼ ┌─────────────┐ 加密SDP ┌─────────────┐ │ 下游FS │ <────────────────── │ (未解密) │ └─────────────┘ └─────────────┘
|
rtpproxy vs rtpengine
解决方案
1. 检查 FreeSWITCH 配置
确保 sip_profiles/external.xml 中的 RTP 相关配置正确:
1 2
| <param name="rtp-enable-vad" value="false"/> <param name="rtp-disable-codec-negotiation" value="false"/>
|
验证方法
1. 检查 SDP 是否解密
1 2 3 4 5
| fs_cli -x "sofia global siptrace on"
|
2. 抓包验证
1 2 3 4 5
| tcpdump -i any -n port 5060 -s 0 -w sip.pcap
|
相关知识
488 Not Acceptable Here
- 定义:SIP 响应码,表示被叫方无法接受会话描述
- 常见原因:
- SDP 格式错误
- 编解码器不匹配
- 媒体流参数不兼容
- 加密的 SDP 未被解密(本次问题)
SRTP (Secure Real-time Transport Protocol)
- SRTP 是 RTP 的加密版本
- 需要媒体服务器支持解密才能正常处理
- rtpengine 可以作为 SRTP 代理,处理加密的媒体流
参考资料