Commit Graph

40 Commits

Author SHA1 Message Date
Ken Rice 6e7d5d0897 update copyright header for 2014 2014-02-12 12:08:56 -06:00
Nathan Neulinger 32adc789f6 make noexpandtab explicit in all vim modelines other than xml files 2013-06-25 11:50:17 -05:00
Stefan Knoblich 2ad2b6d31b ftmod_isdn: Avoid stack smashing buffer overflow in isdn_tones_run().
The len variable can, in certain situations (large burst of incoming non-SLIN audio),
exceed the size of the on-stack frame buffer, which causes ftdm_buffer_read_loop() to
overwrite the dt_buffer pointer.

Use ftdm_min() to make sure len (after conversion to SLIN units) isn't larger
than the frame buffer size.

Also adds are couple more code comments.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-08-10 17:16:05 +02:00
Stefan Knoblich 964d14c012 ftmod_isdn: Fix channel state handling in NT mode w/ early disconnect.
In this particular case: NO_ROUTE_DESTINATION caused by missing context.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-08-07 17:22:17 +02:00
Stefan Knoblich ac0eec9de4 ftmod_isdn: Fix set-but-unused warning.
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>
2012-08-03 12:33:40 +02:00
Stefan Knoblich 5ebc68fb51 ftmod_isdn: Fix per-channel teletone buffer offset wraparound.
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>
2012-07-26 09:14:51 +02:00
Stefan Knoblich 5367b96153 ftmod_isdn: Rework teletone buffer offset handling in isdn_tones_run().
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>
2012-07-26 01:21:47 +02:00
Stefan Knoblich 890ecc6d45 ftmod_isdn: Use span trunk_mode to select default mode and print warning if final modes do not match.
Same as ftmod_libpri.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-25 14:03:22 +02:00
Stefan Knoblich 200438d18f ftmod_isdn: Use ftmod_log_chan(_msg)() and ftdm_strlen_zero().
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-25 14:03:21 +02:00
Stefan Knoblich 9883035bec ftmod_isdn: OpenZAP -> FreeTDM API updates.
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>
2012-07-25 14:03:21 +02:00
Stefan Knoblich fc9ea9eab0 ftmod_isdn: Handle zero length read correctly.
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>
2012-07-24 00:07:41 +02:00
Stefan Knoblich 9c05387735 ftmod_isdn: Fix format string warning(/error).
Use %p for printing pointer address in hex.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-23 19:45:58 +02:00
Ken Rice 7a147e4762 Update a ton of copyright statements to make sure the dates are proper 2012-04-25 17:14:55 -05:00
Stefan Knoblich 3de9b51a86 ftmod_isdn: Fix warnings
No guarantee this module still works, but it compiles again.

Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2011-04-08 14:53:59 +02:00
David Yat Sin 49ac70defd freetdm: User variables now stored in ftdm_usrmsg_t 2011-02-25 09:58:15 -05:00
David Yat Sin 7b1da2316b freetdm: Updated signalling modules to not set channel state to DIALING on OUTGOING_CALL_FUNCTION 2011-02-18 13:21:05 -05:00
David Yat Sin ea2b477444 Freetdm:fix for ftdm_channel_close not always passed double-pointer 2010-12-15 12:56:49 -05:00
David Yat Sin 905fdcc248 freetdm: Support for channel restarts 2010-12-14 11:23:47 -05:00
Moises Silva f1789ed5a2 Merge remote branch 'fsorig/master' 2010-11-22 10:41:16 -05:00
Stefan Knoblich 9257e0f344 ftmod_isdn: Port(/Fix) span signal handling, remove some dead/unused pieces and close the D-Channel on shutdown.
This fixes a NULL-call segfault in ftdm_span_trigger_signal().

Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-16 23:01:21 +01:00
Moises Silva 6cfce6f43d freetdm: rename mod_data to io_data since is data meant for I/O modules only
fix ftmod_isdn usage of mod_data, it should be call_data pointer
2010-11-15 15:39:44 -05:00
Moises Silva f3e55a26ef Merge remote branch 'fsorig/master'
Conflicts:
	libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c
