Fix incoming call notification.

Fix transfer if no busy line.
This commit is contained in:
llea
2005-07-18 21:06:00 +00:00
parent 45e8bd3edd
commit 2eda087201
5 changed files with 21 additions and 17 deletions

View File

@ -1,3 +1,7 @@
Laurielle LEA (18 July 2005) version 0.4
- Fix incoming call sound notification
- Fix transfer if no busy line
Laurielle LEA (15 July 2005) version 0.4
- Fix configuration init

View File

@ -150,6 +150,7 @@ AudioLayer::audioCallback (const void *inputBuffer, void *outputBuffer,
// Consume the regular one as well (same amount of bytes)
_mainSndRingBuffer.Discard(SAMPLES_SIZE(toGet));
}
else {
// If nothing urgent, play the regular sound samples

View File

@ -289,7 +289,7 @@ AudioRtpRTX::receiveSessionForSpkr (int16* data_for_speakers,
countTime += time->getSecond();
if (Manager::instance().getNumberOfCalls() > 0
and Manager::instance().getbRingtone()) {
countTime = countTime % 2000;
countTime = countTime % 4000;
if (countTime < 100 and countTime > 0) {
Manager::instance().notificationIncomingCall();
}

View File

@ -1027,11 +1027,15 @@ int
QtGUIMainWindow::qt_transferCall (short id)
{
int i;
const string to(_lcd->getTextBuffer().ascii());;
_debug("qt_transferCall: Transfer call %d to %s\n", id, to.data());
i = transferCall(id, to);
getPhoneLine(id)->setStatus(QString(getCall(id)->getStatus()));
return i;
if (id != -1) {
const string to(_lcd->getTextBuffer().ascii());;
_debug("qt_transferCall: Transfer call %d to %s\n", id, to.data());
i = transferCall(id, to);
getPhoneLine(id)->setStatus(QString(getCall(id)->getStatus()));
return i;
} else {
return 0;
}
}
void
@ -1177,6 +1181,7 @@ QtGUIMainWindow::hangupLine (void)
int i;
int line = getCurrentLine();
int id = phLines[line]->getCallId();
setTransfer(false);
_debug("id = %d et line = %d\n", id, line);
if (Manager::instance().getbCongestion()) {
@ -1320,7 +1325,8 @@ QtGUIMainWindow::button_msg (void) {
// This number is validated by ok-button or typing Enter
void
QtGUIMainWindow::button_transfer (void) {
if (getCurrentLine() != -1) {
int line_num = getCurrentLine();
if (line_num != -1 and phLines[line_num]->isBusy()) {
setTransfer(true);
onHoldCall(line2id(getCurrentLine()));
displayStatus(TRANSFER_STATUS);

View File

@ -640,13 +640,13 @@ void
ManagerImpl::notificationIncomingCall (void) {
int16* buf_ctrl_vol;
int16* buffer = new int16[SAMPLING_RATE];
int size = SAMPLING_RATE/2;
int size = SAMPLES_SIZE(FRAME_PER_BUFFER);//SAMPLING_RATE/2;
int k, spkrVolume;
_tone->generateSin(440, 0, buffer);
// Control volume
buf_ctrl_vol = new int16[size];
buf_ctrl_vol = new int16[size*CHANNELS];
spkrVolume = getSpkrVolume();
for (int j = 0; j < size; j++) {
k = j*2;
@ -654,15 +654,8 @@ ManagerImpl::notificationIncomingCall (void) {
}
getAudioDriver()->urgentRingBuffer().Put(buf_ctrl_vol,
size * CHANNELS);
SAMPLES_SIZE(FRAME_PER_BUFFER));
_debug("---- Notification call\n");
#if 0
getAudioDriver()->startStream();
getAudioDriver()->sleep(NOTIFICATION_LEN);
getAudioDriver()->stopStream();
#endif
delete[] buf_ctrl_vol;
delete[] buffer;
}