Skip to content
Snippets Groups Projects
Commit 0ddab496 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files
parents 96010c04 5ef72f40
Branches
Tags
No related merge requests found
Showing
with 180 additions and 104 deletions
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
* Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
* Author: Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com> * Author: Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com>
* Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -106,6 +107,9 @@ GtkWidget * overrtp; ...@@ -106,6 +107,9 @@ GtkWidget * overrtp;
GHashTable * directIpCallsProperties = NULL; GHashTable * directIpCallsProperties = NULL;
gchar *current_username;
// Credentials // Credentials
enum { enum {
COLUMN_CREDENTIAL_REALM, COLUMN_CREDENTIAL_REALM,
...@@ -193,12 +197,17 @@ static GPtrArray* getNewCredential (GHashTable * properties) { ...@@ -193,12 +197,17 @@ static GPtrArray* getNewCredential (GHashTable * properties) {
-1); -1);
g_hash_table_insert(properties, g_strdup(ACCOUNT_REALM), realm); g_hash_table_insert(properties, g_strdup(ACCOUNT_REALM), realm);
g_hash_table_insert(properties, g_strdup(ACCOUNT_AUTHENTICATION_USERNAME), username);
// better use the current_username as it is the account username in the
// g_hash_table_insert(properties, g_strdup(ACCOUNT_AUTHENTICATION_USERNAME), username);
g_hash_table_insert(properties, g_strdup(ACCOUNT_AUTHENTICATION_USERNAME), current_username);
// Do not change the password if nothing has been changed by the user // Do not change the password if nothing has been changed by the user
if (g_strcasecmp (password, PW_HIDDEN) != 0) if (g_strcasecmp (password, PW_HIDDEN) != 0)
g_hash_table_insert(properties, g_strdup(ACCOUNT_PASSWORD), password); g_hash_table_insert(properties, g_strdup(ACCOUNT_PASSWORD), password);
valid = gtk_tree_model_iter_next (GTK_TREE_MODEL(credentialStore), &iter); valid = gtk_tree_model_iter_next (GTK_TREE_MODEL(credentialStore), &iter);
while (valid) { while (valid) {
...@@ -1346,10 +1355,11 @@ void show_account_window (account_t * a) { ...@@ -1346,10 +1355,11 @@ void show_account_window (account_t * a) {
return; return;
} }
gchar *key = g_strdup(ACCOUNT_USERNAME);
// If accept button is // If accept button is
if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) { if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) {
g_hash_table_replace(currentAccount->properties, g_hash_table_replace(currentAccount->properties,
g_strdup(ACCOUNT_ALIAS), g_strdup(ACCOUNT_ALIAS),
g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryAlias)))); g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryAlias))));
...@@ -1368,6 +1378,10 @@ void show_account_window (account_t * a) { ...@@ -1368,6 +1378,10 @@ void show_account_window (account_t * a) {
g_hash_table_replace(currentAccount->properties, g_hash_table_replace(currentAccount->properties,
g_strdup(ACCOUNT_MAILBOX), g_strdup(ACCOUNT_MAILBOX),
g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryMailbox)))); g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryMailbox))));
// Variable used to update credentials
current_username = (gchar *)g_hash_table_lookup(currentAccount->properties, g_strdup(ACCOUNT_USERNAME));
} }
if (proto && strcmp (proto, "SIP") == 0) { if (proto && strcmp (proto, "SIP") == 0) {
......
...@@ -61,7 +61,6 @@ AC_CONFIG_FILES([Makefile]) ...@@ -61,7 +61,6 @@ AC_CONFIG_FILES([Makefile])
src/audio/codecs/Makefile \ src/audio/codecs/Makefile \
src/config/Makefile \ src/config/Makefile \
src/dbus/Makefile \ src/dbus/Makefile \
src/plug-in/audiorecorder/Makefile \
src/plug-in/Makefile \ src/plug-in/Makefile \
src/plug-in/test/Makefile \ src/plug-in/test/Makefile \
src/hooks/Makefile \ src/hooks/Makefile \
......
...@@ -37,27 +37,8 @@ endif ...@@ -37,27 +37,8 @@ endif
sflphoned_CXXFLAGS = \ sflphoned_CXXFLAGS = \
-DPREFIX=\"$(prefix)\" -DPROGSHAREDIR=\"${datadir}/sflphone\" $(IAX_CXXFLAG) $(NETWORKMANAGER) \ -DPREFIX=\"$(prefix)\" -DPROGSHAREDIR=\"${datadir}/sflphone\" $(IAX_CXXFLAG) $(NETWORKMANAGER) \
-DVERSION=\"$(VERSION)\" \
@ZRTPCPP_CFLAGS@ \
@libssl_CFLAGS@
# Add here the dynamic libraries sflphoned should be linked against
sflphoned_LDADD = \
./libsflphone.la \
@CCGNU2_LIBS@ \
@CCEXT2_LIBS@ \
@ZRTPCPP_LIBS@ \
$(PJSIP_LIBS) \
@CCRTP_LIBS@ \
@ALSA_LIBS@ \
@PULSEAUDIO_LIBS@ \
@SAMPLERATE_LIBS@ \
@libssl_LIBS@
# sflphoned_LDFLAGS= -pg -luuid
sflphoned_LDFLAGS= $(UUID_LIBS)
-DVERSION=\"$(VERSION)\" -DVERSION=\"$(VERSION)\"
# libsflphone # libsflphone
sflphoned_LDADD = ./libsflphone.la sflphoned_LDADD = ./libsflphone.la
...@@ -85,15 +66,9 @@ libsflphone_la_LIBADD = \ ...@@ -85,15 +66,9 @@ libsflphone_la_LIBADD = \
$(IAX_LIB) \ $(IAX_LIB) \
./sip/libsiplink.la \ ./sip/libsiplink.la \
./audio/libaudio.la \ ./audio/libaudio.la \
./audio/audiortp/libaudiortp.la \
./audio/sound/libsound.la \
./audio/codecs/libcodecdescriptor.la \
./audio/alsa/libalsalayer.la \
./audio/pulseaudio/libpulselayer.la \
./dbus/libdbus.la \ ./dbus/libdbus.la \
./config/libconfig.la \ ./config/libconfig.la \
./plug-in/libplugin.la \ ./plug-in/libplugin.la \
./plug-in/audiorecorder/libaudiorecorder.la \
./hooks/libhooks.la \ ./hooks/libhooks.la \
./history/libhistory.la ./history/libhistory.la
...@@ -101,9 +76,6 @@ libsflphone_la_LDFLAGS = \ ...@@ -101,9 +76,6 @@ libsflphone_la_LDFLAGS = \
@CCGNU2_LIBS@ \ @CCGNU2_LIBS@ \
@CCEXT2_LIBS@ \ @CCEXT2_LIBS@ \
@ZRTPCPP_LIBS@ \ @ZRTPCPP_LIBS@ \
@GSTREAMER_LIBS@ \
@LIBAVCODEC_LIBS@ \
@LIBSWSCALE_LIBS@ \
$(PJSIP_LIBS) \ $(PJSIP_LIBS) \
@CCRTP_LIBS@ \ @CCRTP_LIBS@ \
@ALSA_LIBS@ \ @ALSA_LIBS@ \
...@@ -116,9 +88,6 @@ libsflphone_la_CFLAGS = \ ...@@ -116,9 +88,6 @@ libsflphone_la_CFLAGS = \
@CCGNU2_CFLAGS@ \ @CCGNU2_CFLAGS@ \
@CCEXT2_CFLAGS@ \ @CCEXT2_CFLAGS@ \
@ZRTPCPP_CFLAGS@ \ @ZRTPCPP_CFLAGS@ \
@GSTREAMER_CFLAGS@ \
@LIBAVCODEC_CFLAGS@ \
@LIBSWSCALE_CFLAGS@ \
$(PJSIP_CFLAGS) \ $(PJSIP_CFLAGS) \
@CCRTP_CFLAGS@ \ @CCRTP_CFLAGS@ \
@ALSA_CFLAGS@ \ @ALSA_CFLAGS@ \
......
...@@ -12,6 +12,8 @@ libaudio_la_SOURCES = \ ...@@ -12,6 +12,8 @@ libaudio_la_SOURCES = \
audioloop.cpp \ audioloop.cpp \
ringbuffer.cpp \ ringbuffer.cpp \
mainbuffer.cpp \ mainbuffer.cpp \
audiorecord.cpp \
audiorecorder.cpp \
recordable.cpp \ recordable.cpp \
audiolayer.cpp \ audiolayer.cpp \
audiodevice.cpp \ audiodevice.cpp \
...@@ -28,9 +30,11 @@ noinst_HEADERS = \ ...@@ -28,9 +30,11 @@ noinst_HEADERS = \
audioloop.h \ audioloop.h \
common.h \ common.h \
ringbuffer.h \ ringbuffer.h \
mainbuffer.h \
audiorecord.h \
audiorecorder.h \
audiolayer.h \ audiolayer.h \
audiodevice.h \ audiodevice.h \
mainbuffer.h \
recordable.h \ recordable.h \
algorithm.h \ algorithm.h \
delaydetection.h \ delaydetection.h \
......
...@@ -37,20 +37,17 @@ ...@@ -37,20 +37,17 @@
#include "audiodevice.h" #include "audiodevice.h"
#include "ringbuffer.h" #include "ringbuffer.h"
#include "mainbuffer.h" #include "mainbuffer.h"
#include <cc++/thread.h> // for ost::Mutex
#include "dcblocker.h" #include "dcblocker.h"
#include "speexechocancel.h" #include "speexechocancel.h"
#include "echocancel.h" #include "echocancel.h"
#include <cc++/thread.h> // for ost::Mutex
/** /**
* @file audiolayer.h * @file audiolayer.h
* @brief Main sound class. Manages the data transfers between the application and the hardware. * @brief Main sound class. Manages the data transfers between the application and the hardware.
*/ */
class Recordable;
class ManagerImpl; class ManagerImpl;
class AudioLayer { class AudioLayer {
......
...@@ -120,8 +120,6 @@ void AudioRecord::initFileName (std::string peerNumber) ...@@ -120,8 +120,6 @@ void AudioRecord::initFileName (std::string peerNumber)
void AudioRecord::openFile() void AudioRecord::openFile()
{ {
_info ("AudioRecord: Open file()");
bool result = false; bool result = false;
_debug ("AudioRecord: Open file()"); _debug ("AudioRecord: Open file()");
...@@ -408,6 +406,8 @@ void AudioRecord::closeWavFile() ...@@ -408,6 +406,8 @@ void AudioRecord::closeWavFile()
return; return;
} }
_debug("AudioRecord: Close wave file");
SINT32 bytes = byteCounter_ * channels_; SINT32 bytes = byteCounter_ * channels_;
...@@ -499,6 +499,8 @@ void AudioRecord::recData (SFLDataFormat* buffer_1, SFLDataFormat* buffer_2, int ...@@ -499,6 +499,8 @@ void AudioRecord::recData (SFLDataFormat* buffer_1, SFLDataFormat* buffer_2, int
if (recordingEnabled_) { if (recordingEnabled_) {
_debug("Recording enabled");
if (fp == 0) { if (fp == 0) {
_debug ("AudioRecord: Can't record data, a file has not yet been opened!"); _debug ("AudioRecord: Can't record data, a file has not yet been opened!");
return; return;
......
...@@ -36,10 +36,7 @@ ...@@ -36,10 +36,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <sstream> #include <sstream>
#include "plug-in/plugin.h" #include "global.h"
// #include "audiodsp.h"
// class AudioDSP;
using namespace std; using namespace std;
......
...@@ -29,13 +29,28 @@ ...@@ -29,13 +29,28 @@
*/ */
#include "audiorecorder.h" #include "audiorecorder.h"
#include "mainbuffer.h"
AudioRecorder::AudioRecorder (AudioRecord *arec) int AudioRecorder::count = 0;
: Thread(), recorderId("recorder_id")
AudioRecorder::AudioRecorder (AudioRecord *arec, MainBuffer *mb) : Thread()
{ {
setCancel (cancelDeferred); setCancel (cancelDeferred);
++count;
std::string id("processid_");
// convert count into string
std::string s;
std::stringstream out;
out << count;
s = out.str();
recorderId = id.append(s);
arecord = arec; arecord = arec;
mbuffer = mb;
} }
...@@ -44,13 +59,26 @@ AudioRecorder::AudioRecorder (AudioRecord *arec) ...@@ -44,13 +59,26 @@ AudioRecorder::AudioRecorder (AudioRecord *arec)
*/ */
void AudioRecorder::run (void) void AudioRecorder::run (void)
{ {
SFLDataFormat buffer[10000]; SFLDataFormat buffer[10000];
// int availBytes = mbuffer->availForGet(recorderId); while(true) {
if(!mbuffer)
_warn("AudioRecorder: Error: No instance of ringbuffer");
// mbuffer->getData(buffer, availBytes, 100, recorderId); int availBytes = mbuffer->availForGet(recorderId);
// arecord->recData(buffer, availBytes/sizeof(SFLDataFormat)); if(availBytes > 0) {
int got = mbuffer->getData(buffer, availBytes, 100, recorderId);
int availBytesAfter = mbuffer->availForGet(recorderId);
arecord->recData(buffer, availBytes/sizeof(SFLDataFormat));
}
sleep(20);
}
} }
...@@ -35,13 +35,17 @@ ...@@ -35,13 +35,17 @@
#include "audiorecord.h" #include "audiorecord.h"
#include <string> #include <string>
class MainBuffer;
class AudioRecorder : public ost::Thread { class AudioRecorder : public ost::Thread {
public: public:
AudioRecorder(AudioRecord *arec); AudioRecorder(AudioRecord *arec, MainBuffer *mb);
~AudioRecorder(void){ terminate(); } ~AudioRecorder(void){ terminate(); }
static int count;
std::string getRecorderID() { return recorderId; } std::string getRecorderID() { return recorderId; }
virtual void run(); virtual void run();
...@@ -50,10 +54,10 @@ class AudioRecorder : public ost::Thread { ...@@ -50,10 +54,10 @@ class AudioRecorder : public ost::Thread {
AudioRecorder (const AudioRecorder& ar); AudioRecorder (const AudioRecorder& ar);
AudioRecorder& operator=(const AudioRecorder& ar); AudioRecorder& operator=(const AudioRecorder& ar);
// MainBuffer *mbuffer;
std::string recorderId; std::string recorderId;
MainBuffer *mbuffer;
AudioRecord *arecord; AudioRecord *arecord;
}; };
......
...@@ -736,10 +736,10 @@ namespace sfl { ...@@ -736,10 +736,10 @@ namespace sfl {
// DTMF over RTP, size must be over 4 in order to process it as voice data // DTMF over RTP, size must be over 4 in order to process it as voice data
if(size > 4) { if(size > 4) {
// processDataDecode(spkrDataIn, size); processDataDecode(spkrDataIn, size);
if(result == JB_OK) { //if(result == JB_OK) {
processDataDecode((unsigned char *)(frame.data), 160); // processDataDecode((unsigned char *)(frame.data), 160);
} //}
} }
delete adu; delete adu;
...@@ -815,6 +815,8 @@ namespace sfl { ...@@ -815,6 +815,8 @@ namespace sfl {
// Recv session // Recv session
receiveSpeakerData (); receiveSpeakerData ();
/*
// Let's wait for the next transmit cycle // Let's wait for the next transmit cycle
if (sessionWaiting == 1) { if (sessionWaiting == 1) {
// Record mic and speaker during conversation // Record mic and speaker during conversation
...@@ -823,6 +825,7 @@ namespace sfl { ...@@ -823,6 +825,7 @@ namespace sfl {
// Record mic only while leaving a message // Record mic only while leaving a message
_ca->recAudio.recData (_micData,_nSamplesMic); _ca->recAudio.recData (_micData,_nSamplesMic);
} }
*/
_manager->getAudioLayerMutex()->leave(); _manager->getAudioLayerMutex()->leave();
......
...@@ -54,7 +54,7 @@ void DcBlocker::process (SFLDataFormat *data, int nbBytes) ...@@ -54,7 +54,7 @@ void DcBlocker::process (SFLDataFormat *data, int nbBytes)
for (int i = 0; i < nbSamples; i++) { for (int i = 0; i < nbSamples; i++) {
_x = data[i]; _x = data[i];
_y = (SFLDataFormat) ( (float) _x - (float) _xm1 + 0.9999 * (float) _ym1); _y = (SFLDataFormat) ( (float) _x - (float) _xm1 + 0.995 * (float) _ym1);
_xm1 = _x; _xm1 = _x;
_ym1 = _y; _ym1 = _y;
......
...@@ -255,23 +255,33 @@ void MainBuffer::unBindCallID (CallID call_id1, CallID call_id2) ...@@ -255,23 +255,33 @@ void MainBuffer::unBindCallID (CallID call_id1, CallID call_id2)
} }
} }
void MainBuffer::unBindHalfDuplexOut(CallID call_id, CallID process_id) void MainBuffer::unBindHalfDuplexOut(CallID process_id, CallID call_id)
{ {
removeCallIDfromSet(process_id, call_id); removeCallIDfromSet(process_id, call_id);
RingBuffer* ringbuffer; RingBuffer* ringbuffer = getRingBuffer(call_id);
ringbuffer = getRingBuffer(process_id);
if(ringbuffer) { if(ringbuffer) {
ringbuffer->removeReadPointer(call_id); ringbuffer->removeReadPointer(process_id);
if(ringbuffer->getNbReadPointer() == 0) { if(ringbuffer->getNbReadPointer() == 0) {
removeCallIDSet(call_id);
removeRingBuffer(call_id);
}
}
else {
_debug("Error: did not found ringbuffer %s", process_id.c_str());
removeCallIDSet(process_id); removeCallIDSet(process_id);
removeRingBuffer(process_id);
} }
CallIDSet* callid_set = getCallIDSet(process_id);
if(callid_set) {
if(callid_set->empty())
removeCallIDSet(process_id);
} }
} }
...@@ -387,9 +397,7 @@ int MainBuffer::getData (void *buffer, int toCopy, unsigned short volume, CallID ...@@ -387,9 +397,7 @@ int MainBuffer::getData (void *buffer, int toCopy, unsigned short volume, CallID
return 0; return 0;
} else { } else {
for (int k = 0; k < nbSmplToCopy; k++) { memset(buffer, 0, nbSmplToCopy*sizeof(SFLDataFormat*));
( (SFLDataFormat*) (buffer)) [k] = 0;
}
int size = 0; int size = 0;
......
...@@ -37,12 +37,10 @@ ...@@ -37,12 +37,10 @@
#include <cc++/thread.h> // for ost::Mutex #include <cc++/thread.h> // for ost::Mutex
#include <string> #include <string>
#include "../global.h" #include "global.h"
#include "../call.h" #include "call.h"
#include "ringbuffer.h" #include "ringbuffer.h"
typedef std::map<CallID, RingBuffer*> RingBufferMap; typedef std::map<CallID, RingBuffer*> RingBufferMap;
typedef std::set<CallID> CallIDSet; typedef std::set<CallID> CallIDSet;
......
...@@ -29,9 +29,8 @@ ...@@ -29,9 +29,8 @@
#include "recordable.h" #include "recordable.h"
#include "manager.h" #include "manager.h"
#include "mainbuffer.h"
Recordable::Recordable() : recorder(&recAudio) Recordable::Recordable() : recorder(&recAudio, Manager::instance().getMainBuffer())
{ {
FILE_TYPE fileType = FILE_WAV; FILE_TYPE fileType = FILE_WAV;
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
#ifndef RECORDABLE_H #ifndef RECORDABLE_H
#define RECORDABLE_H #define RECORDABLE_H
#include "../plug-in/audiorecorder/audiorecord.h" #include "audiorecord.h"
#include "../plug-in/audiorecorder/audiorecorder.h" #include "audiorecorder.h"
class Recordable { class Recordable {
...@@ -41,14 +41,30 @@ class Recordable { ...@@ -41,14 +41,30 @@ class Recordable {
~Recordable(); ~Recordable();
/**
* Return recording state (true/false)
*/
bool isRecording(){ return recAudio.isRecording(); } bool isRecording(){ return recAudio.isRecording(); }
/**
* This method must be implemented for this interface as calls and conferences
* have different behavior.
*/
virtual bool setRecording() = 0; virtual bool setRecording() = 0;
/**
* Stop recording
*/
void stopRecording(){ recAudio.stopRecording(); } void stopRecording(){ recAudio.stopRecording(); }
/**
* Init the recording file name according to path specified in configuration
*/
void initRecFileName(); void initRecFileName();
/**
* Set recording sampling rate.
*/
void setRecordingSmplRate(int smplRate); void setRecordingSmplRate(int smplRate);
virtual std::string getRecFileId() = 0; virtual std::string getRecFileId() = 0;
...@@ -64,11 +80,6 @@ class Recordable { ...@@ -64,11 +80,6 @@ class Recordable {
AudioRecorder recorder; AudioRecorder recorder;
private:
/** File name for his call : time YY-MM-DD */
// std::string _filename;
}; };
#endif #endif
...@@ -189,18 +189,33 @@ Call::isAudioStarted() ...@@ -189,18 +189,33 @@ Call::isAudioStarted()
bool bool
Call::setRecording() Call::setRecording()
{ {
bool recordStatus = Recordable::recAudio.setRecording(); bool recordStatus = Recordable::recAudio.isRecording();
if(!recordStatus) Recordable::recAudio.setRecording();
return false;
MainBuffer *mbuffer = &(Manager::instance()._mainBuffer); // Start recording
if(!recordStatus) {
MainBuffer *mbuffer = Manager::instance().getMainBuffer();
CallID process_id = Recordable::recorder.getRecorderID(); CallID process_id = Recordable::recorder.getRecorderID();
mbuffer->bindHalfDuplexOut(process_id, _id); mbuffer->bindHalfDuplexOut(process_id, _id);
mbuffer->bindHalfDuplexOut(process_id); mbuffer->bindHalfDuplexOut(process_id);
}
// Stop recording
else {
MainBuffer *mbuffer = Manager::instance().getMainBuffer();
CallID process_id = Recordable::recorder.getRecorderID();
mbuffer->unBindHalfDuplexOut(process_id, _id);
mbuffer->unBindHalfDuplexOut(process_id);
}
Manager::instance().getMainBuffer()->stateInfo();
Recordable::recorder.start(); Recordable::recorder.start();
return recordStatus; return recordStatus;
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include <cc++/thread.h> // for mutex #include <cc++/thread.h> // for mutex
#include <sstream> #include <sstream>
// #include "plug-in/audiorecorder/audiorecord.h"
#include "audio/recordable.h" #include "audio/recordable.h"
#define SIP_SCHEME "sip:" #define SIP_SCHEME "sip:"
......
...@@ -162,12 +162,14 @@ ParticipantSet Conference::getParticipantList() ...@@ -162,12 +162,14 @@ ParticipantSet Conference::getParticipantList()
bool Conference::setRecording() { bool Conference::setRecording() {
bool recordStatus = Recordable::recAudio.setRecording(); bool recordStatus = Recordable::recAudio.isRecording();
if(!recordStatus) Recordable::recAudio.setRecording();
return false;
MainBuffer *mbuffer = &(Manager::instance()._mainBuffer); // start recording
if(!recordStatus){
MainBuffer *mbuffer = Manager::instance().getMainBuffer();
ParticipantSet::iterator iter = _participants.begin(); ParticipantSet::iterator iter = _participants.begin();
...@@ -180,6 +182,26 @@ bool Conference::setRecording() { ...@@ -180,6 +182,26 @@ bool Conference::setRecording() {
mbuffer->bindHalfDuplexOut(process_id); mbuffer->bindHalfDuplexOut(process_id);
}
// stop recording
else {
MainBuffer *mbuffer = Manager::instance().getMainBuffer();
ParticipantSet::iterator iter = _participants.begin();
CallID process_id = Recordable::recorder.getRecorderID();
while(iter != _participants.end()) {
mbuffer->unBindHalfDuplexOut(process_id, *iter);
iter++;
}
mbuffer->unBindHalfDuplexOut(process_id);
}
Recordable::recorder.start(); Recordable::recorder.start();
return recordStatus; return recordStatus;
......
...@@ -1240,7 +1240,6 @@ class ManagerImpl { ...@@ -1240,7 +1240,6 @@ class ManagerImpl {
void unloadAccountMap(); void unloadAccountMap();
public:
/** /**
* Instance of the MainBuffer for the whole application * Instance of the MainBuffer for the whole application
* *
...@@ -1251,6 +1250,14 @@ class ManagerImpl { ...@@ -1251,6 +1250,14 @@ class ManagerImpl {
MainBuffer _mainBuffer; MainBuffer _mainBuffer;
public:
/**
* Return a pointer to the instance of the mainbuffer
*/
MainBuffer *getMainBuffer(void) { return &_mainBuffer; }
/** /**
* Tell if there is a current call processed * Tell if there is a current call processed
* @return bool True if there is a current call * @return bool True if there is a current call
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment