Two fixes:
Use ftdm_set_string() instead of sprintf() (seriously, wtf?).
Drop invalid, needless argument to ftdm_log().
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Neither of them accepts extra arguments and ftmod_sangoma_isdn is calling
ftmod_assert() with a char * msg argument.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
The format string checks already caught a couple crash-worthy bugs and this
commit fixes a couple more.
Also includes __ftdm_check_scanf(), for completeness (currently unused).
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Output the current trunk_type in "add X-channel vs. trunk_type" error messages and
check this for B-/D-channels too.
ISDN (= digital) spans need to have a trunk_type set before adding channels,
bail out early with an error message (actually two) if this is not the case.
(Adding channels should really be moved out of the parsing loop, to catch
certain types of errors easier.)
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Some I/O implementations (e.g. mISDN) need this information to correctly
set up the port configuration. In FreeTDM, the mode of a span has been.
up until now, a part of the signalling module configuration ("node" or "mode"
for libpri and isdn spans), which is parsed _after_ the I/O part of a span
has been initialized. This limitation currently prevents us from using mISDN
in NT mode.
To work around this problem (without adding a lot of new tunk_type values like "E1_NET" etc.),
add a new "trunk_mode" parameter to the span categories in freetdm.conf, which by default
is "CPE" for all trunk types, except "FXS" (which defaults to "NET").
ftmod_misdn uses trunk_type + trunk_mode to correctly choose the d-channel protocol
for a port.
ftmod_libpri uses trunk_mode as a hint for the default "mode" setting.
(NOTE: It will print a warning if trunk_mode and signalling mode do not match.)
All other modules currently ignore the value of trunk_mode.
Example freetdm.conf snippet for a mISDN span in NET/NT mode
(using a HFC-S USB dongle):
[span misdn MBRI_1]
trunk_type => BRI_PTMP
trunk_mode => NET
b-channel => HFC-S_USB.1:1-2
d-channel => HFC-S_USB.1:3
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Portability fix for uClibc and other (linux) environments that lack execinfo.h.
ftdm_backtrace_walk() and related return FTDM_NOTIMPL and print a message
if backtraces are not available in the current environment.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
This feature allows ftmod_libpri to ignore calls with non-matching destination number.
You may want to use this on BRI PTMP lines (Point-to-MultiPoint),
to avoid conflicts between your FreeSWITCH server and other devices connected to the line.
The filter is disabled by default (all calls will be accepted),
setting one (or more) "local-number" parameters on the span configuration enables it.
Example configuration snippet:
<libpri_spans>
<span name="example01">
<!-- ... other span settings omitted ... -->
<param name="local-number" value="123456"/>
<param name="local-number" value="654321"/>
</span>
</libpri_spans>
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
readfile returns a value of type ssize_t (signed) and returns -1 if an
error occurs. In auth_readdb_internal, however, we were assigning the
return value of readfile to a variable of type size_t (unsigned), but
then testing this unsigned value to see if it was < 0, a
contradiction. We would thus simultaneously fail to report the error
in readfile and would end up with a corrupted length value.
sres_cached_answers_sockaddr is supposed to return ENOENT if no cached
records are found. Because of the missing return statement, however,
it would never do this and would instead return something very likely
to be garbage.
base64_d returns a value of size_t, which is unsigned. The value
therefore cannot be less than zero. The second check testing whether
it is >= INT_MAX is not a contradiction, but it doesn't make any sense
to check for this (as far as I can tell).
Converting these macros to functions declared static inline allow the
C type-checker to work and avoid warnings about unused expression
values. These warnings break the build with clang.
This avoid warnings about expressions with unused values. These
warnings break the build with clang.
An optimizing compiler should still inline these calls. If that turns
out not to happen on some platform, we could rename the functions used
internally and declare them static inline.
The implementation clears the context / state data from memory when it
is finished with it. Prior to this commit, however, it was actually
only clearing the first 4 bytes on x86 or 8 bytes on x86_64.
clang warns:
warning: argument to 'sizeof' in 'memset' call is the same
expression as the destination; did you mean to dereference it?
[-Wsizeof-pointer-memaccess]
In a sofia profile, you can now set the parameter tls-timeout to a
positive integer value which represents the maximum time in seconds
that OpenSSL will keep a TLS session (and its ephemeral keys) alive.
This value is passed to OpenSSL's SSL_CTX_set_timeout(3).
OpenSSL's default value is 300 seconds, but the relevant standard
(RFC 2246) suggests that much longer session lifetimes are
acceptable (it recommends values less than 24 hours).
Longer values can be useful for extending battery life on mobile
devices.
Signed-off-by: Travis Cross <tc@traviscross.com>
* fixed bug with remote hello-hash buffer being too small
* removed unused hello-hash storage in zrtp stream context
* fixed bug with libzrtp rendered "empty" SAS hash from incoming
SasRelay packet
* incremented libzrtp version number to 1.15
Signed-off-by: Travis Cross <tc@traviscross.com>