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
22422541
Commit
22422541
authored
16 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
Refactoring Python code, PEP8
parent
2d9b8fc7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
sflphone-client-gnome/src/dbus/dbus.c
+9
-8
9 additions, 8 deletions
sflphone-client-gnome/src/dbus/dbus.c
tools/pysflphone/sflphonectrlsimple.py
+273
-271
273 additions, 271 deletions
tools/pysflphone/sflphonectrlsimple.py
with
282 additions
and
279 deletions
sflphone-client-gnome/src/dbus/dbus.c
+
9
−
8
View file @
22422541
...
...
@@ -215,18 +215,18 @@ dbus_connect ()
/* Create a proxy object for the "bus driver" (name "org.freedesktop.DBus") */
/*
instanceProxy = dbus_g_proxy_new_for_name (connection,
"org.sflphone.SFLphone",
"/org/sflphone/SFLphone/Instance",
"org.sflphone.SFLphone.Instance");
/
*
*
/
instanceProxy
=
dbus_g_proxy_new_for_name_owner
(
connection
,
"org.sflphone.SFLphone"
,
"/org/sflphone/SFLphone/Instance"
,
"org.sflphone.SFLphone.Instance"
,
&
error
);
*/
if
(
instanceProxy
==
NULL
)
{
...
...
@@ -237,18 +237,19 @@ dbus_connect ()
DEBUG
(
"DBus connected to Instance"
);
/*
callManagerProxy = dbus_g_proxy_new_for_name (connection,
"org.sflphone.SFLphone",
"/org/sflphone/SFLphone/CallManager",
"org.sflphone.SFLphone.CallManager");
/
*
*
/
callManagerProxy
=
dbus_g_proxy_new_for_name_owner
(
connection
,
"org.sflphone.SFLphone"
,
"/org/sflphone/SFLphone/CallManager"
,
"org.sflphone.SFLphone.CallManager"
,
&
error
);
*/
if
(
callManagerProxy
==
NULL
)
{
ERROR
(
"Failed to get proxy to CallManagers"
);
...
...
@@ -299,20 +300,20 @@ dbus_connect ()
dbus_g_proxy_connect_signal
(
callManagerProxy
,
"volumeChanged"
,
G_CALLBACK
(
volume_changed_cb
),
NULL
,
NULL
);
/*
configurationManagerProxy = dbus_g_proxy_new_for_name (connection,
"org.sflphone.SFLphone",
"/org/sflphone/SFLphone/ConfigurationManager",
"org.sflphone.SFLphone.ConfigurationManager");
/
*
*
/
configurationManagerProxy
=
dbus_g_proxy_new_for_name_owner
(
connection
,
"org.sflphone.SFLphone"
,
"/org/sflphone/SFLphone/ConfigurationManager"
,
"org.sflphone.SFLphone.ConfigurationManager"
,
&
error
);
*/
if
(
!
configurationManagerProxy
)
{
ERROR
(
"Failed to get proxy to ConfigurationManager"
);
...
...
This diff is collapsed.
Click to expand it.
tools/pysflphone/sflphonectrlsimple.py
+
273
−
271
View file @
22422541
...
...
@@ -100,9 +100,7 @@ class SflPhoneCtrlSimple(object):
except
dbus
.
DBusException
,
e
:
raise
SPdbusError
(
"
Unable to bind to sflphoned api,
ask core-dev team to implement getVersion method and
start to pray.
"
)
raise
SPdbusError
(
"
Unable to bind to sflphoned api, ask core-dev team to implement getVersion method and start to pray.
"
)
try
:
self
.
instance
.
Register
(
os
.
getpid
(),
self
.
name
)
...
...
@@ -142,7 +140,8 @@ class SflPhoneCtrlSimple(object):
print
"
Incoming call:
"
+
account
+
"
,
"
+
callid
+
"
,
"
+
to
self
.
activeCalls
[
callid
]
=
{
'
Account
'
:
account
,
'
To
'
:
to
,
'
State
'
:
''
}
# On call state changed event, set the values for new calls, or delete the call from the list of active calls
# On call state changed event, set the values for new calls,
# or delete the call from the list of active calls
def
onCallStateChanged
(
self
,
callid
,
state
):
print
"
Call state changed:
"
+
callid
+
"
,
"
+
state
if
state
==
"
HUNGUP
"
:
...
...
@@ -150,6 +149,7 @@ class SflPhoneCtrlSimple(object):
del
self
.
activeCalls
[
callid
]
except
KeyError
:
print
"
Call
"
+
callid
+
"
didn
'
t exist. Cannot delete.
"
elif
state
in
[
"
RINGING
"
,
"
CURRENT
"
,
"
INCOMING
"
,
"
HOLD
"
]:
try
:
self
.
activeCalls
[
callid
][
'
State
'
]
=
state
...
...
@@ -195,6 +195,7 @@ class SflPhoneCtrlSimple(object):
return
self
.
configurationmanager
.
getAccountDetails
(
self
.
account
)
else
:
if
self
.
checkAccountExists
(
account
):
return
self
.
configurationmanager
.
getAccountDetails
(
account
)
...
...
@@ -203,7 +204,8 @@ class SflPhoneCtrlSimple(object):
for
testedaccount
in
self
.
getAllAccounts
():
details
=
self
.
getAccountDetails
(
testedaccount
)
if
(
details
[
'
Account.enable
'
]
==
"
TRUE
"
and
details
[
'
Account.alias
'
]
==
alias
):
if
(
details
[
'
Account.enable
'
]
==
"
TRUE
"
and
details
[
'
Account.alias
'
]
==
alias
):
self
.
account
=
testedaccount
return
raise
SPaccountError
(
"
No enabled account matched with alias
"
)
...
...
@@ -216,6 +218,7 @@ class SflPhoneCtrlSimple(object):
details
=
self
.
getAccountDetails
(
account
)
if
details
[
'
Account.alias
'
]
==
alias
:
return
account
raise
SPaccountError
(
"
No account matched with alias
"
)
def
setAccount
(
self
,
account
):
...
...
@@ -345,7 +348,6 @@ class SflPhoneCtrlSimple(object):
else
:
self
.
configurationmanager
.
sendRegister
(
account
,
int
(
0
))
#self.setFirstRegisteredAccount()
except
SflPhoneError
,
e
:
print
e
...
...
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