Commit b1fb764c authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #9871: SipTransport: hide more implementation

parent 82c93b1a
......@@ -43,22 +43,17 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <stdexcept>
#include "logger.h"
#include "siptransport.h"
#include "manager.h"
#include "sip/sdp.h"
#include "sipcall.h"
#include "sipaccount.h"
#include "eventthread.h"
#include "sdes_negotiator.h"
#include "dbus/dbusmanager.h"
#include "dbus/callmanager.h"
#include "dbus/configurationmanager.h"
static const char * const DEFAULT_INTERFACE = "default";
......@@ -366,16 +361,14 @@ void SipTransport::createSipTransport(SIPAccount &account)
void SipTransport::createDefaultSipUdpTransport()
{
pj_uint16_t port = 0;
int counter = 0;
DEBUG("SipTransport: Create default sip udp transport");
SIPAccount *account = Manager::instance().getIP2IPAccount();
pjsip_transport *transport = NULL;
pj_uint16_t port = 0;
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
// with 2 step size increment (i.e. 5062, 5064, ...)
port = account->getLocalPort() + (counter * 2);
......
......@@ -92,14 +92,6 @@ class SipTransport {
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);
/**
......@@ -111,13 +103,6 @@ class SipTransport {
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
* @param transport A transport associated with an account
......@@ -165,6 +150,21 @@ class SipTransport {
pjsip_tpfactory *
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
* several accounts would share the same port number.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment