Commit 98c95e44 authored by alexandresavard's avatar alexandresavard
Browse files

Merge branch 'master' into recording

Conflicts:

	src/audio/audiortp.cpp
	src/iaxvoiplink.cpp
	src/sipvoiplink.cpp
	src/sipvoiplink.h
	src/voiplink.h
parents e872d3e1 047b3f4c
......@@ -91,8 +91,8 @@ else
# Prepare for packaging
mv sflphone sflphone-$ver
cp sflphone-$ver/platform/$platform.spec $BUILDDIR/SPECS/
cp sflphone-$ver/libs/pjproject-1.0/libpj-sfl.pc $BUILDDIR/SOURCES
cp sflphone-$ver/platform/$platform.spec $BUILDDIR/SPECS/sflphone.spec
sed -e "s!@PREFIX@!/usr!" sflphone-$ver/libs/pjproject-1.0/libpj-sfl.pc.in > $BUILDDIR/SOURCES/libpj-sfl.pc
tar zcvf sflphone-$ver.tar.gz sflphone-$ver
rm sflphone-$ver -rf
......
%define name sflphone
%define version 0.9.2
Autoreq: 0
Name: %name
Summary: A VoIP daemon with SIP protocol and IAX protocol
Version: %version
Release: 6fedora
License: GPL
Group: System Environment/Daemons
URL: http://www.sflphone.org/
Packager: Yun Liu <yun.liu@savoirfairelinux.com>
Source0: %{name}-%{version}.tar.gz
Source1: libpj-sfl.pc
BuildRoot: %{_tmppath}/%{name}-%{version}
Requires: commoncpp2 ccrtp cppunit libsamplerate pulseaudio-libs-zeroconf pulseaudio-libs-devel gsm speex sflphone-iax2 dbus-c++ libgcc dbus-glib expat gtk2 glibc glib2 dbus-libs dbus-glib libsexy libnotify perl
%description
SFLPhoned is a VoIP daeamon with SIP protocol and IAX protocol.
%prep
%setup -q
cd libs/pjproject-1.0
./configure --prefix=/usr
make dep
make clean
make
cd ../..
%build
./autogen.sh --prefix=/usr
make
cd sflphone-gtk/
./autogen.sh --prefix=/usr
make
cd ..
%install
%makeinstall
cd sflphone-gtk/
%makeinstall
cd ../libs/pjproject-1.0
%makeinstall
cd ../..
cd %{buildroot}/usr/bin/
ln -sf ./sflphone-gtk sflphone
cd -
cp %{SOURCE1} %{buildroot}/usr/lib/pkgconfig/ -f
rm -rf %{buildroot}/usr/lib/debug
rm -rf %{buildroot}/usr/include/
%files
%defattr(-, root, root)
/usr/bin/*
/usr/lib/*
/usr/share/applications/*
/usr/share/dbus-1/services/*
/usr/share/locale/*
/usr/share/pixmaps/*
/usr/share/sflphone/*
/usr/share/man/*
%clean
rm -rf %{buildroot}
%changelog
* Mon Jan 26 2009 Yun Liu <yun.liu@savoirfairelinux.com> 6
- Packaging sflphone for Fedora 10
* Mon Jan 5 2009 Yun Liu <yun.liu@savoirfairelinux.com>
- Fix bug ticket #107, #108, #109, #110, #111, #117, #129
* Thu Nov 6 2008 Yun Liu <yun.liu@savoirfairelinux.com>
- Packaging sflphone for Fedora 9
* Thu Nov 30 2006 Yan Morin <yan.morin@savoirfairelinux.com>
Packaging sflphone for Fedora Core 6
* Wed Sep 6 2006 Yan Morin <yan.morin@savoirfairelinux.com>
Packaging sflphone, sflphone-qt and sflphone-cli
* Mon Nov 21 2005 Yan Morin <yan.morin@savoirfairelinux.com>
- Final 0.6.0 version (Release / Source without alphatag)
%define name sflphone
%define version 0.9.2
Autoreq: 0
Name: %name
Summary: A VoIP daemon with SIP protocol and IAX protocol
Version: %version
Release: 6suse
License: GPL
Group: System Environment/Daemons
URL: http://www.sflphone.org/
Packager: Yun Liu <yun.liu@savoirfairelinux.com>
Source0: %{name}-%{version}.tar.gz
Source1: libpj-sfl.pc
BuildRoot: %{_tmppath}/%{name}-%{version}
Requires: commoncpp2 ccrtp cppunit libsamplerate pulseaudio-libs-zeroconf pulseaudio-libs-devel gsm speex sflphone-iax2 dbus-c++ libgcc dbus-glib expat gtk2 glibc glib2 dbus-libs dbus-glib libsexy libnotify perl
%description
SFLPhoned is a VoIP daeamon with SIP protocol and IAX protocol.
%prep
%setup -q
cd libs/pjproject-1.0
./configure --prefix=/usr
make dep
make clean
make
cd ../..
%build
./autogen.sh --prefix=/usr
make
cd sflphone-gtk/
./autogen.sh --prefix=/usr
make
cd ..
%install
make prefix=%{buildroot}/usr install
cd sflphone-gtk/
make prefix=%{buildroot}/usr install
cd ../libs/pjproject-1.0
make prefix=%{buildroot}/usr install
cd ../..
cd %{buildroot}/usr/bin/
ln -sf ./sflphone-gtk sflphone
cd -
cp %{SOURCE1} %{buildroot}/usr/lib/pkgconfig/ -f
rm -rf %{buildroot}/usr/lib/debug
rm -rf %{buildroot}/usr/include
%files
%defattr(-, root, root)
/usr/bin/*
/usr/lib/*
/usr/share/applications/*
/usr/share/dbus-1/services/*
/usr/share/locale/*
/usr/share/pixmaps/*
/usr/share/sflphone/*
/usr/share/man/*
%clean
rm -rf %{buildroot}
%changelog
* Mon Jan 26 2009 Yun Liu <yun.liu@savoirfairelinux.com> 6suse
- Packaging sflphone on openSUSE 11
* Mon Jan 5 2009 Yun Liu <yun.liu@savoirfairelinux.com>
- Fix bug ticket #107, #108, #109, #110, #111, #117, #129
* Thu Nov 6 2008 Yun Liu <yun.liu@savoirfairelinux.com>
- Packaging sflphone for Fedora 9
* Thu Nov 30 2006 Yan Morin <yan.morin@savoirfairelinux.com>
Packaging sflphone for Fedora Core 6
* Wed Sep 6 2006 Yan Morin <yan.morin@savoirfairelinux.com>
Packaging sflphone, sflphone-qt and sflphone-cli
* Mon Nov 21 2005 Yan Morin <yan.morin@savoirfairelinux.com>
- Final 0.6.0 version (Release / Source without alphatag)
......@@ -259,7 +259,7 @@ sflphone_hang_up()
case CALL_STATE_HOLD:
case CALL_STATE_BUSY:
case CALL_STATE_FAILURE:
case CALL_STATE_RECORDING:
case CALL_STATE_RECORD:
dbus_hang_up (selectedCall);
selectedCall->state = CALL_STATE_DIALING;
(void) time(&selectedCall->_stop);
......
/* Generated by dbus-binding-tool; do not edit! */
#include <glib/gtypes.h>
#include <glib/gerror.h>
#include <glib.h>
#include <dbus/dbus-glib.h>
G_BEGIN_DECLS
......@@ -2001,6 +2000,156 @@ org_sflphone_SFLphone_ConfigurationManager_get_sip_port_async (DBusGProxy *proxy
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "getSipPort", org_sflphone_SFLphone_ConfigurationManager_get_sip_port_async_callback, stuff, g_free, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_set_stun_server (DBusGProxy *proxy, const char * IN_server, GError **error)
{
return dbus_g_proxy_call (proxy, "setStunServer", error, G_TYPE_STRING, IN_server, G_TYPE_INVALID, G_TYPE_INVALID);
}
typedef void (*org_sflphone_SFLphone_ConfigurationManager_set_stun_server_reply) (DBusGProxy *proxy, GError *error, gpointer userdata);
static void
org_sflphone_SFLphone_ConfigurationManager_set_stun_server_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID);
(*(org_sflphone_SFLphone_ConfigurationManager_set_stun_server_reply)data->cb) (proxy, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_sflphone_SFLphone_ConfigurationManager_set_stun_server_async (DBusGProxy *proxy, const char * IN_server, org_sflphone_SFLphone_ConfigurationManager_set_stun_server_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "setStunServer", org_sflphone_SFLphone_ConfigurationManager_set_stun_server_async_callback, stuff, g_free, G_TYPE_STRING, IN_server, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_get_stun_server (DBusGProxy *proxy, char ** OUT_server, GError **error)
{
return dbus_g_proxy_call (proxy, "getStunServer", error, G_TYPE_INVALID, G_TYPE_STRING, OUT_server, G_TYPE_INVALID);
}
typedef void (*org_sflphone_SFLphone_ConfigurationManager_get_stun_server_reply) (DBusGProxy *proxy, char * OUT_server, GError *error, gpointer userdata);
static void
org_sflphone_SFLphone_ConfigurationManager_get_stun_server_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
char * OUT_server;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRING, &OUT_server, G_TYPE_INVALID);
(*(org_sflphone_SFLphone_ConfigurationManager_get_stun_server_reply)data->cb) (proxy, OUT_server, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_sflphone_SFLphone_ConfigurationManager_get_stun_server_async (DBusGProxy *proxy, org_sflphone_SFLphone_ConfigurationManager_get_stun_server_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "getStunServer", org_sflphone_SFLphone_ConfigurationManager_get_stun_server_async_callback, stuff, g_free, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_enable_stun (DBusGProxy *proxy, GError **error)
{
return dbus_g_proxy_call (proxy, "enableStun", error, G_TYPE_INVALID, G_TYPE_INVALID);
}
typedef void (*org_sflphone_SFLphone_ConfigurationManager_enable_stun_reply) (DBusGProxy *proxy, GError *error, gpointer userdata);
static void
org_sflphone_SFLphone_ConfigurationManager_enable_stun_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID);
(*(org_sflphone_SFLphone_ConfigurationManager_enable_stun_reply)data->cb) (proxy, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_sflphone_SFLphone_ConfigurationManager_enable_stun_async (DBusGProxy *proxy, org_sflphone_SFLphone_ConfigurationManager_enable_stun_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "enableStun", org_sflphone_SFLphone_ConfigurationManager_enable_stun_async_callback, stuff, g_free, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_is_stun_enabled (DBusGProxy *proxy, gint* OUT_state, GError **error)
{
return dbus_g_proxy_call (proxy, "isStunEnabled", error, G_TYPE_INVALID, G_TYPE_INT, OUT_state, G_TYPE_INVALID);
}
typedef void (*org_sflphone_SFLphone_ConfigurationManager_is_stun_enabled_reply) (DBusGProxy *proxy, gint OUT_state, GError *error, gpointer userdata);
static void
org_sflphone_SFLphone_ConfigurationManager_is_stun_enabled_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
gint OUT_state;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INT, &OUT_state, G_TYPE_INVALID);
(*(org_sflphone_SFLphone_ConfigurationManager_is_stun_enabled_reply)data->cb) (proxy, OUT_state, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_sflphone_SFLphone_ConfigurationManager_is_stun_enabled_async (DBusGProxy *proxy, org_sflphone_SFLphone_ConfigurationManager_is_stun_enabled_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "isStunEnabled", org_sflphone_SFLphone_ConfigurationManager_is_stun_enabled_async_callback, stuff, g_free, G_TYPE_INVALID);
}
#endif /* defined DBUS_GLIB_CLIENT_WRAPPERS_org_sflphone_SFLphone_ConfigurationManager */
G_END_DECLS
......@@ -109,7 +109,7 @@ config_window_fill_account_list()
* Delete an account
*/
static void
delete_account(GtkWidget *widget, gpointer data UNUSED)
delete_account(GtkWidget *widget UNUSED, gpointer data UNUSED)
{
if(selectedAccount)
{
......@@ -449,24 +449,15 @@ create_accounts_tab()
void stun_state( void )
{
guint i, size;
gchar * stun_enabled = "FALSE";
account_t * account;
guint stun_enabled = 0;
gboolean stunActive = (gboolean)gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( stunEnable ));
gtk_widget_set_sensitive( GTK_WIDGET( stunServer ) , stunActive );
// Check if we actually change the state
size = account_list_get_size();
for(i=0; i<size; i++)
{
account = account_list_get_nth(i);
if( strcmp(g_hash_table_lookup(account->properties, ACCOUNT_TYPE), "SIP" ) == 0 )
{
stun_enabled = g_hash_table_lookup(account->properties, ACCOUNT_SIP_STUN_ENABLED);
break;
}
}
if( (stunActive && strcmp(stun_enabled, "FALSE")==0) || (!stunActive && strcmp(stun_enabled, "TRUE")==0) )
stun_enabled = dbus_stun_is_enabled();
if( (stunActive && stun_enabled ==0 ) || (!stunActive && stun_enabled ==1))
{
gtk_widget_set_sensitive( GTK_WIDGET( applyButton ) , TRUE );
}
......@@ -477,24 +468,8 @@ void stun_state( void )
void update_registration( void )
{
guint nb_accounts, i;
account_t *current;
nb_accounts = account_list_get_size();
for(i=0; i<nb_accounts;i++){
current = account_list_get_nth(i);
// If SIP account, then set the new value
if( strcmp(g_hash_table_lookup(current->properties, ACCOUNT_TYPE), "SIP" ) == 0 )
{
g_hash_table_replace(current->properties, g_strdup(ACCOUNT_SIP_STUN_SERVER),
g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(stunServer))));
g_hash_table_replace(current->properties, g_strdup(ACCOUNT_SIP_STUN_ENABLED),
g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(stunEnable)) ? "TRUE": "FALSE"));
dbus_set_account_details(current);
}
}
dbus_set_stun_server((gchar *)gtk_entry_get_text(GTK_ENTRY(stunServer)));
dbus_enable_stun();
gtk_widget_set_sensitive(GTK_WIDGET( applyButton ) , FALSE );
}
......@@ -505,23 +480,11 @@ GtkWidget* create_stun_tab()
gchar * stun_server= "stun.fwdnet.net:3478";
gchar * stun_enabled = "FALSE";
GtkWidget * label;
account_t * account;
guint i, size;
// All SIP accounts are supposed to have the same STUN configuration
// So let's take the first SIP account we find
size = account_list_get_size();
for(i=0; i<size; i++)
{
account = account_list_get_nth(i);
if( strcmp(g_hash_table_lookup(account->properties, ACCOUNT_TYPE), "SIP" ) == 0 )
{
stun_enabled = g_hash_table_lookup(account->properties, ACCOUNT_SIP_STUN_ENABLED);
stun_server = g_hash_table_lookup(account->properties, ACCOUNT_SIP_STUN_SERVER);
break;
}
}
/* Retrieve the STUN configuration */
stun_enabled = (dbus_stun_is_enabled()==1)?"TRUE":"FALSE";
stun_server = dbus_get_stun_server();
tableNat = gtk_table_new ( 3, 2 , FALSE/* homogeneous */);
// NAT detection code section
......
......@@ -207,11 +207,10 @@ dbus_connect ()
}
nameOwnerProxy = dbus_g_proxy_new_for_name_owner( connection,
nameOwnerProxy = dbus_g_proxy_new_for_name( connection,
DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS,
DBUS_INTERFACE_DBUS,
&error);
DBUS_INTERFACE_DBUS);
if( nameOwnerProxy==NULL)
{
......@@ -227,11 +226,11 @@ dbus_connect ()
/* Create a proxy object for the "bus driver" (name "org.freedesktop.DBus") */
instanceProxy = dbus_g_proxy_new_for_name_owner (connection,
instanceProxy = dbus_g_proxy_new_for_name (connection,
"org.sflphone.SFLphone",
"/org/sflphone/SFLphone/Instance",
"org.sflphone.SFLphone.Instance",
&error);
"org.sflphone.SFLphone.Instance");
if (instanceProxy==NULL)
{
g_printerr ("Failed to get proxy to Instance\n");
......@@ -241,11 +240,11 @@ dbus_connect ()
g_print ("DBus connected to Instance\n");
callManagerProxy = dbus_g_proxy_new_for_name_owner (connection,
callManagerProxy = dbus_g_proxy_new_for_name (connection,
"org.sflphone.SFLphone",
"/org/sflphone/SFLphone/CallManager",
"org.sflphone.SFLphone.CallManager",
&error);
"org.sflphone.SFLphone.CallManager");
if (callManagerProxy==NULL)
{
g_printerr ("Failed to get proxy to CallManagers\n");
......@@ -288,11 +287,11 @@ dbus_connect ()
dbus_g_proxy_connect_signal (callManagerProxy,
"volumeChanged", G_CALLBACK(volume_changed_cb), NULL, NULL);
configurationManagerProxy = dbus_g_proxy_new_for_name_owner (connection,
configurationManagerProxy = dbus_g_proxy_new_for_name (connection,
"org.sflphone.SFLphone",
"/org/sflphone/SFLphone/ConfigurationManager",
"org.sflphone.SFLphone.ConfigurationManager",
&error);
"org.sflphone.SFLphone.ConfigurationManager");
if (!configurationManagerProxy)
{
g_printerr ("Failed to get proxy to ConfigurationManager\n");
......@@ -1557,3 +1556,58 @@ dbus_get_sip_port( void )
return (guint)portNum;
}
gchar* dbus_get_stun_server (void)
{
GError* error = NULL;
gchar* server;
org_sflphone_SFLphone_ConfigurationManager_get_stun_server(
configurationManagerProxy,
&server,
&error);
if(error)
{
g_error_free(error);
}
return server;
}
void dbus_set_stun_server( gchar* server)
{
GError* error = NULL;
org_sflphone_SFLphone_ConfigurationManager_set_stun_server(
configurationManagerProxy,
server,
&error);
if(error)
{
g_error_free(error);
}
}
guint dbus_stun_is_enabled (void)
{
GError* error = NULL;
guint stun;
org_sflphone_SFLphone_ConfigurationManager_is_stun_enabled(
configurationManagerProxy,
&stun,
&error);
if(error)
{
g_error_free(error);
}
return stun;
}
void dbus_enable_stun (void)
{
GError* error = NULL;
org_sflphone_SFLphone_ConfigurationManager_enable_stun(
configurationManagerProxy,
&error);
if(error)
{
g_error_free(error);
}
}
......@@ -429,4 +429,11 @@ void dbus_set_sip_port(const guint portNum);
guint dbus_get_sip_port();
gchar* dbus_get_stun_server (void);
void dbus_set_stun_server( gchar* server);
guint dbus_stun_is_enabled (void);
void dbus_enable_stun (void);
void dbus_set_record (const call_t * c);
#endif
......@@ -39,8 +39,7 @@ sflphoned_SOURCES = \
call.cpp \
account.cpp \
sipcall.cpp \
$(IAXSOURCES) \
useragent.cpp
$(IAXSOURCES)
sflphoned_CXXFLAGS = \
-DPREFIX=\"$(prefix)\" -DPROGSHAREDIR=\"${datadir}/sflphone\" \
......@@ -81,8 +80,7 @@ noinst_HEADERS = \
accountcreator.h \
sipvoiplink.h \
call.h \
sipcall.h \
useragent.h
sipcall.h
libsflphone_la_LIBADD = \
$(src)/libs/stund/libstun.la \
......
......@@ -22,9 +22,10 @@
#include "account.h"
#include "manager.h"
Account::Account(const AccountID& accountID) :
_accountID(accountID), _link(NULL), _enabled(false)
Account::Account(const AccountID& accountID, std::string type) :
_accountID(accountID), _link(NULL), _enabled(false), _type(type)
{