2010-11-15 14:00:49 -05:00
Stefan Knoblich ced7c9ae43 freetdm: Another round of parameter handling fixes (ftmod_{libpri,isdn,pritap})
ftmod_pritap: Abort before overflowing spanparameters array and initialize to all zero
ftmod_isdn:   Fix overflow check, skip over parameters without name or value, initialize spanparameters array to all zero.
ftmod_libpri: Skip over parameters without name or value, initialize spanparameters array to all zero and drop "i < 10" hardcoded check.

This should fix:
	2010-11-15 09:24:34.609515 [ERR] ftmod_libpri.c:1741 Unknown parameter '', aborting configuration
	2010-11-15 09:24:34.609515 [ERR] mod_freetdm.c:3080 Error configuring FreeTDM span BRI_1

Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
Reported-by: Ingmar Schraub <is@eseco.de>
2010-11-15 12:33:58 +01:00
Stefan Knoblich e17201bbac freetdm: Add ftdm_channel_get_state(), ftdm_channel_get_last_state() and ftdm_span_get_trunk_type_str().
Remove custom versions from ftmod_isdn and ftmod_libpri.

Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-14 17:48:09 +01:00
Stefan Knoblich b0cca151e6 ftmod_isdn: Major cleanup: use accessor functions, coding-style, etc.
Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-14 16:45:35 +01:00
Stefan Knoblich 47af9933c4 freetdm: convert ftmod_isdn to use (+ pri_spans) to use ftdm_configure_span_signaling() interface.
Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-14 15:44:50 +01:00
David Yat Sin c9db28c25f Merge branch 'master' of git.sangoma.com:smg_freeswitch 2010-11-09 16:54:24 -05:00
David Yat Sin a0b164c132 freetdm: ISDN - Fix for not waking up the line on power-saving lines 2010-11-09 16:34:34 -05:00
Moises Silva 8d66f38212 Merge branch 'master' of git://git.freeswitch.org/freeswitch
Conflicts:
	conf/autoload_configs/modules.conf.xml
	libs/freetdm/src/ftdm_sched.c
	libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c
2010-11-09 12:59:48 -05:00
Stefan Knoblich 3428bd3d43 ftmod_isdn: FreeTDM port, first steps
- Requires non-public development version of libisdn(!)
- Based on older patches from http://oss.axsentis.de/gitweb/?p=ftmod_isdn.git;a=summary
- Rework of ftmod_isdn related buildsystem parts (Makefile.am, configure.in and libpcap.m4)
2010-11-01 00:47:43 +01:00
Arnaldo Pereira f825d1b0ad merged threaded ftmod_r2.c with non-threaded version from moy and added support for receiving the events to wait for, on ftdm_span_poll_event(), which keeps its default behavior: POLLPRI if NULL is passed 2010-09-23 17:51:45 -03:00
Moises Silva 110bd5cdb1 freetdm: windows fixes 2010-04-29 10:53:03 -04:00
Moises Silva 428931bce2 Use the pendingchans queue only on request by signaling modules.
Remove suggest_chan_id member and add a span flag instead.
2010-04-05 16:01:08 -04:00
Moises Silva 66bc2e43c8 merged 1039:1053 openzap/trunk
git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@1054 a93c3328-9c30-0410-af19-c9cd2b2d52af
2010-03-10 20:06:31 +00:00
Moises Silva 0d392527dc merged 956:1023 (partial merge - anything non-boost related)
git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@1026 a93c3328-9c30-0410-af19-c9cd2b2d52af
2010-02-09 22:01:15 +00:00
Moises Silva 926f140754 replace use of ani in favor of dnis in caller_data structure for the destiny number in outgoing calls
git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@1017 a93c3328-9c30-0410-af19-c9cd2b2d52af
2010-02-01 21:40:01 +00:00
Moises Silva a8ddece1b6 more freetdm changes
git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@974 a93c3328-9c30-0410-af19-c9cd2b2d52af
2010-01-15 20:35:11 +00:00
Moises Silva a5bd5142da more freetdm renaming changes
git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@973 a93c3328-9c30-0410-af19-c9cd2b2d52af
2010-01-15 20:08:43 +00:00
Moises Silva 1b47133795 more naming changes
git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@971 a93c3328-9c30-0410-af19-c9cd2b2d52af
2010-01-15 19:56:54 +00:00
Moises Silva 900f1ed2ef Linux renaming from openzap to freetdm
git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@967 a93c3328-9c30-0410-af19-c9cd2b2d52af
2010-01-15 19:22:49 +00:00