Commit Graph

5618 Commits

Author SHA1 Message Date
Anthony Minessale
afdf50d423 stop sched thread quicker on global destroy 2012-04-02 15:33:45 -05:00
Anthony Minessale
972504a3ca unset logger on global destroy 2012-04-02 15:00:35 -05:00
Anthony Minessale
b80a3a3439 set session loglevel as well in fs_cli when doing 'console loglevel info' also now implies '/log info' locally 2012-04-02 11:58:00 -05:00
Travis Cross
d2edcad66e Merge Phil Zimmermann's libzrtp as a FreeSWITCH library
Thanks to Phil Zimmermann for the code and for the license exception
we needed to include it.

There remains some build system integration work to be done before
this code will build properly in the FreeSWITCH tree.
2012-03-31 23:42:27 +00:00
Steve Underwood
13fbaf7e0f Tweaks for spandsp 2012-03-29 23:33:11 +08:00
Stefan Knoblich
a856d81a06 ftmod_misdn: More reworking of b-channel audio tx handling.
Use the amount of audio data received in misdn_read() to determine how many
bytes we need to send to the b-channel (= how much free space is left
in the b-channel tx queue). (This is how libosmo-abis and LCR handle it too.)

A pipe is used as a poll()-able audio tx buffer (filled in misdn_write()):
FTDM_WRITE wait requests are currently poll()-ed on the input side of the pipe,
whereas FTDM_READ and _EVENT requests are poll()-ed on the b-channel socket itself.

For every N-bytes of audio data read from the b-channel in misdn_read(),
we try to get as much out of the tx pipe, convert it into the ISDN_P_B_RAW
format and send it to the b-channel socket.

If there's less than N-bytes left in the pipe, we fill the remaining buffer
with silence to avoid buffer underflows.

B-Channel handling overview:

  - misdn_wait(FTDM_WRITE) on audio pipe

  - misdn_write() put audio data into pipe

  - misdn_wait(FTDM_READ) for next incoming mISDN
    message on b-channel socket

  - misdn_read() handle mISDN event, for PH_DATA_IND:

      - Write data into channel buffer and convert
        to a/u-law using misdn_convert_audio_bits()

      - Try to fetch N-bytes from audio pipe

      - If not enough bytes in pipe: fill remaining space with silence

      - Convert audio to raw format

      - Send to b-channel (PH_DATA_REQ)

Known problems / bugs / further investigation:

   1. Bridge aborted by "Write Buffer 0 bytes Failed!" error from switch_core_io.c.
      This is "fixed" by _not_ setting the b-channel sockfd to non-blocking mode.

   2. Audio glitches (maybe caused by FTDM_WRITE misdn_wait() handling or blocking I/O on sockfd?)

   3. misdn_read() EBUSY error messages from sending data to b-channel sockfd after enabling channel.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-03-28 23:49:55 +02:00
Steve Underwood
7b9e4ff674 Various updates to spandsp tests
spandsp logging now passes an opaque pointer to the logging routine, to
increase flexibility. Right now the pointer is set to NULL in all calls.
2012-03-28 23:36:30 +08:00
Steve Underwood
c1203b5863 Tweak spandsp tests 2012-03-28 21:45:20 +08:00
Steve Underwood
3e2bea0f1c Lots of little improvements to the spandsp test suite 2012-03-28 21:43:13 +08:00
Ken Rice
c1f3ff998f opps missed an include 2012-03-27 14:24:58 -05:00
Ken Rice
a1ed759b1c try to make compiler -Werror hush 2012-03-27 14:11:41 -05:00
Ken Rice
57fac728c6 make compiler stop complaining 2012-03-27 13:58:27 -05:00
Anthony Minessale
d308694201 after f7f9a43a40 missing a bunch of code changes 2012-03-26 16:41:49 -05:00
Stefan Knoblich
e3698c2067 ftmod_misdn: Make sure misdn_read() doesn't loop forever and improve logging etc.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-03-23 01:21:55 +01:00
Stefan Knoblich
ff4b395956 ftmod_misdn: Rework channel de-/activation and activate d-channel early.
The former fixes a strange "bug" with hfcsusb, where a b-channel deactivation
on a inactive channel (caused by a reset cycle) would cause the port to
lock up and stop processing events.

