Commit Graph

105 Commits

Author SHA1 Message Date
Stefan Knoblich 2ac7a9de4f ftmod_libpri: Set default config values, just in case the user forgot to set some parameters in freetdm.conf.xml.
This fixes the "[ERR] ftmod_libpri.c:128 Don't know how to SABME on a type 0 node" messages
from libpri, when there's no "node"/"mode" parameter set for the span.

NOTE: Now defaulting to CPE mode; EuroISDN on BRI/E1 and 4ESS on J1/T1 lines,
      make sure you set dialect/switchtype!

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2011-05-10 19:53:58 +02:00
Stefan Knoblich ccce356392 ftmod_libpri: Rewrite parts of hangup handling to fix hanging calls problem.
Let's hope this fixes it for good and doesn't introduce new problems.

Tested-by: SparFux (#freetdm @ irc.freenode.net)
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2011-05-03 13:44:21 +02:00
Markus Mueller 6196a4199e ftmod_libpri: Possible fix for call tear-down problems (+ locking cleanup)
Remove pri_destroycall() in on_hangup() and
use pri_hangup() instead of the deprecated pri_release().

NOTE: The original patch used PRI_CAUSE_NORMAL_CIRCUIT_CONGESTION for the cause
      code, which (without pri_enable_hangup_fix() enabled) emits a RELEASE COMPLETE
      message. This version of the patch uses PRI_CAUSE_NORMAL_CLEARING (-1). (stkn)

Additionally, use ftdm_set_state() instead of ftdm_set_state_locked() because the channel
is already locked. (stkn)

Completely-untested-by: Stefan Knoblich <stkn@openisdn.net>
2011-04-30 18:16:46 +02:00
Stefan Knoblich 360ed43a04 ftmod_libpri: ignore missing call_data in on_hangup() and use the call handle passed in the pevent structure (still needs more love...)
Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2011-04-29 01:59:24 +02:00
Stefan Knoblich 1a54968d99 ftmod_libpri: go to PROGRESS_MEDIA in on_ringing() if there is inband information available and rework channel opening to not skip state changes when the channel is already open.
The latter part affects on_ringing(), on_progress() and on_proceeding().

Somewhat experimental and untested (apart from a compile run).

Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2011-03-10 18:25:43 +01: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
Stefan Knoblich dff01c07f1 [ftmod_libpri] Use FTDM_SPAN_USE_PROCEED_STATE and rework state handling.
- Use the newly introduced FTDM_SPAN_USE_PROCEED_STATE flag and FTDM_CHANNEL_STATE_PROCEED.

- Update ftmod_libpri's state machine table (taken from ftmod_sangoma_isdn).

- Move pri_destroycall() to HANGUP_COMPLETE state.

- Try to get a little bit closer to the ISDN states by using pri_acknowledge() in RINGING,
  pri_progress() in PROGRESS and pri_proceeding() in PROCEED state.

- Go to PROGRESS_MEDIA in on_progress() only if there is inband indication available, go to
  PROGRESS if not.

- Go to RINGING state in on_ringing() and remove PROGRESS_MEDIA check.

NOTE: One libpri error message and a VETO (PROGRESS -> RINGING) warning to investigate,
      but changes seem to work fine nonetheless.

Tested-by: SparFux (#freeswitch / #freeswitch-de  @ irc.freenode.net)
Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2011-01-13 23:28:00 +01:00
Moises Silva fe0d8d1ec5 freetdm: - updated all signaling modules (except for ftmod_isdn and ftmod_sangoma_ss7) to adapt to new core state processing
- fixed bug in configure.ac to detect ftmod_pritap compilation
         - ignore FTDM_SIGEVENT_RELEASED and FTDM_SIGEVENT_INDICATION_COMPLETED in mod_freetdm
         - Destroy the state completed interrupt on channel destroy
         - Fix analog polarity reversal bug when using 3-way calling or call-swap
2010-12-31 13:44:20 -05:00
Moises Silva dd4bad220c freetdm: ftmod_libpri - update to use proper structure member for signaling status change notifications 2010-12-19 12:55:55 -05:00
Stefan Knoblich 6066993d21 ftmod_libpri: remove ftdm_channel_done(), only use ftdm_channel_close().
Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-12-18 02:24:28 +01:00
Moises Silva 15b5170b14 freetdm: ftmod_libpri - add support for RINGING state 2010-11-30 16:42:58 -05:00
Moises Silva ffbded67fd freetdm: ftmod_libpri - lock the channel in libpri on_ring callback
this should fix potential call_data pointer corruption
2010-11-25 12:53:51 -05:00
Moises Silva a697462a58 freetdm: ftmod_libpri - Do not unlock the channel until all states pending
have been cleared. This should fix issues with
                        state transitions being ignored.
2010-11-24 12:30:58 -05:00
Stefan Knoblich a9b2ced2aa ftmod_libpri: First part of the BRI PTMP channel handling changes.
I really need to dig deeper here, some libpri events never fire for
incoming calls and i'll have to find out how mod_freetdm or the
FreeSWITCH core change states on the channel...

Anyway, incoming and outgoing calls still work for me (BRI PTMP TE),
so commit this now and let a wider audience do some more testing.

Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
Tested-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-16 23:01:21 +01: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 e98b4a6b8d ftmod_libpri: Set RDNIS
Signed-off-by: lakshmanan ganapathy <lakindia89@gmail.com>
Reviewed-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-15 11:38:45 +01:00
Stefan Knoblich 96b0ef9ce9 ftmod_libpri: Use ftdm_array_len(), remove custom ARRAY_SIZE macro.
Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-14 17:48:53 +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 1e777c2ce9 ftmod_libpri: While we're at it, drop the cast too
Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-11 22:21:18 +01:00
Stefan Knoblich e0961aee3a ftmod_libpri: Dereference facility event correctly, add debug message.
Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-11 22:19:32 +01:00
Stefan Knoblich a2e16ce83c ftmod_libpri: Minor cleanups in ftdm_libpri_configure_span().
Move some things around and remove 'paramindex' var (just use 'i' for that too).

Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-11 00:16:25 +01:00
Stefan Knoblich 9ff4cfd569 ftmod_libpri: "ftdm libpri debug <span>" now prints the current debug flags
Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-11 00:06:06 +01:00
Stefan Knoblich 1074f006a0 ftmod_libpri: Clean up misnamed parameters and variables, remove unused.
- Add alias names for parameters:
     "node"   -> "mode"
     "dp"     -> "ton"
     "switch" -> "dialect"
     "l1"     -> "layer1"

  (Switching between ftmod_libpri and ftmod_isdn is easier now.)

- Removed unused members from struct ftdm_libpri_data
  and rename misnamed ones

Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-10 22:42:18 +01:00
Stefan Knoblich 3df1476a6d ftmod_libpri: Major cleanup, enhance configuration checks
- Check D and B-channel availability (could be extended to check B-channel count)

- Drop usage of spri->private_info, use spri->span instead
- Use accessor functions where possible
- Rename ftdmchan to chan where possible
- Various other cleanups

Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
Tested-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-10 21:32:32 +01:00
Stefan Knoblich 180feff1f4 ftmod_libpri: Completely disable on_facility if AOC support is not available in libpri (= is too old).
Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-10 01:28:30 +01:00
Stefan Knoblich cc8d790cfd Merge branch 'master' of ssh://git.freeswitch.org/freeswitch 2010-11-10 00:48:59 +01:00
Stefan Knoblich b1cf0d9a15 ftmod_libpri: Check if a span really has a D-Channel.
Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-10 00:47:16 +01: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 ff7a617098 ftmod_libpri: Bail out with an error message if libpri is too old and selected trunk type is BRI or BRI_PTMP
Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-09 15:51:30 +01:00
Stefan Knoblich 0a0e79e1fe ftmod_libpri: clarify why we enable facility conditionally
Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-08 00:57:50 +01:00
Stefan Knoblich b7d9265562 ftmod_libpri: First attempt at getting AOC Facility messages going (and minor cleanups)
Requires libpri-1.4.12_beta1 or newer!
Completely untested, AOC-S/D/E ChargingRequest operations are sent to NT (DTAG BRI PTMP),
but rejected with "Unrecognized Operation".

NOTE: FreeTDM core needs support for this to be useful!
      Only AOC-E events are decoded and sent to the log.

To enable:
    Set (or add) <param name="opts" value="aoc"> in your
    libpri_spans span config.

Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-08 00:43:09 +01:00
Stefan Knoblich 428d05349a ftmod_libpri: Write fatal error message during span configuration to console (and to span error log).
Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-07 19:55:00 +01:00
Stefan Knoblich 81515b7bd8 ftmod_libpri: Improve "ftdm libpri debug" usage information.
"all" and "none" can only be used alone,
other flags are additive.

Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-07 17:22:22 +01:00
Stefan Knoblich 78eff1d821 freetdm: convert ftmod_libpri (+ libpri_spans) to use new ftdm_configure_span_signaling() interface.
This fixes several issues with parameter handling (e.g. default alaw/ulaw selection being totally useless).

Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-07 17:00:54 +01:00
Stefan Knoblich 6e217401d9 ftmod_libpri: Rework debug flag handling, make BRI/BRI PTMP default to alaw too (does not work yet)
Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-07 15:48:39 +01:00
Stefan Knoblich b9391cffc2 ftmod_libpri: Fix reversed PTP/PTMP mode parameter 2010-11-06 18:28:37 +01:00
Stefan Knoblich 30fb69bbab ftmod_libpri: temporary segfault fix if libpri does not have BRI support 2010-11-06 17:58:41 +01:00
Stefan Knoblich 3d5ccf055d ftmod_libpri: Initial support for BRI and various cleanups + double locking fix
Fixes:
- Fix double locking in check_state(): remove ftdm_mutex_(un)lock calls.

New:
- Add lpwrap_init_bri() to initialize libpri in BRI mode
- Use trunk type to determine PRI/BRI and PTP/PTMP mode (no additional configuration required).
- Improve libpri detection code in configure.ac, check whether libpri is usable
  and if BRI support is available (needs more work)

Cleanups:
- Whitespace and indentation cleanups
- Rename str2* functions to parse_*
- Simplify libpri_configure_span() option parsing and bail out on error
- Add "ftdm libpri help" command that displays usage information
- Coding style cleanups and other (minor) changes

Known issues:
- BRI PTMP TE Q.921 link does not go beyond TEI ASSIGNED state,
  SABME requests are ignored by NT (EuroISDN DTAG, DAHDI-2.3.0.1, vzaphfc)

Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
2010-11-06 16:08:07 +01:00
Arnaldo Pereira 039e4297ac Merge branch 'master' into ftmod_r2 2010-11-01 23:11:42 -02:00
Moises Silva d427b3df77 freetdm: allow libpri transition from terminating to hangup 2010-10-05 13:59:31 -04:00
Moises Silva c9ab6f3355 freetdm: libpri update 2010-10-05 13:14:03 -04:00
Moises Silva b96f854803 freetdm: fix libpri mod 2010-09-30 11:12:43 -04:00
Marc Olivier Chouinard 00207cede3 freetdm: Initial fix attempt for libpri. It will now load and work. More testing will be required, I got the feeling some event will clean a channel / span of it value when there is timer still active. 2010-09-30 02:37:57 -04: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 de2a4ea100 freetdm: fix dchan libpri 2010-04-28 18:17:50 -04:00
Moises Silva d4f93843a1 fix flags 2010-04-28 18:17:49 -04:00
David Yat Sin 318866b7f9 freetdm: Added signalling status report
Fix for ftmod_libpri not reporting proper physical and protocol alarms on init
2010-04-27 14:32:36 -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 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