Minor modifications on the original patch to use ftdm_hunting_direction_t
everywhere instead of ftdm_direction_t or int
Patched-by: Marc Olivier Chouinard
* Rename option ringback-during-collect to immediate-ringback
* Allow regular ringback tone with immediate-ringback, not just a wav file
* Do not request full frame of data, just packet_len which is what we receive per IO interval
* Ignore user data when playing ringback tone
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>