NOTE: this still needs to be investigated further, but this workaround will
      at least prevent it from breaking completely.

We'll now keep track of the channel activation state and not send any
PH_ACTIVATE_REQ / PH_DEACTIVATE_REQ requests, if the channel already has the
desired state.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-03-23 01:21:55 +01:00
Stefan Knoblich
a2f3ef7460 ftmod_misdn: Reserve some space for the mISDN message header in misdn_write().
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-03-23 01:21:55 +01:00
Stefan Knoblich
f2841e0280 ftmod_misdn: misdn_write() workaround for signalling drivers that do not use write polling.
Wait till the channel is actually ready to send data.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-03-23 01:21:55 +01:00
Stefan Knoblich
fc1e1a91f2 ftmod_misdn: Stop using timerfd for b-channel write polling.
Use POLLIN on the socket instead, the b-channel should be able
to write when there is something to read.

Several other projects handle it this way, e.g. libosmo-abis.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-03-23 01:21:55 +01:00
Stefan Knoblich
c85271aaf5 ftmod_misdn: Improve debug log messages.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-03-23 01:21:55 +01:00
Stefan Knoblich
28ed1b5076 ftmod_misdn: Move misdn_handle_incoming() up.
Only used by misdn_read(), so move it right in front of that one.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-03-23 01:21:55 +01:00
Stefan Knoblich
6b76212324 ftmod_misdn: Decode hfcsusb MPH_INFORMATION_IND state and flags.
For diagnostic / debugging purposes.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-03-23 01:21:55 +01:00
Moises Silva
57b022c2d4 freetdm: Do not report error for DAHDI RINGER ON/OFF events, they are no-ops at the moment 2012-03-19 09:27:29 -04:00
Moises Silva
681f582b20 freetdm: Try to resolve OPENZAP-173
The token count needs to be updated after the master session token is cleared
         and before checking for other tokens
2012-03-19 09:20:44 -04:00
Moises Silva
bf652b567f freetdm: ftmod_zt - Print which DAHDI event number is failing to be processed 2012-03-18 18:54:54 -04:00
Jeff Lenk
e8fbaa77a4 FS-3997 --resolve 2012-03-14 09:26:32 -05:00
Jeff Lenk
d3078c60ec update flite to 1.5.4 fixes win64 and kal rate problem 2012-03-13 22:56:02 -05:00
Jeff Lenk
d827cfecb4 corrected managedEsl sample 2012-03-04 17:48:30 -06:00
Anthony Minessale
872a0fe658 FS-3957 --resolve 2012-03-01 10:04:07 -06:00
Anthony Minessale
0626c89d4a always update the .update file when changing the sofia lib 2012-02-29 14:45:39 -06:00
Jeff Lenk
6aa492d034 vs2010 add some ssl support to curl - test 2012-02-29 08:50:00 -06:00
Jeff Lenk
da36d1f57f FS-3953 --resolve 2012-02-28 08:38:45 -06:00
Anthony Minessale
23645b6af2 comment assert for windows 2012-02-27 16:49:12 -06:00
Jeff Lenk
5e66db63f1 FS-3896 --resolve that sizeof was incorrect 2012-02-17 08:50:03 -06:00
David Yat Sin
08d29b10b6 freetdm - ISDN fix for channel getting stuck if we receive ALERT after sending DISCONNECT 2012-02-15 13:07:07 -05:00
Christopher Rienzo
fdaa155b99 Lower super_tone_rx DETECTION_THRESHOLD by a factor of 128 2012-02-10 13:17:54 +00:00
Stefan Knoblich
674dc9850b [FreeTDM] Another round of ftdm_log() format string fixes.
Use FTDM_SIZE_FMT where needed, don't treat ftdm_event_t as an int
(even if the e_type enum is the first member), datalen vs. *datalen fix
and other warnings.

