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
b06b10d6
Commit
b06b10d6
authored
14 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#3649] Implement serialization method for accounts
parent
12cfa3fe
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
sflphone-common/src/sip/sipaccount.cpp
+103
-1
103 additions, 1 deletion
sflphone-common/src/sip/sipaccount.cpp
sflphone-common/src/sip/sipaccount.h
+2
-2
2 additions, 2 deletions
sflphone-common/src/sip/sipaccount.h
with
105 additions
and
3 deletions
sflphone-common/src/sip/sipaccount.cpp
+
103
−
1
View file @
b06b10d6
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
#include
"manager.h"
#include
"manager.h"
#include
"user_cfg.h"
#include
"user_cfg.h"
#include
<pwd.h>
#include
<pwd.h>
#include
<sstream>
Credentials
::
Credentials
()
:
credentialCount
(
0
)
{}
Credentials
::
Credentials
()
:
credentialCount
(
0
)
{}
...
@@ -135,6 +135,108 @@ SIPAccount::~SIPAccount()
...
@@ -135,6 +135,108 @@ SIPAccount::~SIPAccount()
void
SIPAccount
::
serialize
(
Engine
*
engine
)
{
void
SIPAccount
::
serialize
(
Engine
*
engine
)
{
Conf
::
MappingNode
accountmap
(
NULL
);
Conf
::
MappingNode
credentialmap
(
NULL
);
Conf
::
MappingNode
srtpmap
(
NULL
);
Conf
::
MappingNode
zrtpmap
(
NULL
);
Conf
::
MappingNode
tlsmap
(
NULL
);
Conf
::
ScalarNode
id
(
Account
::
_accountID
);
Conf
::
ScalarNode
username
(
Account
::
_username
);
Conf
::
ScalarNode
password
(
Account
::
_password
);
Conf
::
ScalarNode
alias
(
Account
::
_alias
);
Conf
::
ScalarNode
hostname
(
Account
::
_hostname
);
Conf
::
ScalarNode
enable
(
_enabled
?
"true"
:
"false"
);
Conf
::
ScalarNode
type
(
Account
::
_type
);
Conf
::
ScalarNode
expire
(
_registrationExpire
);
Conf
::
ScalarNode
interface
(
_interface
);
std
::
stringstream
portstr
;
portstr
<<
_localPort
;
Conf
::
ScalarNode
port
(
portstr
.
str
());
Conf
::
ScalarNode
mailbox
(
"97"
);
Conf
::
ScalarNode
publishAddr
(
_publishedIpAddress
);
std
::
stringstream
publicportstr
;
publicportstr
<<
_publishedPort
;
Conf
::
ScalarNode
publishPort
(
publicportstr
.
str
());
Conf
::
ScalarNode
sameasLocal
(
_publishedSameasLocal
?
"true"
:
"false"
);
Conf
::
ScalarNode
resolveOnce
(
_resolveOnce
?
"true"
:
"false"
);
Conf
::
ScalarNode
codecs
(
""
);
Conf
::
ScalarNode
stunServer
(
std
::
string
(
_stunServerName
.
ptr
,
_stunServerName
.
slen
));
Conf
::
ScalarNode
stunEnabled
(
_stunEnabled
?
"true"
:
"false"
);
Conf
::
ScalarNode
displayName
(
_displayName
);
Conf
::
ScalarNode
dtmfType
(
_dtmfType
==
0
?
"overrtp"
:
"sipinfo"
);
std
::
stringstream
countstr
;
countstr
<<
_credentialCount
;
Conf
::
ScalarNode
count
(
countstr
.
str
());
Conf
::
ScalarNode
srtpenabled
(
_srtpEnabled
?
"true"
:
"false"
);
Conf
::
ScalarNode
keyExchange
(
_srtpKeyExchange
);
Conf
::
ScalarNode
rtpFallback
(
_srtpFallback
?
"true"
:
"false"
);
Conf
::
ScalarNode
displaySas
(
_zrtpDisplaySas
?
"true"
:
"false"
);
Conf
::
ScalarNode
displaySasOnce
(
_zrtpDisplaySasOnce
?
"true"
:
"false"
);
Conf
::
ScalarNode
helloHashEnabled
(
_zrtpHelloHash
?
"true"
:
"false"
);
Conf
::
ScalarNode
notSuppWarning
(
_zrtpNotSuppWarning
?
"true"
:
"false"
);
Conf
::
ScalarNode
tlsport
(
_tlsPortStr
);
Conf
::
ScalarNode
certificate
(
_tlsCertificateFile
);
Conf
::
ScalarNode
calist
(
_tlsCaListFile
);
Conf
::
ScalarNode
ciphers
(
_tlsCiphers
);
Conf
::
ScalarNode
tlsenabled
(
_tlsEnable
);
Conf
::
ScalarNode
tlsmethod
(
_tlsMethod
);
Conf
::
ScalarNode
timeout
(
_tlsNegotiationTimeoutSec
);
Conf
::
ScalarNode
tlspassword
(
_tlsPassword
);
Conf
::
ScalarNode
privatekey
(
_tlsPrivateKeyFile
);
Conf
::
ScalarNode
requirecertif
(
_tlsRequireClientCertificate
?
"true"
:
"false"
);
Conf
::
ScalarNode
server
(
_tlsServerName
);
Conf
::
ScalarNode
verifyclient
(
_tlsVerifyServer
?
"true"
:
"false"
);
Conf
::
ScalarNode
verifyserver
(
_tlsVerifyClient
?
"true"
:
"false"
);
accountmap
.
setKeyValue
(
aliasKey
,
&
alias
);
accountmap
.
setKeyValue
(
typeKey
,
&
type
);
accountmap
.
setKeyValue
(
idKey
,
&
id
);
accountmap
.
setKeyValue
(
usernameKey
,
&
username
);
accountmap
.
setKeyValue
(
passwordKey
,
&
password
);
accountmap
.
setKeyValue
(
hostnameKey
,
&
hostname
);
accountmap
.
setKeyValue
(
accountEnableKey
,
&
enable
);
accountmap
.
setKeyValue
(
mailboxKey
,
&
mailbox
);
accountmap
.
setKeyValue
(
expireKey
,
&
expire
);
accountmap
.
setKeyValue
(
interfaceKey
,
&
interface
);
accountmap
.
setKeyValue
(
portKey
,
&
port
);
accountmap
.
setKeyValue
(
publishAddrKey
,
&
publishAddr
);
accountmap
.
setKeyValue
(
publishPortKey
,
&
publishPort
);
accountmap
.
setKeyValue
(
sameasLocalKey
,
&
sameasLocal
);
accountmap
.
setKeyValue
(
resolveOnceKey
,
&
resolveOnce
);
accountmap
.
setKeyValue
(
dtmfTypeKey
,
&
dtmfType
);
accountmap
.
setKeyValue
(
displayNameKey
,
&
displayName
);
accountmap
.
setKeyValue
(
srtpKey
,
&
srtpmap
);
srtpmap
.
setKeyValue
(
srtpEnableKey
,
&
srtpenabled
);
srtpmap
.
setKeyValue
(
keyExchangeKey
,
&
keyExchange
);
srtpmap
.
setKeyValue
(
rtpFallbackKey
,
&
rtpFallback
);
accountmap
.
setKeyValue
(
zrtpKey
,
&
zrtpmap
);
zrtpmap
.
setKeyValue
(
displaySasKey
,
&
displaySas
);
zrtpmap
.
setKeyValue
(
displaySasOnceKey
,
&
displaySasOnce
);
zrtpmap
.
setKeyValue
(
helloHashEnabledKey
,
&
helloHashEnabled
);
zrtpmap
.
setKeyValue
(
notSuppWarningKey
,
&
notSuppWarning
);
accountmap
.
setKeyValue
(
credKey
,
&
credentialmap
);
credentialmap
.
setKeyValue
(
credentialCountKey
,
&
count
);
accountmap
.
setKeyValue
(
tlsKey
,
&
tlsmap
);
tlsmap
.
setKeyValue
(
tlsPortKey
,
&
tlsport
);
tlsmap
.
setKeyValue
(
certificateKey
,
&
certificate
);
tlsmap
.
setKeyValue
(
calistKey
,
&
calist
);
tlsmap
.
setKeyValue
(
ciphersKey
,
&
ciphers
);
tlsmap
.
setKeyValue
(
tlsEnableKey
,
&
tlsenabled
);
tlsmap
.
setKeyValue
(
methodKey
,
&
tlsmethod
);
tlsmap
.
setKeyValue
(
timeoutKey
,
&
timeout
);
tlsmap
.
setKeyValue
(
tlsPasswordKey
,
&
tlspassword
);
tlsmap
.
setKeyValue
(
privateKeyKey
,
&
privatekey
);
tlsmap
.
setKeyValue
(
requireCertifKey
,
&
requirecertif
);
tlsmap
.
setKeyValue
(
serverKey
,
&
server
);
tlsmap
.
setKeyValue
(
verifyClientKey
,
&
verifyclient
);
tlsmap
.
setKeyValue
(
verifyServerKey
,
&
verifyserver
);
}
}
...
...
This diff is collapsed.
Click to expand it.
sflphone-common/src/sip/sipaccount.h
+
2
−
2
View file @
b06b10d6
...
@@ -451,8 +451,8 @@ class SIPAccount : public Account
...
@@ -451,8 +451,8 @@ class SIPAccount : public Account
bool
getZrtpDiaplaySasOnce
(
void
)
{
return
_zrtpDisplaySasOnce
;
}
bool
getZrtpDiaplaySasOnce
(
void
)
{
return
_zrtpDisplaySasOnce
;
}
void
setZrtpDiaplaySasOnce
(
bool
sasonce
)
{
_zrtpDisplaySasOnce
=
sasonce
;
}
void
setZrtpDiaplaySasOnce
(
bool
sasonce
)
{
_zrtpDisplaySasOnce
=
sasonce
;
}
bool
getZrtpNotSuppWarning
(
void
)
{
return
_zrtp
DisplaySasOnce
;
}
bool
getZrtpNotSuppWarning
(
void
)
{
return
_zrtp
NotSuppWarning
;
}
void
setZrtpNotSuppWarning
(
bool
warning
)
{
_zrtp
DisplaySasOnce
=
_zrtpNotSuppW
arning
;
}
void
setZrtpNotSuppWarning
(
bool
warning
)
{
_zrtp
NotSuppWarning
=
w
arning
;
}
bool
getZrtpHelloHash
(
void
)
{
return
_zrtpHelloHash
;
}
bool
getZrtpHelloHash
(
void
)
{
return
_zrtpHelloHash
;
}
void
setZrtpHelloHash
(
bool
hellohash
)
{
_zrtpHelloHash
=
hellohash
;
}
void
setZrtpHelloHash
(
bool
hellohash
)
{
_zrtpHelloHash
=
hellohash
;
}
...
...
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