Hi, Let me try :) On Thu, Jan 29, 2009 at 12:42 AM, manjeet soodan <manjeetss1 at yahoo.com> wrote: > Could somebody please help out to answer the below queries i have. > > Thanks n regards, > Manjeet > > > > --- On Wed, 1/28/09, manjeet soodan <manjeetss1 at yahoo.com> wrote: > > From: manjeet soodan <manjeetss1@xxxxxxxxx> > Subject: Help needed in Media Proxy implementation > To: pjsip at lists.pjsip.org > Date: Wednesday, January 28, 2009, 6:36 PM > > Hi, > > I am working on a Media Proxy app which we do the RTP(Encode/Decode) plus > RTCP message translation between two servers. > > The questions i have are :- > 1) I will have to create 2 streams (on top of 2 transports) talking to each > of the two servers. > But i am confused about Get_Frame/Put_Frame callbacks and > on_rx_rtp/on_rx_rtcp callback. which one i have to use? What is the > difference between the two and when to use each? get_frame & put_frame are pjmedia_port callbacks which are called when user need to get/put data from/to the port. on_rx_rtp & on_rx_rtcp are pjmedia_transport callbacks which are called when pjmedia transport receive packets (e.g: from network). > > Similarly when we shall use pjmedia_port_get_frame() & > pjmedia_port_put_frame() OR pjmedia_transport_send_rtp() & > pjmedia_transport_send_rtcp()? I guess the functions names defined it already, and the docs may be able to give more :) > > Can we use on_rx_rtp/on_rx_rtcp with streams too? > Not sure if I understand the question, however if your application needs to talk to stream, it can use: pjmedia_stream_get_port(stream, stream_port) and then start talking: pjmedia_port_put/get_frame(stream_port, frame) Again, perhaps you'll be interested in this doc http://trac.pjsip.org/repos/wiki/media-flow > 2) As pjmedia_stream_create, calls the "pjmedia_transport_attach" and > assigns its own on_rx_rtp/on_rx_rtcp callbacks? > > Do i have to again call "pjmedia_transport_attach" in my application code > and give my own > on_rx_rtp/on_rx_rtcp callbacks to receive rtp/rtcp? I guess not, it seems your application just needs to talk to stream, not transport. > > Right now the seq of APIs i have called is :- > > pj_init(), pj_caching_pool_init, pj_pool_create, pjmedia_endpt_create (call > twice as i need 2 endpoints talking to 2 servers), initcodecs (register the > codecs i need for each endpoint like pjmedia_codec_g711_init and > pjmedia_codec_ipp_init), pjmedia_transport_udp_create2 (called twice to > create 2 transports to talk to 2 servers), pjmedia_stream_create(), > pjmedia_transport_attach(), defined my own on_rx_rtp, on_rx_rtcp. > > Please let me know if the sequence of API call is correct? It seems so, except the transport_attach(). > > Am new to PJMedia stack, so will highly appreciate any help provided? > > Thanks n regards, > Mannu > Regards, nanang