All reported by __check_printf() (GCC + __attribute__((format(printf,x,y))) ).

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-02-10 13:29:49 +01:00
Stefan Knoblich
9d5eb0737b [FreeTDM] Fix a couple of ftdm_log() format string errors.
... that could cause segmentation faults.

Caught while working on __check_printf() support for ftdm_log().

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-02-10 13:24:57 +01:00
Stefan Knoblich
124c04624a [ftmod_misdn] Add missing braces around condition of ternary operator.
For compilers that seem to do the wrong thing(tm).

Speculative fix for:

  segfault at 1 ip b72145d3 sp b58f8bfc error 4 in libc-2.11.3.so

  #0  0xb7a5d5d3 in vfprintf () from /lib/i686/cmov/libc.so.6
  #1  0xb7a7cec7 in vasprintf () from /lib/i686/cmov/libc.so.6
  #2  0xb7dd7c5b in switch_vasprintf (...)
  #3  0xb6296de2 in ftdm_logger (...)
  #4  0xb621625d in misdn_handle_mph_information_ind (...) at ftmod_misdn.c:658

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-02-10 13:22:47 +01:00
Stefan Knoblich
36b26c51ac [ftmod_misdn] Fix a couple of ftdm_log() printf format errors
Also adds a local ftdm_channel_get_type_str() helper.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-02-09 12:58:59 +01:00
David Yat Sin
9de1e1ad67 freetdm - disabled dtmf detect duration by default 2012-02-07 14:36:22 -05:00
David Yat Sin
c5cc318afa Merge branch 'master' of ssh://git.freeswitch.org:222/freeswitch 2012-02-07 14:28:58 -05:00
David Yat Sin
1377b9c84d freetdm: support for dtmf_on_start 2012-02-07 14:28:47 -05:00
Stefan Knoblich
4bb1ab0113 [ftmod_misdn] Add some TODO items at the top of ftmod_misdn.c.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-02-07 18:39:11 +01:00
Stefan Knoblich
810f0d4eaa [ftmod_misdn] Make misdn_handle_mph_information_ind() cope with hfcsusb-style MPH_INFORMATION_IND messages.
Only two mISDN hardware drivers emit MPH_INFORMATION_IND messages and both use a different payload:

	- hfcsusb (HFC-based USB dongle) sends a set of ph_info + ph_info_ch structures
	  which contain the complete state information of the port
	  (including internal hw-specific state and flags).

	- hfcmulti which sends a single integer, a single L1_SIGNAL_* event.

We now try to guess the type of message from the payload length.

The hfcmulti signals are converted to FreeTDM alarm flags; the hfcsusb
state/flags are defined in kernel internal hw-specific headers and are ignored ATM (todo).

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-02-07 18:39:11 +01:00
Stefan Knoblich
452c13573d [ftmod_misdn] Include mISDN message primitive id in channel activation log messages.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-02-07 18:39:11 +01:00
Stefan Knoblich
fd3ebc7ae3 [ftmod_misdn] Handle MPH_INFORMATION_IND during channel activation.
Add MISDN_MSG_DATA() helper macro for easy access to mISDN message
payload.

Add forward declaration of misdn_handle_mph_information_ind() and use
it in misdn_activate_channel().

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-02-07 18:39:11 +01:00
Stefan Knoblich
9e0928a7ea [ftmod_misdn] Undefine MISDN_CONTROL_TYPE helper macro after use.
No reason to keep it around for longer.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-02-07 18:39:11 +01:00
Stefan Knoblich
b6ec127194 [ftmod_misdn] Extend misdn_event_types[] and use a helper macro.
Add missing mISDN event/message types (e.g. MPH_INFORMATION_IND)
and use a helper macro (MISDN_EVENT_TYPE) to define the entries,
like we already do for misdn_control_types[].

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-02-07 18:39:11 +01:00
Steve Underwood
8b3dd5cc1c Fixed issue where junk T.38 received after a FAX exchange is totally completed
s not simply ignored.
2012-02-04 20:33:06 +08:00
Anthony Minessale
1015883e1b commenting this out completely until a better solution is implemented. also FYI you should be refreshing .update on each commit that changes the lib or any of its mods to force a rebuild from the top level 2012-02-03 15:23:46 -06:00