Commit 7d410955 authored by llea's avatar llea

Clean up code

parent 4ecd714b
SFLphone (0.4)
* Reorganisation of SFLphone architecture
SFLphone (0.3.1) / 2005-04-21
SFLphone (0.3.1) / 2005-05-27
* Reorganisation of SFLphone architecture
* Handle error messages on screen
* Handle refused call
* Notification of remote RINGING event added
* Management of lines updated
* Call management updated
SFLphone (0.3) / 2005-04-05
* ALSA driver support added
......
This is SFLPhone-0.3 release.
This is SFLPhone-0.3.1 release.
You need ccrtp-1.3.0 which needs commoncpp2>=1.3.0
libeXosip-0.9.0 needs libosip2-2.2.0
......@@ -42,6 +42,9 @@ make install
How to use it ?
---------------
If you have old version, remove your sflphonerc file located in $HOME/.sflphone
1. Lauch it, a setup window appears.
2. If you do have a SIP account, fill the SIP stuff where related. You can use
......
......@@ -72,8 +72,6 @@ OBJS = \
gui/qt/configurationpanelui.moc.o \
gui/qt/url_inputui.o \
gui/qt/url_inputui.moc.o \
gui/qt/voIPLinkmanagementui.o \
gui/qt/voIPLinkmanagementui.moc.o \
main.o \
manager.o \
sipcall.o \
......@@ -97,16 +95,12 @@ endif
.cpp.o:
$(CXX) $(DEFVARS) $(CXXFLAGS) -c -o $@ $<
prereq: gui/qt/phonebook.ui gui/qt/url_input.ui gui/qt/configurationpanel.ui gui/qt/voIPLinkmanagement.ui
prereq: gui/qt/url_input.ui gui/qt/configurationpanel.ui
@echo "Making User Interface files..."
$(UIC) -o gui/qt/phonebookui.h gui/qt/phonebook.ui
$(UIC) -o gui/qt/phonebookui.cpp -impl gui/qt/phonebookui.h gui/qt/phonebook.ui
$(UIC) -o gui/qt/url_inputui.h gui/qt/url_input.ui
$(UIC) -o gui/qt/url_inputui.cpp -impl gui/qt/url_inputui.h gui/qt/url_input.ui
$(UIC) -o gui/qt/configurationpanelui.h gui/qt/configurationpanel.ui
$(UIC) -o gui/qt/configurationpanelui.cpp -impl gui/qt/configurationpanelui.h gui/qt/configurationpanel.ui
$(UIC) -o gui/qt/voIPLinkmanagementui.h gui/qt/voIPLinkmanagement.ui
$(UIC) -o gui/qt/voIPLinkmanagementui.cpp -impl gui/qt/voIPLinkmanagementui.h gui/qt/voIPLinkmanagement.ui
%.moc.cpp: %.h
$(MOC) -o $@ $<
......
......@@ -326,7 +326,6 @@ AudioRtpRTX::run (void) {
TimerPort::incTimer(frameSize); // 'frameSize' ms
}
// AudioCodec::destroy(_ca->payload);
delete[] data_for_speakers;
delete[] data_from_mic;
delete[] data_from_mic_tmp;
......
......@@ -164,7 +164,6 @@ void DTMFGenerator::getNextSamples(short* buffer, size_t n) throw(DTMFException)
*/
short* DTMFGenerator::generateSample(unsigned char code) throw (DTMFException) {
short* ptr;
// double arg1, arg2;
// try {
ptr = new short[SAMPLING_RATE];
......@@ -172,16 +171,6 @@ short* DTMFGenerator::generateSample(unsigned char code) throw (DTMFException) {
//throw new DTMFException("No memory left");
return 0;
}
#if 0
arg1 = (double)2 * (double)M_PI * (double)tones[code].higher / (double)SAMPLING_RATE;
arg2 = (double)2 * (double)M_PI * (double)tones[code].lower / (double)SAMPLING_RATE;
for(unsigned int i = 0; i < SAMPLING_RATE; i++) {
ptr[i] = (short)((double)(AMPLITUDE >> 2) * sin(arg1 * i) + (double)(AMPLITUDE >> 2) * sin(arg2 * i));
};
return ptr;
#endif
generateSin(tones[code].higher, tones[code].lower, AMPLITUDE,
SAMPLING_RATE, ptr);
......
......@@ -51,9 +51,6 @@ public:
class DTMFGenerator : public ToneGenerator
{
private:
// unsigned int samplingRate; // Sampling rate used, default is 8000 Hz
// short amplitude; // Amplitude of the resulting signal
struct DTMFTone {
unsigned char code; // Code of the tone
int lower; // Lower frequency
......
......@@ -18,19 +18,11 @@
*/
#include <iostream>
//#include "audio/audiocodec.h"
#include "call.h"
#include "manager.h"
#include "sipvoiplink.h"
#include "voIPLink.h"
Call::Call (void)
{
initConstructor();
_id = 0;
_manager = NULL;
_voIPLink = NULL;
}
Call::Call (Manager* manager, short id, CallType type, VoIPLink* voiplink)
{
......@@ -104,13 +96,6 @@ Call::getVoIPLink (void)
return _voIPLink;
}
/*
void
Call::setAudioCodec (void)
{
_audiocodec = _voIPLink->getAudioCodec(getId());
}
*/
string
Call::getStatus (void)
{
......@@ -332,13 +317,6 @@ Call::refuse (void)
return i;
}
int
Call::cancel (void)
{
int i = _voIPLink->cancel(_id);
_voIPLink->deleteSipCall(_id);
return i;
}
///////////////////////////////////////////////////////////////////////////////
// Private functions
......@@ -350,5 +328,4 @@ Call::initConstructor(void)
_state = NotExist;
_type = Null;
_voIPLinkId = 1;
// _audiocodec = NULL;
}
......@@ -52,11 +52,8 @@ enum CallType {
#include "manager.h"
//class AudioCodec;
class Call {
public:
Call(void);
Call(Manager* manager, short id, CallType type, VoIPLink* voiplink);
~Call(void);
......@@ -71,7 +68,6 @@ public:
void setVoIPLinkId (short voIPLinkId);
void setVoIPLink (VoIPLink* voIPLink);
VoIPLink* getVoIPLink(void);
// void setAudioCodec(void);
string getStatus (void);
void setStatus (const string& status);
......@@ -113,15 +109,12 @@ public:
int muteOn (void);
int muteOff (void);
int refuse (void);
int cancel (void);
private:
void initConstructor (void);
Manager* _manager;
VoIPLink* _voIPLink;
// AudioCodec* _audiocodec;
short _id;
short _voIPLinkId;
......
......@@ -43,11 +43,6 @@ Config::get (const string& section, const string& key, const string& defval) {
return value;
}
}
/*
string
Config::getschar (const string& section, const string& key) {
return Config::getchar (section, key, "");
}*/
string
Config::getchar (const string& section, const string& key, const string& defval){
......@@ -59,13 +54,7 @@ Config::getchar (const string& section, const string& key, const string& defval)
return value;
}
}
/*
bool
Config::getb (const string& section, const string& key) {
return (bool)Config::get (section, key, 0);
}
*/
int
Config::geti (const string& section, const string& key) {
return Config::get (section, key, 0);
......
......@@ -33,9 +33,7 @@ public:
~Config (void) {};
static string gets (const string&, const string&);
// static string getschar(const string&, const string&);
static int geti (const string&, const string&);
// static bool getb (const string&, const string&);
static string get (const string&, const string&, const string&);
static string getchar (const string&, const string&, const string&);
......
......@@ -17,7 +17,6 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
//#include <stdio.h>
#include <iostream>
#include "eventthread.h"
......
......@@ -32,7 +32,7 @@
#define PREFIX "/usr/local"
#endif
#define VERSION "0.4"
#define VERSION "0.3.1"
#define PROGNAME "sflphone"
#define SKINDIR "skins"
#define PIXDIR "pixmaps"
......
......@@ -116,16 +116,6 @@ GuiFramework::refuseCall (short id)
}
}
int
GuiFramework::cancelCall (short id)
{
if (_manager->cancelCall(id)) {
return 1;
} else {
return 0;
}
}
int
GuiFramework::saveConfig (void)
{
......
......@@ -56,7 +56,6 @@ public:
int muteOn (short id);
int muteOff (short id);
int refuseCall (short id);
int cancelCall (short id);
int saveConfig (void);
int registerVoIPLink (void);
......
......@@ -18,1302 +18,1237 @@
<property name="sizeGripEnabled">
<bool>true</bool>
</property>
<widget class="QLayoutWidget">
<grid>
<property name="name">
<cstring>layout20</cstring>
<cstring>unnamed</cstring>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>12</y>
<width>540</width>
<height>530</height>
</rect>
</property>
<vbox>
<widget class="QLayoutWidget" row="1" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>unnamed</cstring>
<cstring>layout19</cstring>
</property>
<widget class="QLayoutWidget">
<vbox>
<property name="name">
<cstring>layout31</cstring>
<cstring>unnamed</cstring>
</property>
<hbox>
<widget class="Line">
<property name="name">
<cstring>line1</cstring>
</property>
<property name="frameShape">
<enum>HLine</enum>
</property>
<property name="frameShadow">
<enum>Sunken</enum>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>unnamed</cstring>
<cstring>layout28</cstring>
</property>
<widget class="QListBox">
<hbox>
<property name="name">
<cstring>Menu</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="cursor">
<cursor>13</cursor>
</property>
<property name="currentItem">
<number>-1</number>
</property>
<property name="selectionMode">
<enum>Single</enum>
<cstring>unnamed</cstring>
</property>
</widget>
<widget class="QLayoutWidget">
<widget class="QPushButton">
<property name="name">
<cstring>buttonHelp</cstring>
</property>
<property name="text">
<string>&amp;Help</string>
</property>
<property name="accel">
<string>F1</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
</widget>
<spacer>
<property name="name">
<cstring>Horizontal Spacing2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>160</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QPushButton">
<property name="name">
<cstring>buttonSave</cstring>
</property>
<property name="text">
<string>&amp;Save</string>
</property>
<property name="accel">
<string>Alt+S</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>buttonOk</cstring>
</property>
<property name="text">
<string>&amp;OK</string>
</property>
<property name="accel">
<string>Alt+O</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>buttonCancel</cstring>
</property>
<property name="text">
<string>&amp;Cancel</string>
</property>
<property name="accel">
<string>F, Backspace</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
</widget>
</hbox>
</widget>
</vbox>
</widget>
<widget class="QListBox" row="0" column="0">
<property name="name">
<cstring>Menu</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="cursor">
<cursor>13</cursor>
</property>
<property name="currentItem">
<number>-1</number>
</property>
<property name="selectionMode">
<enum>Single</enum>
</property>
</widget>
<widget class="QLayoutWidget" row="0" column="1">
<property name="name">
<cstring>layout17</cstring>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<property name="name">
<cstring>TitleTab</cstring>
</property>
<property name="font">
<font>
<bold>1</bold>
</font>
</property>
<property name="text">
<string>Setup signalisation</string>
</property>
</widget>
<widget class="Line">
<property name="name">
<cstring>line2</cstring>
</property>
<property name="frameShape">
<enum>HLine</enum>
</property>
<property name="frameShadow">
<enum>Sunken</enum>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
</widget>
<widget class="QTabWidget">
<property name="name">
<cstring>Tab_Signalisations</cstring>
</property>
<widget class="QWidget">
<property name="name">
<cstring>layout17</cstring>
<cstring>SIPPage</cstring>
</property>
<vbox>
<attribute name="title">
<string>SIP Authentication</string>
</attribute>
<widget class="QLayoutWidget">
<property name="name">
<cstring>unnamed</cstring>
<cstring>layout24</cstring>
</property>
<widget class="QLabel">
<property name="name">
<cstring>TitleTab</cstring>
</property>
<property name="font">
<font>
<bold>1</bold>
</font>
</property>
<property name="text">
<string>Setup signalisation</string>
</property>
</widget>
<widget class="Line">
<property name="name">
<cstring>line2</cstring>
</property>
<property name="frameShape">
<enum>HLine</enum>
</property>
<property name="frameShadow">
<enum>Sunken</enum>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
</widget>
<widget class="QTabWidget">
<property name="geometry">
<rect>
<x>16</x>
<y>12</y>
<width>401</width>
<height>393</height>
</rect>
</property>
<vbox>
<property name="name">
<cstring>Tab_Signalisations</cstring>
<cstring>unnamed</cstring>
</property>
<widget class="QWidget">
<widget class="QGroupBox">
<property name="name">
<cstring>SIPPage</cstring>
<cstring>groupBox1</cstring>
</property>
<property name="title">
<string></string>
</property>
<attribute name="title">
<string>SIP Authentication</string>
</attribute>
<widget class="QLayoutWidget">
<grid>
<property name="name">
<cstring>layout24</cstring>
<cstring>unnamed</cstring>
</property>
<property name="geometry">
<rect>
<x>16</x>
<y>12</y>
<width>401</width>
<height>393</height>
</rect>
</property>
<vbox>
<widget class="QLabel" row="0" column="0">
<property name="name">
<cstring>unnamed</cstring>
<cstring>textLabel2</cstring>
</property>
<widget class="QGroupBox">
<property name="name">
<cstring>groupBox1</cstring>
</property>
<property name="title">
<string></string>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel" row="0" column="0">
<property name="name">
<cstring>textLabel2</cstring>
</property>
<property name="text">
<string>Full name</string>
</property>
</widget>
<widget class="QLineEdit" row="1" column="0">
<property name="name">
<cstring>fullName</cstring>
</property>
</widget>
<widget class="QLineEdit" row="3" column="0">
<property name="name">
<cstring>userPart</cstring>
</property>
</widget>
<widget class="QLabel" row="2" column="0">
<property name="name">
<cstring>textLabel3</cstring>
</property>
<property name="text">
<string>User Part of SIP URL</string>
</property>
</widget>
<widget class="QLabel" row="4" column="0">
<property name="name">