* UserAgent/Server header

* Max-Forwards header (bugfix)
* documentation for Signature, listen_ip, sip_port
* small fix in auth (algorithm not quoted)



git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@178 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 20 years ago
parent 68466deda1
commit dbbdd8c616

@ -53,6 +53,7 @@ int AmConfig::RtpHighPort = RTP_HIGHPORT;
int AmConfig::MediaProcessorThreads = NUM_MEDIA_PROCESSORS;
int AmConfig::LocalSIPPort = 5060;
string AmConfig::LocalSIPIP = "";
string AmConfig::Signature = "";
AmSessionTimerConfig AmConfig::defaultSessionTimerConfig;
@ -175,6 +176,12 @@ int AmConfig::readConfiguration()
// plugin_path
PlugInPath = cfg.getParameter("plugin_path");
// user_agent
if (cfg.getParameter("use_default_signature")=="yes")
Signature = DEFAULT_SIGNATURE;
else
Signature = cfg.getParameter("signature");
// log_level
if(cfg.hasParameter("loglevel")){
if(!setLoglevel(cfg.getParameter("loglevel"))){

@ -81,6 +81,8 @@ struct AmConfig
static string LocalSIPIP;
/** the port SIP requests are sent from - optional (default 5060) */
static int LocalSIPPort;
/** Server/User-Agent header (optional) */
static string Signature;
/** Init function. Resolves SMTP server address. */
static int init();

@ -97,9 +97,8 @@ int AmRtpAudio::receive(unsigned int audio_buffer_ts)
}
else
{
if (!last_ts_i) {
last_ts_i = true;
}
last_ts_i = true;
size = decode(size);
if (size <= 0) {

@ -3,6 +3,7 @@
#include "AmSession.h"
#include "AmUtils.h"
#include "AmServer.h"
#include "sems.h"
AmSipDialog::~AmSipDialog()
{
@ -273,6 +274,8 @@ int AmSipDialog::reply(const AmSipRequest& req,
if(!body.empty())
msg += "Content-Type: " + content_type + "\n";
if (AmConfig::Signature.length())
msg += "Server: " + AmConfig::Signature + "\n";
msg += ".\n";
@ -303,6 +306,9 @@ int AmSipDialog::reply_error(const AmSipRequest& req, unsigned int code,
if(!hdrs.empty())
msg += hdrs;
if (AmConfig::Signature.length())
msg += "Server: " + AmConfig::Signature + "\n";
msg += ".\n.\n\n";
return AmServer::send_msg(msg,reply_sock, 500);
@ -494,6 +500,11 @@ int AmSipDialog::sendRequest(const string& method,
if(!body.empty())
msg += "Content-Type: " + content_type + "\n";
msg += "Max-Forwards: " MAX_FORWARDS "\n";
if (AmConfig::Signature.length())
msg += "User-Agent: " + AmConfig::Signature + "\n";
msg += ".\n" // EoH
+ body + ".\n\n";

@ -1,14 +1,42 @@
#version number
VERSION = 0
PATCHLEVEL = 10
SUBLEVEL = 0
EXTRAVERSION = -rc2
RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
LD_FLAGS = -lm
OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
ifeq ($(OS),solaris)
GETARCH=uname -p
else
GETARCH=uname -m
endif
ARCH := $(shell $(GETARCH) |sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
-e s/armv4l/arm/ -e "s/Power Macintosh/ppc/" \
-e "s/cobalt/mips2/" \
-e s/amd64/x86_64/ )
# fix sparc -> sparc64
ifeq ($(ARCH),sparc)
ifeq ($(shell uname -m),sun4u)
ARCH := sparc64
endif
endif
CPP_FLAGS = -Wall -Wno-reorder -fPIC -g \
-O2 \
-D_DEBUG \
-D_THREAD_SAFE -D_REENTRANT \
-DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"'\
-DOS='"$(OS)"' \
# -DSUPPORT_IPV6
LD_FLAGS = -lm
OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
TARGET =
ifeq ($(OS), linux)
LD_FLAGS += -ldl -rdynamic -lpthread
else

@ -294,7 +294,7 @@ bool UACAuth::do_auth(const unsigned int code, const string& auth_hdr,
if (challenge.opaque.length())
result+="opaque=\""+challenge.opaque+"\", ";
result+="response=\""+string((char*)response)+"\", algorithm=\"MD5\"\n";
result+="response=\""+string((char*)response)+"\", algorithm=MD5\n";
DBG("Auth req hdr: '%s'\n", result.c_str());

@ -54,7 +54,7 @@ plugin_path=/usr/local/lib/sems/plug-in
# optional parameter: smtp_server=<hostname>
#
# - sets address of smtp server
smtp_server=safekeeper
smtp_server=mail
# optional parameter: smtp_port=<port>
#
@ -79,3 +79,50 @@ rtp_high_port=60000
# value
media_processor_threads=1
# optional parameter: listen=<ip_address>
#
# - this informs SEMS about the interface where its SER is
# bound to. SEMS needs this information to correctly set
# the contact header in outgoing calls and registrations.
# Should be set to equal the 'listen' configuration option
# in ser_sems.cfg.
# This does not need to be set if outgoing calls and
# registrations from SEMS are not used.
# If not set, this defaults to the interface SEMS binds to.
#
# listen=10.0.0.34
# optional parameter: sip_port=<port_number>
#
# - this informs SEMS about the port where its SER is
# bound to. SEMS needs this information to correctly set
# the contact header in outgoing calls and registrations.
# Should be set to equal the 'port' configuration option
# in ser_sems.cfg.
# This does not need to be set if outgoing calls and
# registrations from SEMS are not used.
#
# default: 5060
#
#sip_port=5060
# optional parameter: use_default_signature={yes|no}
#
# - use a Server/User-Agent header with the SEMS server
# signature and version.
# Set server_signature=0 in ser_sems.cfg if you use it.
#
# default=no
#
# use_default_signature=no
# optional parameter: signature=<signature string>
#
# - use a Server/User-Agent header with a custom user agent
# signature.
# Overridden by default signature if
# use_default_signature is set.
# Set server_signature=0 in ser_sems.cfg if you use it.
#
#
# signature="SEMS media server 1.0"

@ -44,10 +44,15 @@
#define PREFIX_SEPARATOR ""
#define RTP_LOWPORT 1024
#define RTP_HIGHPORT 0xffff
#define MAX_FORWARDS "70"
/* Session Timer: -ssa */
#define DEFAULT_SIGNATURE "Sip Express Media Server " \
"(" VERSION " (" ARCH "/" OS"))"
/* Session Timer defaul configuration: */
#define DEFAULT_ENABLE_SESSION_TIMER 1
#define SESSION_EXPIRES 10 // seconds
#define SESSION_EXPIRES 60 // seconds
#define MINIMUM_TIMER 5 //seconds
#define NUM_MEDIA_PROCESSORS 1

Loading…
Cancel
Save