Resolves OPENZAP-189
Fixes:
src/ftmod/ftmod_isdn/ftmod_isdn.c: In function 'ftdm_isdn_931_34':
src/ftmod/ftmod_isdn/ftmod_isdn.c:902:21: error: variable 'status' set but not used [-Werror=unused-but-set-variable]
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
*sigh* of course there are two versions of strerror_r():
char *strerror_r() - GNU
int strerror_r() - non-GNU
Revert and back the drawing board...
This reverts commit 3c82033e53.
Fixes:
src/ftmod/ftmod_misdn/ftmod_misdn.c: In function 'misdn_handle_mph_information_ind':
src/ftmod/ftmod_misdn/ftmod_misdn.c:871:3: error: format '%lx' expects argument of type 'long unsigned int', but argument 13 has type 'uint64_t' [-Werror=format]
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Do a "soft" wraparound with modulo, removes the ~0.5s tone glitch.
(Multiply ts.rate (samples) by two to match the offset unit (bytes, 2 per sample).)
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Store the offset in the teletone buffer in the b-channel private data.
An NT-mode setup with ftmod_misdn showed severe (dial-)tone distortions
in a sound editor (330Hz sine wave phase errors), caused by
using a global teletone buffer offset.
Switching to a per-channel offset, that is advanced by the amount
of data actually written to the channel, removes (almost) all
distortions.
There is still a minimal phase error every ~500ms (audible) that
needs more investigating.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Might as well import these too...
ftdm_offset_of() - Get offset of member in structure.
ftdm_container_of() - Get pointer to enclosing structure from pointer to structure member.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
ftdm_min(x,y) - Returns the smaller of the two values x and y.
ftdm_max(x,y) - Returns the larger of the two values x and y.
ftdm_clamp(val, min, max) - Returns value that is in the range [vmin,vmax].
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Remove the 'state' variable of per-channel data, use active flag exclusively to track
open/close state.
Add misdn_activate_channel()/misdn_deactivate_channel() helper functions, rename old
one to _misdn_toggle_channel() (internal).
Add _nowait variant of channel de-/activation function, that just sends the mISDN request message.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Store call CRV in caller_data.call_reference and use call private to hold the
FreeTDM channel object.
Remove isdn_data->channels_{local,remote,outbound}_crv arrays.
Allow (and force) inbound call state transition DIALTONE -> DOWN for
incoming RELEASE COMPLETE messages in NT mode.
Dialtone in NT mode works, everything else needs more testing.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
ftmod_misdn currently returns len == 0 if the incoming message,
that triggered the read() call, does not contain any data.
Users of ftdm_channel_read() need to handle this case, or they
may possibly end up in an endless loop.
This patch reworks the ftdm_channel_read() handling in ftmod_isdn
and prevents it from entering an endless loop. The read error counter
is reset on first sucessful read w/ data.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>