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
c263db6a
Commit
c263db6a
authored
16 years ago
by
Emmanuel Milou
Browse files
Options
Downloads
Patches
Plain Diff
Prevent crash when trying to call an empty number
parent
53d749ec
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sflphone-gtk/src/actions.c
+55
-52
55 additions, 52 deletions
sflphone-gtk/src/actions.c
src/dbus/callmanager.cpp
+3
-1
3 additions, 1 deletion
src/dbus/callmanager.cpp
with
58 additions
and
53 deletions
sflphone-gtk/src/actions.c
+
55
−
52
View file @
c263db6a
...
...
@@ -643,60 +643,63 @@ sflphone_keypad( guint keyval, gchar * key)
void
sflphone_place_call
(
call_t
*
c
)
{
if
(
c
->
state
==
CALL_STATE_DIALING
)
{
if
(
account_list_get_size
()
==
0
)
{
notify_no_accounts
();
sflphone_fail
(
c
);
}
else
if
(
account_list_get_by_state
(
ACCOUNT_STATE_REGISTERED
)
==
NULL
)
{
notify_no_registered_accounts
();
sflphone_fail
(
c
);
}
else
if
(
c
->
state
==
CALL_STATE_DIALING
&&
strcmp
(
c
->
to
,
""
)
!=
0
)
{
account_t
*
current
=
account_list_get_current
();
if
(
current
)
{
if
(
g_strcasecmp
(
g_hash_table_lookup
(
current
->
properties
,
"Status"
),
"REGISTERED"
)
==
0
)
{
// OK, everything alright - the call is made with the current account
c
->
accountID
=
current
->
accountID
;
status_bar_display_account
(
c
);
dbus_place_call
(
c
);
}
else
{
// Current account is not registered
// So we place a call with the first registered account
// And we switch the current account
current
=
account_list_get_by_state
(
ACCOUNT_STATE_REGISTERED
);
c
->
accountID
=
current
->
accountID
;
dbus_place_call
(
c
);
notify_current_account
(
current
);
status_bar_display_account
(
c
);
account_list_set_current_id
(
c
->
accountID
);
}
}
else
{
// No current accounts have been setup.
// So we place a call with the first registered account
// and we change the current account
current
=
account_list_get_by_state
(
ACCOUNT_STATE_REGISTERED
);
c
->
accountID
=
current
->
accountID
;
dbus_place_call
(
c
);
notify_current_account
(
current
);
status_bar_display_account
(
c
);
account_list_set_current_id
(
c
->
accountID
);
}
if
(
account_list_get_size
()
==
0
)
{
notify_no_accounts
();
sflphone_fail
(
c
);
}
else
if
(
account_list_get_by_state
(
ACCOUNT_STATE_REGISTERED
)
==
NULL
)
{
notify_no_registered_accounts
();
sflphone_fail
(
c
);
}
else
{
account_t
*
current
=
account_list_get_current
();
if
(
current
)
{
if
(
g_strcasecmp
(
g_hash_table_lookup
(
current
->
properties
,
"Status"
),
"REGISTERED"
)
==
0
)
{
// OK, everything alright - the call is made with the current account
c
->
accountID
=
current
->
accountID
;
status_bar_display_account
(
c
);
dbus_place_call
(
c
);
}
else
{
// Current account is not registered
// So we place a call with the first registered account
// And we switch the current account
current
=
account_list_get_by_state
(
ACCOUNT_STATE_REGISTERED
);
c
->
accountID
=
current
->
accountID
;
dbus_place_call
(
c
);
notify_current_account
(
current
);
status_bar_display_account
(
c
);
account_list_set_current_id
(
c
->
accountID
);
}
}
else
{
// No current accounts have been setup.
// So we place a call with the first registered account
// and we change the current account
current
=
account_list_get_by_state
(
ACCOUNT_STATE_REGISTERED
);
c
->
accountID
=
current
->
accountID
;
dbus_place_call
(
c
);
notify_current_account
(
current
);
status_bar_display_account
(
c
);
account_list_set_current_id
(
c
->
accountID
);
}
}
// Update history
c
->
history_state
=
OUTGOING
;
call_list_add
(
history
,
c
);
}
// Update history
c
->
history_state
=
OUTGOING
;
call_list_add
(
history
,
c
);
}
}
/* Internal to action - set the __CURRENT_ACCOUNT variable */
...
...
This diff is collapsed.
Click to expand it.
src/dbus/callmanager.cpp
+
3
−
1
View file @
c263db6a
...
...
@@ -34,7 +34,9 @@ CallManager::placeCall( const std::string& accountID,
const
std
::
string
&
to
)
{
_debug
(
"CallManager::placeCall received
\n
"
);
Manager
::
instance
().
outgoingCall
(
accountID
,
callID
,
to
);
// Check if a destination number is available
if
(
to
==
""
)
_debug
(
"No number entered - Call stopped
\n
"
);
else
Manager
::
instance
().
outgoingCall
(
accountID
,
callID
,
to
);
}
void
...
...
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