Commit f215bcbc authored by Alexandre Savard's avatar Alexandre Savard

Merge branch 'm_savard' into echocancel

parents 0a55c876 22c238d1
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -195,6 +195,8 @@ void sflphone_fill_account_list (void) {
int count;
GQueue *codeclist;
DEBUG("SFLphone: Fill account list");
count = current_account_get_message_number ();
account_list_clear ();
......@@ -950,13 +952,16 @@ sflphone_place_call ( callable_obj_t * c )
void
sflphone_detach_participant(const gchar* callID)
{
DEBUG("sflphone detach participant from conference");
DEBUG("Action: Detach participant from conference");
if(callID == NULL) {
callable_obj_t * selectedCall = calltab_get_selected_call(current_calls);
DEBUG(" sflphone_detach_participant %s\n", selectedCall->_callID);
DEBUG("Action: Detach participant %s", selectedCall->_callID);
if(selectedCall->_confID) {
g_free(selectedCall->_confID);
selectedCall->_confID = NULL;
}
calltree_remove_call(current_calls, selectedCall, NULL);
calltree_add_call(current_calls, selectedCall, NULL);
......@@ -964,7 +969,12 @@ sflphone_detach_participant(const gchar* callID)
}
else {
callable_obj_t * selectedCall = calllist_get(current_calls, callID);
DEBUG(" sflphone_detach_participant %s\n", callID);
DEBUG("Action: Darticipant %s", callID);
if(selectedCall->_confID) {
g_free(selectedCall->_confID);
selectedCall->_confID = NULL;
}
calltree_remove_call(current_calls, selectedCall, NULL);
calltree_add_call(current_calls, selectedCall, NULL);
......@@ -1077,7 +1087,9 @@ void sflphone_fill_codec_list () {
guint account_list_size;
guint i;
account_t *current = NULL;
gchar** codecs = NULL;
gchar** codecs = NULL;
DEBUG("SFLphone: Fill codec list");
account_list_size = account_list_get_size ();
......@@ -1109,22 +1121,27 @@ void sflphone_fill_codec_list_per_account (account_t **account) {
gboolean active = FALSE;
order = (gchar**) dbus_get_active_codec_list ((*account)->accountID);
codeclist = (*account)->codecs;
// First clean the list
codec_list_clear (&codeclist);
// First clean the list
codec_list_clear (&codeclist);
if(!(*order))
ERROR("SFLphone: No codec list provided");
for (pl=order; *order; order++)
for (pl=order; *pl; pl++)
{
codec_t * cpy;
// Each account will have a copy of the system-wide capabilities
codec_create_new_from_caps (codec_list_get_by_payload ((gconstpointer) (size_t)atoi (*order), NULL), &cpy);
if (cpy) {
cpy->is_active = TRUE;
codec_list_add (cpy, &codeclist);
}
else
ERROR ("Couldn't find codec \n");
codec_t * cpy = NULL;
// Each account will have a copy of the system-wide capabilities
codec_create_new_from_caps (codec_list_get_by_payload ((gconstpointer) (size_t)atoi (*pl), NULL), &cpy);
if (cpy) {
cpy->is_active = TRUE;
codec_list_add (cpy, &codeclist);
}
else
ERROR ("SFLphone: Couldn't find codec");
}
// Test here if we just added some active codec.
......@@ -1415,7 +1432,7 @@ sflphone_call_state_changed( callable_obj_t * c, const gchar * description, cons
}
void sflphone_get_interface_addr_from_name(char *iface_name, char **iface_addr) {
void sflphone_get_interface_addr_from_name(char *iface_name, char **iface_addr, int size) {
struct ifreq ifr;
int fd;
......@@ -1443,7 +1460,9 @@ void sflphone_get_interface_addr_from_name(char *iface_name, char **iface_addr)
tmp_addr = (char *)addr_in;
snprintf(*iface_addr, sizeof(*iface_addr), "%d.%d.%d.%d",
snprintf(*iface_addr, size, "%d.%d.%d.%d",
UC(tmp_addr[0]), UC(tmp_addr[1]), UC(tmp_addr[2]), UC(tmp_addr[3]));
close(fd);
}
......@@ -289,5 +289,5 @@ void sflphone_call_state_changed(callable_obj_t * c, const gchar * description,
/**
* Resolve an interface address given its name
*/
void sflphone_get_interface_addr_from_name(char *iface_name, char **iface_addr);
void sflphone_get_interface_addr_from_name(char *iface_name, char **iface_addr, int size);
#endif
......@@ -183,7 +183,7 @@ void create_new_call_from_details (const gchar *call_id, GHashTable *details, ca
else
state = CALL_STATE_FAILURE;
create_new_call (CALL, state, (gchar*)call_id, accountID, peer_name, peer_number, &new_call);
create_new_call (CALL, state, (gchar*)call_id, accountID, peer_name, call_get_peer_number(peer_number), &new_call);
*call = new_call;
}
......
......@@ -145,6 +145,11 @@ void codec_create_new_from_caps (codec_t *original, codec_t **copy) {
codec_t *codec;
if(!original) {
*copy = NULL;
return;
}
codec = g_new0 (codec_t, 1);
codec->_payload = original->_payload;
codec->name = original->name;
......
......@@ -54,7 +54,7 @@ GtkWidget * entryID;
GtkWidget * entryAlias;
GtkWidget * protocolComboBox;
GtkWidget * entryUsername;
GtkWidget * entryDomainName;
GtkWidget * entryRouteSet;
GtkWidget * entryHostname;
GtkWidget * entryPassword;
GtkWidget * entryMailbox;
......@@ -240,7 +240,7 @@ static GtkWidget* create_basic_tab (account_t **a) {
gchar *curAccountType = "SIP";
gchar *curAlias = "";
gchar *curUsername = "";
gchar *curDomainName = "";
gchar *curRouteSet = "";
gchar *curHostname = "";
gchar *curPassword = "";
/* TODO: add curProxy, and add boxes for Proxy support */
......@@ -262,7 +262,7 @@ static GtkWidget* create_basic_tab (account_t **a) {
curHostname = g_hash_table_lookup(currentAccount->properties, ACCOUNT_HOSTNAME);
curPassword = g_hash_table_lookup(currentAccount->properties, ACCOUNT_PASSWORD);
curUsername = g_hash_table_lookup(currentAccount->properties, ACCOUNT_USERNAME);
curDomainName = g_hash_table_lookup(currentAccount->properties, ACCOUNT_DOMAIN);
curRouteSet = g_hash_table_lookup(currentAccount->properties, ACCOUNT_ROUTE);
curMailbox = g_hash_table_lookup(currentAccount->properties, ACCOUNT_MAILBOX);
curUseragent = g_hash_table_lookup(currentAccount->properties, ACCOUNT_USERAGENT);
}
......@@ -348,17 +348,20 @@ static GtkWidget* create_basic_tab (account_t **a) {
g_signal_connect(G_OBJECT (entryUsername), "changed", G_CALLBACK (update_credential_cb), NULL);
g_object_set_data (G_OBJECT (entryUsername), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_USERNAME));
// Domain name can be update only for SIP account
// Route set can be update only for SIP account
// TODO: uncomment this code and implement route
/*
if(strcmp(curAccountType, "SIP") == 0) {
row++;
label = gtk_label_new_with_mnemonic(_("_Domain name (optional)"));
label = gtk_label_new_with_mnemonic(_("_Route (optional)"));
gtk_table_attach(GTK_TABLE( table ), label, 0, 1, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5);
entryDomainName = gtk_entry_new();
gtk_label_set_mnemonic_widget(GTK_LABEL(label), entryDomainName);
gtk_entry_set_text(GTK_ENTRY(entryDomainName), curDomainName);
gtk_table_attach (GTK_TABLE(table), entryDomainName, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
entryRouteSet = gtk_entry_new();
gtk_label_set_mnemonic_widget(GTK_LABEL(label), entryRouteSet);
gtk_entry_set_text(GTK_ENTRY(entryRouteSet), curRouteSet);
gtk_table_attach (GTK_TABLE(table), entryRouteSet, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
}
*/
row++;
label = gtk_label_new_with_mnemonic (_("_Password"));
......@@ -638,7 +641,7 @@ static local_interface_changed_cb(GtkWidget * widget, gpointer data UNUSED) {
local_iface_name = (gchar *) gtk_combo_box_get_active_text (GTK_COMBO_BOX (localAddressCombo));
// sflphone_get_interface_addr_from_name((char *)local_interface);
sflphone_get_interface_addr_from_name(local_iface_name, &local_iface_addr);
sflphone_get_interface_addr_from_name(local_iface_name, &local_iface_addr, 36);
gtk_entry_set_text(GTK_ENTRY(localAddressEntry), local_iface_addr);
gtk_entry_set_text (GTK_ENTRY(publishedAddressEntry), local_iface_addr);
......@@ -654,13 +657,13 @@ static set_published_addr_manually_cb(GtkWidget * widget, gpointer data UNUSED)
{
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
DEBUG("Showing manual options");
DEBUG("Config: Showing manual publishing options");
gtk_widget_show(publishedPortLabel);
gtk_widget_show(publishedPortSpinBox);
gtk_widget_show(publishedAddressLabel);
gtk_widget_show(publishedAddressEntry);
} else {
DEBUG("Hiding manual options");
DEBUG("Config: Hiding manual publishing options");
gtk_widget_hide(publishedPortLabel);
gtk_widget_hide(publishedPortSpinBox);
gtk_widget_hide(publishedAddressLabel);
......@@ -675,7 +678,7 @@ static use_stun_cb(GtkWidget *widget, gpointer data UNUSED)
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) {
DEBUG("Showing stun options, hiding Local/Published info");
DEBUG("Config: Showing stun options, hiding Local/Published info");
gtk_widget_show (stunServerLabel);
gtk_widget_show (stunServerEntry);
gtk_widget_set_sensitive (sameAsLocalRadioButton, FALSE);
......@@ -688,6 +691,8 @@ static use_stun_cb(GtkWidget *widget, gpointer data UNUSED)
} else {
DEBUG("Config: hiding stun options, showing Local/Published info");
gtk_widget_hide (stunServerLabel);
gtk_widget_hide (stunServerEntry);
gtk_widget_set_sensitive (sameAsLocalRadioButton, TRUE);
......@@ -698,14 +703,6 @@ static use_stun_cb(GtkWidget *widget, gpointer data UNUSED)
gtk_widget_show (publishedPortLabel);
gtk_widget_show (publishedAddressEntry);
gtk_widget_show (publishedPortSpinBox);
// Since stun callback is called at initialization, we cannot reinit published address
// TODO: find a way so that if stun is unchecked, reinit published address entry
// in case local address changedd
// local_interface = (gchar *) gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo));
// local_address = dbus_get_address_from_interface_name(local_interface);
// gtk_entry_set_text(GTK_ENTRY(publishedAddressEntry), local_address);
}
}
}
......@@ -1004,7 +1001,7 @@ GtkWidget* create_network (account_t **a) {
gchar *local_iface_addr;
gchar *local_iface_name;
local_iface_addr= g_malloc(18);
local_iface_addr= g_malloc(36);
if (iface_list != NULL) {
......@@ -1047,7 +1044,7 @@ GtkWidget* create_network (account_t **a) {
// Fill the text entry with the ip address of local interface selected
localAddressEntry = gtk_entry_new();
local_iface_name = (gchar *) gtk_combo_box_get_active_text (GTK_COMBO_BOX (localAddressCombo));
sflphone_get_interface_addr_from_name(local_iface_name, &local_iface_addr);
sflphone_get_interface_addr_from_name(local_iface_name, &local_iface_addr, 36);
gtk_entry_set_text(GTK_ENTRY(localAddressEntry), local_iface_addr);
gtk_widget_set_sensitive(localAddressEntry, FALSE);
gtk_table_attach ( GTK_TABLE( table ), localAddressEntry, 2, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
......@@ -1143,8 +1140,6 @@ GtkWidget* create_published_address (account_t **a) {
gtk_table_attach_defaults(GTK_TABLE(table), publishedPortSpinBox, 1, 2, 6, 7);
use_stun_cb (GTK_WIDGET (useStunCheckBox), NULL);
// This will trigger a signal, and the above two
// widgets need to be instanciated before that.
g_signal_connect(localAddressCombo, "changed", G_CALLBACK(local_interface_changed_cb), localAddressCombo);
......@@ -1162,6 +1157,7 @@ GtkWidget* create_published_address (account_t **a) {
GtkWidget* create_advanced_tab (account_t **a) {
// Build the advanced tab, to appear on the account configuration panel
DEBUG("Config: Build advanced tab")
GtkWidget *ret, *frame;
......@@ -1179,6 +1175,10 @@ GtkWidget* create_advanced_tab (account_t **a) {
gtk_widget_show_all (ret);
use_stun_cb (GTK_WIDGET (useStunCheckBox), NULL);
set_published_addr_manually_cb(GTK_WIDGET (publishedAddrRadioButton), NULL);
return ret;
}
......@@ -1336,8 +1336,8 @@ void show_account_window (account_t * a) {
g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryUsername))));
if(strcmp(proto, "SIP") == 0) {
g_hash_table_replace(currentAccount->properties,
g_strdup(ACCOUNT_DOMAIN),
g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryDomainName))));
g_strdup(ACCOUNT_ROUTE),
g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryRouteSet))));
}
g_hash_table_replace(currentAccount->properties,
......
......@@ -287,10 +287,26 @@ conference_created_cb(DBusGProxy *proxy UNUSED, const gchar* confID, void * foo
static void
conference_removed_cb(DBusGProxy *proxy UNUSED, const gchar* confID, void * foo UNUSED )
{
DEBUG ("Conference removed %s\n", confID);
DEBUG ("DBUS: Conference removed %s", confID);
conference_obj_t * c = conferencelist_get(confID);
calltree_remove_conference(current_calls, c, NULL);
GSList *participant = c->participant_list;
callable_obj_t *call;
while(participant) {
call = calllist_get(current_calls, (const gchar *)(participant->data));
if(call) {
DEBUG("DBUS: Remove participant %s", call->_callID);
if(call->_confID){
g_free(call->_confID);
call->_confID = NULL;
}
}
participant = conference_next_participant(participant);
}
conferencelist_remove(c->_confID);
}
......
<?xml version="1.0" ?>
<node name="/org/sflphone/SFLphone">
<interface name="org.sflphone.SFLphone.Instance">
<method name="Register">
<arg type="i" name="pid" direction="in"/>
<arg type="s" name="name" direction="in"/>
</method>
<method name="Unregister">
<arg type="i" name="pid" direction="in"/>
</method>
<method name="getRegistrationCount">
<arg type="i" name="count" direction="out"/>
</method>
</interface>
<node name="/instance-introspec" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
<interface name="org.sflphone.SFLphone.Instance">
<tp:docstring xmlns="http://www.w3.org/1999/xhtml">
<p>Count the number of clients actually registered to the core. When initializing your client, you need to register it against the core by using this interface.</p>
</tp:docstring>
<method name="Register" tp:name-for-bindings="Register">
<tp:docstring>
Register a new client to the core. Increments the registration count.
</tp:docstring>
<arg type="i" name="pid" direction="in">
<tp:docstring>
The pid of the client process
</tp:docstring>
</arg>
<arg type="s" name="name" direction="in">
<tp:docstring>
The name of the client
</tp:docstring>
</arg>
</method>
<method name="Unregister" tp:name-for-bindings="Unregister">
<tp:docstring>
Unregister a connected client from the core. Decrements the registration count. If no more clients are connected, ie the registration count equals 0, the core properly quits.
</tp:docstring>
<arg type="i" name="pid" direction="in">
<tp:docstring>
The pid of the client process
</tp:docstring>
</arg>
</method>
<method name="getRegistrationCount" tp:name-for-bindings="getRegistrationCount">
<tp:docstring>
Get the number of connected clients.
</tp:docstring>
<arg type="i" name="count" direction="out">
<tp:docstring>
The number of client currently connected to the core
</tp:docstring>
</arg>
</method>
</interface>
</node>
......@@ -65,7 +65,7 @@
#define ACCOUNT_DTMF_TYPE "Account.dtmfType"
#define ACCOUNT_HOSTNAME "hostname"
#define ACCOUNT_USERNAME "username"
#define ACCOUNT_DOMAIN "domainname"
#define ACCOUNT_ROUTE "routeset"
#define ACCOUNT_PASSWORD "password"
#define ACCOUNT_AUTHENTICATION_USERNAME "authenticationUsername"
#define ACCOUNT_REALM "realm"
......
......@@ -69,7 +69,7 @@ typedef enum RegistrationState {
#define HOSTNAME "hostname"
#define USERNAME "username"
#define DOMAINNAME "domainname"
#define ROUTESET "routeset"
#define AUTHENTICATION_USERNAME "authenticationUsername"
#define PASSWORD "password"
#define REALM "realm"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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