Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a way to get rtp stream ? #15

Open
pascal-pro opened this issue Dec 7, 2020 · 3 comments
Open

a way to get rtp stream ? #15

pascal-pro opened this issue Dec 7, 2020 · 3 comments

Comments

@pascal-pro
Copy link

pascal-pro commented Dec 7, 2020

Hello,
I wanted to try your library but I never managed to get the audio streams back.
More concretely, I use freeswitch like ipbx, I can connect myself, receive the call event, pick up the call, as in the example, and then I don't know what to do.
When I try to read or write to the ports present in the SDP, with gstreamer, I have the impression that there are already reads or writes on these RTP streams.
Is there an ontrack function like in the pion/webrtc library?

@cloudwebrtc
Copy link
Owner

cloudwebrtc commented Dec 31, 2020

@pascal-ace Sorry for the slow reply, I got back to this line after a long time. I am ready to add RTP relay support, will try to add pion/webrtc to support rtp streams. If you have any ideas or wishes, We can communicate here. :)

@pascal-pro
Copy link
Author

My main interest is simply to get the audio streams, to send them to gstreamer for processing.
For the integration of pion/webrtc, I have a directory : link
it's just a test, not even trying since I managed to get the websocket audio with the example.
Only on an ipbx freeswitch.
I'm on their slack if you want to talk directly.

@Windforce17
Copy link

I use this lib to make SIP call server .The vender has different address and port for SIP and RTP server.And I behind a router(IP:192.168.100.27), if I don't send a udp packet contain RTP protocol to vender's RTP server,I can't received any packet.

c.ua.InviteStateHandler = func(s *session.Session, req *sip.Request, resp *sip.Response, status session.Status) {
	c.logger.Infof("InviteStateHandler: state => %v, type => %s", status, s.Direction())
	switch status {
	case session.Provisional: //After response for 1XX
		if len(s.RemoteSdp()) == 0 {
			break
		}

		//send RTP packet to vender RTP server
		c.logger.Info("  - - - - - - -Write RTP - - - - - ")
		str := "80000000a1b622ca54480d92fffffffffffff……THIS_IS_RTP_PACKET_ENCODE_BY_HEX"
		b, _ := hex.DecodeString(str)

		remoteSDP, err := sdp.ParseString(s.RemoteSdp())
		if err != nil {
			c.logger.Errorf("Error Get Remote SDP:%v", err)
			return
		}
		remoteIP, remotePort := mock.GetRemoteIpPort(remoteSDP)
		//send RTP packet to vender RTP server
		c.remoteRTPAddr = &net.UDPAddr{IP: net.ParseIP(remoteIP), Port: remotePort}
		c.logger.Infof("Got remoteIp:%s,remotePort:%d", remoteIP, remotePort)
		_, err = c.UDPSteam.Send(b, c.remoteRTPAddr)


		if err != nil {
			c.logger.Errorf("Error In Send UDP message %v", err)
			return
		}
		...

And then,I can received rtp package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants