Commit Graph

22128 Commits

Author SHA1 Message Date
Steve Underwood 72c073c6cb Bring fax_modem handling in the fax_tester code into line with the upstream code 2012-08-28 15:32:00 +08:00
Steve Underwood 1b3710d5d0 This update brings the fax modem handling into line with the upstream code 2012-08-28 13:32:43 +08:00
Anthony Minessale a8cd9b82da add tmute command 2012-08-27 17:51:07 -05:00
Michael S Collins f9a10978d8 Merge branch 'master' of ssh://git.freeswitch.org:222/freeswitch 2012-08-27 15:50:01 -07:00
Michael S Collins 56ed094b39 Tweak to-be-recorded prompts 2012-08-27 15:49:53 -07:00
Anthony Minessale a8b89bcc1e add cache param to httapi 2012-08-27 16:13:21 -05:00
Anthony Minessale 90e637cc2f FS-4561 more debug 2012-08-27 12:55:34 -05:00
Anthony Minessale a0f752c564 FS-4561 revert 2012-08-27 12:50:51 -05:00
Anthony Minessale be5fc2c0c5 enable debug 2012-08-27 12:38:48 -05:00
Steve Underwood 11cc977391 More cleanups of fax modem stuff 2012-08-27 23:04:05 +08:00
Michael S Collins b515a1f8f9 Update to-be-recorded phrases (blacklist) 2012-08-26 19:04:22 -07:00
Robert Jongbloed 48b85ca9c1 Added check for PTLib version, can't be too old. 2012-08-27 11:51:28 +10:00
Jeff Lenk 59e1d56cb5 spandsp windows build fix 2012-08-26 16:04:36 -05:00
Anthony Minessale 4d8c82c86b FS-4561 please test this 2012-08-26 12:35:36 -05:00
Steve Underwood 2733e21cd5 More tweaks to spandsp 2012-08-27 00:41:19 +08:00
Steve Underwood e1be1639de Tweaks 2012-08-26 22:53:24 +08:00
Steve Underwood 0e4fb82ecf Tweaks 2012-08-26 22:18:26 +08:00
Steve Underwood acf7c40717 More tweaks 2012-08-26 22:07:01 +08:00
Steve Underwood 3b9dac029e Tweaks 2012-08-26 20:58:54 +08:00
Steve Underwood 124a0742d4 Tweaks 2012-08-26 20:45:49 +08:00
Steve Underwood fe5ac498f7 More tweaks 2012-08-26 20:39:33 +08:00
Steve Underwood dbec2dcbaf More tweaks 2012-08-26 20:28:48 +08:00
Steve Underwood 3b4aafe945 More tweaks 2012-08-26 20:24:20 +08:00
Steve Underwood e60d204a59 More tweaks 2012-08-26 20:11:39 +08:00
Steve Underwood 7f40c5fb41 More tweaks 2012-08-26 19:37:14 +08:00
Steve Underwood ac9656015a More fax modem tweaks 2012-08-26 19:30:42 +08:00
Steve Underwood 887c373c92 Tweaks 2012-08-26 18:12:44 +08:00
Steve Underwood 8cb975f345 Various fax_modems.c related improvements 2012-08-26 15:43:15 +08:00
Anthony Minessale 60cd56d1fc FS-4561 send notify with terminate state when we get a SUBSCRIBE with expires 0 2012-08-24 17:53:53 -05:00
Stefan Knoblich 7da8e15e96 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-08-24 20:49:53 +02:00
Anthony Minessale e0372f57c3 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-08-24 13:15:57 -05:00
Michael S Collins 9cde99b406 FS-3003: --resolve Add lang config files for es-ES,es-MX,pt-BR,pt-PT (Thanks Francois Delawarde) 2012-08-24 09:42:52 -07:00
Stefan Knoblich 5b499e8a59 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-08-24 18:03:31 +02:00
Jeff Lenk 72d67cdbd8 FS-4219 --resolve 2012-08-24 08:24:18 -05:00
Anthony Minessale fbc83cb0ea revert 2012-08-23 17:52:32 -05:00
Stefan Knoblich a436a3e962 FreeSWITCH: Fix format string error in witch_core_session_thread_pool_worker().
Fixes:
    cc1: warnings being treated as errors
    src/switch_core_session.c: In function 'switch_core_session_thread_pool_worker':
    src/switch_core_session.c:1478: warning: format '%ld' expects type 'long int', but argument 9 has type 'switch_size_t'
    src/switch_core_session.c:1483: warning: format '%ld' expects type 'long int', but argument 9 has type 'switch_size_t'
    gmake[2]: *** [libfreeswitch_la-switch_core_session.lo] Error 1

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-08-24 00:51:36 +02:00
Anthony Minessale f34085965c fix some issues in httapi record parser 2012-08-23 17:49:53 -05:00
Stefan Knoblich a4216351c0 ftmod_libpri: Implement channel hunting in NT-mode.
Hunt for a free channel for incoming calls that do not
preselect a channel (pevent->ring.channel == -1).

Verify the preselected channel for calls that do specify a channel
and in case the channel is already taken, hunt for a free one,
or abort with an error message (if the preselection was exclusive).

TE-mode channel selection is the same as before
(there's still room for improvement, though, but i'll save that for later).

The MSN/DDI filter code is moved into the TE-mode section (only useful there).

The duplicate ring detection had to be reworked. We now store the
call reference (CRV) in caller_data->call_reference of the selected channel
and do a CRV -> channel look up with find_channel_by_cref()
at the top of on_ring().

NOTE: This is only lightly tested (NT/TE mode), i'd either have to
      write a lot of custom code to check it toroughly or the need for
      a scriptable ISDN stack...

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-08-24 00:36:34 +02:00
Anthony Minessale 4efff5c463 fix small bug, init this value to success so you can record without playing a file first 2012-08-23 16:29:30 -05:00
Stefan Knoblich 716f4c0675 ftmod_libpri: Check for '#' key to leave overlap receiving state.
Same as ftmod_isdn, '#' key ends overlap receive and moves the incoming
call to RING state.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-08-23 22:26:49 +02:00
Anthony Minessale 04924f1694 FS-4079 FS-4540 regression from 5213c764bb please update ASAP if you are running this one 2012-08-23 14:56:37 -05:00
Anthony Minessale 29a3d7ab02 copy channel data into RECV_INFO event 2012-08-23 13:07:08 -05:00
Anthony Minessale cfa02f0e32 FS-4561 please update to this version and retest with new logs if necessary 2012-08-23 13:02:08 -05:00
Anthony Minessale 5213c764bb FS-4079 FS-4540 minor refactoring to fix some minor side effects of recent changes 2012-08-23 11:10:03 -05:00
Jeff Lenk 3d34215919 vs2010 reswig 2012-08-22 18:08:55 -05:00
Anthony Minessale d38b905606 remove debug 2012-08-22 17:49:42 -05:00
Anthony Minessale b3140af073 cleanup 2012-08-22 17:05:25 -05:00
Anthony Minessale 2a8841ab66 change mod_sofia to use new core based recovery engine 2012-08-22 16:27:07 -05:00
Anthony Minessale 66677c940a move recovery engine up into the core 2012-08-22 16:27:07 -05:00
Anthony Minessale 8aaca1cef3 make sure recovering calls start with re-invite instead of invite handler 2012-08-22 16:27:07 -05:00