Compare commits

...

No commits in common. "master" and "old-master-svn" have entirely different histories.

349 changed files with 2356 additions and 13013 deletions

29
.gitignore vendored
View File

@ -1,29 +0,0 @@
*.cache
Makefile
YateLocal*
configure
config.*
*-stamp
yatepaths.h
yateversn.h
yateiss.inc
run
yate.spec
yate
yate-config
yate-config.in
yate.pc
core*
yate.core*
*.o
*.a
*.so
*.so.*
*.yate
*.orig
*~
.*.swp
*.log
*.out
*.csv
*.tsv

View File

@ -81,10 +81,6 @@ DOCGEN := $(DOCGEN_D)
APIDOCS := apidocs
endif
GIT_TAG := $(shell LANG=C LC_MESSAGES=C git tag 2>/dev/null | tail -1)
GIT_HASH := $(shell LANG=C LC_MESSAGES=C git rev-list -n1 HEAD 2>/dev/null)
.PHONY: all everything debug ddebug xdebug ndebug
all: engine modules clients ilibs
@ -295,9 +291,9 @@ uninstall uninstall-root:
install-root uninstall-root: LDCONFIG:=ldconfig
.PHONY: snapshot tarball rpm srpm rpm-tag srpm-tag rpm-head srpm-head revision check-gittag
.PHONY: snapshot tarball rpm srpm revision
snapshot tarball: check-topdir revision clean windows apidocs
@if [ $@ = snapshot ]; then ver="`date '+GIT-%Y%m%d'`"; else ver="@PACKAGE_VERSION@-@PACKAGE_STATUS@@PACKAGE_RELEASE@"; fi ; \
@if [ $@ = snapshot ]; then ver="`date '+SVN-%Y%m%d'`"; else ver="@PACKAGE_VERSION@-@PACKAGE_STATUS@@PACKAGE_RELEASE@"; fi ; \
wd=`pwd|sed 's,^.*/,,'`; \
mkdir -p packing/tarballs; cd ..; \
echo $$wd/tar-exclude >$$wd/tar-exclude; \
@ -311,8 +307,6 @@ snapshot tarball: check-topdir revision clean windows apidocs
find $$wd -name .svn >>$$wd/tar-exclude; \
find $$wd -name CVS >>$$wd/tar-exclude; \
find $$wd -name .cvsignore >>$$wd/tar-exclude; \
find $$wd -name .gitignore >>$$wd/tar-exclude; \
find $$wd -name .git >>$$wd/tar-exclude; \
else \
echo "$$wd/packing/rpm/yate.spec" >>$$wd/tar-exclude; \
fi ; \
@ -329,47 +323,15 @@ snapshot tarball: check-topdir revision clean windows apidocs
$$wd; \
rm $$wd/tar-exclude
# rpm and sprm will check that head is at the last tag
rpm: check-gittag tarball
rpm: tarball
rpmbuild -tb $(RPMOPT) packing/tarballs/@PACKAGE_TARNAME@-@PACKAGE_VERSION@-@PACKAGE_STATUS@@PACKAGE_RELEASE@.tar.gz
srpm: check-gittag tarball
srpm: tarball
rpmbuild -ta $(RPMOPT) packing/tarballs/@PACKAGE_TARNAME@-@PACKAGE_VERSION@-@PACKAGE_STATUS@@PACKAGE_RELEASE@.tar.gz
#build rpm/srpm with tag in revision number
rpm-tag: check-gittag tarball
rpmbuild -tb --define 'revision $(GIT_TAG)git' $(RPMOPT) packing/tarballs/@PACKAGE_TARNAME@-@PACKAGE_VERSION@-@PACKAGE_STATUS@@PACKAGE_RELEASE@.tar.gz
srpm-tag: check-gittag tarball
rpmbuild -ta --define 'revision $(GIT_TAG)git' $(RPMOPT) packing/tarballs/@PACKAGE_TARNAME@-@PACKAGE_VERSION@-@PACKAGE_STATUS@@PACKAGE_RELEASE@.tar.gz
# build packages from GIT HEAD
rpm-head: tarball
rpmbuild -tb --define 'revision $(GIT_HASH)git' $(RPMOPT) packing/tarballs/@PACKAGE_TARNAME@-@PACKAGE_VERSION@-@PACKAGE_STATUS@@PACKAGE_RELEASE@.tar.gz
srpm-head: tarball
rpmbuild -ta --define 'revision $(GIT_HASH)git' $(RPMOPT) packing/tarballs/@PACKAGE_TARNAME@-@PACKAGE_VERSION@-@PACKAGE_STATUS@@PACKAGE_RELEASE@.tar.gz
check-gittag revision: check-topdir
@tag_hash=""; \
if [ "" != "$(GIT_TAG)" ]; then \
tag_hash=`LANG=C LC_MESSAGES=C git rev-list -n1 $(GIT_TAG) 2>/dev/null`; \
elif [ $@ = check-gittag ]; then \
echo "No available GIT tag"; \
exit 1; \
fi; \
if [ "x$(GIT_HASH)" != "x$$tag_hash" ]; then \
if [ $@ = check-gittag ]; then \
echo "Current commit hash $(GIT_HASH) different from expected hash for tag $(GIT_TAG) ($$tag_hash)"; \
exit 1; \
fi; \
tag=""; \
fi; \
test -z "$(GIT_TAG)" || echo "$(GIT_TAG)" > packing/revision.txt ; \
test -z "$(GIT_HASH)" || echo "$(GIT_HASH)" > packing/git_commit.txt
revision: check-topdir
@-rev=`LANG=C LC_MESSAGES=C svn info 2>/dev/null | sed -n 's,^Last Changed Rev: *,,p'`; \
test -z "$$rev" || echo "$$rev" > packing/revision.txt
%.o: @srcdir@/%.cpp $(MKDEPS) @srcdir@/yatengine.h
$(COMPILE) -c $<

11
clients/.gitignore vendored
View File

@ -1,11 +0,0 @@
Makefile
YateLocal*
.xvpics
core*
yate-*
*.o
*.a
*.so
*.orig
*~
.*.swp

View File

