This is configured through 2 new parameters:
ringback-during-collect=yes|no
ringback-file=<wav file path>
You may not want to use this if your E&M lines are connected to traditional phones, otherwise
you will hear ringback tone while pressing digits. This is mostly useful with old switches that do
not provide ringback tone but the user is already done dialing (perhaps the signaling was converted from
ISDN to E&M and the full number was received in a single SETUP message)
The state FTDM_CHANNEL_STATE_RINGING is not used when there is media available. We have
FTDM_CHANNEL_PROGRESS_MEDIA for that, therefore the pri_acknowledge() call should not set
the info argument to avoid sending an indication of media to the other end, as that may cause
the other end to not generate any ringing tone and at that moment we will not be generating
any ringing tone either and the caller will hear only silence
Use uint64_t and FTDM_UINT64_FMT for flagval and "%u" for unsigned int.
Extend invalid channel id check to cover chan_id == 0 case.
Use ftdm_strlen_zero() and ftdm_array_len() instead of open-coding them.
Move some variables from global scope into local subcommand scope.
Various other little format string and variable naming fixes.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Auto-loading can be toggled by setting the new autoload parameter
to FTDM_FALSE/FTDM_TRUE.
Update ftdm_span_create() and ftdm_api_execute() to use the new code.
NOTE: Auto-loading of missing I/O interfaces remains enabled in both cases,
but I guess we should disable it for ftdm_api_execute().
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
"x >> 1" is _NOT_ the reverse of "1 << x"...
Use code from Sean Eron Andersen's "Bit Twiddling Hacks"
(=> http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog)
to compute the log2 value (= position in the enum) of the bitflag.
This preserves the current behaviour, which is rather odd because
it is based on the position of the value in the enum, not its
actual (bit flag) value.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Simplify code by using shared string constants using bool (0/1) index,
!!-operator and negation-via-XOR.
Future optimization: Preallocate and re-use of iterators, to avoid
repeatedly allocating and freeing of memory.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Part of my ongoing effort to split ftdm_io.c into more manageable pieces.
This change (along with others in the future) allows decoupling of the
span registry and its users, in preparation of moving all span related
functions and data structures into ftdm_span.c.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Catch single channel RESTART/RESTART ACK events for non-B-channels,
that would lead to a NULL pointer dereference, because those do not have
per-channel private data (chan->call_data = chan_priv == NULL).
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Full clang error message:
error: implicit conversion from enumeration type 'ftdm_bool_t' to
different enumeration type 'ftdm_status_t' [-Werror,-Wconversion]
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Add support for "q921_all"/"q931_all" to parse_debug() ("debug" span parameter), taken from
ftmod_libpri.
Passive libpri's raw dump feature is broken (e.g. I-frames missing), so
add "q921_raw" hexdump support to the pritap I/O read/write function.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Said function has been added in libpri-1.4.11 and breaks
building with older libpri versions (i.e. the passive one for ftmod_pritap).
Check for pri_maintenance_service() in configure and disable
the "maintenance" subcommand if it is not available.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Yeah, right, discard the incoming audio data when the b-channel is active...
Reverse the check, so ftdm_read() on an active mISDN b-channel will
be able to read audio data from the RX socketpair and not kill
the call from repeatedly timing out in poll().
Fixes:
[WARNING] mod_freetdm.c:775 Too many timeouts while waiting I/O in channel FreeTDM/1:1/XX device 1:1!
[ERR] mod_freetdm.c:820 clearing IO in channel FreeTDM/1:1/XX device 1:1!
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
epoll_wait() on the B-channel socket may indicate pending messages, but
recvfrom() returns EAGAIN. Retry a few more times (up to 5 retries)
to get the pending message.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Fixes:
src/ftmod/ftmod_misdn/ftmod_misdn.c:924:3: error: format '%lx' expects
argument of type 'long unsigned int', but argument 13 has type '__u64'
[-Werror=format]
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Reported-by: hyper_ch #freetdm @ irc.freenode.net
This bug was cause when answer-supervision is used because now we do not move from DIALING to UP
as soon as the line is ringing, but instead we wait for the CAS bit change
Handle driver events while reading media
ftmod_analog_em:
Initialize read data len to avoid crashing when
the freetdm read function does not read anything