Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
ae8c4c31
Commit
ae8c4c31
authored
13 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
#8315: Fix unknown call when hanging up a call in another client
parent
00d8956c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gnome/src/contacts/calltree.c
+1
-1
1 addition, 1 deletion
gnome/src/contacts/calltree.c
gnome/src/dbus/dbus.c
+94
-46
94 additions, 46 deletions
gnome/src/dbus/dbus.c
with
95 additions
and
47 deletions
gnome/src/contacts/calltree.c
+
1
−
1
View file @
ae8c4c31
...
...
@@ -748,7 +748,7 @@ calltree_update_call_recursive(calltab_t* tab, callable_obj_t * c, GtkTreeIter *
void
calltree_update_call
(
calltab_t
*
tab
,
callable_obj_t
*
c
)
{
return
calltree_update_call_recursive
(
tab
,
c
,
NULL
);
calltree_update_call_recursive
(
tab
,
c
,
NULL
);
}
void
calltree_add_call
(
calltab_t
*
tab
,
callable_obj_t
*
c
,
GtkTreeIter
*
parent
)
...
...
This diff is collapsed.
Click to expand it.
gnome/src/dbus/dbus.c
+
94
−
46
View file @
ae8c4c31
...
...
@@ -145,63 +145,111 @@ incoming_message_cb(DBusGProxy *proxy UNUSED, const gchar* callID UNUSED, const
im_widget_add_message
(
IM_WIDGET
(
*
widget
),
from
,
msg
,
0
);
}
static
void
call_state_cb
(
DBusGProxy
*
proxy
UNUSED
,
const
gchar
*
callID
,
const
gchar
*
state
,
void
*
foo
UNUSED
)
/**
* Perform the right sflphone action based on the requested state
*/
static
void
process_existant_call_state_change
(
callable_obj_t
*
c
,
const
gchar
*
state
)
{
callable_obj_t
*
c
=
calllist_get_call
(
current_calls_tab
,
callID
);
if
(
c
==
NULL
)
{
ERROR
(
"Pointer to call is NULL in %s
\n
"
,
__func__
);
return
;
}
if
(
c
)
{
if
(
g_strcmp0
(
state
,
"HUNGUP"
)
==
0
)
{
if
(
c
->
_state
==
CALL_STATE_CURRENT
)
{
time
(
&
c
->
_time_stop
);
calltree_update_call
(
history_tab
,
c
);
}
if
(
state
==
NULL
)
{
ERROR
(
"Pointer to state is NULL in %s
\n
"
,
__func__
);
return
;
}
if
(
g_strcmp0
(
state
,
"HUNGUP"
)
==
0
)
{
if
(
c
->
_state
==
CALL_STATE_CURRENT
)
{
time
(
&
c
->
_time_stop
);
calltree_update_call
(
history_tab
,
c
);
status_bar_display_account
();
sflphone_hung_up
(
c
);
}
else
if
(
g_strcmp0
(
state
,
"UNHOLD_CURRENT"
)
==
0
)
{
sflphone_current
(
c
);
}
else
if
(
g_strcmp0
(
state
,
"UNHOLD_RECORD"
)
==
0
)
{
sflphone_record
(
c
);
}
else
if
(
g_strcmp0
(
state
,
"HOLD"
)
==
0
)
{
sflphone_hold
(
c
);
}
else
if
(
g_strcmp0
(
state
,
"RINGING"
)
==
0
)
{
sflphone_ringing
(
c
);
}
else
if
(
g_strcmp0
(
state
,
"CURRENT"
)
==
0
)
{
sflphone_current
(
c
);
}
else
if
(
g_strcmp0
(
state
,
"RECORD"
)
==
0
)
{
sflphone_record
(
c
);
}
else
if
(
g_strcmp0
(
state
,
"FAILURE"
)
==
0
)
{
sflphone_fail
(
c
);
}
else
if
(
g_strcmp0
(
state
,
"BUSY"
)
==
0
)
{
sflphone_busy
(
c
);
}
}
else
{
ERROR
(
"DBUS: Error: Call is NULL in %s"
,
__func__
);
// The callID is unknow, threat it like a new call
// If it were an incoming call, we won't be here
// It means that a new call has been initiated with an other client (cli for instance)
if
((
g_strcmp0
(
state
,
"RINGING"
))
==
0
||
(
g_strcmp0
(
state
,
"CURRENT"
))
==
0
||
(
g_strcmp0
(
state
,
"RECORD"
)))
{
calltree_update_call
(
history_tab
,
c
);
status_bar_display_account
();
sflphone_hung_up
(
c
);
}
else
if
(
g_strcmp0
(
state
,
"UNHOLD_CURRENT"
)
==
0
)
{
sflphone_current
(
c
);
}
else
if
(
g_strcmp0
(
state
,
"UNHOLD_RECORD"
)
==
0
)
{
sflphone_record
(
c
);
}
else
if
(
g_strcmp0
(
state
,
"HOLD"
)
==
0
)
{
sflphone_hold
(
c
);
}
else
if
(
g_strcmp0
(
state
,
"RINGING"
)
==
0
)
{
sflphone_ringing
(
c
);
}
else
if
(
g_strcmp0
(
state
,
"CURRENT"
)
==
0
)
{
sflphone_current
(
c
);
}
else
if
(
g_strcmp0
(
state
,
"RECORD"
)
==
0
)
{
sflphone_record
(
c
);
}
else
if
(
g_strcmp0
(
state
,
"FAILURE"
)
==
0
)
{
sflphone_fail
(
c
);
}
else
if
(
g_strcmp0
(
state
,
"BUSY"
)
==
0
)
{
sflphone_busy
(
c
);
}
DEBUG
(
"DBUS: New ringing call! accountID: %s"
,
callID
);
return
;
}
// We fetch the details associated to the specified call
GHashTable
*
call_details
=
dbus_get_call_details
(
callID
);
callable_obj_t
*
new_call
=
create_new_call_from_details
(
callID
,
call_details
);
new_call
->
_history_state
=
(
g_strcasecmp
(
g_hash_table_lookup
(
call_details
,
"CALL_TYPE"
),
INCOMING_STRING
)
==
0
)
/**
* This function process call state changes in case the call have not been created yet.
* This mainly occurs when anotehr SFLphone client takes actions.
*/
static
void
process_inexistant_call_state_change
(
const
gchar
*
callID
,
const
gchar
*
state
)
{
if
(
callID
==
NULL
)
{
ERROR
(
"Pointer to call id is NULL in %s
\n
"
,
__func__
);
return
;
}
if
(
state
==
NULL
)
{
ERROR
(
"Pointer to state is NULL in %s
\n
"
,
__func__
);
return
;
}
// Could occur if a user picked up the phone and hung up without making a call
if
(
g_strcmp0
(
state
,
"HUNGUP"
)
==
0
)
return
;
// The callID is unknow, threat it like a new call
// If it were an incoming call, we won't be here
// It means that a new call has been initiated with an other client (cli for instance)
if
((
g_strcmp0
(
state
,
"RINGING"
))
==
0
||
(
g_strcmp0
(
state
,
"CURRENT"
))
==
0
||
(
g_strcmp0
(
state
,
"RECORD"
)))
{
DEBUG
(
"DBUS: New ringing call! accountID: %s"
,
callID
);
// We fetch the details associated to the specified call
GHashTable
*
call_details
=
dbus_get_call_details
(
callID
);
callable_obj_t
*
new_call
=
create_new_call_from_details
(
callID
,
call_details
);
new_call
->
_history_state
=
(
g_strcasecmp
(
g_hash_table_lookup
(
call_details
,
"CALL_TYPE"
),
INCOMING_STRING
)
==
0
)
?
g_strdup
(
INCOMING_STRING
)
:
g_strdup
(
OUTGOING_STRING
);
calllist_add_call
(
current_calls_tab
,
new_call
);
calltree_add_call
(
current_calls_tab
,
new_call
,
NULL
);
update_actions
();
calltree_display
(
current_calls_tab
);
}
calllist_add_call
(
current_calls_tab
,
new_call
);
calltree_add_call
(
current_calls_tab
,
new_call
,
NULL
);
update_actions
();
calltree_display
(
current_calls_tab
);
}
}
/**
* Callback called when a
*/
static
void
call_state_cb
(
DBusGProxy
*
proxy
UNUSED
,
const
gchar
*
callID
,
const
gchar
*
state
,
void
*
foo
UNUSED
)
{
callable_obj_t
*
c
=
calllist_get_call
(
current_calls_tab
,
callID
);
if
(
c
)
{
process_existant_call_state_change
(
c
,
state
);
}
else
{
WARN
(
"DBUS: Call does not exist in %s"
,
__func__
);
process_inexistant_call_state_change
(
callID
,
state
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment