Skip to content
GitLab
Explore
Sign in
Register
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
1dea4d6d
Commit
1dea4d6d
authored
14 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#4116] Add a simple script to migrate configuration files
parent
0625d2ca
No related branches found
No related tags found
Loading
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
sflphone-common/src/sip/sipvoiplink.h
+1
-1
1 addition, 1 deletion
sflphone-common/src/sip/sipvoiplink.h
sflphone-common/test/sflphoned-sample.yml
+1
-1
1 addition, 1 deletion
sflphone-common/test/sflphoned-sample.yml
tools/ini2yaml.py
+176
-0
176 additions, 0 deletions
tools/ini2yaml.py
with
178 additions
and
2 deletions
sflphone-common/src/sip/sipvoiplink.h
+
1
−
1
View file @
1dea4d6d
This diff is collapsed.
Click to expand it.
sflphone-common/test/sflphoned-sample.yml
+
1
−
1
View file @
1dea4d6d
...
@@ -54,7 +54,7 @@ preferences:
...
@@ -54,7 +54,7 @@ preferences:
historyMaxCalls
:
20
historyMaxCalls
:
20
md5Hash
:
false
md5Hash
:
false
notifyMails
:
false
notifyMails
:
false
order
:
Account:1285257971/Account:1285253592/Account:1285252571/Account:1285251984/Account:1285251811/Account:1285251597/Account:1285192081/Account:1285184087/Account:1285182355/
order
:
Account:1285265589/
Account:1285257971/Account:1285253592/Account:1285252571/Account:1285251984/Account:1285251811/Account:1285251597/Account:1285192081/Account:1285184087/Account:1285182355/
portNum
:
5060
portNum
:
5060
registrationExpire
:
180
registrationExpire
:
180
searchBarDisplay
:
true
searchBarDisplay
:
true
...
...
This diff is collapsed.
Click to expand it.
tools/ini2yaml.py
0 → 100644
+
176
−
0
View file @
1dea4d6d
import
os
import
yaml
from
ConfigParser
import
ConfigParser
as
cp
# path = os.environ['HOME'] + "/.config/sflphone/sflphonedrc"
path
=
"
sflphonedrc
"
c
=
cp
()
c
.
read
(
path
)
accnodes
=
[
'
srtp
'
,
'
tls
'
,
'
zrtp
'
]
auxnodes
=
[
'
alsa
'
,
'
pulse
'
,
'
dtmf
'
]
dico
=
{}
dico
[
'
Accounts
'
]
=
[]
conversion
=
{
# addressbook
'
addressbook
'
:
'
addressbook
'
,
'
contact_photo
'
:
'
photo
'
,
'
enable
'
:
'
enabled
'
,
'
max_results
'
:
'
maxResults
'
,
'
phone_business
'
:
'
business
'
,
'
phone_home
'
:
'
photo
'
,
'
phone_mobile
'
:
'
mobile
'
,
# audio
'
audio
'
:
'
audio
'
,
'
cardid_in
'
:
'
cardIn
'
,
'
cardid_out
'
:
'
cardOut
'
,
'
cardid_ring
'
:
'
cardRing
'
,
'
framesize
'
:
'
frameSize
'
,
'
plugin
'
:
'
plugin
'
,
'
samplerate
'
:
'
smplRate
'
,
'
deviceplayback
'
:
'
devicePlayback
'
,
'
devicerecord
'
:
'
deviceRecord
'
,
'
deviceringtone
'
:
'
deviceRingtone
'
,
'
path
'
:
'
recordPath
'
,
'
ringchoice
'
:
'
ringtonePath
'
,
'
micro
'
:
'
volumeMic
'
,
'
speakers
'
:
'
volumeSpkr
'
,
# hooks
'
hooks
'
:
'
hooks
'
,
'
iax2_enabled
'
:
'
iax2Enabled
'
,
'
phone_number_add_prefix
'
:
'
numberAddPrefix
'
,
'
phone_number_enabled
'
:
'
numberEnabled
'
,
'
sip_enabled
'
:
'
sipEnabled
'
,
'
url_command
'
:
'
urlCommand
'
,
'
url_sip_field
'
:
'
urlSipField
'
,
# general preference
'
preferences
'
:
'
preferences
'
,
'
order
'
:
'
order
'
,
'
api
'
:
'
audioApi
'
,
'
display
'
:
'
searchBarDisplay
'
,
'
limit
'
:
'
historyLimit
'
,
'
mails
'
:
'
notifyMails
'
,
'
zonetonechoice
'
:
'
zoneToneChoice
'
,
'
portnum
'
:
'
portNum
'
,
'
md5hash
'
:
'
md5Hash
'
,
# voip link
'
voiplink
'
:
'
voipPreferences
'
,
'
playdtmf
'
:
'
playDtmf
'
,
'
playtones
'
:
'
playTones
'
,
'
pulselength
'
:
'
pulseLength
'
,
'
senddtmfas
'
:
'
dtmfType
'
,
'
symmetric
'
:
'
symmetric
'
,
'
zidfile
'
:
'
zidFile
'
,
# account
'
ip2ip
'
:
'
IP2IP
'
,
'
alias
'
:
'
alias
'
,
'
displayname
'
:
'
displayName
'
,
'
localinterface
'
:
'
interface
'
,
'
localport
'
:
'
port
'
,
'
publishedaddress
'
:
'
publishAddr
'
,
'
publishedport
'
:
'
publishPort
'
,
'
publishedsameaslocal
'
:
'
sameasLocal
'
,
'
activecodecs
'
:
'
codecs
'
,
# srtp
'
enable
'
:
'
enable
'
,
'
keyexchange
'
:
'
keyExchange
'
,
'
rtpfallback
'
:
'
rtpFallback
'
,
# stun
'
enable
'
:
'
stunEnabled
'
,
'
server
'
:
'
stunServer
'
,
# tls
'
certificatefile
'
:
'
certificate
'
,
'
certificatelistfile
'
:
'
calist
'
,
'
ciphers
'
:
'
ciphers
'
,
'
enable
'
:
'
enable
'
,
'
listenerport
'
:
'
tlsPort
'
,
'
method
'
:
'
password
'
,
'
negotiationtimemoutmsec
'
:
''
,
'
negotiationtimeoutsec
'
:
'
timeout
'
,
'
password
'
:
'
password
'
,
'
privatekeyfile
'
:
'
privateKey
'
,
'
requireclientcertificate
'
:
'
requireCertif
'
,
'
servername
'
:
'
server
'
,
'
verifyclient
'
:
'
verifyClien
'
,
'
verifyserver
'
:
'
verifyServer
'
,
# zrtp
'
displaysas
'
:
'
displaySAS
'
,
'
displaysasonce
'
:
'
displaySasOnce
'
,
'
hellohashenable
'
:
'
helloHashEnable
'
,
'
notsuppwarning
'
:
'
notSuppWarning
'
,
# to be removed
'
listenerport
'
:
'
port
'
,
}
# parcourt des sections du fichier d'origine
for
sec
in
c
.
sections
():
# les comptes sont maintenant dans une liste de comptes
if
'
Account
'
in
sec
or
sec
==
'
IP2IP
'
:
dsec
=
'
Accounts
'
# dict temporaire pour insertion ulterieure des comptes dans le dictionnaire
daccount
=
{}
daccount
[
'
id
'
]
=
sec
# dict temporaire pour insertion ulterieure des nodes dans le compte
subdic
=
{}
# preparation du dictionnaire pour les nodes du compte
for
x
in
accnodes
:
subdic
[
x
]
=
{}
# parcourt des options
for
opt
in
c
.
options
(
sec
):
spl
=
opt
.
split
(
'
.
'
)
# si nous avons affaire a un node
if
spl
[
0
]
in
accnodes
:
# on ajoute dans le sous dict du compte
print
spl
[
1
]
subdic
[
spl
[
0
]][
conversion
[
spl
[
1
]]]
=
c
.
get
(
sec
,
opt
)
# sinon l'option est attachee au compte
else
:
daccount
[
spl
[
len
(
spl
)
-
1
]]
=
c
.
get
(
sec
,
opt
)
# insertion des nodes dans le compte
for
x
in
accnodes
:
daccount
[
x
]
=
subdic
[
x
]
#insertion du compte dans le dictionnaire principal
dico
[
dsec
].
append
(
daccount
)
else
:
dsec
=
sec
dico
[
dsec
]
=
{}
#print dsec
#for opt in c.options(sec):
# dico[dsec][opt] = c.get(sec, opt)
# print opt
subdic
=
{}
# preparation du dictionnaire pour les nodes de la section
for
x
in
auxnodes
:
subdic
[
x
]
=
{}
# parcourt des options
for
opt
in
c
.
options
(
sec
):
spl
=
opt
.
split
(
'
.
'
)
# si nous avons affaire a un node
if
spl
[
0
]
in
auxnodes
:
# on ajoute dans le sous dict du compte
print
spl
[
1
]
subdic
[
spl
[
0
]][
conversion
[
spl
[
1
]]]
=
c
.
get
(
sec
,
opt
)
# sinon l'option est attachee au compte
else
:
dico
[
sec
][
spl
[
len
(
spl
)
-
1
]]
=
c
.
get
(
sec
,
opt
)
# insertion des nodes dans le compte
for
x
in
auxnodes
:
if
subdic
[
x
]:
dico
[
sec
][
x
]
=
subdic
[
x
]
f
=
open
(
'
blah.yml
'
,
'
wr
'
)
f
.
write
(
yaml
.
dump
(
dico
,
default_flow_style
=
False
))
f
.
close
()
#Addressbook: ajouter 'list': None
#Rings.ringChoice ringsringChoice
# dictionnaires:
# alsa, accounts,
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