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
b1fb764c
Commit
b1fb764c
authored
13 years ago
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
* #9871: SipTransport: hide more implementation
parent
82c93b1a
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
daemon/src/sip/siptransport.cpp
+3
-10
3 additions, 10 deletions
daemon/src/sip/siptransport.cpp
daemon/src/sip/siptransport.h
+15
-15
15 additions, 15 deletions
daemon/src/sip/siptransport.h
with
18 additions
and
25 deletions
daemon/src/sip/siptransport.cpp
+
3
−
10
View file @
b1fb764c
...
@@ -43,22 +43,17 @@
...
@@ -43,22 +43,17 @@
#include
<sys/types.h>
#include
<sys/types.h>
#include
<sys/socket.h>
#include
<sys/socket.h>
#include
<sys/ioctl.h>
#include
<sys/ioctl.h>
#include
<unistd.h>
#include
<arpa/inet.h>
#include
<arpa/inet.h>
#include
<net/if.h>
#include
<net/if.h>
#include
<stdexcept>
#include
"logger.h"
#include
"logger.h"
#include
"siptransport.h"
#include
"siptransport.h"
#include
"manager.h"
#include
"manager.h"
#include
"sip/sdp.h"
#include
"sipcall.h"
#include
"sipaccount.h"
#include
"sipaccount.h"
#include
"eventthread.h"
#include
"sdes_negotiator.h"
#include
"dbus/dbusmanager.h"
#include
"dbus/dbusmanager.h"
#include
"dbus/callmanager.h"
#include
"dbus/configurationmanager.h"
#include
"dbus/configurationmanager.h"
static
const
char
*
const
DEFAULT_INTERFACE
=
"default"
;
static
const
char
*
const
DEFAULT_INTERFACE
=
"default"
;
...
@@ -366,16 +361,14 @@ void SipTransport::createSipTransport(SIPAccount &account)
...
@@ -366,16 +361,14 @@ void SipTransport::createSipTransport(SIPAccount &account)
void
SipTransport
::
createDefaultSipUdpTransport
()
void
SipTransport
::
createDefaultSipUdpTransport
()
{
{
pj_uint16_t
port
=
0
;
int
counter
=
0
;
DEBUG
(
"SipTransport: Create default sip udp transport"
);
DEBUG
(
"SipTransport: Create default sip udp transport"
);
SIPAccount
*
account
=
Manager
::
instance
().
getIP2IPAccount
();
SIPAccount
*
account
=
Manager
::
instance
().
getIP2IPAccount
();
pjsip_transport
*
transport
=
NULL
;
pjsip_transport
*
transport
=
NULL
;
pj_uint16_t
port
=
0
;
static
const
int
DEFAULT_TRANSPORT_ATTEMPTS
=
5
;
static
const
int
DEFAULT_TRANSPORT_ATTEMPTS
=
5
;
for
(;
transport
==
NULL
and
counter
<
DEFAULT_TRANSPORT_ATTEMPTS
;
++
counter
)
{
for
(
int
counter
=
0
;
transport
==
NULL
and
counter
<
DEFAULT_TRANSPORT_ATTEMPTS
;
++
counter
)
{
// if default udp transport fails to init on 5060, try other ports
// if default udp transport fails to init on 5060, try other ports
// with 2 step size increment (i.e. 5062, 5064, ...)
// with 2 step size increment (i.e. 5062, 5064, ...)
port
=
account
->
getLocalPort
()
+
(
counter
*
2
);
port
=
account
->
getLocalPort
()
+
(
counter
*
2
);
...
...
This diff is collapsed.
Click to expand it.
daemon/src/sip/siptransport.h
+
15
−
15
View file @
b1fb764c
...
@@ -92,14 +92,6 @@ class SipTransport {
...
@@ -92,14 +92,6 @@ class SipTransport {
pool_
=
pool
;
pool_
=
pool
;
}
}
/**
* Create a new stun resolver. Store it inside the array. Resolve public address for this
* server name.
* @param serverName The name of the stun server
* @param port number
*/
pj_status_t
createStunResolver
(
pj_str_t
serverName
,
pj_uint16_t
port
);
pj_status_t
destroyStunResolver
(
const
std
::
string
&
serverName
);
pj_status_t
destroyStunResolver
(
const
std
::
string
&
serverName
);
/**
/**
...
@@ -111,13 +103,6 @@ class SipTransport {
...
@@ -111,13 +103,6 @@ class SipTransport {
void
createDefaultSipUdpTransport
();
void
createDefaultSipUdpTransport
();
/**
* Create SIP UDP transport from account's setting
* @param account The account for which a transport must be created.
*/
pjsip_transport
*
createUdpTransport
(
const
std
::
string
&
interface
,
unsigned
int
port
);
/**
/**
* Initialize the transport selector
* Initialize the transport selector
* @param transport A transport associated with an account
* @param transport A transport associated with an account
...
@@ -165,6 +150,21 @@ class SipTransport {
...
@@ -165,6 +150,21 @@ class SipTransport {
pjsip_tpfactory
*
pjsip_tpfactory
*
createTlsListener
(
SIPAccount
&
account
);
createTlsListener
(
SIPAccount
&
account
);
/**
* Create a new stun resolver. Store it inside the array. Resolve public address for this
* server name.
* @param serverName The name of the stun server
* @param port number
*/
pj_status_t
createStunResolver
(
pj_str_t
serverName
,
pj_uint16_t
port
);
/**
* Create SIP UDP transport from account's setting
* @param account The account for which a transport must be created.
*/
pjsip_transport
*
createUdpTransport
(
const
std
::
string
&
interface
,
unsigned
int
port
);
/**
/**
* UDP Transports are stored in this map in order to retreive them in case
* UDP Transports are stored in this map in order to retreive them in case
* several accounts would share the same port number.
* several accounts would share the same port number.
...
...
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