Skip to content
Snippets Groups Projects
Commit b1fb764c authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #9871: SipTransport: hide more implementation

parent 82c93b1a
Branches
Tags
No related merge requests found
...@@ -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);
......
...@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment