Commit Graph

22041 Commits

Author SHA1 Message Date
Anthony Minessale ce88d572d3 add uuid_answer and uuid_pre_answer 2012-09-11 14:31:30 -04:00
Anthony Minessale 8672cf08fb add fire-message-events profile param 2012-09-11 14:31:30 -04:00
Anthony Minessale 9c06cb34fe add fire-message-events profile param 2012-09-11 14:31:30 -04:00
Anthony Minessale fdae1fd2a6 clean up mutex app code 2012-09-11 14:31:30 -04:00
Anthony Minessale 129e67a8b9 some minor regressions from the last commit 2012-09-11 14:31:30 -04:00
Anthony Minessale 12dc982a2b swigall 2012-09-11 14:31:30 -04:00
Anthony Minessale 6a5f200a4b FS-4570 --resolve 2012-09-11 14:31:30 -04:00
Anthony Minessale 3af25d503c FS-4573 --resolve 2012-09-11 14:31:30 -04:00
Anthony Minessale 8e5f5baa06 fix double sessions on auth challenged calls 2012-09-11 14:31:30 -04:00
Anthony Minessale 9544d7a49e finish up mutex app 2012-09-11 14:31:30 -04:00
Anthony Minessale a952e91197 evil typo to cause regression in new core recover engine 2012-09-11 14:31:30 -04:00
Anthony Minessale 64fd2bdd12 update last 2012-09-11 14:31:30 -04:00
Steve Underwood 4a1ddf0e4c More cleanups of the FAX modems 2012-09-11 14:31:29 -04:00
Anthony Minessale 90b75b3b71 check-in of mutex app 2012-09-11 14:31:29 -04:00
Jeff Lenk 25d1e7a394 FS-4343 --resolve 2012-09-11 14:31:29 -04:00
Anthony Minessale 5ae97f749a FS-4488 wrong format macro 2012-09-11 14:31:29 -04:00
Anthony Minessale 77a542e4be FS-4565 --resolve 2012-09-11 14:31:29 -04:00
Anthony Minessale 6fcf2cc5a0 fix wrong len in ESL sendMSG method 2012-09-11 14:31:29 -04:00
Steve Underwood d2d7175908 Bring fax_modem handling in the fax_tester code into line with the upstream code 2012-09-11 14:31:29 -04:00
Steve Underwood fb7ee3a7ab This update brings the fax modem handling into line with the upstream code 2012-09-11 14:31:29 -04:00
Anthony Minessale 4546a15b35 add tmute command 2012-09-11 14:31:29 -04:00
Michael S Collins 12a0e420ce Tweak to-be-recorded prompts 2012-09-11 14:31:29 -04:00
Anthony Minessale cac11178b9 add cache param to httapi 2012-09-11 14:31:29 -04:00
Anthony Minessale 99695438af FS-4561 more debug 2012-09-11 14:31:29 -04:00
Anthony Minessale 1fb13e7615 FS-4561 revert 2012-09-11 14:31:29 -04:00
Anthony Minessale 841d887bfe enable debug 2012-09-11 14:31:29 -04:00
Steve Underwood 7a2f2aeeb1 More cleanups of fax modem stuff 2012-09-11 14:31:29 -04:00
Michael S Collins b535e4a48b Update to-be-recorded phrases (blacklist) 2012-09-11 14:31:28 -04:00
Robert Jongbloed b2b63b0878 Added check for PTLib version, can't be too old. 2012-09-11 14:31:28 -04:00
Jeff Lenk 648297aa27 spandsp windows build fix 2012-09-11 14:31:28 -04:00
Anthony Minessale 04d5ec4b1f FS-4561 please test this 2012-09-11 14:31:28 -04:00
Steve Underwood d986926d0e More tweaks to spandsp 2012-09-11 14:31:28 -04:00
Steve Underwood abbdb16173 Tweaks 2012-09-11 14:31:28 -04:00
Steve Underwood 0d9e200144 Tweaks 2012-09-11 14:31:28 -04:00
Steve Underwood 64541c08d2 More tweaks 2012-09-11 14:31:28 -04:00
Steve Underwood 823d59f573 Tweaks 2012-09-11 14:31:28 -04:00
Steve Underwood 48330d913d Tweaks 2012-09-11 14:31:28 -04:00
Steve Underwood c560fe7fbe More tweaks 2012-09-11 14:31:28 -04:00
Steve Underwood 116186a5e5 More tweaks 2012-09-11 14:31:28 -04:00
Steve Underwood dfd4f70e98 More tweaks 2012-09-11 14:31:28 -04:00
Steve Underwood 2a040e1d2c More tweaks 2012-09-11 14:31:28 -04:00
Steve Underwood 8c6e2d20d5 More tweaks 2012-09-11 14:31:28 -04:00
Steve Underwood 308371c8e1 More fax modem tweaks 2012-09-11 14:31:27 -04:00
Steve Underwood 410a83bde1 Tweaks 2012-09-11 14:31:27 -04:00
Steve Underwood f26a4990d7 Various fax_modems.c related improvements 2012-09-11 14:31:27 -04:00
Anthony Minessale 3e0aad8eda FS-4561 send notify with terminate state when we get a SUBSCRIBE with expires 0 2012-09-11 14:31:27 -04:00
Stefan Knoblich 9ac3e78802 FreeTDM: Remove oz{rename,replace}.sh scripts.
Remnants from the olden days of the big OpenZAP migration.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-09-11 14:31:27 -04:00
Anthony Minessale 4dc3e0948e FS-4525 --resolve ok there was 2 parts to this and I missed one, your client actually uses different to and from in the subscribe where the majority use the target name in the request, to and from, this should make it compat 2012-09-11 14:31:27 -04:00
Michael S Collins 09d3f266dc FS-3003: --resolve Add lang config files for es-ES,es-MX,pt-BR,pt-PT (Thanks Francois Delawarde) 2012-09-11 14:31:27 -04:00
Stefan Knoblich 705543c8b4 ftmod_misdn: Use a per-span I/O thread to handle B-channel data.
Move the B-channel message handling into a per-span I/O thread,
to solve most of the problems caused by the intermixed data + control
socket interface of mISDN, missing write poll() support on
mISDN B-channels and the FreeTDM I/O model. This eliminates most of
the audio problems (except for a few minor glitches).

A unix stream socket pair is used as a bi-directional pipe replacement
(the pipe code is still included in this commit, but will be removed later),
with the RX and TX buffer sizes carefully tuned to avoid excessive buffering
(= latency) and a deadlock situation between the write() call in ftdm_write()
and the code in misdn_span_run() that needs a minimum amount of data in the
TX buffer, before sending out a PH_DATA_REQ to the mISDN socket
(see misdn_span_run() comments for more details).

The minimum size for pipes is PAGE_SIZE (4k), which is ~500 ms worth of
audio. A socket pair RX/TX buffer size of 3k, seems to hold a maximum
amount of around 500 bytes data in practice, giving us a much lower
maximum latency than a unix pipe. (The socket pair might be replaced by a
custom ring buffer / fifo data structure to get even more fine grained
control of the maximum latency.)

The newly introduced span_start / span_stop callbacks in
ftdm_io_interface_t are used to start / stop the I/O thread. The callback
functions will wait up to 10 seconds for the thread to successfully
start up or shut down (using a mutex + condition var).

NOTE: Using any of the locking ftdm_span_() functions in the I/O will cause
      a deadlock between the I/O thread (trying to lock span->mutex) and the
      thread calling ftdm_start()/_stop() (holding the span->mutex).
      (The I/O thread currently uses direct span member access to avoid this.)

The I/O thread uses the epoll(7) family of functions for event handling.
An epoll context is created on startup and all B-channel sockets are
registered (READ, PRI and ERR). Before entering the event loop,
the I/O thread will send a signal on the condition variable, to
indicate it has completed the startup procedure.

Incoming b-channel and command pipe events are handled by the event loop.
Payload of incoming PH_DATA_IND frames (= audio data) is sent to the
rx_audio_pipe_in end of the b-channel's socket pair and, if enough data is
available, a PH_DATA_REQ of the same size is sent to the b-channel mISDN socket
to transmit audio.

A MISDN_CMD_STOP command on the event pipe will wake up the I/O thread and
cause it to shut down. All b-channels will be unregistered from the epoll context
and the epoll fd closed. The I/O thread terminates itself after signalling the
successfull shutdown on the condition variable.

TODOs:
    - Move D-Channel into I/O thread too

    - Custom FIFO/ring buffer for data (even lower latency)

    - Improve epoll() code (per-channel struct w/ callback, for epfd.data.ptr)

    - Use mISDN DSP for audio (e.g. tone generator, dtmf detector, echo cancel)

    - Use a per-port / span control socket to execute channel commands
      synchronously, or add misdn_commands (queue?) that can be used that way

    - Name I/O threads 'mISDN-%SPAN_NAME%', e.g. 'mISDN-M_BRI1'
      (= add ftdm_thread_set_namef(thread, fmt, ...) / ftdm_thread_set_name(thread, name))

TL;DR: "tweak", solves "booboo" with audio

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-09-11 14:31:27 -04:00