Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-libclient
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-libclient
Commits
9316baca
Commit
9316baca
authored
Apr 23, 2015
by
Emmanuel Lepage Vallee
Browse files
Options
Downloads
Patches
Plain Diff
account: Add TURN settings
Refs #71564
parent
180d4419
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/account.cpp
+25
-1
25 additions, 1 deletion
src/account.cpp
src/account.h
+6
-0
6 additions, 0 deletions
src/account.h
src/accountmodel.cpp
+2
-0
2 additions, 0 deletions
src/accountmodel.cpp
src/keyexchangemodel.cpp
+1
-1
1 addition, 1 deletion
src/keyexchangemodel.cpp
with
34 additions
and
2 deletions
src/account.cpp
+
25
−
1
View file @
9316baca
...
@@ -858,6 +858,16 @@ bool Account::useDefaultPort() const
...
@@ -858,6 +858,16 @@ bool Account::useDefaultPort() const
return
d_ptr
->
m_UseDefaultPort
;
return
d_ptr
->
m_UseDefaultPort
;
}
}
bool
Account
::
isTurnEnabled
()
const
{
return
d_ptr
->
accountDetail
(
DRing
::
Account
::
ConfProperties
::
TURN
::
ENABLED
)
IS_TRUE
;
}
QString
Account
::
turnServer
()
const
{
return
d_ptr
->
accountDetail
(
DRing
::
Account
::
ConfProperties
::
TURN
::
SERVER
);
}
#define CAST(item) static_cast<int>(item)
#define CAST(item) static_cast<int>(item)
QVariant
Account
::
roleData
(
int
role
)
const
QVariant
Account
::
roleData
(
int
role
)
const
{
{
...
@@ -971,6 +981,10 @@ QVariant Account::roleData(int role) const
...
@@ -971,6 +981,10 @@ QVariant Account::roleData(int role) const
return
trimesterCallCount
();
return
trimesterCallCount
();
case
CAST
(
Account
::
Role
::
LastUsed
)
:
case
CAST
(
Account
::
Role
::
LastUsed
)
:
return
(
int
)
lastUsed
();
return
(
int
)
lastUsed
();
case
CAST
(
Account
::
Role
::
SipTurnServer
)
:
return
turnServer
();
case
CAST
(
Account
::
Role
::
SipTurnEnabled
)
:
return
isTurnEnabled
();
default
:
default
:
return
QVariant
();
return
QVariant
();
}
}
...
@@ -1467,7 +1481,7 @@ void Account::setUseDefaultPort(bool value)
...
@@ -1467,7 +1481,7 @@ void Account::setUseDefaultPort(bool value)
switch
(
protocol
())
{
switch
(
protocol
())
{
case
Account
::
Protocol
::
SIP
:
case
Account
::
Protocol
::
SIP
:
case
Account
::
Protocol
::
IAX
:
case
Account
::
Protocol
::
IAX
:
setLocalPort
(
5060
);
setLocalPort
(
5060
);
//FIXME check is TLS is used
break
;
break
;
case
Account
::
Protocol
::
RING
:
case
Account
::
Protocol
::
RING
:
setLocalPort
(
5061
);
setLocalPort
(
5061
);
...
@@ -1479,6 +1493,16 @@ void Account::setUseDefaultPort(bool value)
...
@@ -1479,6 +1493,16 @@ void Account::setUseDefaultPort(bool value)
d_ptr
->
m_UseDefaultPort
=
value
;
d_ptr
->
m_UseDefaultPort
=
value
;
}
}
void
Account
::
setTurnEnabled
(
bool
value
)
{
d_ptr
->
setAccountProperty
(
DRing
::
Account
::
ConfProperties
::
TURN
::
ENABLED
,
(
value
)
TO_BOOL
);
}
void
Account
::
setTurnServer
(
const
QString
&
value
)
{
d_ptr
->
setAccountProperty
(
DRing
::
Account
::
ConfProperties
::
TURN
::
SERVER
,
value
);
}
///Set the DTMF type
///Set the DTMF type
void
Account
::
setDTMFType
(
DtmfType
type
)
void
Account
::
setDTMFType
(
DtmfType
type
)
{
{
...
...
This diff is collapsed.
Click to expand it.
src/account.h
+
6
−
0
View file @
9316baca
...
@@ -230,6 +230,8 @@ class LIB_EXPORT Account : public QObject {
...
@@ -230,6 +230,8 @@ class LIB_EXPORT Account : public QObject {
WeekCallCount
=
148
,
WeekCallCount
=
148
,
TrimesterCallCount
=
149
,
TrimesterCallCount
=
149
,
LastUsed
=
150
,
LastUsed
=
150
,
SipTurnServer
=
151
,
SipTurnEnabled
=
152
,
};
};
enum
class
Protocol
{
enum
class
Protocol
{
...
@@ -323,6 +325,8 @@ class LIB_EXPORT Account : public QObject {
...
@@ -323,6 +325,8 @@ class LIB_EXPORT Account : public QObject {
QString
lastTransportErrorMessage
()
const
;
QString
lastTransportErrorMessage
()
const
;
QString
userAgent
()
const
;
QString
userAgent
()
const
;
bool
useDefaultPort
()
const
;
bool
useDefaultPort
()
const
;
bool
isTurnEnabled
()
const
;
QString
turnServer
()
const
;
RegistrationState
registrationState
()
const
;
RegistrationState
registrationState
()
const
;
Protocol
protocol
()
const
;
Protocol
protocol
()
const
;
KeyExchangeModel
::
Type
keyExchange
()
const
;
KeyExchangeModel
::
Type
keyExchange
()
const
;
...
@@ -358,6 +362,7 @@ class LIB_EXPORT Account : public QObject {
...
@@ -358,6 +362,7 @@ class LIB_EXPORT Account : public QObject {
void
setLocalInterface
(
const
QString
&
detail
);
void
setLocalInterface
(
const
QString
&
detail
);
void
setRingtonePath
(
const
QString
&
detail
);
void
setRingtonePath
(
const
QString
&
detail
);
void
setLastErrorMessage
(
const
QString
&
message
);
void
setLastErrorMessage
(
const
QString
&
message
);
void
setTurnServer
(
const
QString
&
value
);
void
setKeyExchange
(
KeyExchangeModel
::
Type
detail
);
void
setKeyExchange
(
KeyExchangeModel
::
Type
detail
);
void
setLastErrorCode
(
int
code
);
void
setLastErrorCode
(
int
code
);
void
setVoiceMailCount
(
int
count
);
void
setVoiceMailCount
(
int
count
);
...
@@ -391,6 +396,7 @@ class LIB_EXPORT Account : public QObject {
...
@@ -391,6 +396,7 @@ class LIB_EXPORT Account : public QObject {
void
setUpnpEnabled
(
bool
enable
);
void
setUpnpEnabled
(
bool
enable
);
void
setHasCustomUserAgent
(
bool
enable
);
void
setHasCustomUserAgent
(
bool
enable
);
void
setUseDefaultPort
(
bool
value
);
void
setUseDefaultPort
(
bool
value
);
void
setTurnEnabled
(
bool
value
);
void
setRoleData
(
int
role
,
const
QVariant
&
value
);
void
setRoleData
(
int
role
,
const
QVariant
&
value
);
...
...
This diff is collapsed.
Click to expand it.
src/accountmodel.cpp
+
2
−
0
View file @
9316baca
...
@@ -147,6 +147,8 @@ QHash<int,QByteArray> AccountModel::roleNames() const
...
@@ -147,6 +147,8 @@ QHash<int,QByteArray> AccountModel::roleNames() const
roles
.
insert
(
CAST
(
Account
::
Role
::
WeekCallCount
)
,
QByteArray
(
"weekCallCount"
));
roles
.
insert
(
CAST
(
Account
::
Role
::
WeekCallCount
)
,
QByteArray
(
"weekCallCount"
));
roles
.
insert
(
CAST
(
Account
::
Role
::
TrimesterCallCount
)
,
QByteArray
(
"trimesterCallCount"
));
roles
.
insert
(
CAST
(
Account
::
Role
::
TrimesterCallCount
)
,
QByteArray
(
"trimesterCallCount"
));
roles
.
insert
(
CAST
(
Account
::
Role
::
LastUsed
)
,
QByteArray
(
"lastUsed"
));
roles
.
insert
(
CAST
(
Account
::
Role
::
LastUsed
)
,
QByteArray
(
"lastUsed"
));
roles
.
insert
(
CAST
(
Account
::
Role
::
SipTurnServer
)
,
QByteArray
(
"sipTurnServer"
));
roles
.
insert
(
CAST
(
Account
::
Role
::
SipTurnEnabled
)
,
QByteArray
(
"sipTurnEnabled"
));
}
}
return
roles
;
return
roles
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/keyexchangemodel.cpp
+
1
−
1
View file @
9316baca
...
@@ -96,7 +96,7 @@ int KeyExchangeModel::rowCount( const QModelIndex& parent ) const
...
@@ -96,7 +96,7 @@ int KeyExchangeModel::rowCount( const QModelIndex& parent ) const
Qt
::
ItemFlags
KeyExchangeModel
::
flags
(
const
QModelIndex
&
index
)
const
Qt
::
ItemFlags
KeyExchangeModel
::
flags
(
const
QModelIndex
&
index
)
const
{
{
if
(
!
index
.
isValid
())
return
Qt
::
NoItemFlags
;
if
(
!
index
.
isValid
())
return
Qt
::
NoItemFlags
;
return
Qt
::
ItemIsEnabled
|
Qt
::
ItemIsSelectable
;
return
index
.
row
()
!=
(
int
)
KeyExchangeModel
::
Type
::
ZRTP
?
(
Qt
::
ItemIsEnabled
|
Qt
::
ItemIsSelectable
)
:
Qt
::
NoItemFlags
;
}
}
bool
KeyExchangeModel
::
setData
(
const
QModelIndex
&
index
,
const
QVariant
&
value
,
int
role
)
bool
KeyExchangeModel
::
setData
(
const
QModelIndex
&
index
,
const
QVariant
&
value
,
int
role
)
...
...
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