webrtc_test.go 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package webrtc
  2. import (
  3. "testing"
  4. "github.com/pion/webrtc/v3"
  5. "github.com/stretchr/testify/require"
  6. )
  7. func TestAlexa(t *testing.T) {
  8. // from https://github.com/AlexxIT/go2rtc/issues/825
  9. offer := `v=0
  10. o=- 3911343731 3911343731 IN IP4 0.0.0.0
  11. s=a 2 z
  12. c=IN IP4 0.0.0.0
  13. t=0 0
  14. a=group:BUNDLE audio0 video0
  15. m=audio 1 UDP/TLS/RTP/SAVPF 96 0 8
  16. a=candidate:1 1 UDP 2013266431 52.90.193.210 60128 typ host
  17. a=candidate:2 1 TCP 1015021823 52.90.193.210 9 typ host tcptype active
  18. a=candidate:3 1 TCP 1010827519 52.90.193.210 45962 typ host tcptype passive
  19. a=candidate:1 2 UDP 2013266430 52.90.193.210 46109 typ host
  20. a=candidate:2 2 TCP 1015021822 52.90.193.210 9 typ host tcptype active
  21. a=candidate:3 2 TCP 1010827518 52.90.193.210 53795 typ host tcptype passive
  22. a=setup:actpass
  23. a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
  24. a=rtpmap:96 opus/48000/2
  25. a=rtpmap:0 PCMU/8000
  26. a=rtpmap:8 PCMA/8000
  27. a=rtcp:9 IN IP4 0.0.0.0
  28. a=rtcp-mux
  29. a=sendrecv
  30. a=mid:audio0
  31. a=ssrc:3573704076 cname:user3856789923@host-9dd1dd33
  32. a=ice-ufrag:gxfV
  33. a=ice-pwd:KepKrlQ1+LD+RGTAFaqVck
  34. a=fingerprint:sha-256 A2:93:53:50:E4:2F:C5:4E:DF:7C:70:99:5A:A7:39:50:1A:63:E5:B2:CA:73:70:7A:C5:F4:01:BF:BD:99:57:FC
  35. m=video 1 UDP/TLS/RTP/SAVPF 99
  36. a=candidate:1 1 UDP 2013266431 52.90.193.210 60128 typ host
  37. a=candidate:1 2 UDP 2013266430 52.90.193.210 46109 typ host
  38. a=candidate:2 1 TCP 1015021823 52.90.193.210 9 typ host tcptype active
  39. a=candidate:3 1 TCP 1010827519 52.90.193.210 45962 typ host tcptype passive
  40. a=candidate:3 2 TCP 1010827518 52.90.193.210 53795 typ host tcptype passive
  41. a=candidate:2 2 TCP 1015021822 52.90.193.210 9 typ host tcptype active
  42. b=AS:2500
  43. a=setup:actpass
  44. a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
  45. a=rtpmap:99 H264/90000
  46. a=rtcp:9 IN IP4 0.0.0.0
  47. a=rtcp-mux
  48. a=sendrecv
  49. a=mid:video0
  50. a=rtcp-fb:99 nack
  51. a=rtcp-fb:99 nack pli
  52. a=rtcp-fb:99 ccm fir
  53. a=ssrc:3778078295 cname:user3856789923@host-9dd1dd33
  54. a=ice-ufrag:gxfV
  55. a=ice-pwd:KepKrlQ1+LD+RGTAFaqVck
  56. a=fingerprint:sha-256 A2:93:53:50:E4:2F:C5:4E:DF:7C:70:99:5A:A7:39:50:1A:63:E5:B2:CA:73:70:7A:C5:F4:01:BF:BD:99:57:FC
  57. `
  58. pc, err := webrtc.NewPeerConnection(webrtc.Configuration{})
  59. require.Nil(t, err)
  60. conn := NewConn(pc)
  61. err = conn.SetOffer(offer)
  62. require.Nil(t, err)
  63. _, err = conn.GetAnswer()
  64. require.Nil(t, err)
  65. }