@ -5,7 +5,7 @@
* A Qt-4 based universal telephony client
*
* Yet Another Telephony Engine - a fully featured software PBX and IVR
* Copyright (C) 2004-2023 Null Team
* Copyright (C) 2004-2014 Null Team
*
* This software is distributed under multiple licenses;
* see the COPYING file in the main directory for licensing

View File

@ -1,9 +0,0 @@
Makefile
YateLocal.mak
core*
*.moc
*.o
*.a
*.orig
*~
.*.swp

View File

@ -5,7 +5,7 @@
* A Qt-4 based universal telephony client
*
* Yet Another Telephony Engine - a fully featured software PBX and IVR
* Copyright (C) 2004-2023 Null Team
* Copyright (C) 2004-2014 Null Team
*
* This software is distributed under multiple licenses;
* see the COPYING file in the main directory for licensing

View File

@ -5,7 +5,7 @@
* A Qt-4 based universal telephony client
*
* Yet Another Telephony Engine - a fully featured software PBX and IVR
* Copyright (C) 2004-2023 Null Team
* Copyright (C) 2004-2014 Null Team
*
* This software is distributed under multiple licenses;
* see the COPYING file in the main directory for licensing

8
conf.d/.gitignore vendored
View File

@ -1,8 +0,0 @@
*.bind
Makefile
YateLocal.mak
core*
*.conf
*.orig
*~
.*.swp

View File

@ -39,13 +39,6 @@
; Default true
; sips: Boolean. Use SIPS URI for register/contact. Transport defaults to TLS if enabled
;
; For TCP SIP HEP3 capturing, setup the following parameters:
; capture_filter: Boolean, default false. Enable it if you want HEP3 capture of packets
; capture_agent: String, mandatory if capture_filter is set to true. Name of capture
; capture_server: String, mandatory if capture_filter is set to true. Name of HEP3 server where to send packets
; capture_compress: Boolean, default false. Set to true to compress captured packets
; If not set, capture settings will default to SIP global capture settings.
;
; NOTE: Default port is 5060 for udp/tcp and 5061 for tls
;
; Jabber:

View File

@ -1,52 +0,0 @@
; each section starting with 'server' configures a connection
; to a HEP3 server
; The string after 'server' is the server name
[server hep_server]
; enable: boolean: True to enable this connection. False to disable it
; This setting is applicable on reload.
;enable=yes
; auth_key: string: Authentication key string. If not set, it will look at
; value of auth_key_hex.
; This setting is applicable on reload.
;auth_key=
; auth_key_hex: Hexified string: Authentication key in hexadecimal octet string.
; If auth_key is not set and neither is this, authentication key will not be set
; in HEP3 packets.
; This setting is applicable on reload.
;auth_key_hex=
; capture_id: unsigned 4 byte integer: HEP3 Capture agent ID for this connection
; This setting is applicable on reload.
;capture_id=0
; compress: boolean: Compress HEP3 packet payload
; This setting can be overridden by entities that request a HEP3 capture
; for its own instance.
;compress=false
; socket_type: keyword (udp, tcp). Type of socket to create for communication
; with this server.
; Not applicable on reload.
;socket_type=udp
; remote_host: destination IPv4 address, mandatory to set. IPv4 address of the
; server where to send HEP3 packets
; Not applicable on reload.
;remote_host=
; remote_port: destination port, mandatory to set. Port where to send HEP3 packets
; Not applicable on reload.
;remote_port=
; local_host: local IPv4 address, mandatory to set. IPv4 address to use for
; sending HEP3 packets
; Not applicable on reload.
;local_host=
; remote_port: source port, mandatory to set. Port to use for sending HEP3 packets
; Not applicable on reload.
;local_port=

View File

@ -74,46 +74,3 @@ eliza=eliza.js
; These scripts are loaded only after the engine and modules have initialized, immediately
; after the dispatching of the "engine.start" message.
; The names must be unique and different from any in the [scripts] section.
[handlers]
; Install singleton message handlers
; These handlers are running using a separate context for each handled message
;
; Description:
; name=filename,callback,priority,trackname,parameters_prefix,filter,context,script_name
;
; Parameters (optional, unless otherwise specified):
; name: Required. Name of the message to handle
; Names starting with 'handlerparam:' are ignored
; filename: Required. Script to load
; callback: Required. Callback function. Function is required to be present in script code
; priority: Handler priority. Default: 100
; trackname: Track name to be put in handled message 'handlers' parameter
; parameters_prefix: Prefix for handler parameters specified in separate section parameters
; filter: Message handler filter.
; Format: filter_param=filter_value. Ignored if 'filter_param' is empty.
; filter_value starting with '^' char is handled as regular expression
; context: String to be passed to callback function
; script_name: Name of the script. Used internally for debug purposes. Use 'script_file_name' if empty
;
; Notes:
; - The following parameters are used to identify a handler:
; name,filename,callback,priority,trackname,filter,context,script_name
; An existing handler whose identity changed (not found in config) is removed at reload
; - Multiple handlers for the same message may be installed
; handlerparam:<parameters_prefix>:<param_name>: string: Configure a parameters for a handler
; Some of these parameters may be set in message handler description also (ignored here if so)
; They may be configured here since they may contain ',' in their contents
; Parameters:
; debug: string: Script debug (e.g. 'level 10'). This parameter is applied on reload
; context: string: Context to be passed to callback function
; filter: string: Message handler filter. See handler description for format
; track_priority: boolean: Add priority to tracked name. Default: true
; load_extensions: boolean: Load extension in script context when a message is handled
; This parameter is applied on reload
; Default: [general] 'auto_extensions'
; keep_old_on_fail: boolean: Keep old code if failed to parse the new one
; This parameter is used when handler is re-loaded and script changed
; Default: [general] 'keep_old_on_fail'

View File

@ -53,9 +53,3 @@
; poolsize: int: Number of connections to establish for this account
; Minimum number of connections is 1
;poolsize=1
; warn_query_duration: integer: Warn if query duration (database query and result fetch)
; exceeds this value (in milliseconds)
; This parameter is applied on reload and can be overridden in query database message
; Minium allowed interval is 50
;warn_query_duration=0

View File

