Help on manipulating SDP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Giuseppina Senzatela wrote:
> Hi guys,
> I need some suggestions on how to manipulate the SDP part of an INVITE 
> packet I received.
> I need to update the "c" and "m" attributes of SDP with other values 
> (received  from a mediaproxy).
> 
> I have to modify the IP address in c and the port in m attributes
> 
> c=IN IP4 62.94.0.199
> t=0 0
> m=audio 26374 RTP/AVP 0 98 8 3 101
> 
> and return the rdata modified to the pjsip_endpt_create_request_fwd() 
> function.

First you'll need to parse the text body, with pjmedia_sdp_parse(). 
Then modify the "c" and "m" line as required. Then put back the SDP 
in the rdata.

For the last task above, we have two options on what format to be 
put on the rdata. If you have other functions which expect the 
message body in rdata to be in plain text format, then you'll need 
to print the SDP into a text buffer with pjmedia_sdp_print() and 
create a text body out of this buffer with pjsip_msg_body_create(). 
Otherwise if you do not care about the body (other than cloning it 
in the outgoing request), then you can directly attach the modified 
SDP into the message body. For the later, see create_sdp_body() (or 
pjsip_create_sdp_body() in newer pjsip) in pjsip-ua/sip_inv.c.

cheers
  -benny

> Do you have any suggestions?
> Tnx in advance!
> Giusy
> 


-- 
Benny Prijono
http://www.pjsip.org




[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux