sipp icon indicating copy to clipboard operation
sipp copied to clipboard

RTP source port remains the same even though changed via offset in the xml file

Open rolstein62 opened this issue 3 years ago • 3 comments

I need to change the media_port during runtime. Changing the current media port within sdp by adding an offset eg. [media_port+2] works and the port changes from 6000 to 6002 in sdp. However, the RTP stream still sends from source port 6000. example.txt

rolstein62 avatar Mar 12 '21 11:03 rolstein62

Hello folks, is there any update to this issue? We did a clone from the latest repo just yesterday and experiencing the same issue.

The SDP fields reflect the correct settings (UDP:10000) but the RTP packets are using port 6000.

Palezvar avatar Oct 18 '21 14:10 Palezvar

Well. SIPp SIP messages are free-form. You're free to enter [media_port+whatever] or entering 12345 when sending SDP to your peer, but it will not affect the behaviour of other SIPp internals.

If a port could be changed, it would have to be through some rtpstream action/attribute (assuming you're using rtpstream). You might also want to look into the pcap stream. Replaying pcaps should allow you to send from multiple ports.

It takes the lowest destination port found in the pcap as offset 0:

https://github.com/SIPp/sipp/blob/2e338afef08f1216ac94f0d8841b3ce09e8d4dd1/src/prepare_pcap.c#L278-L284

That offset is applied to the packets before sending:

https://github.com/SIPp/sipp/blob/2e338afef08f1216ac94f0d8841b3ce09e8d4dd1/src/send_packets.c#L262-L265

So, if your pcap contains (src -> dst):

  • 1235 -> 6002
  • 1234 -> 6001

You'll get a base of 6001.

The messages that would be sent from SIPp from -min_rtp_port 6000 to the peer at 4000 would be at:

  • 6000 + (6002 - 6001) -> 4000 + (6002 - 6001)
  • 6000 + (6001 - 6001) -> 4000 + (6001 - 6001)

Which is:

  • 6001 -> 4001
  • 6000 -> 4000

wdoekes avatar Nov 03 '21 08:11 wdoekes

OK, thanks for clarification. I think I generally understand the behavior when using pcap as an rtp-stream source. Howerver, I've been using rtp-stream with wav audio files in my test scenarios. I find this more conveniant, since wav audio files are easier to create. So in this case, there's no rtp port included in the audio file and I have to configure the port using the media_port parameter. I guess I have to change my scenario files to using pcap then and try a different approach. Thanks anyway

rolstein62 avatar Nov 03 '21 12:11 rolstein62