Commit 73e1a44b authored by llea's avatar llea

Display name for From header

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