meetecho / janus-gateway

Janus WebRTC Server
https://janus.conf.meetecho.com
GNU General Public License v3.0
8.15k stars 2.47k forks source link

Returning Janus API error 465 (Error processing SDP) #1595

Closed daviddean99 closed 5 years ago

daviddean99 commented 5 years ago

I'm passing a clients SDP from my SIP server (Kamailio) to the Janus echo plugin via the API.

When parsing the SDP, Janus fails with the message "Error processing SDP".

But even with the log levels turn up to 7 Janus does not indicate what is wrong with the SDP.

I think the issue is because the SIP client doesn't support ICE, so there are no candidates in the SDP, but that's just a guess. I would have assumed Janus can fall back to non-ICE operation if the client doesn't support it?

Here is the Janus debug log:

[transports/janus_http.c:janus_http_handler:1166] Got a HTTP POST request on /janus/1561968352310974/2911672044179845... [transports/janus_http.c:janus_http_handler:1167] ... Just parsing headers for now... [transports/janus_http.c:janus_http_headers:1777] Host: 127.0.0.1:8088 [transports/janus_http.c:janus_http_headers:1777] User-Agent: kamailio (5.2.2 (x86_64/linux)) [transports/janus_http.c:janus_http_headers:1777] Accept: / [transports/janus_http.c:janus_http_headers:1777] Content-Type: application/json [transports/janus_http.c:janus_http_headers:1777] Content-Length: 1046 [transports/janus_http.c:janus_http_headers:1777] Expect: 100-continue [transports/janus_http.c:janus_http_handler:1199] Processing HTTP POST request on /janus/1561968352310974/2911672044179845... [transports/janus_http.c:janus_http_handler:1252] ... parsing request... Session: 1561968352310974 Handle: 2911672044179845 Processing POST data (application/json) (1046 bytes)... [transports/janus_http.c:janus_http_handler:1277] -- Data we have now (1046 bytes) [transports/janus_http.c:janus_http_handler:1199] Processing HTTP POST request on /janus/1561968352310974/2911672044179845... [transports/janus_http.c:janus_http_handler:1252] ... parsing request... Session: 1561968352310974 Handle: 2911672044179845 Processing POST data (application/json) (0 bytes)... [transports/janus_http.c:janus_http_handler:1282] Done getting payload, we can answer { "janus" : "message", "transaction" : "zxcvbn891", "body" : { "audio" : true }, "jsep" : { "type" : "offer", "sdp" : "v=0\r\no=organization 1983 678901 IN IP4 192.168.0.21\r\ns=-\r\nc=IN IP4 192.168.0.21\r\nt=0 0\r\na=tcap:1 RTP/AVPF\r\nm=audio 46850 RTP/AVP 114 115 0 101\r\ni=speech\r\na=ptime:20\r\na=minptime:1\r\na=maxptime:255\r\na=silenceSupp:off - - - -\r\na=rtpmap:114 opus/48000/2\r\na=imageattr:114 octet-align=0\r\na=fmtp:114 octet-align=0\r\na=rtpmap:115 AMR-WB/16000/1\r\na=imageattr:115 octet-align=1\r\na=fmtp:115 octet-align=1\r\na=rtpmap:0 PCMU/8000/1\r\na=rtpmap:101 telephone-event/8000/1\r\na=fmtp:101 0-16\r\na=pcfg:1 t=1\r\na=sendrecv\r\na=rtcp-mux\r\na=ssrc:21127160 cname:aceacf48cbad8ca2495eabb84fb25827\r\na=ssrc:21127160 mslabel:6994f7d1-6ce9-4fbd-acfd-84e5131ca2e2\r\na=ssrc:21127160 label:organization@audio\r\n\r\n" } } Forwarding request to the core (0x7f70a8001240) Got a Janus API request from janus.transport.http (0x7f70a8001240) Transport task pool, serving request [2911672044179845] There's a message for JANUS EchoTest plugin [2911672044179845] Remote SDP: v=0 o=organization 1983 678901 IN IP4 192.168.0.21 s=- c=IN IP4 192.168.0.21 t=0 0 a=tcap:1 RTP/AVPF m=audio 46850 RTP/AVP 114 115 0 101 i=speech a=ptime:20 a=minptime:1 a=maxptime:255 a=silenceSupp:off - - - - a=rtpmap:114 opus/48000/2 a=imageattr:114 octet-align=0 a=fmtp:114 octet-align=0 a=rtpmap:115 AMR-WB/16000/1 a=imageattr:115 octet-align=1 a=fmtp:115 octet-align=1 a=rtpmap:0 PCMU/8000/1 a=rtpmap:101 telephone-event/8000/1 a=fmtp:101 0-16 a=pcfg:1 t=1 a=sendrecv a=rtcp-mux a=ssrc:21127160 cname:aceacf48cbad8ca2495eabb84fb25827 a=ssrc:21127160 mslabel:6994f7d1-6ce9-4fbd-acfd-84e5131ca2e2 a=ssrc:21127160 label:organization@audio

[WARN] Ignoring 'i' property (m-line) [2911672044179845] Audio has been negotiated, Video has NOT been negotiated, SCTP/DataChannels have NOT been negotiated [2911672044179845] Setting ICE locally: got OFFER (1 audios, 0 videos) [2911672044179845] Creating ICE agent (ICE Full mode, controlled) [2911672044179845] Adding 176.58.115.250 to the addresses to gather candidates for [2911672044179845] Gathering done for stream 1 [2911672044179845] Parsing audio candidates (stream=1)... [ERR] [janus.c:janus_process_incoming_request:1227] Error processing SDP [zxcvbn891] Returning Janus API error 465 (Error processing SDP) Got a Janus API response to send (0x7f70a8001240)

lminiero commented 5 years ago

You're trying to pass a non-WebRTC SDP to Janus, which is not allowed: ICE, DTLS and SRTP support are required. If you want to interact with legacy devices, e.g., a SIP endpoint, you should use the Janus SIP or NoSIP plugins instead.

lminiero commented 5 years ago

PS: please, as explained in the guidelines, no huge chunks of text inline, use gist/pastebin or similar services next time.

daviddean99 commented 5 years ago

I checked the noSIP plugin documentation, but it seems to only enable communication between two endpoints. I was hoping to enable a legacy device (i.e a SIP endpoint) to use the Janus echo or conference bridge plugins.

lminiero commented 5 years ago

Yeah, that's not possible: those plugins are only available to endpoints that really "speak" WebRTC. You can probably achieve that result via a bit of "orchestration" (e.g., application server that picks NoSIP generated WebRTC offer from SIP endpoint and uses it as an offer for the EchoTest). Anyway, this kind of discussion belongs to our group, as we only use Github for code issues.