[pjsip] Conference Multiple Streams

Marco Zissen maz at gmx.net
Tue Nov 6 08:14:19 EST 2007

Hi Thomas,
don't know if I understand you correcly, but I think you would like to
create your own conference, instead of using
Or better say, you would like to change the frames, before they are going to
conference (e.g. sound effects, talkover, own mixer routines ;))
You can try the following:
// declare two callbacks (one for putframe one for getframe), to hold the
original getframe/putframe
pj_status_t (* mediaport_cb_get_frame)(pjmedia_port *this_port,
pjmedia_frame *frame);
pj_status_t (* mediaport_cb_put_frame)(pjmedia_port *this_port,
pjmedia_frame *frame);
// when you got the media_port in on_media_update(), "hook" the "original"
media_port callbacks...
mediaport_cb_get_frame = media_port->get_frame;
mediaport_cb_put_frame = media_port->put_frame;
// ... and modify getframe/putframe to point onto your own function:
media_port->get_frame = &hooked_get_frame;
media_port->put_frame = &hooked_put_frame;
// Now, create two functions, that should receive media_port
putframe/getframe and call the original function:
static pj_status_t hooked_put_frame(pjmedia_port *port, pjmedia_frame
   // Call real media_port putframe()
   return pdata->mediaport_cb_put_frame(port, &frame_new);
static pj_status_t hooked_get_frame(pjmedia_port *port, pjmedia_frame
   pj_status_t status;
   // Call real media_port getframe()
   status = pdata->mediaport_cb_get_frame(port, &frame_new);
   return status;
This way, you are able to modify (or save frames to a private buffer),
before they go or return from conference. Hope this helps ...


Von: pjsip-bounces at lists.pjsip.org [mailto:pjsip-bounces at lists.pjsip.org] Im
Auftrag von Thomas Plotkowiak
Gesendet: Dienstag, 6. November 2007 11:53
An: pjsip at lists.pjsip.org
Betreff: [pjsip] Conference Multiple Streams

I have a special need to hold a conference and be able to access the
incoming streams individually. Speaking of when I hold a conference with for
example 5 people including me, then i should be able to access the 4
incoming streams somehow to fetch them to a "processing engine". I know that
so far the incoming streams are mixed to one single stream. 

My thoughts were to simply instead of doing a conference call placing a
number of single calls, to achieve this, or a modified conference. Are there
any experiences or recommendations with this? I guess this would involve
some changes to the source code, to obtain a non mixed array of streams. 

Here a small example of how the conference works so far

person A ---|                       |
person B ---| mixed together |------ my sound card output
person C ---|                       |
person D ---|                       | 

BUT I want to have it this way

person A --- third party sound engine |                       |
person B --- third party sound engine | mixed together |--- my sound card
person C --- third party sound engine |                       |
person D --- third party sound engine |                       |

I am wondering if this is possible.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20071106/15be6e40/attachment.html>

More information about the pjsip mailing list