0

I'm developing a program which must modify the sdp load of a SIP message. Right now, I create the sipstack, receive the packet, proccess the request, access the data, obtain the formats and decide which ones I want.

The problem begins when I want to modify the media information. I set the formats I want using media.setMediaFormats(valid);

When I print this, i have something like "m=audio "myport" RTP/AVP "myformats", so it seems to do it right.

After this, I try to set the media to the packet to send it to the server, but I don't get it. At the mediaDescription, I can modify the "m=" line, but the "a=" lines keep without changes, and I don't know how to do it. I've tried setMedia(media), and I've also tried to remove the "a=" attributes and after that add the new ones, but it doesn't work properly neither.

Any ideas?

I'm quite desperate right now.

AstroCB
  • 12,337
  • 20
  • 57
  • 73

1 Answers1

0

I assume you have already gotten your answer (its been a while since you asked) but for the benefit if others who might be reading this, you should be able to get the media fields and then setAttribute from the SessionDescription object and do what you want. The SDP implementation is very simple. You can easily read the source code for this and figure it out as well (and inform the project of any bugs you come across BTW).