Commit 1aef40b4 authored by Emmanuel Milou's avatar Emmanuel Milou

[#2384] Tags incoming call as direct SIP call, if applicable

parent 29f4bfe2
......@@ -80,7 +80,7 @@ msgstr ""
#: ../sflphone-client-gnome/src/actions.c:879
msgid "Direct SIP call"
msgstr "Appels IP"
msgstr "Appel direct SIP"
#: ../sflphone-client-gnome/src/actions.c:1071
#, c-format
......
......@@ -80,7 +80,7 @@ msgstr ""
#: ../sflphone-client-gnome/src/actions.c:879
msgid "Direct SIP call"
msgstr "Appels IP"
msgstr "Appel direct SIP"
#: ../sflphone-client-gnome/src/actions.c:1071
#, c-format
......@@ -303,8 +303,9 @@ msgid "About SFLphone"
msgstr "A propos de SFLphone"
#: ../sflphone-client-gnome/src/uimanager.c:654
#, fuzzy
msgid "Call"
msgstr "Actions"
msgstr "_Actions"
#: ../sflphone-client-gnome/src/uimanager.c:655
#: ../sflphone-client-gnome/src/uimanager.c:1119
......
......@@ -64,15 +64,14 @@ typedef enum
*/
typedef struct {
gchar * accountID;
account_state_t state;
gchar * protocol_state_description;
guint protocol_state_code;
GHashTable * properties;
GPtrArray * credential_information;
guint _messages_number;
gchar * accountID;
account_state_t state;
gchar * protocol_state_description;
guint protocol_state_code;
GHashTable * properties;
GPtrArray * credential_information;
guint _messages_number;
} account_t;
......
......@@ -58,6 +58,32 @@ sflphone_notify_voice_mail (const gchar* accountID , guint count)
notify_voice_mails (count, current);
}
/*
* Place a call with the current account.
* If there is no default account selected, place a call with the first
* registered account of the account list
* Else, check if it an IP call. if not, popup an error message
*/
static gboolean _is_direct_call(callable_obj_t * c) {
if(g_strcasecmp(c->_accountID, EMPTY_ENTRY) == 0) {
if(!g_str_has_prefix (c->_peer_number, "sip:")) {
gchar * new_number = g_strconcat("sip:", c->_peer_number, NULL);
g_free(c->_peer_number);
c->_peer_number = new_number;
}
return 1;
}
if(g_str_has_prefix (c->_peer_number, "sip:")) {
return 1;
}
return 0;
}
void
status_bar_display_account ()
{
......@@ -528,12 +554,22 @@ sflphone_display_transfer_status(const gchar* message)
void
sflphone_incoming_call (callable_obj_t * c)
{
gchar *msg = "";
c->_history_state = MISSED;
calllist_add ( current_calls, c );
calllist_add( history, c );
calltree_add_call( current_calls, c, NULL);
update_actions();
calltree_display (current_calls);
// Change the status bar if we are dealing with a direct SIP call
if(_is_direct_call(c)) {
msg = g_markup_printf_escaped (_("Direct SIP call"));
statusbar_pop_message(__MSG_ACCOUNT_DEFAULT);
statusbar_push_message( msg , __MSG_ACCOUNT_DEFAULT);
g_free(msg);
}
}
void
......@@ -769,31 +805,6 @@ sflphone_keypad( guint keyval, gchar * key)
}
}
/*
* Place a call with the current account.
* If there is no default account selected, place a call with the first
* registered account of the account list
* Else, check if it an IP call. if not, popup an error message
*/
static gboolean _is_direct_call(callable_obj_t * c) {
if(g_strcasecmp(c->_accountID, EMPTY_ENTRY) == 0) {
if(!g_str_has_prefix (c->_peer_number, "sip:")) {
gchar * new_number = g_strconcat("sip:", c->_peer_number, NULL);
g_free(c->_peer_number);
c->_peer_number = new_number;
}
return 1;
}
if(g_str_has_prefix (c->_peer_number, "sip:")) {
return 1;
}
return 0;
}
static int _place_direct_call(const callable_obj_t * c) {
if (c->_state == CALL_STATE_DIALING) {
dbus_place_call (c);
......
......@@ -50,8 +50,7 @@ incoming_call_cb (DBusGProxy *proxy UNUSED,
const gchar* from,
void * foo UNUSED )
{
DEBUG("Incoming call! %s", callID);
DEBUG(" from: %s", from);
DEBUG("Incoming call (%s) from %s", callID, from);
callable_obj_t * c;
gchar *peer_name, *peer_number;
......
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