@ -148,14 +148,10 @@
[extra]
; This section allows installing handlers for any message name.
; Each line must be of the form:
; message.name=priority[,[paramname][,context][,filter_param][,filter_match]]]
; message.name=priority[,[paramname][,context]]
; For each handler create a corresponding [context] or [message.name] section
; in which implement handling for that specific message. If paramname is not
; set you will need to match parameters explicitely or set a new match string.
; For filters, filter_param is the name of the parameter you want to match.
; filter_match is the value that filter_param parameter has to match. It can be
; an exact value to match or a regular expression. For regular expressions,
; filter_match must start with the character '^'.
; Examples:
; engine.command=90
; call.execute=120,callto

View File

@ -21,13 +21,9 @@
; If empty it will match all messages
; Example for a filter matching all chan.Anything messages and engine.halt:
; filter=^\(chan\.\|engine\.halt$\)
;filter=
;filter
; timer: boolean: True to sniff engine.timer messages, false otherwise
;timer=false
; max_buf_size: integer: Maximum admitted length of an encoded message.
; If encoded message length exceeds this length, message will not be sniffed
; Acceptable range is 2048 .. 65507
;max_buf_size=2048

View File

@ -110,18 +110,16 @@
; filtersniff: regexp: Default filter to apply to message sniffer at initialization
; If empty it will match all messages except engine.timer which is never displayed
; Example for a filter matching all chan.Anything messages and engine.halt:
; filtersniff=^\(chan\.\|engine\.halt\)$
; filtersniff=^\(chan\.\|engine\.halt$\)
;filtersniff=
; agesniff: float: Display only messages whose age or delay is higher than this value
; This is a floating point number in seconds (1.5 means 1500msec)
;agesniff=0
; filtersniffparams: string: Default parameter(s) filter to apply to message sniffer at initialization
; If empty it will not attempt to match message parameters
; Format: [any] [negated] param1=value1 [param2=value2 ...]
; any: message matches if at least one configured parameter matches
; negated: message matches if list does not match
; Format: [any] param1=value1 [param2=value2 ...]
; 'any' indicates that message matches if at least one configured parameter matches
; Value to match is handled as regexp. It may end with '^' to revert match (i.e. matches if regexp don't match)
; Value may be empty. In this case the parameter matches if missing in message or present with empty value
; Example for a filter matching messages with empty route_type or route_type=call
@ -130,16 +128,6 @@
; filtersniffparams=any caller=^123$ called=^123$
;filtersniffparams=
; msgsniff:<NAME>: string: Add a message sniffer rule
; <NAME> is optional. If missing the rule is handled as the one set using filtersniff/agesniff/filtersniffparams
; This parameter may be repeated with different <NAME> value to add multiple rules
; A rule will replace a previously defined rule with the same name
; Format: [filter=[value]] [age=[value]] [params [any negated] [name=value]]
; Examples:
; msgsniff:=filter=^\(chan\.\) age=0.5 params id=^sip/
; msgsniff:extra=filter=^\(call\.cdr\)$ params any caller=123 called=^2
;msgsniff:<NAME>=
; trace_msg_time: boolean: Instruct message dispatcher to set message event(s) time (enqueue / dispatch)
;trace_msg_time=no
@ -241,19 +229,3 @@ h323chan.yate=yes
; dtmfdups: bool: Allow duplicate DTMFs (detected with different methods)
;dtmfdups=disable
[configuration]
; Options for Configuration files
; These parameters are handled on first load only (repeated parameters are ignored)
; This section should be the first handled section if you need to apply parameters on this file also
; max_depth: integer: Maximum file include depth
; Allowed interval: 3..10
;max_depth=3
; disable_include_silent: boolean: Disable silent include in Configuration files
; The '$includesilent' directives of configuration file will be handled as '$include' if this
; parameter is set to boolean true
; Same applies for '$includesectionsilent': handled as '$includesection'
;disable_include_silent=no

View File

@ -155,9 +155,6 @@
; OBSOLETE - please use "enable" in section [options]
;options=enable
; update: bool: Enable receiving UPDATE transactions (RFC 3311)
;update=disable
; prack: bool: Enable acknowledging provisional 1xx answers (RFC 3262)
;prack=disable
@ -250,15 +247,10 @@
; Defaults to enable
;honor_dtmf_detect=enable
; rfc2833: bool: Offer RFC2833 telephone-event 8KHz by default
; rfc2833: bool: Offer RFC2833 telephone-event by default
; A numeric payload >= 96 can be provided
;rfc2833=yes
; rfc2833_RATE: bool: Offer RFC2833 telephone-event for specific rate (non 8KHz) by default
; A numeric payload >= 96 can be provided
; Supported rates (parameters): rfc2833_16000, rfc2833_32000
;rfc2833_RATE=yes
; privacy: bool: Process and generate privacy related SIP headers
;privacy=disable
@ -268,9 +260,6 @@
; forward_sdp: bool: Include the raw SDP body to be used as-is for forwarding RTP
;forward_sdp=disable
; forward_gpmd: bool: Propagate GPMD even when not forwarding RTP
;forward_gpmd=disable
; rtp_start: bool: Start RTP when sending 200 on incoming instead of receiving ACK
;rtp_start=disable
@ -381,73 +370,12 @@
; If set this parameter must be less than 'tcp_keepalive'
;tcp_keepalive_first=0
; ssdp_prefix: string: Prefix to use when handling SDP session level parameters
; This parameter is used when setting them in yate messages or handling them from there
; This parameter is applied on reload
; Prefix used to set parsed SDP: <ssdp_prefix>_ (default: ssdp_)
; Prefix used to update from yate messages: o<ssdp_prefix>_ (default: ossdp_)
; When updated from yate messages the prefix must be set in 'ossdp-prefix' message parameter
;ssdp_prefix=ssdp
; initial_headers: boolean: Put all headers from initial requests in yate message
; Handled for incoming channel preroute, user (un)register and messages sent on SIP
; requests received outside a dialog
; This parameter is applied on reload
;initial_headers=no
; reinvite_wait_initial: boolean: Wait for answered initial transaction termination when need to send
; a re-INVITE and initial transaction was not terminated
; Applicable for the inbound call leg
; This parameter is handled when answer (200 OK) was sent to initial transaction
; If enabled the module will not send an UPDATE even if supported by remote
; This parameter can be overridden from routing
; This parameter is applied on reload
;reinvite_wait_initial=no
; mixed_provisional: boolean: Accept mixed (non)reliable provisional responses to initial transaction
; When enabled (default) the dialog will accept non reliable provisional messages
; after receiving a reliable one
; This parameter can be overridden from routing
; This parameter is applied on reload
;mixed_provisional=yes
; warn_bind_fail_delay: integer/string: Delay failed to bind debug message
; This parameter may be used when listener is going to bind on an IP which may become
; available later
; Values:
; integer: Delay in milliseconds. Interval: 500..60000
; 'start': Delay until engine starts (engine.start message is handled by module)
;warn_bind_fail_delay=0
; warn_no_default_udp_transport: boolean: Warn if there is not default UDP transport
; This parameter is applied on reload
;warn_no_default_udp_transport=yes
; capture_filter: boolean. Enable global HEP3 capture of SIP packets
; NOTE: This setting can be overridden by listener settings or by account settings
; in case of outgoing TCP connections.
; This setting applies on reload.
;capture_filter=false
; capture_agent: string, mandatory if capture_filter is set to true. Name of capture agent.
; NOTE: This setting can be overridden by listener settings or by account settings
; in case of outgoing TCP connections.
; This is for internal tracking.
;capture_agent=
; capture_server: string, mandatory if capture_filter is set to true.
; Name of HEP3 server where to send packets. The server with this name must be configured
; in HEP3 module configuration.
; NOTE: This setting can be overridden by listener settings or by account settings
; in case of outgoing TCP connections.
;capture_server=
; capture_compress: boolean. Set to true to compress captured packets.
; If not set, it will use the HEP server configuration 'compress' configured value.
; NOTE: This setting can be overridden by listener settings or by account settings
; in case of outgoing TCP connections.
;capture_compress=false
[options]
; Controls the behaviour for SIP options retrieval
@ -623,7 +551,6 @@
; The following parameters can be overridden from 'general' section:
; UDP: maxpkt, buffer
; TCP/TLS: tcp_maxpkt
; All: warn_bind_fail_delay
; type: keyword: Listener type
; Allowed values:
@ -688,21 +615,3 @@
; role: string: Role to be set in messages sent by connections using this listener
; This parameter is applied on reload
;role=
; capture_filter: boolean. Enable HEP3 capture of packets on this listener.
; NOTE: for outgoing TCP connections, these settings must be made in accfile.conf.
; This setting applies on reload.
;capture_filter=false
; capture_agent: string, mandatory if capture_filter is set to true. Name of capture agent
; This is for internal tracking.
;capture_agent=
; capture_server: string, mandatory if capture_filter is set to true.
; Name of HEP3 server where to send packets. The server with this name must be configured
; in HEP3 module configuration
;capture_server=
; capture_compress: boolean. Set to true to compress captured packets.
; If not set, it will use the HEP server configuration 'compress' configured value
;capture_compress=false

View File

@ -9,11 +9,8 @@ fi
PACKAGE_RELEASE="1"
PACKAGE_STATUS="devel"
PACKAGE_REVISION=`cd "$srcdir"; LANG=C LC_MESSAGES=C git rev-list -n 1 HEAD 2>/dev/null`
PACKAGE_REVISION=`cd "$srcdir"; LANG=C LC_MESSAGES=C svn info 2>/dev/null | sed -n 's,^Last Changed Rev: *,,p'`
test -z "$PACKAGE_REVISION" && PACKAGE_REVISION=`cat "$srcdir/packing/revision.txt" 2>/dev/null`
test -z "$PACKAGE_REVISION" && PACKAGE_REVISION=`cat "$srcdir/packing/git_commit.txt" 2>/dev/null`
PACKAGE_GIT_HASH=`cd "$srcdir"; LANG=C LC_MESSAGES=C git rev-list -n 1 HEAD 2>/dev/null`
test -z "$PACKAGE_REVISION" && PACKAGE_REVISION=`cat "$srcdir/packing/git_commit.txt" 2>/dev/null`
AC_ARG_WITH(status,AC_HELP_STRING([--with-status=NAME],[use NAME as package status]),[PACKAGE_STATUS=$withval])
PACKAGE_VERSION_MAJOR="${PACKAGE_VERSION%%.*}"
@ -28,7 +25,6 @@ AC_SUBST(PACKAGE_VERSION_RELEASE)
AC_SUBST(PACKAGE_RELEASE)
AC_SUBST(PACKAGE_STATUS)
AC_SUBST(PACKAGE_REVISION)
AC_SUBST(PACKAGE_GIT_HASH)
# We may need the host OS type but avoid the overhead of AC_CANONICAL_SYSTEM
AC_MSG_CHECKING([for local operating system type])
@ -313,25 +309,6 @@ MUTEX_HACK="$MUTEX_HACK -DHAVE_TIMEDWAIT"
fi
AC_MSG_RESULT([$have_sem_timedwait])
have_rd_timedlock=""
AC_CHECK_LIB([pthread], [pthread_rwlock_timedrdlock], [have_rd_timedlock="yes"])
if [[ "x$have_rd_timedlock" = "x" ]]; then
AC_CHECK_LIB([c], [pthread_rwlock_timedrdlock],[have_rd_timedlock="yes"])
fi
if [[ "x$have_rd_timedlock" = "xyes" ]]; then
MUTEX_HACK="$MUTEX_HACK -DHAVE_TIMEDRDLOCK"
fi
have_wr_timedlock=""
AC_CHECK_LIB([pthread], [pthread_rwlock_timedwrlock], [have_wr_timedlock="yes"])
if [[ "x$have_wr_timedlock" = "x" ]]; then
AC_CHECK_LIB([c], [pthread_rwlock_timedwrlock], [have_wr_timedlock="yes"])
fi
if [[ "x$have_rd_timedlock" = "xyes" ]]; then
MUTEX_HACK="$MUTEX_HACK -DHAVE_TIMEDWRLOCK"
fi
CFLAGS="$SAVE_CFLAGS"
LIBS="$SAVE_LIBS"
AC_LANG_RESTORE
@ -1204,7 +1181,7 @@ AC_SUBST(SPEEX_LIB)
HAVE_AMRNB=no
AMRNB_INC=""
AMRNB_LIB="-lopencore-amrnb"
AMRNB_LIB="-lamrnb"
AC_ARG_WITH(amrnb,AC_HELP_STRING([--with-amrnb=DIR],[use AMR-NB if available (default)]),[ac_cv_use_amrnb=$withval],[ac_cv_use_amrnb=/usr])
if [[ "x$ac_cv_use_amrnb" = "xstatic" ]]; then
ac_cv_use_amrnb=/usr
@ -1213,9 +1190,9 @@ fi
if [[ "x$ac_cv_use_amrnb" != "xno" ]]; then
AC_MSG_CHECKING([for AMR-NB in $ac_cv_use_amrnb])
local_lib="$ARCHLIB"
amrinc="$ac_cv_use_amrnb/include/opencore-amrnb"
test -f "$ac_cv_use_amrnb/$local_lib/libopencore-amrnb.so" || local_lib="lib"
if [[ -f "$ac_cv_use_amrnb/$local_lib/libopencore-amrnb.so" -a -f "$amrinc/interf_dec.h" ]]; then
amrinc="$ac_cv_use_amrnb/include/amrnb"
test -f "$ac_cv_use_amrnb/$local_lib/libamrnb.so" || local_lib="lib"
if [[ -f "$ac_cv_use_amrnb/$local_lib/libamrnb.so" -a -f "$amrinc/interf_rom.h" ]]; then
HAVE_AMRNB=yes
AMRNB_LIB="-L$ac_cv_use_amrnb/$local_lib $AMRNB_LIB"
AMRNB_INC="-I$amrinc"
@ -1824,7 +1801,7 @@ AC_SUBST(INSTALL_L)
INSTALL_D="install -D"
CFLAGS=`echo "$CFLAGS" | sed 's/\(^\| \+\)-g[[0-9]]*//' | sed 's/[[[:space:]]]\{2,\}/ /g'`
MODULE_CFLAGS="-fno-exceptions -fPIC $HAVE_GCC_FORMAT_CHECK $HAVE_BLOCK_RETURN $ATOMIC_OPS"
MODULE_CFLAGS="-fno-exceptions -fPIC $HAVE_GCC_FORMAT_CHECK $HAVE_BLOCK_RETURN"
MODULE_CPPFLAGS="$HAVE_NO_OVERLOAD_VIRT_WARN $RTTI_OPT $MODULE_CFLAGS"
MODULE_LDRELAX="-rdynamic -shared"
MODULE_SYMBOLS="-Wl,--retain-symbols-file,/dev/null"

4
docs/.gitignore vendored
View File

@ -1,4 +0,0 @@
core*
*.orig
*~
.*.swp

3
docs/api/.gitignore vendored
View File

@ -1,3 +0,0 @@
core*
*.*
*~

8
engine/.gitignore vendored
View File

@ -1,8 +0,0 @@
Makefile
YateLocal*
core*
*.o
*.a
*.orig
*~
.*.swp

View File

@ -3,7 +3,7 @@
* This file is part of the YATE Project http://YATE.null.ro
*
* Yet Another Telephony Engine - a fully featured software PBX and IVR
* Copyright (C) 2004-2023 Null Team
* Copyright (C) 2004-2014 Null Team
*
* This software is distributed under multiple licenses;
* see the COPYING file in the main directory for licensing

View File

@ -5,7 +5,7 @@
* Base64 data encoding and decoding
*
* Yet Another Telephony Engine - a fully featured software PBX and IVR
* Copyright (C) 2004-2023 Null Team
* Copyright (C) 2004-2014 Null Team
*
* This software is distributed under multiple licenses;
* see the COPYING file in the main directory for licensing

View File

@ -3,7 +3,7 @@
* This file is part of the YATE Project http://YATE.null.ro
*
* Yet Another Telephony Engine - a fully featured software PBX and IVR
* Copyright (C) 2004-2023 Null Team
* Copyright (C) 2004-2014 Null Team
*
* This software is distributed under multiple licenses;
* see the COPYING file in the main directory for licensing
@ -1333,17 +1333,28 @@ bool Module::setDebug(Message& msg, const String& target)
return false;
NamedCounter* counter = objectsCounter();
const String& line = msg[YSTRING("line")];
debugSet(line);
String str = line;
if (str.startSkip("level"))
;
else if (str == YSTRING("reset")) {
String str = msg.getValue("line");
if (str.startSkip("level")) {
int dbg = debugLevel();
str >> dbg;
if (str == "+") {
if (debugLevel() > dbg)
dbg = debugLevel();
}
else if (str == "-") {
if (debugLevel() < dbg)
dbg = debugLevel();
}
debugLevel(dbg);
}
else if (str == "reset") {
debugLevel(TelEngine::debugLevel());
debugEnabled(true);
if (counter)
counter->enable(getObjCounting());
}
else if (str.startSkip("objects")) {
bool dbg = (str == YSTRING("reset")) ? getObjCounting() : (counter && counter->enabled());
bool dbg = (str == "reset") ? getObjCounting() : (counter && counter->enabled());
str >> dbg;
if (counter)
counter->enable(dbg);

View File

@ -3,7 +3,7 @@
* This file is part of the YATE Project http://YATE.null.ro
*
* Yet Another Telephony Engine - a fully featured software PBX and IVR
* Copyright (C) 2004-2023 Null Team
* Copyright (C) 2004-2014 Null Team
*
* This software is distributed under multiple licenses;
* see the COPYING file in the main directory for licensing

View File

@ -3,7 +3,7 @@
* This file is part of the YATE Project http://YATE.null.ro
*
* Yet Another Telephony Engine - a fully featured software PBX and IVR
* Copyright (C) 2004-2023 Null Team
* Copyright (C) 2004-2014 Null Team
*
* This software is distributed under multiple licenses;
* see the COPYING file in the main directory for licensing

View File

@ -5,7 +5,7 @@
* Default client logic
*
* Yet Another Telephony Engine - a fully featured software PBX and IVR
* Copyright (C) 2004-2023 Null Team
* Copyright (C) 2004-2014 Null Team
*
* This software is distributed under multiple licenses;
* see the COPYING file in the main directory for licensing

View File

@ -3,7 +3,7 @@
* This file is part of the YATE Project http://YATE.null.ro
*
* Yet Another Telephony Engine - a fully featured software PBX and IVR
* Copyright (C) 2004-2023 Null Team
* Copyright (C) 2004-2014 Null Team
*
* This software is distributed under multiple licenses;
* see the COPYING file in the main directory for licensing

View File

@ -3,7 +3,7 @@
* This file is part of the YATE Project http://YATE.null.ro
*
* Yet Another Telephony Engine - a fully featured software PBX and IVR
* Copyright (C) 2004-2023 Null Team
* Copyright (C) 2004-2020 Null Team
*
* This software is distributed under multiple licenses;
* see the COPYING file in the main directory for licensing
@ -22,159 +22,10 @@
#include <stdio.h>
#include <string.h>
#define MAX_DEPTH 3
using namespace TelEngine;
static unsigned int s_maxDepth = 3;
static int s_disableIncludeSilent = -1;
class ConfigurationPrivate
{
public:
enum Include {
IncludeNone = 0,
Include = 1,
IncludeSilent = 2,
IncludeRequire = 3,
};
inline ConfigurationPrivate(Configuration& cfg, bool isMain)
: m_cfg(cfg), m_main(isMain)
{}
inline void addingParam(const String& sect, const String& name, const String& value) {
if (!m_main || sect != YSTRING("configuration"))
return;
if (s_maxDepthInit && name == YSTRING("max_depth")) {
s_maxDepthInit = false;
s_maxDepth = value.toInteger(3,0,3,10);
}
else if (s_disableIncludeSilent < 0 && name == YSTRING("disable_include_silent"))
s_disableIncludeSilent = value.toBoolean() ? 1 : 0;
}
inline bool prepareIncludeSection(const String& sect, String& s, const char* file, bool warn,
bool& ok) {
int inc = getIncludeSect(s);
if (!inc)
return false;
NamedList* nl = sect ? m_cfg.getSection(sect) : 0;
if (nl) {
nl->addParam("[]",s);
if (!m_includeSections.find(nl))
m_includeSections.append(nl)->setDelete(false);
XDebug(DebugAll,"Config '%s' prepared section '%s' include '%s' file='%s'",
m_cfg.safe(),sect.safe(),s.safe(),(file == m_cfg.c_str() ? "<same>" : file));
}
else {
if (inc == IncludeRequire)
ok = false;
if (getWarn(warn,inc == IncludeSilent)) {
String tmp;
if (file != m_cfg.c_str())
tmp.printf(" in included file '%s'",file);
Debug(DebugNote,"Config '%s' found '%s' outside any section%s",
m_cfg.safe(),s.safe(),tmp.safe());
}
}
return true;
}
inline void processIncludeSections(bool warn, bool& ok) {
for (ObjList* o = m_includeSections.skipNull(); o; o = o->skipNext()) {
ObjList stack;
processInclude(static_cast<NamedList*>(o->get()),stack,warn,ok);
}
}
inline bool getWarn(bool warn, bool silent)
{ return (warn && silent) ? (s_disableIncludeSilent > 0) : warn; }
static inline int getIncludeSect(String& buf, bool setName = false) {
if (buf.startsWith("$includesection",true))
{ if (setName) buf = buf.substr(16,buf.length() - 16); return Include; }
if (buf.startsWith("$includesectionsilent",true))
{ if (setName) buf = buf.substr(22,buf.length() - 22); return IncludeSilent; }
if (buf.startsWith("$requiresection",true))
{ if (setName) buf = buf.substr(16,buf.length() - 16); return IncludeRequire; }
return 0;
}
static bool s_maxDepthInit;
private:
void processInclude(NamedList* sect, ObjList& stack, bool warn, bool& ok);
Configuration& m_cfg;
bool m_main;
ObjList m_includeSections;
ObjList m_includeSectProcessed;
};
bool ConfigurationPrivate::s_maxDepthInit = true;
void ConfigurationPrivate::processInclude(NamedList* sect, ObjList& stack, bool warn, bool& ok)
{
if (!sect || m_includeSectProcessed.find(sect))
return;
stack.append(sect)->setDelete(false);
#ifdef XDEBUG
String tmp;
tmp.append(stack," -> ");
Debug(DebugInfo,"Config '%s' processing include section stack: %s",
m_cfg.safe(),tmp.safe());
#endif
for (ObjList* o = sect->paramList()->skipNull(); o;) {
NamedString* s = static_cast<NamedString*>(o->get());
int inc = 0;
if ('[' == s->name()[0] && ']' == s->name()[1])
inc = getIncludeSect(*s,true);
if (!inc) {
o = o->skipNext();
continue;
}
Engine::runParams().replaceParams(*s);
if (*s) {
String error;
if (!stack[*s]) {
// NOTE: We are adding current section to processed after processing it
// Handle already processed sections whithout checking for recursive include
NamedList* incSect = static_cast<NamedList*>(m_includeSectProcessed[*s]);
if (!incSect) {
incSect = m_cfg.getSection(*s);
if (incSect && incSect != sect)
processInclude(incSect,stack,warn,ok);
else
error = incSect ? "recursive include" : "not found";
}
if (!error) {
XDebug(DebugAll,"Config '%s' including section '%s' in '%s'",
m_cfg.safe(),incSect->safe(),sect->safe());
for (ObjList* p = incSect->paramList()->skipNull(); p; p = p->skipNext()) {
NamedString* ns = static_cast<NamedString*>(p->get());
o->insert(new NamedString(ns->name(),*ns));
// Update current element (replaced by insert)
o = o->next();
}
}
}
else {
error.append(stack," -> ");
error = "recursive include stack=" + error;
}
if (error) {
if (inc == IncludeRequire)
ok = false;
if (getWarn(warn,inc == IncludeSilent))
Debug(DebugNote,"Config '%s' not including section '%s' in '%s': %s",
m_cfg.safe(),s->safe(),sect->safe(),error.c_str());
}
}
o->remove();
o = o->skipNull();
if (o)
continue;
sect->paramList()->compact();
break;
}
stack.remove(sect,false);
m_includeSectProcessed.insert(sect)->setDelete(false);
}
// Text sort callback
static int textSort(GenObject* obj1, GenObject* obj2, void* context)
{
@ -189,12 +40,11 @@ static int textSort(GenObject* obj1, GenObject* obj2, void* context)
Configuration::Configuration()
: m_main(false)
{
}
Configuration::Configuration(const char* filename, bool warn)
: String(filename), m_main(false)
: String(filename)
{
load(warn);
}
@ -335,8 +185,7 @@ bool Configuration::load(bool warn)
m_sections.clear();
if (null())
return false;
ConfigurationPrivate priv(*this,m_main);
return loadFile(c_str(),"",0,warn,&priv);
return loadFile(c_str(),"",0,warn);
}
static inline char* cfgReadLine(FILE* f, char* buf, int rd,
@ -391,14 +240,12 @@ static inline char* cfgReadLine(FILE* f, char* buf, int rd,
return pc;
}
bool Configuration::loadFile(const char* file, String sect, unsigned int depth, bool warn, void* priv)
bool Configuration::loadFile(const char* file, String sect, unsigned int depth, bool warn)
{
ConfigurationPrivate& cfg = *(ConfigurationPrivate*)priv;
DDebug(DebugInfo,"Configuration::loadFile(\"%s\",[%s],%u,%s)",
file,sect.c_str(),depth,String::boolText(warn));
if (depth > s_maxDepth) {
Debug(DebugWarn,"Config '%s' refusing to load config file '%s' at include depth %u",
c_str(),file,depth);
if (depth > MAX_DEPTH) {
Debug(DebugWarn,"Refusing to open config file '%s' at include depth %u",file,depth);
return false;
}
FILE *f = ::fopen(file,"r");
@ -453,12 +300,8 @@ bool Configuration::loadFile(const char* file, String sect, unsigned int depth,
}
if (!enabled)
continue;
if (cfg.prepareIncludeSection(sect,s,file,warn,ok))
continue;
bool noerr = false;
bool silent = false;
if (s.startSkip("$require") || (noerr = s.startSkip("$include"))
|| (silent = noerr = s.startSkip("$includesilent"))) {
if (s.startSkip("$require") || (noerr = s.startSkip("$include"))) {
Engine::runParams().replaceParams(s);
String path;
if (!s.startsWith(Engine::pathSeparator())) {
@ -483,7 +326,6 @@ bool Configuration::loadFile(const char* file, String sect, unsigned int depth,
}
path << s;
ObjList files;
bool doWarn = cfg.getWarn(warn,silent);
if (File::listDirectory(path,0,&files)) {
path << Engine::pathSeparator();
DDebug(DebugAll,"Configuration loading up to %u files from '%s'",
@ -492,7 +334,7 @@ bool Configuration::loadFile(const char* file, String sect, unsigned int depth,
while (String* it = static_cast<String*>(files.remove(false))) {
if (!(it->startsWith(".") || it->endsWith("~")
|| it->endsWith(".bak") || it->endsWith(".tmp")))
ok = (loadFile(path + *it,sect,depth+1,doWarn,priv) || noerr) && ok;
ok = (loadFile(path + *it,sect,depth+1,warn) || noerr) && ok;
#ifdef DEBUG
else
Debug(DebugAll,"Configuration skipping over file '%s'",it->c_str());
@ -501,7 +343,7 @@ bool Configuration::loadFile(const char* file, String sect, unsigned int depth,
}
}
else
ok = (loadFile(path,sect,depth+1,doWarn,priv) || noerr) && ok;
ok = (loadFile(path,sect,depth+1,warn) || noerr) && ok;
continue;
}
Engine::runParams().replaceParams(s);
@ -529,20 +371,16 @@ bool Configuration::loadFile(const char* file, String sect, unsigned int depth,
break;
s += pc;
}
s.trimBlanks();
cfg.addingParam(sect,key,s);
addValue(sect,key,s);
addValue(sect,key,s.trimBlanks());
}
::fclose(f);
if (!depth)
cfg.processIncludeSections(warn,ok);
return ok;
}
if (warn) {
int err = errno;
if (depth)
Debug(DebugNote,"Config '%s' failed to open included config file '%s' (%d: %s)",
c_str(),file,err,strerror(err));
Debug(DebugNote,"Failed to open included config file '%s' (%d: %s)",
file,err,strerror(err));
else
Debug(DebugNote,"Failed to open config file '%s', using defaults (%d: %s)",
file,err,strerror(err));

View File

@ -3,7 +3,7 @@
* This file is part of the YATE Project http://YATE.null.ro
*
* Yet Another Telephony Engine - a fully featured software PBX and IVR
* Copyright (C) 2004-2023 Null Team
* Copyright (C) 2004-2014 Null Team
*
* This software is distributed under multiple licenses;
* see the COPYING file in the main directory for licensing
@ -77,14 +77,6 @@ static InitG711 s_initG711;
static const DataBlock s_empty;
static inline void* dbAlloc(unsigned int n, void* oldBuf = 0)
{
void* data = ::realloc(oldBuf,n);
if (!data)
Debug("DataBlock",DebugFail,"realloc(%u) returned NULL!",n);
return data;
}
const DataBlock& DataBlock::empty()
{
return s_empty;
@ -130,7 +122,6 @@ void* DataBlock::getObject(const String& name) const
void DataBlock::clear(bool deleteData)
{
m_length = 0;
m_allocated = 0;
if (m_data) {
void *data = m_data;
m_data = 0;
@ -139,91 +130,6 @@ void DataBlock::clear(bool deleteData)
}
}
// Change (insert or append data) the current block
bool DataBlock::change(unsigned int pos, const void* buf, unsigned int bufLen,
unsigned int extra, int extraVal, bool mayOverlap)
{
unsigned int addLen = (buf ? bufLen : 0) + extra;
if (!addLen)
return true;
XDebug("DataBlock",DebugAll,
"change(%u,%p,%u,%d,%d,%u) add_lenlen=%u m_data=%p m_length=%u allocated=%u [%p]",
pos,buf,bufLen,extra,extraVal,mayOverlap,addLen,m_data,m_length,m_allocated,this);
if (!(buf && bufLen)) {
buf = 0;
bufLen = 0;
}
if (pos > m_length)
pos = m_length;
unsigned int newLen = m_length + addLen;
void* data = 0;
unsigned int aLen = 0;
// Allocate a new buffer if input data may overlap with existing
bool overlap = buf && (mayOverlap || buf == m_data);
if (!m_data || overlap || newLen > m_allocated) {
aLen = allocLen(newLen);
// Append to existing: Realloc data. Avoid free
void* reallocAppend = (!overlap && pos == m_length) ? m_data : 0;
data = dbAlloc(aLen,reallocAppend);
if (!data)
return false;
if (reallocAppend)
clear(false);
else
copyData(data,m_data,m_length,pos,addLen);
}
else {
moveData(m_data,m_length,pos,addLen);
data = m_data;
}
if (bufLen)
::memcpy((uint8_t*)data + pos,buf,bufLen);
if (extra)
::memset((uint8_t*)data + pos + bufLen,extraVal,extra);
if (aLen)
assign(data,newLen,false,aLen);
else
m_length = newLen;
return true;
}
#define DB_CHANGE_UINT_FUNC \
unsigned int n = 0; \
if (lsb) { \
while (len--) { \
buf[n++] = (uint8_t)value; \
value = value >> 8; \
} \
} \
else { \
uint8_t sh = (len - 1) * 8; \
while (len--) { \
buf[n++] = (uint8_t)(value >> sh); \
sh -= 8; \
} \
} \
return change(pos,(const void*)buf,n,0,0,false)
bool DataBlock::change8(unsigned int pos, uint64_t value, unsigned int len, bool lsb)
{
if (!len)
return true;
if (len > 8)
len = 8;
uint8_t buf[8] = {0,0,0,0,0,0,0,0};
DB_CHANGE_UINT_FUNC;
}
bool DataBlock::change4(unsigned int pos, uint32_t value, unsigned int len, bool lsb)
{
if (!len)
return true;
if (len > 4)
len = 4;
uint8_t buf[4] = {0,0,0,0};
DB_CHANGE_UINT_FUNC;
}
DataBlock& DataBlock::assign(void* value, unsigned int len, bool copyData, unsigned int allocated)
{
if ((value != m_data) || (len != m_length)) {
@ -292,6 +198,76 @@ DataBlock& DataBlock::operator=(const DataBlock& value)
return *this;
}
void DataBlock::append(const DataBlock& value)
{
if (m_length) {
if (value.length()) {
unsigned int len = m_length+value.length();
if (len <= m_allocated) {
::memcpy(m_length+(char*)m_data,value.data(),value.length());
m_length = len;
return;
}
unsigned int aLen = allocLen(len);
void *data = ::malloc(aLen);
if (data) {
::memcpy(data,m_data,m_length);
::memcpy(m_length+(char*)data,value.data(),value.length());
assign(data,len,false,aLen);
}
else
Debug("DataBlock",DebugFail,"malloc(%d) returned NULL!",aLen);
}
}
else
assign(value.data(),value.length());
}
void DataBlock::append(const String& value)
{
if (m_length) {
if (value.length()) {
unsigned int len = m_length+value.length();
if (len <= m_allocated) {
::memcpy(m_length+(char*)m_data,value.safe(),value.length());
m_length = len;
return;
}
unsigned int aLen = allocLen(len);
void *data = ::malloc(aLen);
if (data) {
::memcpy(data,m_data,m_length);
::memcpy(m_length+(char*)data,value.safe(),value.length());
assign(data,len,false,aLen);
}
else
Debug("DataBlock",DebugFail,"malloc(%d) returned NULL!",aLen);
}
}
else
assign((void*)value.c_str(),value.length());
}
void DataBlock::insert(const DataBlock& value)
{
unsigned int vl = value.length();
if (m_length) {
if (vl) {
unsigned int len = m_length+vl;
void *data = ::malloc(len);
if (data) {
::memcpy(data,value.data(),vl);
::memcpy(vl+(char*)data,m_data,m_length);
assign(data,len,false);
}
else
Debug("DataBlock",DebugFail,"malloc(%d) returned NULL!",len);
}
}
else
assign(value.data(),vl);
}
unsigned int DataBlock::allocLen(unsigned int len) const
{
// allocate a multiple of 8 bytes
@ -390,24 +366,60 @@ inline signed char hexDecode(char c)
return -1;
}
static inline bool retResult(bool ok, int result, int* res)
{
if (res)
*res = result;
return ok;
}
// Change data from a hexadecimal string representation.
// Build this data block from a hexadecimal string representation.
// Each octet must be represented in the input string with 2 hexadecimal characters.
// If a separator is specified, the octets in input string must be separated using
// exactly 1 separator. Only 1 leading or 1 trailing separators are allowed
bool DataBlock::changeHex(unsigned int pos, const char* data, unsigned int len, char sep,
bool guessSep, bool emptyOk, int* res)
bool DataBlock::unHexify(const char* data, unsigned int len, char sep)
{
clear();
if (!(data && len))
return retResult(emptyOk,0,res);
return true;
if (!sep && guessSep && len > 2) {
// Calculate the destination buffer length
unsigned int n = 0;
if (!sep) {
if (0 != (len % 2))
return false;
n = len / 2;
}
else {
// Remove leading and trailing separators
if (data[0] == sep) {
data++;
len--;
}
if (len && data[len-1] == sep)
len--;
// No more leading and trailing separators allowed
if (2 != (len % 3))
return (bool)(len == 0);
n = (len + 1) / 3;
}
if (!n)
return true;
char* buf = (char*)::malloc(n);
unsigned int iBuf = 0;
for (unsigned int i = 0; i < len; i += (sep ? 3 : 2)) {
signed char c1 = hexDecode(data[i]);
signed char c2 = hexDecode(data[i+1]);
if (c1 == -1 || c2 == -1 || (sep && (iBuf != n - 1) && (sep != data[i+2])))
break;
buf[iBuf++] = (c1 << 4) | c2;