Commit 73e1a44b authored by llea's avatar llea

Display name for From header

parent 5633ac9e
......@@ -296,6 +296,7 @@ AudioDriversOSS::writeBuffer (void) {
size_t count = audio_buf.getSize();
short *buf = (short*)audio_buf.getData();
audio_buf_info info;
if (ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info) == 0 ) {
......
......@@ -70,7 +70,9 @@ AudioRtp::createNewSession (SipCall *ca) {
RTXThread = new AudioRtpRTX (ca, manager->audiodriver, manager, symetric);
qDebug("-- START SOUND --");
RTXThread->start();
if (RTXThread->start() != 0) {
return -1;
}
return 0;
}
......@@ -83,7 +85,7 @@ AudioRtp::closeRtpSession (SipCall *ca) {
if (RTXThread != NULL) {
// Wait for them...and delete.
// RTXThread->join();
//RTXThread->join();
delete RTXThread;
RTXThread = NULL;
}
......@@ -182,7 +184,7 @@ AudioRtpRTX::run (void) {
} else {
qDebug("RTP(Recv): Added destination %s:%d",
remote_ip.getHostname(),
(unsigned short) ca->remote_sdp_audio_port)
(unsigned short) ca->remote_sdp_audio_port);
}
#endif
......@@ -243,6 +245,7 @@ AudioRtpRTX::run (void) {
if (!manager->mute) {
// i = audioDevice->readBuffer (320);
// data_from_mic = (short*)manager->audiodriver->audio_buf.getData();
// qDebug("audiortp data_from_mic 0x%d", data_from_mic);
i = audioDevice->readBuffer (data_from_mic, 320);
} else {
// When IP-phone user click on mute button, we read buffer of a
......@@ -288,8 +291,8 @@ AudioRtpRTX::run (void) {
// Write decoded data to sound device
manager->audiodriver->audio_buf.resize(expandedSize);
manager->audiodriver->audio_buf.setData (data_for_speakers);
i = audioDevice->writeBuffer (data_for_speakers, expandedSize);
// i = audioDevice->writeBuffer ();
// i = audioDevice->writeBuffer (data_for_speakers, expandedSize);
i = audioDevice->writeBuffer ();
delete adu;
......
/****************************************************************************
** Form implementation generated from reading ui file 'configurationpanel.ui'
**
** Created: Fri Jan 21 17:23:55 2005
** Created: Mon Jan 24 17:46:09 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Form interface generated from reading ui file 'configurationpanel.ui'
**
** Created: Fri Jan 21 17:23:55 2005
** Created: Mon Jan 24 17:46:09 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
......@@ -24,7 +24,7 @@
#define PREFIX "/usr/local"
#endif
#define VERSION "0.1"
#define VERSION "0.2"
#define PROGNAME "SFLPhone"
#define SKINDIR "skins"
#define PIXDIR "pixmaps"
......
......@@ -519,3 +519,9 @@ void
Manager::errorDisplay (char *error) {
gui()->lcd->appendText(error);
}
void
Manager::nameDisplay (char *name) {
gui()->lcd->clearBuffer();
gui()->lcd->appendText(name);
}
......@@ -90,6 +90,7 @@ public:
void startDialTone (void);
void congestion (bool);
void errorDisplay (char*);
void nameDisplay (char*);
private:
bool b_ringing;
......
......@@ -370,6 +370,11 @@ MyDisplay::clear (void) {
setStatus(QString(FREE_STATUS));
}
void
MyDisplay::clearBuffer (void) {
this->textBuffer->remove(0, this->textBuffer->length());
}
void
MyDisplay::clear (const QString &newstatus) {
// Remove everything in the buffer and set the new status.
......
......@@ -69,6 +69,7 @@ public slots:
void appendText (const char *);
void appendText (const QChar &);
void clear (void);
void clearBuffer(void);
void clear (const QString &);
void backspace (void);
......
/****************************************************************************
** Form implementation generated from reading ui file 'phonebook.ui'
**
** Created: Fri Jan 21 17:23:55 2005
** Created: Mon Jan 24 17:46:08 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Form interface generated from reading ui file 'phonebook.ui'
**
** Created: Fri Jan 21 17:23:55 2005
** Created: Mon Jan 24 17:46:08 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
......@@ -1046,12 +1046,12 @@ QtGUIMainWindow::pressedKeySlot (int id) {
// Handle dtmf
key->startTone(code);
key->generateDTMF(buf, SAMPLING_RATE);
// callmanager->audiodriver->audio_buf.resize(SAMPLING_RATE);
// callmanager->audiodriver->audio_buf.setData (buf);
callmanager->audiodriver->audio_buf.resize(SAMPLING_RATE);
callmanager->audiodriver->audio_buf.setData (buf);
pulselen = Config::get("Signalisations", "DTMF.pulseLength", 250);
// callmanager->audiodriver->audio_buf.resize(pulselen * (OCTETS/1000));
a = callmanager->audiodriver->writeBuffer(buf, pulselen * (OCTETS/1000));
// a = callmanager->audiodriver->writeBuffer();
callmanager->audiodriver->audio_buf.resize(pulselen * (OCTETS/1000));
// a = callmanager->audiodriver->writeBuffer(buf, pulselen * (OCTETS/1000));
a = callmanager->audiodriver->writeBuffer();
if (a == 1) {
pressedKeySlot(id);
} else {
......
......@@ -290,8 +290,6 @@ int
SIP::checkURI (const char *buffer) {
osip_uri_t *uri;
int i;
char *dest = NULL;
QString qdest;
// To parse a buffer containing a sip URI
i = osip_uri_init(&uri);
......@@ -306,7 +304,6 @@ SIP::checkURI (const char *buffer) {
// Free memory
osip_uri_free(uri);
osip_free(dest);
return 0;
}
......@@ -326,6 +323,9 @@ SIP::checkUrl(char *url) {
qWarning ("Cannot parse url");
return -1;
}
// Free memory
osip_from_free (to);
return 0;
}
......@@ -421,7 +421,8 @@ SIP::setAuthentication (void) {
string
SIP::fromHeader (string user, string host) {
return ("sip:" + user + "@" + host);
string displayname = Config::gets("Signalisations", "SIP.fullName");
return ("\"" + displayname + "\"" + " <sip:" + user + "@" + host + ">");
}
......@@ -623,13 +624,16 @@ SIP::manageActions (int usedLine, int action) {
case ONHOLD_CALL:
call[usedLine]->usehold = true;
qDebug("ON HOLD CALL 0x%d, usedLine = %d", call[usedLine], usedLine);
eXosip_lock();
i = eXosip_on_hold_call(call[usedLine]->did);
eXosip_unlock();
// Disable audio
call[usedLine]->enable_audio = -1;
callmanager->closeSound(call[usedLine]);
//call[usedLine]->enable_audio = -1;
//callmanager->closeSound(call[usedLine]);
call[usedLine]->closedCall();
break;
// IP-Phone user is parking peer OFF HOLD
......@@ -692,6 +696,7 @@ SIP::getEvent (void) {
eXosip_event_t *event;
int theline = -1;
int curLine;
char *name;
static int countReg = 0;
event = eXosip_event_wait (0, 50);
......@@ -719,6 +724,15 @@ SIP::getEvent (void) {
}
assert (theline >= 0); assert (theline < NUMBER_OF_LINES);
// Display the name which the call comes from
osip_from_t *from;
osip_from_init(&from);
osip_from_parse(from, event->remote_uri);
name = osip_from_get_displayname(from);
callmanager->nameDisplay(name);
callmanager->phLines[theline]->text = QString(name);
osip_from_free(from);
if (call[theline] == NULL) {
//callmanager->setCallInProgress(true);
callmanager->phLines[theline]->setbInProgress(true);
......@@ -928,7 +942,8 @@ SIP::getEvent (void) {
qDebug("<- (%i %i) INVITE (On Hold) from: %s", event->cid,
event->did, event->remote_uri);
theline = findLineNumber(event);
callmanager->closeSound(call[theline]);
//callmanager->closeSound(call[theline]);
call[theline]->closedCall();
call[theline]->onholdCall(event);
break;
......
......@@ -38,13 +38,14 @@ ToneThread::ToneThread (Manager *mngr, short *buf, int total) {
}
ToneThread::~ToneThread (void) {
this->terminate();
}
void
ToneThread::run (void) {
while (mngr->tonezone) {
//mngr->audiodriver->writeBuffer();
mngr->audiodriver->writeBuffer(buf, totalbytes);
mngr->audiodriver->writeBuffer();
//mngr->audiodriver->writeBuffer(buf, totalbytes);
}
}
......@@ -229,13 +230,13 @@ ToneGenerator::toneHandle (int idr) {
// New thread for the tone
if (tonethread == NULL) {
tonethread = new ToneThread (manager, buf, totalbytes);
// manager->audiodriver->audio_buf.resize(totalbytes);
// manager->audiodriver->audio_buf.setData (buf);
manager->audiodriver->audio_buf.resize(totalbytes);
manager->audiodriver->audio_buf.setData (buf);
tonethread->start();
}
if (!manager->tonezone) {
tonethread->join();
//tonethread->join();
if (tonethread != NULL) {
delete tonethread;
tonethread = NULL;
......
/****************************************************************************
** Form implementation generated from reading ui file 'url_input.ui'
**
** Created: Fri Jan 21 17:23:55 2005
** Created: Mon Jan 24 17:46:09 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Form interface generated from reading ui file 'url_input.ui'
**
** Created: Fri Jan 21 17:23:55 2005
** Created: Mon Jan 24 17:46:09 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
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