Hi,
[email protected] wrote:
Greetings,

I'm figuring out the best way to record a conference.  I know I can
connect an AmAudio object to the conference mixer, but then I need to
get sems to pump the data to it.  Rather than reinventing the wheel,
would it be possible to create an AmSession object, which is not
actually connected to an RTP channel, and hook it to the conference,
thereby causing the media processor to do the pumping?  I would set up
the AmSession so that its audio output (sent from the conference
mixer) is set to an AmAudio file for recording.  If this hack would
work, how exactly would I construct the AmSession object?

its a bit of a waste, constructing the full AmSession, including RTP stream, but anyway...

you can use the "local audio" feature - if you set input or output to local, instead of receiving from RTP it gets audio from the LocalInput/LocalOutput, which you can set with setLocalInput/setLocalOutput just like you usually do setInput/setOutput. This is used e.g. for generating local ringtone (on receiving 180).

So it would go like this:

 string conf_id="myconf";
  AmSession* r_sess = new AmSession();
  AmConferenceChannel* chan = AmConferenceStatus::getChannel(conf_id,
                                     r_sess->getLocalTag());
  AmAudioFile* m_file = new AmAudioFile();
  m_file->open("/tmp/rec.wav", AmAudioFile::Write);
  r_sess->setLocalInput(chan);
  r_sess->setInput(m_file);
  r_sess->setAudioLocal(AM_AUDIO_IN, true);
  AmMediaProcessor::instance()->addSession(r_sess, conf_id);

bonus points: make a DSM action out of this, saving the AmAudioFile to avar, and using transferOwnership. so that you can also stop the recording with another action, and its automatically stopped when the session that owns it ends. Also, don't forget to remove from conference channel in destructor. With the SystemDSM, these conf recordings then can also be done of a whole conference (unrelated to the sessions of who is dialing in and leaves).

Stefan

--
Stefan Sayer
VoIP Services Consulting and Development

Warschauer Str. 24
10243 Berlin

tel:+491621366449
sip:[email protected]
email/xmpp:[email protected]


_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems

Reply via email to