Commit 0714f633 authored by Tristan Matthews's avatar Tristan Matthews

return a copy of the call ID, not just a reference.

parent 592e8153
......@@ -126,7 +126,7 @@ AudioRtpRecord::~AudioRtpRecord()
}
AudioRtpRecordHandler::AudioRtpRecordHandler (SIPCall *ca) : _audioRtpRecord (), _id (ca->getCallId()), echoCanceller(ca->getMemoryPool()), gainController(8000, -10.0)
AudioRtpRecordHandler::AudioRtpRecordHandler (SIPCall *ca) : _audioRtpRecord (), id_ (ca->getCallId()), echoCanceller(ca->getMemoryPool()), gainController(8000, -10.0)
{
}
......@@ -275,13 +275,13 @@ int AudioRtpRecordHandler::processDataEncode (void)
int bytesToGet = computeNbByteAudioLayer (mainBufferSampleRate, fixedCodecFramesize);
// available bytes inside ringbuffer
int availBytesFromMic = Manager::instance().getMainBuffer()->availForGet (_id);
int availBytesFromMic = Manager::instance().getMainBuffer()->availForGet (id_);
if (availBytesFromMic < bytesToGet)
return 0;
// Get bytes from micRingBuffer to data_from_mic
int nbSample = Manager::instance().getMainBuffer()->getData (micData, bytesToGet, 100, _id) / sizeof (SFLDataFormat);
int nbSample = Manager::instance().getMainBuffer()->getData (micData, bytesToGet, 100, id_) / sizeof (SFLDataFormat);
// process mic fade in
if (!_audioRtpRecord._micFadeInComplete)
......@@ -393,7 +393,7 @@ void AudioRtpRecordHandler::processDataDecode (unsigned char *spkrData, unsigned
}
// put data in audio layer, size in byte
Manager::instance().getMainBuffer()->putData (spkrDataConverted, nbSample * sizeof (SFLDataFormat), 100, _id);
Manager::instance().getMainBuffer()->putData (spkrDataConverted, nbSample * sizeof (SFLDataFormat), 100, id_);
} else {
......@@ -401,7 +401,7 @@ void AudioRtpRecordHandler::processDataDecode (unsigned char *spkrData, unsigned
echoCanceller.putData(spkrDataDecoded, expandedSize);
}
// put data in audio layer, size in byte
Manager::instance().getMainBuffer()->putData (spkrDataDecoded, expandedSize, 100, _id);
Manager::instance().getMainBuffer()->putData (spkrDataDecoded, expandedSize, 100, id_);
}
}
......
......@@ -225,9 +225,9 @@ class AudioRtpRecordHandler
private:
std::string& _id;
const std::string id_;
EchoSuppress echoCanceller;
EchoSuppress echoCanceller;
GainControl gainController;
};
......
......@@ -86,10 +86,10 @@ class Call: public Recordable
virtual ~Call();
/**
* Return a reference on the call id
* Return a copy of the call id
* @return call id
*/
std::string& getCallId() {
std::string getCallId() const {
return _id;
}
......
......@@ -75,7 +75,7 @@ static void XMLCALL startElementCallback (void *userData, const char *name, cons
}
static void XMLCALL endElementCallback (void *userData, const char *name)
static void XMLCALL endElementCallback (void * /*userData*/, const char * /*name*/)
{
// std::cout << "endElement " << name << std::endl;
}
......@@ -133,7 +133,7 @@ bool InstantMessaging::saveMessage (const std::string& message, const std::strin
return true;
}
std::string InstantMessaging::receive (const std::string& message, const std::string& author, std::string& id)
std::string InstantMessaging::receive (const std::string& message, const std::string& /*author*/, const std::string& /*id*/)
{
// We just receive a TEXT message. Before sent it to the recipient, we must assure that the message is complete.
......@@ -153,7 +153,7 @@ std::string InstantMessaging::receive (const std::string& message, const std::st
}
pj_status_t InstantMessaging::notify (std::string& id)
pj_status_t InstantMessaging::notify (const std::string& /*id*/)
{
// Notify the clients through a D-Bus signal
return PJ_SUCCESS;
......@@ -246,7 +246,7 @@ pj_status_t InstantMessaging::send_sip_message (pjsip_inv_session *session, std:
}
bool InstantMessaging::iax_send (iax_session* session, const std::string& id, const std::string& message)
bool InstantMessaging::iax_send (iax_session* session, const std::string& /*id*/, const std::string& message)
{
if (iax_send_text (session, message.c_str()) != -1)
return true;
......
......@@ -141,7 +141,7 @@ class InstantMessaging
* @param message The message contained in the TEXT message
* @param id The call recipient of the message
*/
std::string receive (const std::string& message, const std::string& author, std::string& id);
std::string receive (const std::string& message, const std::string& author, const std::string& id);
/*
* Send a SIP string message inside a call
......@@ -168,7 +168,7 @@ class InstantMessaging
*
* @param id The callID to notify (TODO: accountID?)
*/
pj_status_t notify (std::string& id);
pj_status_t notify (const std::string& /*id*/);
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment