Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
24db5cdc
Commit
24db5cdc
authored
Oct 05, 2011
by
Tristan Matthews
Browse files
* #7097: cleanup, stripped dead code, removed shadowed-vars
Found with -Wshadow argument to g++
parent
6aceecc3
Changes
21
Hide whitespace changes
Inline
Side-by-side
daemon/src/audio/alsa/alsalayer.cpp
View file @
24db5cdc
...
@@ -214,10 +214,10 @@ AlsaLayer::stopStream (void)
...
@@ -214,10 +214,10 @@ AlsaLayer::stopStream (void)
* return the function return value
* return the function return value
*/
*/
#define ALSA_CALL(call, error) ({ \
#define ALSA_CALL(call, error) ({ \
int err = call; \
int err
_code
= call; \
if (err < 0) \
if (err
_code
< 0) \
_error("ALSA: "error": %s", snd_strerror(err)); \
_error("ALSA: "error": %s", snd_strerror(err
_code
)); \
err; \
err
_code
; \
})
})
void
AlsaLayer
::
stopCaptureStream
(
void
)
void
AlsaLayer
::
stopCaptureStream
(
void
)
...
...
daemon/src/config/yamlemitter.cpp
View file @
24db5cdc
...
@@ -374,7 +374,7 @@ void YamlEmitter::addMappingItem (int mappingid, std::string key, YamlNode *node
...
@@ -374,7 +374,7 @@ void YamlEmitter::addMappingItem (int mappingid, std::string key, YamlNode *node
throw
;
throw
;
}
}
}
else
if
(
node
->
getType
()
==
SEQUENCE
)
{
}
else
if
(
node
->
getType
()
==
SEQUENCE
)
{
SequenceNode
*
seqnode
=
(
SequenceNode
*
)
node
;
SequenceNode
*
seqnode
=
static_cast
<
SequenceNode
*
>
(
node
)
;
if
(
(
temp1
=
yaml_document_add_scalar
(
&
document
,
NULL
,
(
yaml_char_t
*
)
key
.
c_str
(),
-
1
,
YAML_PLAIN_SCALAR_STYLE
))
==
0
)
if
(
(
temp1
=
yaml_document_add_scalar
(
&
document
,
NULL
,
(
yaml_char_t
*
)
key
.
c_str
(),
-
1
,
YAML_PLAIN_SCALAR_STYLE
))
==
0
)
throw
YamlEmitterException
(
"Could not add scalar to document"
);
throw
YamlEmitterException
(
"Could not add scalar to document"
);
...
@@ -387,25 +387,21 @@ void YamlEmitter::addMappingItem (int mappingid, std::string key, YamlNode *node
...
@@ -387,25 +387,21 @@ void YamlEmitter::addMappingItem (int mappingid, std::string key, YamlNode *node
Sequence
*
seq
=
seqnode
->
getSequence
();
Sequence
*
seq
=
seqnode
->
getSequence
();
Sequence
::
const_iterator
it
;
Sequence
::
const_iterator
it
;
for
(
it
=
seq
->
begin
();
it
!=
seq
->
end
();
++
it
)
{
for
(
it
=
seq
->
begin
();
it
!=
seq
->
end
();
++
it
)
{
YamlNode
*
n
ode
=
*
it
;
YamlNode
*
yamlN
ode
=
*
it
;
int
id
;
int
id
;
if
(
(
id
=
yaml_document_add_mapping
(
&
document
,
NULL
,
YAML_BLOCK_MAPPING_STYLE
))
==
0
)
{
if
((
id
=
yaml_document_add_mapping
(
&
document
,
NULL
,
YAML_BLOCK_MAPPING_STYLE
))
==
0
)
throw
YamlEmitterException
(
"Could not add account mapping to document"
);
throw
YamlEmitterException
(
"Could not add account mapping to document"
);
}
if
(
yaml_document_append_sequence_item
(
&
document
,
temp2
,
id
)
==
0
)
{
if
(
yaml_document_append_sequence_item
(
&
document
,
temp2
,
id
)
==
0
)
throw
YamlEmitterException
(
"Could not append account mapping to sequence"
);
throw
YamlEmitterException
(
"Could not append account mapping to sequence"
);
}
MappingNode
*
mapnode
=
(
MappingNode
*
)
n
ode
;
MappingNode
*
mapnode
=
static_cast
<
MappingNode
*
>
(
yamlN
ode
)
;
Mapping
*
map
=
mapnode
->
getMapping
();
Mapping
*
map
=
mapnode
->
getMapping
();
Mapping
::
iterator
mapit
;
Mapping
::
iterator
mapit
;
for
(
mapit
=
map
->
begin
();
mapit
!=
map
->
end
()
;
++
mapit
)
for
(
mapit
=
map
->
begin
();
mapit
!=
map
->
end
()
;
++
mapit
)
addMappingItem
(
id
,
mapit
->
first
,
mapit
->
second
);
addMappingItem
(
id
,
mapit
->
first
,
mapit
->
second
);
}
}
}
else
{
}
else
throw
YamlEmitterException
(
"Unknown node type while adding mapping node"
);
throw
YamlEmitterException
(
"Unknown node type while adding mapping node"
);
}
}
}
}
}
daemon/src/config/yamlemitter.h
View file @
24db5cdc
...
@@ -131,7 +131,6 @@ class YamlEmitter
...
@@ -131,7 +131,6 @@ class YamlEmitter
friend
class
ConfigurationTest
;
friend
class
ConfigurationTest
;
};
};
}
}
#endif
#endif
daemon/src/dbus/callmanager.h
View file @
24db5cdc
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#ifndef __SFL_CALLMANAGER_H__
#ifndef __SFL_CALLMANAGER_H__
#define __SFL_CALLMANAGER_H__
#define __SFL_CALLMANAGER_H__
#include
"dbus_cpp.h"
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
/* This warning option only exists for gcc 4.6.0 and greater. */
/* This warning option only exists for gcc 4.6.0 and greater. */
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
...
@@ -47,7 +48,6 @@
...
@@ -47,7 +48,6 @@
#pragma GCC diagnostic warning "-Wunused-but-set-variable"
#pragma GCC diagnostic warning "-Wunused-but-set-variable"
#endif
#endif
#include
<dbus-c++/dbus.h>
#include
<stdexcept>
#include
<stdexcept>
class
CallManagerException
:
public
std
::
runtime_error
class
CallManagerException
:
public
std
::
runtime_error
...
...
daemon/src/dbus/configurationmanager.h
View file @
24db5cdc
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
#pragma GCC diagnostic warning "-Wunused-but-set-variable"
#pragma GCC diagnostic warning "-Wunused-but-set-variable"
#endif
#endif
#include
<
dbus
-c++/dbus
.h
>
#include
"
dbus
_cpp
.h
"
class
ConfigurationManager
class
ConfigurationManager
:
public
org
::
sflphone
::
SFLphone
::
ConfigurationManager_adaptor
,
:
public
org
::
sflphone
::
SFLphone
::
ConfigurationManager_adaptor
,
...
...
daemon/src/dbus/dbusmanager.h
View file @
24db5cdc
...
@@ -31,11 +31,8 @@
...
@@ -31,11 +31,8 @@
#ifndef __DBUSMANAGERIMPL_H__
#ifndef __DBUSMANAGERIMPL_H__
#define __DBUSMANAGERIMPL_H__
#define __DBUSMANAGERIMPL_H__
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
#include
"dbus_cpp.h"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include
<dbus-c++/dbus.h>
#pragma GCC diagnostic warning "-Wignored-qualifiers"
#pragma GCC diagnostic warning "-Wunused-parameter"
class
ConfigurationManager
;
class
ConfigurationManager
;
class
CallManager
;
class
CallManager
;
class
NetworkManager
;
class
NetworkManager
;
...
...
daemon/src/dbus/instance.cpp
View file @
24db5cdc
...
@@ -27,8 +27,8 @@
...
@@ -27,8 +27,8 @@
* shall include the source code for the parts of OpenSSL used as well
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
* as that of the covered work.
*/
*/
#include
<
global.h
>
#include
"
global.h
"
#include
<
instance.h
>
#include
"
instance.h
"
#include
"../manager.h"
#include
"../manager.h"
Instance
::
Instance
(
DBus
::
Connection
&
connection
)
Instance
::
Instance
(
DBus
::
Connection
&
connection
)
...
...
daemon/src/dbus/instance.h
View file @
24db5cdc
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
#endif
#include
"dbus_cpp.h"
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunused-parameter"
...
@@ -44,9 +45,6 @@
...
@@ -44,9 +45,6 @@
#pragma GCC diagnostic warning "-Wunused-but-set-variable"
#pragma GCC diagnostic warning "-Wunused-but-set-variable"
#endif
#endif
#include
<dbus-c++/dbus.h>
class
Instance
class
Instance
:
public
org
::
sflphone
::
SFLphone
::
Instance_adaptor
,
:
public
org
::
sflphone
::
SFLphone
::
Instance_adaptor
,
public
DBus
::
IntrospectableAdaptor
,
public
DBus
::
IntrospectableAdaptor
,
...
...
daemon/src/dbus/networkmanager.cpp
View file @
24db5cdc
...
@@ -28,10 +28,12 @@
...
@@ -28,10 +28,12 @@
* as that of the covered work.
* as that of the covered work.
*/
*/
#include
<global.h>
#include
"networkmanager.h"
#include
"networkmanager.h"
#include
<iostream>
#include
<iostream>
#include
<instance.h>
#include
"global.h"
#include
"instance.h"
#include
"../manager.h"
#include
"../manager.h"
const
std
::
string
NetworkManager
::
statesString
[
5
]
=
{
"unknown"
,
"asleep"
,
"connecting"
,
"connected"
,
"disconnected"
};
const
std
::
string
NetworkManager
::
statesString
[
5
]
=
{
"unknown"
,
"asleep"
,
"connecting"
,
"connected"
,
"disconnected"
};
...
@@ -55,6 +57,6 @@ void NetworkManager::PropertiesChanged (const std::map< std::string, ::DBus::Var
...
@@ -55,6 +57,6 @@ void NetworkManager::PropertiesChanged (const std::map< std::string, ::DBus::Var
Manager
::
instance
().
registerAccounts
();
Manager
::
instance
().
registerAccounts
();
}
}
NetworkManager
::
NetworkManager
(
DBus
::
Connection
&
connection
,
const
DBus
::
Path
&
path
,
const
char
*
destination
)
:
DBus
::
ObjectProxy
(
connection
,
path
,
destination
)
NetworkManager
::
NetworkManager
(
DBus
::
Connection
&
connection
,
const
DBus
::
Path
&
dbus_
path
,
const
char
*
destination
)
:
DBus
::
ObjectProxy
(
connection
,
dbus_
path
,
destination
)
{
{
}
}
daemon/src/dbus/networkmanager_proxy.h
View file @
24db5cdc
...
@@ -6,8 +6,7 @@
...
@@ -6,8 +6,7 @@
#ifndef __dbusxx__networkmanager_proxy_h__PROXY_MARSHAL_H
#ifndef __dbusxx__networkmanager_proxy_h__PROXY_MARSHAL_H
#define __dbusxx__networkmanager_proxy_h__PROXY_MARSHAL_H
#define __dbusxx__networkmanager_proxy_h__PROXY_MARSHAL_H
#include
<dbus-c++/dbus.h>
#include
"dbus_cpp.h"
#include
<cassert>
namespace
org
namespace
org
{
{
...
...
daemon/src/hooks/urlhook.cpp
View file @
24db5cdc
...
@@ -31,13 +31,13 @@
...
@@ -31,13 +31,13 @@
#include
"urlhook.h"
#include
"urlhook.h"
#include
<cstdlib>
#include
<cstdlib>
void
UrlHook
::
runAction
(
std
::
string
command
,
std
::
string
args
)
int
UrlHook
::
runAction
(
const
std
::
string
&
command
,
const
std
::
string
&
args
)
{
{
if
(
args
.
empty
())
if
(
args
.
empty
())
return
;
return
0
;
//FIXME : use fork and execve, so no need to escape shell arguments
//FIXME : use fork and execve, so no need to escape shell arguments
std
::
string
cmd
=
command
+
"
\"
"
+
args
+
"
\"
&"
;
std
::
string
cmd
=
command
+
"
\"
"
+
args
+
"
\"
&"
;
system
(
cmd
.
c_str
());
return
system
(
cmd
.
c_str
());
}
}
daemon/src/hooks/urlhook.h
View file @
24db5cdc
...
@@ -33,10 +33,8 @@
...
@@ -33,10 +33,8 @@
#include
<string>
#include
<string>
class
UrlHook
namespace
UrlHook
{
{
public:
int
runAction
(
const
std
::
string
&
command
,
const
std
::
string
&
arg
);
static
void
runAction
(
std
::
string
,
std
::
string
);
}
};
#endif // URL_HOOK_H
#endif // URL_HOOK_H
daemon/src/iax/iaxcall.cpp
View file @
24db5cdc
...
@@ -57,16 +57,16 @@ IAXCall::getSupportedFormat (const std::string &accountID) const
...
@@ -57,16 +57,16 @@ IAXCall::getSupportedFormat (const std::string &accountID) const
{
{
Account
*
account
=
Manager
::
instance
().
getAccount
(
accountID
);
Account
*
account
=
Manager
::
instance
().
getAccount
(
accountID
);
int
format
=
0
;
int
format
_mask
=
0
;
if
(
account
)
{
if
(
account
)
{
CodecOrder
map
(
account
->
getActiveCodecs
());
CodecOrder
map
(
account
->
getActiveCodecs
());
for
(
CodecOrder
::
const_iterator
iter
=
map
.
begin
();
iter
!=
map
.
end
();
++
iter
)
for
(
CodecOrder
::
const_iterator
iter
=
map
.
begin
();
iter
!=
map
.
end
();
++
iter
)
format
|=
codecToASTFormat
(
*
iter
);
format
_mask
|=
codecToASTFormat
(
*
iter
);
}
}
else
else
_error
(
"No IAx account could be found"
);
_error
(
"No IAx account could be found"
);
return
format
;
return
format
_mask
;
}
}
int
IAXCall
::
getFirstMatchingFormat
(
int
needles
,
const
std
::
string
&
accountID
)
const
int
IAXCall
::
getFirstMatchingFormat
(
int
needles
,
const
std
::
string
&
accountID
)
const
...
@@ -76,10 +76,10 @@ int IAXCall::getFirstMatchingFormat (int needles, const std::string &accountID)
...
@@ -76,10 +76,10 @@ int IAXCall::getFirstMatchingFormat (int needles, const std::string &accountID)
if
(
account
!=
NULL
)
{
if
(
account
!=
NULL
)
{
CodecOrder
map
(
account
->
getActiveCodecs
());
CodecOrder
map
(
account
->
getActiveCodecs
());
for
(
CodecOrder
::
const_iterator
iter
=
map
.
begin
();
iter
!=
map
.
end
();
++
iter
)
{
for
(
CodecOrder
::
const_iterator
iter
=
map
.
begin
();
iter
!=
map
.
end
();
++
iter
)
{
int
format
=
codecToASTFormat
(
*
iter
);
int
format
_mask
=
codecToASTFormat
(
*
iter
);
// Return the first that matches
// Return the first that matches
if
(
format
&
needles
)
if
(
format
_mask
&
needles
)
return
format
;
return
format
_mask
;
}
}
}
else
}
else
_error
(
"No IAx account could be found"
);
_error
(
"No IAx account could be found"
);
...
...
daemon/src/iax/iaxvoiplink.cpp
View file @
24db5cdc
...
@@ -86,8 +86,8 @@ IAXVoIPLink::terminate()
...
@@ -86,8 +86,8 @@ IAXVoIPLink::terminate()
for
(
CallMap
::
iterator
iter
=
_callMap
.
begin
();
iter
!=
_callMap
.
end
();
++
iter
)
{
for
(
CallMap
::
iterator
iter
=
_callMap
.
begin
();
iter
!=
_callMap
.
end
();
++
iter
)
{
IAXCall
*
call
=
dynamic_cast
<
IAXCall
*>
(
iter
->
second
);
IAXCall
*
call
=
dynamic_cast
<
IAXCall
*>
(
iter
->
second
);
if
(
call
)
{
if
(
call
)
{
ost
::
MutexLock
m
(
mutexIAX_
);
ost
::
MutexLock
lock
(
mutexIAX_
);
iax_hangup
(
call
->
session
,
(
char
*
)
"Dumped Call"
);
iax_hangup
(
call
->
session
,
const_cast
<
char
*
>
(
"Dumped Call"
)
)
;
delete
call
;
delete
call
;
}
}
}
}
...
...
daemon/src/sip/SdesNegotiator.h
View file @
24db5cdc
...
@@ -93,52 +93,52 @@ class CryptoAttribute
...
@@ -93,52 +93,52 @@ class CryptoAttribute
{
{
public:
public:
CryptoAttribute
(
std
::
string
tag
,
CryptoAttribute
(
const
std
::
string
&
tag
,
std
::
string
cryptoSuite
,
const
std
::
string
&
cryptoSuite
,
std
::
string
srtpKeyMethod
,
const
std
::
string
&
srtpKeyMethod
,
std
::
string
srtpKeyInfo
,
const
std
::
string
&
srtpKeyInfo
,
std
::
string
lifetime
,
const
std
::
string
&
lifetime
,
std
::
string
mkiValue
,
const
std
::
string
&
mkiValue
,
std
::
string
mkiLength
)
:
const
std
::
string
&
mkiLength
)
:
tag
(
tag
),
tag
_
(
tag
),
cryptoSuite
(
cryptoSuite
),
cryptoSuite
_
(
cryptoSuite
),
srtpKeyMethod
(
srtpKeyMethod
),
srtpKeyMethod
_
(
srtpKeyMethod
),
srtpKeyInfo
(
srtpKeyInfo
),
srtpKeyInfo
_
(
srtpKeyInfo
),
lifetime
(
lifetime
),
lifetime
_
(
lifetime
),
mkiValue
(
mkiValue
),
mkiValue
_
(
mkiValue
),
mkiLength
(
mkiLength
)
{}
;
mkiLength
_
(
mkiLength
)
{}
std
::
string
getTag
()
const
{
std
::
string
getTag
()
const
{
return
tag
;
return
tag
_
;
}
;
}
std
::
string
getCryptoSuite
()
const
{
std
::
string
getCryptoSuite
()
const
{
return
cryptoSuite
;
return
cryptoSuite
_
;
}
;
}
std
::
string
getSrtpKeyMethod
()
const
{
std
::
string
getSrtpKeyMethod
()
const
{
return
srtpKeyMethod
;
return
srtpKeyMethod
_
;
}
;
}
std
::
string
getSrtpKeyInfo
()
const
{
std
::
string
getSrtpKeyInfo
()
const
{
return
srtpKeyInfo
;
return
srtpKeyInfo
_
;
}
;
}
std
::
string
getLifetime
()
const
{
std
::
string
getLifetime
()
const
{
return
lifetime
;
return
lifetime
_
;
}
;
}
std
::
string
getMkiValue
()
const
{
std
::
string
getMkiValue
()
const
{
return
mkiValue
;
return
mkiValue
_
;
}
;
}
std
::
string
getMkiLength
()
const
{
std
::
string
getMkiLength
()
const
{
return
mkiLength
;
return
mkiLength
_
;
}
;
}
private:
private:
std
::
string
tag
;
std
::
string
tag
_
;
std
::
string
cryptoSuite
;
std
::
string
cryptoSuite
_
;
std
::
string
srtpKeyMethod
;
std
::
string
srtpKeyMethod
_
;
std
::
string
srtpKeyInfo
;
std
::
string
srtpKeyInfo
_
;
std
::
string
lifetime
;
std
::
string
lifetime
_
;
std
::
string
mkiValue
;
std
::
string
mkiValue
_
;
std
::
string
mkiLength
;
std
::
string
mkiLength
_
;
};
};
class
SdesNegotiator
class
SdesNegotiator
...
@@ -156,7 +156,7 @@ class SdesNegotiator
...
@@ -156,7 +156,7 @@ class SdesNegotiator
public:
public:
SdesNegotiator
(
const
std
::
vector
<
CryptoSuiteDefinition
>&
localCapabilites
,
const
std
::
vector
<
std
::
string
>&
remoteAttribute
);
SdesNegotiator
(
const
std
::
vector
<
CryptoSuiteDefinition
>&
localCapabilites
,
const
std
::
vector
<
std
::
string
>&
remoteAttribute
);
~
SdesNegotiator
()
{
};
~
SdesNegotiator
()
{};
bool
negotiate
(
void
);
bool
negotiate
(
void
);
...
...
daemon/src/sip/sipaccount.cpp
View file @
24db5cdc
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
SIPAccount
::
SIPAccount
(
const
std
::
string
&
accountID
)
SIPAccount
::
SIPAccount
(
const
std
::
string
&
accountID
)
:
Account
(
accountID
,
"SIP"
)
:
Account
(
accountID
,
"SIP"
)
,
transport
(
NULL
)
,
transport
_
(
NULL
)
,
regc_
(
NULL
)
,
regc_
(
NULL
)
,
bRegister_
(
false
)
,
bRegister_
(
false
)
,
registrationExpire_
(
600
)
,
registrationExpire_
(
600
)
...
@@ -298,11 +298,11 @@ void SIPAccount::unserialize (Conf::MappingNode *map)
...
@@ -298,11 +298,11 @@ void SIPAccount::unserialize (Conf::MappingNode *map)
cred
->
getValue
(
USERNAME
,
&
user
);
cred
->
getValue
(
USERNAME
,
&
user
);
cred
->
getValue
(
PASSWORD
,
&
pass
);
cred
->
getValue
(
PASSWORD
,
&
pass
);
cred
->
getValue
(
REALM
,
&
realm
);
cred
->
getValue
(
REALM
,
&
realm
);
std
::
map
<
std
::
string
,
std
::
string
>
m
ap
;
std
::
map
<
std
::
string
,
std
::
string
>
credentialM
ap
;
m
ap
[
USERNAME
]
=
user
;
credentialM
ap
[
USERNAME
]
=
user
;
m
ap
[
PASSWORD
]
=
pass
;
credentialM
ap
[
PASSWORD
]
=
pass
;
m
ap
[
REALM
]
=
realm
;
credentialM
ap
[
REALM
]
=
realm
;
creds
.
push_back
(
m
ap
);
creds
.
push_back
(
credentialM
ap
);
}
}
}
}
if
(
creds
.
empty
())
{
if
(
creds
.
empty
())
{
...
@@ -656,10 +656,10 @@ std::string SIPAccount::getLoginName (void)
...
@@ -656,10 +656,10 @@ std::string SIPAccount::getLoginName (void)
std
::
string
SIPAccount
::
getFromUri
(
void
)
const
std
::
string
SIPAccount
::
getFromUri
(
void
)
const
{
{
std
::
string
scheme
(
""
)
;
std
::
string
scheme
;
std
::
string
transport
(
""
)
;
std
::
string
transport
;
std
::
string
username
=
username_
;
std
::
string
username
(
username_
)
;
std
::
string
hostname
=
hostname_
;
std
::
string
hostname
(
hostname_
)
;
// UDP does not require the transport specification
// UDP does not require the transport specification
if
(
transportType_
==
PJSIP_TRANSPORT_TLS
)
{
if
(
transportType_
==
PJSIP_TRANSPORT_TLS
)
{
...
...
daemon/src/sip/sipaccount.h
View file @
24db5cdc
...
@@ -408,8 +408,7 @@ class SIPAccount : public Account
...
@@ -408,8 +408,7 @@ class SIPAccount : public Account
return
zrtpHelloHash_
;
return
zrtpHelloHash_
;
}
}
pjsip_transport
*
transport
;
pjsip_transport
*
transport_
;
private:
private:
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>
>
credentials_
;
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>
>
credentials_
;
...
...
daemon/src/sip/sipvoiplink.cpp
View file @
24db5cdc
...
@@ -288,7 +288,7 @@ void SIPVoIPLink::sendRegister (Account *a)
...
@@ -288,7 +288,7 @@ void SIPVoIPLink::sendRegister (Account *a)
std
::
string
srvUri
(
account
->
getServerUri
());
std
::
string
srvUri
(
account
->
getServerUri
());
std
::
string
address
,
port
;
std
::
string
address
,
port
;
findLocalAddressFromUri
(
srvUri
,
account
->
transport
,
address
,
port
);
findLocalAddressFromUri
(
srvUri
,
account
->
transport
_
,
address
,
port
);
std
::
string
from
(
account
->
getFromUri
());
std
::
string
from
(
account
->
getFromUri
());
pj_str_t
pjFrom
=
pj_str
((
char
*
)
from
.
c_str
());
pj_str_t
pjFrom
=
pj_str
((
char
*
)
from
.
c_str
());
...
@@ -320,11 +320,11 @@ void SIPVoIPLink::sendRegister (Account *a)
...
@@ -320,11 +320,11 @@ void SIPVoIPLink::sendRegister (Account *a)
if
(
pjsip_regc_register
(
regc
,
PJ_TRUE
,
&
tdata
)
!=
PJ_SUCCESS
)
if
(
pjsip_regc_register
(
regc
,
PJ_TRUE
,
&
tdata
)
!=
PJ_SUCCESS
)
throw
VoipLinkException
(
"Unable to initialize transaction data for account registration"
);
throw
VoipLinkException
(
"Unable to initialize transaction data for account registration"
);
if
(
pjsip_regc_set_transport
(
regc
,
initTransportSelector
(
account
->
transport
,
_pool
))
!=
PJ_SUCCESS
)
if
(
pjsip_regc_set_transport
(
regc
,
initTransportSelector
(
account
->
transport
_
,
_pool
))
!=
PJ_SUCCESS
)
throw
VoipLinkException
(
"Unable to set transport"
);
throw
VoipLinkException
(
"Unable to set transport"
);
// decrease transport's ref count, counter incrementation is managed when acquiring transport
// decrease transport's ref count, counter incrementation is managed when acquiring transport
pjsip_transport_dec_ref
(
account
->
transport
);
pjsip_transport_dec_ref
(
account
->
transport
_
);
// pjsip_regc_send increment the transport ref count by one,
// pjsip_regc_send increment the transport ref count by one,
if
(
pjsip_regc_send
(
regc
,
tdata
)
!=
PJ_SUCCESS
)
if
(
pjsip_regc_send
(
regc
,
tdata
)
!=
PJ_SUCCESS
)
...
@@ -333,7 +333,7 @@ void SIPVoIPLink::sendRegister (Account *a)
...
@@ -333,7 +333,7 @@ void SIPVoIPLink::sendRegister (Account *a)
// Decrease transport's ref count, since coresponding reference counter decrementation
// Decrease transport's ref count, since coresponding reference counter decrementation
// is performed in pjsip_regc_destroy. This function is never called in SFLphone as the
// is performed in pjsip_regc_destroy. This function is never called in SFLphone as the
// regc data structure is permanently associated to the account at first registration.
// regc data structure is permanently associated to the account at first registration.
pjsip_transport_dec_ref
(
account
->
transport
);
pjsip_transport_dec_ref
(
account
->
transport
_
);
account
->
setRegistrationInfo
(
regc
);
account
->
setRegistrationInfo
(
regc
);
}
}
...
@@ -753,7 +753,7 @@ SIPVoIPLink::SIPStartCall(SIPCall *call)
...
@@ -753,7 +753,7 @@ SIPVoIPLink::SIPStartCall(SIPCall *call)
std
::
string
toUri
(
call
->
getPeerNumber
());
// expecting a fully well formed sip uri
std
::
string
toUri
(
call
->
getPeerNumber
());
// expecting a fully well formed sip uri
std
::
string
address
,
port
;
std
::
string
address
,
port
;
findLocalAddressFromUri
(
toUri
,
account
->
transport
,
address
,
port
);
findLocalAddressFromUri
(
toUri
,
account
->
transport
_
,
address
,
port
);
std
::
string
from
(
account
->
getFromUri
());
std
::
string
from
(
account
->
getFromUri
());
pj_str_t
pjFrom
=
pj_str
((
char
*
)
from
.
c_str
());
pj_str_t
pjFrom
=
pj_str
((
char
*
)
from
.
c_str
());
...
@@ -782,7 +782,7 @@ SIPVoIPLink::SIPStartCall(SIPCall *call)
...
@@ -782,7 +782,7 @@ SIPVoIPLink::SIPStartCall(SIPCall *call)
if
(
pjsip_inv_invite
(
call
->
inv
,
&
tdata
)
!=
PJ_SUCCESS
)
if
(
pjsip_inv_invite
(
call
->
inv
,
&
tdata
)
!=
PJ_SUCCESS
)
return
false
;
return
false
;
pjsip_tpselector
*
tp
=
initTransportSelector
(
account
->
transport
,
call
->
inv
->
pool
);
pjsip_tpselector
*
tp
=
initTransportSelector
(
account
->
transport
_
,
call
->
inv
->
pool
);
if
(
pjsip_dlg_set_transport
(
dialog
,
tp
)
!=
PJ_SUCCESS
)
if
(
pjsip_dlg_set_transport
(
dialog
,
tp
)
!=
PJ_SUCCESS
)