Discussions

Ask a Question
Back to All

Getting {"kind":"UnknownError","description":"Internal Server Error"} when sending SDP Answer back for Agents API

Hi,

I have been implementing the Agents API in my own Android App (java). I have followed all the steps on the documents and obtained the SessionId, StreamId, SdpAnswer. I then post the JSON Request using the sample Java code with my details. But I get a

{"kind":"UnknownError","description":"Internal Server Error"}

Here is what my values look like:

Stream_Id = strm_HUEy3LE543X7bYNZUqLyz

Session_Id = AWSALB=M4DwEVH7XzDFaWUhDu5TE9bk0NaesoeqABl6bBaVY/nglkTePDQ99EE2N/YuTwZDktQDcsl941/vpeL0LuDWk+96akxy3sZ/A5EYzHx0RR0eLFHqtqHL6uz1Qg+u; Expires=Sun, 28 Apr 2024 12:56:59 GMT; Path=/; AWSALBCORS=M4DwEVH7XzDFaWUhDu5TE9bk0NaesoeqABl6bBaVY/nglkTePDQ99EE2N/YuTwZDktQDcsl941/vpeL0LuDWk+96akxy3sZ/A5EYzHx0RR0eLFHqtqHL6uz1Qg+u; Expires=Sun, 28 Apr 2024 12:56:59 GMT; Path=/; SameSite=None; Secure

SDP_Answer = v=0
o=- 4292941495048583310 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE a v d
a=extmap-allow-mixed
a=msid-semantic: WMS
m=audio 9 UDP/TLS/RTP/SAVPF 111
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:Av+2
a=ice-pwd:Ao0hCS1KD0g+Q8x6T7LRaNwW
a=ice-options:trickle renomination
a=fingerprint:sha-256 60:2E:BD:6F:E0:4E:11:D5:92:C5:8C:DE:D8:26:4B:F7:32:FA:1E:66:FF:49:91:24:A3:66:42:17:71:F6:3E:56
a=setup:active
a=mid:a
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=recvonly
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
m=video 9 UDP/TLS/RTP/SAVPF 100 101
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:Av+2
a=ice-pwd:Ao0hCS1KD0g+Q8x6T7LRaNwW
a=ice-options:trickle renomination
a=fingerprint:sha-256 60:2E:BD:6F:E0:4E:11:D5:92:C5:8C:DE:D8:26:4B:F7:32:FA:1E:66:FF:49:91:24:A3:66:42:17:71:F6:3E:56
a=setup:active
a=mid:v
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=recvonly
a=rtcp-mux
a=rtpmap:100 VP8/90000
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 transport-cc
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=100
m=application 9 UDP/DTLS/SCTP webrtc-datachannel
c=IN IP4 0.0.0.0
a=ice-ufrag:Av+2
a=ice-pwd:Ao0hCS1KD0g+Q8x6T7LRaNwW
a=ice-options:trickle renomination
a=fingerprint:sha-256 60:2E:BD:6F:E0:4E:11:D5:92:C5:8C:DE:D8:26:4B:F7:32:FA:1E:66:FF:49:91:24:A3:66:42:17:71:F6:3E:56
a=setup:active
a=mid:d
a=sctp-port:5000


My Json Request looks like this:




MediaType mediaType = MediaType.parse("application/json");  
RequestBody body = RequestBody.create(mediaType, "{\"answer\":{\"type\":\""+SDP_ANSWER.toString()+"\"},\"session_id\":\""+SESSION_ID_FULL.toString()+"\"}");
Request request = new Request.Builder()

                    .url("https://api.d-id.com/talks/streams/"+STREAM_ID+"/sdp")
                    .post(body)
                    .addHeader("accept", "application/json")
                    .addHeader("content-type", "application/json")
                    .addHeader("authorization", "Basic "+API_KEY)
                    .build();

I am able to see that the onIceCandidate event is triggered and working but sending the sdp answer back as above is causing the error and not allowing us to establish the chat room and send a message.


Appreciate any help and support. Thank you.