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
9ce08e07
Commit
9ce08e07
authored
16 years ago
by
Emmanuel Milou
Browse files
Options
Downloads
Patches
Plain Diff
Allow user to make IP call without any accounts configured
parent
849f00de
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sflphone-gtk/src/actions.c
+58
-48
58 additions, 48 deletions
sflphone-gtk/src/actions.c
with
58 additions
and
48 deletions
sflphone-gtk/src/actions.c
+
58
−
48
View file @
9ce08e07
...
@@ -670,60 +670,79 @@ sflphone_keypad( guint keyval, gchar * key)
...
@@ -670,60 +670,79 @@ sflphone_keypad( guint keyval, gchar * key)
* Place a call with the current account.
* Place a call with the current account.
* If there is no default account selected, place a call with the first
* If there is no default account selected, place a call with the first
* registered account of the account list
* registered account of the account list
* Else, popup an error message
* Else,
check if it an IP call. if not,
popup an error message
*/
*/
void
void
sflphone_place_call
(
call_t
*
c
)
sflphone_place_call
(
call_t
*
c
)
{
{
if
(
c
->
state
==
CALL_STATE_DIALING
&&
str
cmp
(
c
->
to
,
"
"
)
!=
0
)
if
(
c
->
state
==
CALL_STATE_DIALING
&&
g_
str
_has_prefix
(
c
->
to
,
"
ip:"
)
)
{
{
dbus_place_call
(
c
);
}
//format_phone_number (&c->to);
else
{
if
(
account_list_get_size
(
)
=
=
0
)
if
(
c
->
state
==
CALL_STATE_DIALING
&&
strcmp
(
c
->
to
,
""
)
!
=
0
)
{
{
notify_no_accounts
();
sflphone_fail
(
c
);
}
else
if
(
account_list_get_by_state
(
ACCOUNT_STATE_REGISTERED
)
==
NULL
)
//format_phone_number (&c->to);
{
notify_no_registered_accounts
();
sflphone_fail
(
c
);
}
else
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
);
}
account_t
*
current
;
else
{
if
(
g_strcasecmp
(
c
->
accountID
,
""
)
!=
0
)
{
account_t
*
current
;
current
=
account_list_get_by_id
(
c
->
accountID
);
}
else
{
current
=
account_list_get_current
();
}
// printf("sflphone_place_call :: c->accountID : %i \n",c->accountID);
// account_t * current = c->accountID;
if
(
g_strcasecmp
(
c
->
accountID
,
""
)
!=
0
)
{
current
=
account_list_get_by_id
(
c
->
accountID
);
}
else
{
current
=
account_list_get_current
();
}
// printf("sflphone_place_call :: c->accountID : %i \n",c->accountID);
// account_t * current = c->accountID;
if
(
current
)
{
if
(
g_strcasecmp
(
g_hash_table_lookup
(
current
->
properties
,
"Status"
),
"REGISTERED"
)
==
0
)
if
(
current
)
{
{
// OK, everything alright - the call is made with the current account
c
->
accountID
=
current
->
accountID
;
if
(
g_strcasecmp
(
g_hash_table_lookup
(
current
->
properties
,
"Status"
),
"REGISTERED"
)
==
0
)
dbus_place_call
(
c
);
{
// OK, everything alright - the call is made with the current account
c
->
accountID
=
current
->
accountID
;
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
);
account_list_set_current_id
(
c
->
accountID
);
}
}
}
else
else
{
{
// Current account is not registered
// No current accounts have been setup.
// So we place a call with the first registered account
// So we place a call with the first registered account
//
A
nd we
switch
the current account
//
a
nd we
change
the current account
current
=
account_list_get_by_state
(
ACCOUNT_STATE_REGISTERED
);
current
=
account_list_get_by_state
(
ACCOUNT_STATE_REGISTERED
);
c
->
accountID
=
current
->
accountID
;
c
->
accountID
=
current
->
accountID
;
dbus_place_call
(
c
);
dbus_place_call
(
c
);
...
@@ -731,27 +750,13 @@ sflphone_place_call ( call_t * c )
...
@@ -731,27 +750,13 @@ sflphone_place_call ( call_t * c )
account_list_set_current_id
(
c
->
accountID
);
account_list_set_current_id
(
c
->
accountID
);
}
}
}
}
else
// Update history
{
c
->
history_state
=
OUTGOING
;
calllist_add
(
history
,
c
);
// 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
);
account_list_set_current_id
(
c
->
accountID
);
}
}
}
// Update history
c
->
history_state
=
OUTGOING
;
g_print
(
"add in history
\n
"
);
calllist_add
(
history
,
c
);
}
}
}
}
void
void
sflphone_display_selected_codec
(
const
gchar
*
codecName
)
sflphone_display_selected_codec
(
const
gchar
*
codecName
)
{
{
...
@@ -761,10 +766,15 @@ sflphone_display_selected_codec (const gchar* codecName)
...
@@ -761,10 +766,15 @@ sflphone_display_selected_codec (const gchar* codecName)
account_t
*
acc
;
account_t
*
acc
;
if
(
selectedCall
->
accountID
!=
NULL
){
if
(
selectedCall
->
accountID
!=
NULL
){
acc
=
account_list_get_by_id
(
selectedCall
->
accountID
);
acc
=
account_list_get_by_id
(
selectedCall
->
accountID
);
msg
=
g_markup_printf_escaped
(
_
(
"%s account- %s %s"
)
,
if
(
!
acc
)
{
msg
=
g_markup_printf_escaped
(
_
(
"IP call - %s"
),
codecName
);
}
else
{
msg
=
g_markup_printf_escaped
(
_
(
"%s account- %s %s"
)
,
(
gchar
*
)
g_hash_table_lookup
(
acc
->
properties
,
ACCOUNT_TYPE
),
(
gchar
*
)
g_hash_table_lookup
(
acc
->
properties
,
ACCOUNT_TYPE
),
(
gchar
*
)
g_hash_table_lookup
(
acc
->
properties
,
ACCOUNT_ALIAS
),
(
gchar
*
)
g_hash_table_lookup
(
acc
->
properties
,
ACCOUNT_ALIAS
),
codecName
);
codecName
);
}
statusbar_push_message
(
msg
,
__MSG_ACCOUNT_DEFAULT
);
statusbar_push_message
(
msg
,
__MSG_ACCOUNT_DEFAULT
);
g_free
(
msg
);
g_free
(
msg
);
}
}
...
...
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