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

test ipv4 to ipv4 rtp proxy ie without bridginig #2

Closed
altanai opened this issue Apr 10, 2014 · 4 comments
Closed

test ipv4 to ipv4 rtp proxy ie without bridginig #2

altanai opened this issue Apr 10, 2014 · 4 comments

Comments

@altanai
Copy link

altanai commented Apr 10, 2014

I want to use rtpengine but not with ipv4 ipv6 bridging ie i want the media to relay from the same ipv4 to ipv4 , differentiated by ports , I have made few changes in class of debian folder , basically omitted some code . My problem is that i dont know how to test it and the test classes present give an error of uuid : command not found .
Is there a way to test media relay for my situation ?
Ps : im using it in userspace mode with No kernel forwarding

@rfuchs
Copy link
Member

rfuchs commented Apr 10, 2014

The uuid command is the one from here:
http://www.ossp.org/pkg/lib/uuid/

But is there a reason why you can't just test it in a proper SIP environment, e.g. called from Kamailio?

@altanai
Copy link
Author

altanai commented Apr 11, 2014

Yes I can ofcourse use kamailio and sip softphone to test, I was only looking for the shortest way .
Also since my alteration to the code to make rtpengine ipv4 - ipv4/ipv6 compatible , yields errors , it would be awesome if you could drop me a hint on how to achieve it .

@rfuchs
Copy link
Member

rfuchs commented Apr 21, 2014

You can either try to adapt tests/simulator-ng.pl or hand-roll a test case using utils/ng-client yourself.

As a first step, the latter option might be preferable.

The script utils/ng-client serves as a simple CLI interface to issue commands to rtpengine. Most options and flags present within the control protocol are implemented as CLI options to ng-client -- if any are missing or new, they can easily be added.

In the simplest case, you'd issue one offer and one answer using ng-client and some simple hand-crafted SDP bodies. Afterwards, you can use netcat or any other UDP-capable tool to test packet forwarding.

For example, you could put the following into a text file called "offer":

v=0
o=- 123456 0 IN IP4 192.168.0.1
s=session
t=0 0
m=audio 7654 RTP/AVP 1 2 3 4
c=IN IP4 192.168.0.1

Then copy it to another file "answer" and in there, change the port from 7654 to 5432. You'll have to adapt the IP address to your local address.

Then use ng-client to issue both offer and answer:

./ng-client offer --call-id=abcde --from-tag=xyz --trust-address --sdp-file=offer
./ng-client answer --call-id=abcde --from-tag=xyz --to-tag=foo --trust-address --sdp-file=answer

Note that you'll need additional options to enable whatever bridging functionality you're working on. The output of each command will be the rewritten SDP body: take note of IP address and port. Let's say IP address comes back as 192.168.100.100 both times and the ports are 30000 and 30002.

Then use netcat in UDP mode in two terminals. Note how the ports are swapped between the offer and the answer (first netcat uses local port from offer, but remote port received from answer, and vice versa):

netcat -u -p 7654 192.168.100.100 30002
netcat -u -p 5432 192.168.100.100 30000

Now you should be able to type messages back and forth between the two netcats. Keep an eye on the log produced by rtpengine while you're doing this. You may have to raise the timeout values when starting rtpengine.

The simulator-ng script automates this process with many calls in parallel and supports all kinds of different scenarios. It can be tricky to implement a new test case into simulator-ng, which is why I suggest to try it manually first, to see if anything works at all. Otherwise you wouldn't know whether it's the script that's not working right, or rtpengine.

@rfuchs
Copy link
Member

rfuchs commented Sep 5, 2014

IPv4/IPv4 bridging will be supported soon, see issue #4

@rfuchs rfuchs closed this as completed Sep 5, 2014
@SipSeb SipSeb mentioned this issue Jan 3, 2020
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

2 participants