Made the default of some settings depend on running in client or server mode.

git-svn-id: http://voip.null.ro/svn/yate@1242 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2007-04-02 12:51:23 +00:00
parent 61c6f65137
commit 63cc9ea312
6 changed files with 29 additions and 12 deletions

View File

@ -11,6 +11,15 @@
; numeric TOS value or: lowdelay, throughput, reliability, mincost
;tos=0
; read_threads: int: Number of threads that read packets from socket
;read_threads=1 in client mode, 3 in server mode
; event_threads: int: Number of threads that process events
;event_threads=1 in client mode, 3 in server mode
; trunk_threads: int: Number of threads that service trunked voice packets
;trunk_threads=1
[formats]
; This section allows to individually enable or disable the codecs

View File

@ -15,16 +15,16 @@
;buffer=240
; autoaddr: bool: Auto change outgoing RTP address:port to match incoming
;autoaddr=enabled
;autoaddr=enable
; anyssrc: bool: Accept any incoming SSRC, even if it changes frequently
;anyssrc=disabled
;anyssrc=disable
; rtcp: bool: Allocate socket for the RTCP protocol by default
;rtcp=enabled
; drillhole: bool: Attempt to drill a hole through a firewall or NAT
;drillhole=disabled
;drillhole=disable in server mode, enable in client mode
; defsleep: int: Default in-loop sleep time for new RTP sessions in milliseconds
;defsleep=5

View File

@ -14,10 +14,10 @@
;realm=Yate
; transfer: bool: Allow handling the REFER message to perform transfers
;transfer=enable
;transfer=enable in server mode, disable in client mode
; registrar: bool: Allow the SIP module to receive registration requests
;registrar=enable
;registrar=enable in server mode, disable in client mode
; options: bool: Build and send a default 200 answer to OPTIONS requests
;options=enable

View File

@ -1154,9 +1154,15 @@ void YIAXDriver::initialize()
Debug(this,DebugWarn,"Could not set IP TOS to 0x%02x",tos);
}
}
int readThreadCount = 3;
int eventThreadCount = 3;
int trunkingThreadCount = 1;
int readThreadCount = s_cfg.getIntValue("general","read_threads",Engine::clientMode() ? 1 : 3);
if (readThreadCount < 1)
readThreadCount = 1;
int eventThreadCount = s_cfg.getIntValue("general","event_threads",Engine::clientMode() ? 1 : 3);
if (eventThreadCount < 1)
eventThreadCount = 1;
int trunkingThreadCount = s_cfg.getIntValue("general","trunk_threads",1);
if (trunkingThreadCount < 1)
trunkingThreadCount = 1;
m_iaxEngine->start(readThreadCount,eventThreadCount,trunkingThreadCount);
}

View File

@ -845,7 +845,7 @@ void YRTPPlugin::initialize()
s_autoaddr = cfg.getBoolValue("general","autoaddr",true);
s_anyssrc = cfg.getBoolValue("general","anyssrc",false);
s_rtcp = cfg.getBoolValue("general","rtcp",true);
s_drill = cfg.getBoolValue("general","drillhole",false);
s_drill = cfg.getBoolValue("general","drillhole",Engine::clientMode());
s_sleep = cfg.getIntValue("general","defsleep",5);
RTPGroup::setMinSleep(cfg.getIntValue("general","minsleep"));
setup();

View File

@ -492,6 +492,7 @@ static int s_maxForwards = 20;
static int s_nat_refresh = 25;
static bool s_privacy = false;
static bool s_auto_nat = true;
static bool s_progress = false;
static bool s_inband = false;
static bool s_info = false;
static bool s_forward_sdp = false;
@ -959,9 +960,9 @@ YateSIPEngine::YateSIPEngine(YateSIPEndPoint* ep)
addAllowed("INVITE");
addAllowed("BYE");
addAllowed("CANCEL");
if (s_cfg.getBoolValue("general","registrar",true))
if (s_cfg.getBoolValue("general","registrar",!Engine::clientMode()))
addAllowed("REGISTER");
if (s_cfg.getBoolValue("general","transfer",true))
if (s_cfg.getBoolValue("general","transfer",!Engine::clientMode()))
addAllowed("REFER");
if (s_cfg.getBoolValue("general","options",true))
addAllowed("OPTIONS");
@ -3157,7 +3158,7 @@ bool YateSIPConnection::callRouted(Message& msg)
}
}
if (msg.getBoolValue("progress",s_cfg.getBoolValue("general","progress",false)))
if (msg.getBoolValue("progress",s_progress))
m_tr->setResponse(183);
}
return true;
@ -3887,6 +3888,7 @@ void SIPDriver::initialize()
s_maxForwards = s_cfg.getIntValue("general","maxforwards",20);
s_privacy = s_cfg.getBoolValue("general","privacy");
s_auto_nat = s_cfg.getBoolValue("general","nat",true);
s_progress = s_cfg.getBoolValue("general","progress",false);
s_inband = s_cfg.getBoolValue("general","dtmfinband",false);
s_info = s_cfg.getBoolValue("general","dtmfinfo",false);
s_forward_sdp = s_cfg.getBoolValue("general","forward_sdp",false);