Commit Graph

2577 Commits

Author SHA1 Message Date
root cde7e0408a Merge branch 'nsg-4.3' of ssh://git.sangoma.com/smg_freeswitch into nsg-4.3 2012-07-25 21:16:52 -04:00
Mathieu Rene f85347cf72 add logging before uuid_bridge, set frame->codec from tech_pvt->read_codec 2012-07-25 21:16:46 -04:00
root a0d984c9c6 Merge branch 'nsg-4.3' of ssh://git.sangoma.com/smg_freeswitch into nsg-4.3 2012-07-25 21:16:23 -04:00
Mathieu Rene 4d3038c9e4 add logging before uuid_bridge, set frame->codec from tech_pvt->read_codec 2012-07-25 21:16:14 -04:00
root 6b774cf35a Merge branch 'nsg-4.3' of ssh://git.sangoma.com/smg_freeswitch into nsg-4.3 2012-07-25 21:07:02 -04:00
Mathieu Rene 0494df1ac4 give the tdm channels their caller profile so switch_ivr_uuid_bridge doesn't piss its pants off 2012-07-25 21:06:47 -04:00
root 7fdfd70e26 Merge branch 'nsg-4.3' of ssh://git.sangoma.com/smg_freeswitch into nsg-4.3 2012-07-25 20:50:42 -04:00
Mathieu Rene f7e94c45d3 Merge branch 'nsg-4.3' of git.sangoma.com:smg_freeswitch into nsg-4.3 2012-07-25 20:50:37 -04:00
Mathieu Rene c6fecc1ee8 go in consume media right away 2012-07-25 20:50:18 -04:00
Mathieu Rene ae84538819 mark tdm channel as answered immediately 2012-07-25 20:49:33 -04:00
root c92c727fee Merge branch 'nsg-4.3' of ssh://git.sangoma.com/smg_freeswitch into nsg-4.3 2012-07-25 20:45:42 -04:00
David Yat Sin 7972837f76 Merge branch 'nsg-4.3' of ssh://git.sangoma.com/smg_freeswitch into nsg-4.3 2012-07-25 20:41:16 -04:00
David Yat Sin 3c38278134 Added new channel type clear-channel for channels that do not have a signalling module 2012-07-25 20:41:01 -04:00
root 3de6b0d20c Merge branch 'nsg-4.3' of ssh://git.sangoma.com/smg_freeswitch into nsg-4.3 2012-07-25 20:04:48 -04:00
Mathieu Rene 706c662f4b fix crash on chan open failure 2012-07-25 20:04:35 -04:00
root aa40cc9acf Merge branch 'nsg-4.3' of ssh://git.sangoma.com/smg_freeswitch into nsg-4.3 2012-07-25 19:56:58 -04:00
Mathieu Rene 5284f5d134 missing goto fail 2012-07-25 19:56:25 -04:00
root 63b2654b54 commit -- fix stash pop err 2012-07-25 19:47:41 -04:00
Mathieu Rene 4950c32dd5 properly git rid of span_id 2012-07-25 19:37:47 -04:00
Mathieu Rene 87569c0ba9 properly git rid of span_id 2012-07-25 19:37:16 -04: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
Mathieu Rene 898a183a0e missing crtp init in mod_freetdm.c -- start implementing media modify 2012-07-25 18:57:32 -04:00
Mathieu Rene 6cf298a746 use span name instead of id. implement termination choose for tdm. 2012-07-25 17:18:18 -04:00
David Yat Sin 8b0fbe605c Merge branch 'releases.3.5' of ssh://git.sangoma.com/smg_freeswitch into nsg-4.3
Conflicts:
	.gitignore
	conf/insideout/autoload_configs/modules.conf.xml
	conf/vanilla/autoload_configs/modules.conf.xml
	src/mod/endpoints/mod_sofia/mod_sofia.h
	src/switch_rtp.c
2012-07-25 11:15:18 -04:00
Stefan Knoblich 7a93ae2d95 FreeTDM: Add ftdm_offset_of() and ftdm_container_of() macros.
Might as well import these too...

ftdm_offset_of() - Get offset of member in structure.

ftdm_container_of() - Get pointer to enclosing structure from pointer to structure member.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-25 16:10:35 +02:00
Stefan Knoblich fb57605df7 ftmod_misdn: Drop custom MIN(),MAX(),CLAMP() macros and use the common ones.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-25 16:08:51 +02:00
Stefan Knoblich c3d13d5e00 ftmod_libpri: Drop custom MIN() macro and use common ftdm_min()
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-25 16:07:39 +02:00
Stefan Knoblich e71bacb2f5 FreeTDM: Add convenience macros ftdm_min(), ftdm_max() and ftdm_clamp().
ftdm_min(x,y) - Returns the smaller of the two values x and y.

ftdm_max(x,y) - Returns the larger of the two values x and y.

ftdm_clamp(val, min, max) - Returns value that is in the range [vmin,vmax].

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-25 14:03:22 +02:00
Stefan Knoblich 7d0dcb6175 ftmod_misdn: Rework mISDN channel de-/activation.
Remove the 'state' variable of per-channel data, use active flag exclusively to track
open/close state.

Add misdn_activate_channel()/misdn_deactivate_channel() helper functions, rename old
one to _misdn_toggle_channel() (internal).

Add _nowait variant of channel de-/activation function, that just sends the mISDN request message.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-25 14:03:22 +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
Mathieu Rene 909d464abd add/sub done but untested, mod remains. this commit also adds a message handler inside the rtp endpoint so it can properly flush streams, setup jitter buffering, and honor uuid_debug_audio requests 2012-07-19 17:51:25 -04:00
Moises Silva c55ac6c900 freetdm: OPENZAP-187 --resolve Add ability to set called party subaddress 2012-07-19 16:58:25 -04:00
Stefan Knoblich 0e51786a88 FreeTDM: Add ftmod_analog(_em) and ftmod_zt to summary screen (always built).
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-19 20:42:17 +02:00
Stefan Knoblich 890da63554 ftmod_skel: Add -shared libtool flag.
Do not build static versions of modules.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-19 20:42:17 +02:00
Stefan Knoblich 67442974b2 ftmod_libpri: Fix type-punned pointer warning in msn_filter_foreach().
cc1: warnings being treated as errors
./src/ftmod/ftmod_libpri/ftmod_libpri.c: In function 'msn_filter_foreach':
./src/ftmod/ftmod_libpri/ftmod_libpri.c:422: warning: dereferencing type-punned pointer will break strict-aliasing rules
make: *** [ftmod_libpri_la-ftmod_libpri.lo] Error 1

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-18 21:57:52 +02:00
Jeff Lenk 682fb58bd5 OPENZAP-186 --resolve 2012-07-18 08:16:35 -05:00
Stefan Knoblich de4bf23d59 ftmod_pritap: Fix format string errors.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-12 20:07:18 +02:00
Stefan Knoblich 391d498cbe ftmod_r2: Fix format string errors.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-12 20:07:18 +02:00
Stefan Knoblich 03a219772c ftmod_gsm: Fix format string errors.
Two fixes:

	Use ftdm_set_string() instead of sprintf() (seriously, wtf?).

	Drop invalid, needless argument to ftdm_log().

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-12 12:41:23 +02:00
Stefan Knoblich ba1c27fec7 ftmod_sangoma_ss7: Fix format string errors.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-12 03:20:47 +02:00
Stefan Knoblich da4b28c115 FreeTDM: Cast flag to uint64_t and use FTDM_UINT64_FMT to silence format string warning.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-12 03:18:52 +02:00
Stefan Knoblich 6aebfe6a60 ftmod_wanpipe: Fix "initialization from incompatible pointer type" warning.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-12 03:02:16 +02:00
Stefan Knoblich ee2a5a33f3 FreeTDM: Fix format string errors in ftmod_analog, ftmod_wanpipe and ftmod_sangoma_isdn.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-12 03:01:20 +02:00
Stefan Knoblich 90d299cd7a FreeTDM: Add dumy "%s" format string to ftdm_assert() and ftdm_assert_return() to silence format string warnings.
Neither of them accepts extra arguments and ftmod_sangoma_isdn is calling
ftmod_assert() with a char * msg argument.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-12 02:37:55 +02:00
Stefan Knoblich f384e247fc FreeTDM: Add gcc printf()-style format string checks to ftdm_log(), also add FTDM_(U)INT64_FMT and FTDM_TIME_FMT constants.
The format string checks already caught a couple crash-worthy bugs and this
commit fixes a couple more.

Also includes __ftdm_check_scanf(), for completeness (currently unused).

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-11 22:44:08 +02:00
Stefan Knoblich 90cdc718ec FreeTDM: Whitespace fixes for load_config().
Get rid of those annoying green trailing whitespace and empty lines
with whitespace.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-11 20:41:55 +02:00
Stefan Knoblich fdf86c0c51 FreeTDM: Make cfg_name[] const in load_config().
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-11 20:40:59 +02:00
Stefan Knoblich ab285ace3d FreeTDM: Improve error checking and logging in load_config(), add FTDM_SPAN_IS_DIGITAL() helper.
Output the current trunk_type in "add X-channel vs. trunk_type" error messages and
check this for B-/D-channels too.

ISDN (= digital) spans need to have a trunk_type set before adding channels,
bail out early with an error message (actually two) if this is not the case.

(Adding channels should really be moved out of the parsing loop, to catch
 certain types of errors easier.)

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-11 20:32:34 +02:00
Stefan Knoblich 7a12804577 FreeTDM: Add trunk mode (NET/CPE) to span configuration in freetdm.conf and use it in ftmod_misdn and ftmod_libpri.
Some I/O implementations (e.g. mISDN) need this information to correctly
set up the port configuration. In FreeTDM, the mode of a span has been.
up until now, a part of the signalling module configuration ("node" or "mode"
for libpri and isdn spans), which is parsed _after_ the I/O part of a span
has been initialized. This limitation currently prevents us from using mISDN
in NT mode.

To work around this problem (without adding a lot of new tunk_type values like "E1_NET" etc.),
add a new "trunk_mode" parameter to the span categories in freetdm.conf, which by default
is "CPE" for all trunk types, except "FXS" (which defaults to "NET").

ftmod_misdn uses trunk_type + trunk_mode to correctly choose the d-channel protocol
for a port.

ftmod_libpri uses trunk_mode as a hint for the default "mode" setting.
(NOTE: It will print a warning if trunk_mode and signalling mode do not match.)

All other modules currently ignore the value of trunk_mode.

Example freetdm.conf snippet for a mISDN span in NET/NT mode
(using a HFC-S USB dongle):

  [span misdn MBRI_1]
  trunk_type => BRI_PTMP
  trunk_mode => NET
  b-channel  => HFC-S_USB.1:1-2
  d-channel  => HFC-S_USB.1:3

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-11 19:15:35 +02:00
Stefan Knoblich 61cfafe6c2 FreeTDM: Move custom backtrace code into ftdm_backtrace_walk() and helper functions.
Portability fix for uClibc and other (linux) environments that lack execinfo.h.

ftdm_backtrace_walk() and related return FTDM_NOTIMPL and print a message
if backtraces are not available in the current environment.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-11 17:25:58 +02:00
Moises Silva c81e20475f freetdm: Try to be more foolproof when creating an iterator for an empty span
to avoid triggering asserts later
2012-07-06 18:43:03 -04:00
David Yat Sin f509b708a7 Freetdm: Fix for 64-bit check on Ubuntu 2012-07-06 15:23:37 -04:00
David Yat Sin 4ead147e10 chlog:Support for send-connect-ack parameter 2012-07-06 12:15:48 -04:00
Stefan Knoblich a5e1101302 ftmod_libpri: Add doxygen documentation for new MSN/DDI filter functions.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-06 11:08:34 +02:00
David Yat Sin 3ad41603d0 Merge branch 'releases.3.4' of ssh://git.sangoma.com/smg_freeswitch into releases.3.4 2012-07-04 17:52:37 -04:00
James Zhang 64f33c25da ss7: fix on last fix, make enough memory for bad encode cases 2012-07-04 10:09:19 -04:00
James Zhang edd718d258 ss7: fix a wired crash on remind ticket 4972
- change dynamic memory allocation/deallocation to char array
2012-07-04 10:00:23 -04:00
David Yat Sin 24a458683a Skip filling locPtyNum if caller_data->loc.digits is NULL 2012-06-29 12:54:09 -04:00
James Zhang 80f72823b3 ss7: add ss7_iam_nature_connection_hex to support Nature of Connection
Indicator in IAM message.
     - ss7_iam_nature_connection_hex is the channel variable to carry
       HEX value from/to IAM message
     - X-FreeTDM-IAM-NATURE-CONN-HEX is the x-header string to carry
       HEX value from/to sip invite message
     - This IE is 8 bit hex, which turns into 2 chars
     - Only Satellite indicator, Continuity check indicator, and Echo
       control device indicator are supported. Spare value are not taken.
       Spare value is always set to all zero.
     - example:
       To set 00010101 (bit H-A), set X-FreeTDM-IAM-NATURE-CONN-HEX string
       value to 15 in the sip invite message to NSG.
       When NSG send out sip invite, if the incoming IAM message comes with
       Nature of Connection IE, NSG will put X-FreeTDM-IAM-NATURE-CONN-HEX
       in the invite x-header. For example, if the IE value is 00001010 in
       the IAM, NSG will send X-FreeTDM-IAM-NATURE-CONN-HEX with value string
       of "0A".
     - Two characters are madatory. "0A" must be specified rather than "A". If
       invalid format or characters are found, this x-header will be ommited.
     - Valid characters include 0-9, A-F, and a-f
2012-06-27 12:31:35 -04:00
Stefan Knoblich c92a55d3f1 ftmod_libpri: Add MSN/DDI filter for incoming calls.
This feature allows ftmod_libpri to ignore calls with non-matching destination number.

You may want to use this on BRI PTMP lines (Point-to-MultiPoint),
to avoid conflicts between your FreeSWITCH server and other devices connected to the line.

The filter is disabled by default (all calls will be accepted),
setting one (or more) "local-number" parameters on the span configuration enables it.

Example configuration snippet:

   <libpri_spans>
      <span name="example01">
         <!-- ... other span settings omitted ... -->
         <param name="local-number" value="123456"/>
         <param name="local-number" value="654321"/>
      </span>
   </libpri_spans>

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-06-26 21:53:20 +02:00
Stefan Knoblich 1ae88d51d0 ftmod_libpri: Move service_change_status_t down into #include guard area.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-06-26 21:53:20 +02:00
James Zhang 607da0f56c ss7: adding ss7_iam_fwd_ind_hex as x-header and channel variables in hex format.
Read the forward call indicator IE and print it into channel variable
     ss7_iam_fwd_ind_hex. If this variable exists, put it in the x-header.
     This implementation takes bits of A, CB, D, E, F, HG, I from the hex
     value. Bits of KJ, L, P-M are not taken and set to 0.
     The hex value is H-A-P-I, H is the highest bit to A, and next is P-I.
     I is the lowest bit in the whole field, and H is the highest bit in
     the whole field. Refer to Q.763 chapter 3.23.
2012-06-22 17:05:15 -04:00
Mathieu Rene 294ab3880f fix conflict 2012-06-21 10:40:57 -04:00
Mathieu Rene 79702bc0d2 start implementing command handlers 2012-06-20 21:34:04 -04:00
David Yat Sin b44bcd5763 Added core spanflag CLI command 2012-06-20 16:28:00 -04:00
David Yat Sin b980f47097 Merge branch 'nsg-4.3' of ssh://git.sangoma.com/smg_freeswitch into nsg-4.3 2012-06-20 13:21:22 -04:00
David Yat Sin 8da3d119ab Added display of M2UA signalling channels for CLI command show status 2012-06-20 13:20:35 -04:00
Mathieu Rene 1720e4f072 Merge branch 'nsg-4.3' of git.sangoma.com:smg_freeswitch into nsg-4.3 2012-06-20 12:31:07 -04:00
Mathieu Rene 43ffafcb4b wrong operand to sizeof 2012-06-20 12:30:37 -04:00
Mathieu Rene 166249b0b9 Check in TDM and RTP controllable channels (incomplete) 2012-06-20 12:30:08 -04:00
kapil 7b97ff470f adding "xmlshow m2ua <m2ua_interface_name> clusterstatus" CLI command. 2012-06-20 13:53:51 +05:30
kapil 2512694e43 removing warnings 2012-06-20 12:12:28 +05:30
David Yat Sin a54ec05fdb fix for compilation error on 64-bit 2012-06-20 02:06:31 -04:00
David Yat Sin 6aa8c9b80d freetdm: Improvements to ftdm core flag CLI command 2012-06-19 22:35:37 -04:00
David Yat Sin 0a9f34aa09 Fixed compile issues again on 32-bit 2012-06-18 15:27:45 -04:00
David Yat Sin 0cefb8d633 Fixed compile issues again on 32-bit 2012-06-18 15:01:08 -04:00
David Yat Sin 56c8534827 Fixed compile issues again on 32-bit 2012-06-18 14:34:12 -04:00
David Yat Sin 32106afc43 Fixed compile issues again on 32-bit 2012-06-18 12:51:38 -04:00
kapil 3b4c725b1c fixing cli issues 2012-06-18 17:41:05 +05:30
kapil 6b542763d9 Merge branch 'nsg-4.3' of ssh://git.sangoma.com/smg_freeswitch into nsg-4.3
Conflicts:
	libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_cli.c
2012-06-14 15:45:51 +05:30
kapil 69197b1d0c fixing cli issues 2012-06-14 15:40:57 +05:30
David Yat Sin 2112375e07 re-adjusted parameter names 2012-06-12 20:19:37 -04:00
David Yat Sin 143fb61bdb re-adjusted parameter names 2012-06-12 20:12:27 -04:00
David Yat Sin feaadd2f43 re-adjusted parameter names 2012-06-12 19:29:07 -04:00
David Yat Sin 055dc8bc4b re-adjusted parameter names 2012-06-12 19:15:14 -04:00
David Yat Sin 8880793174 Removed include for switch_utils.h 2012-06-12 18:47:53 -04:00
David Yat Sin ba17ae3f10 Fix for compile warnings 2012-06-12 18:32:58 -04:00
David Yat Sin bdaead271d Fix for compile warnings 2012-06-12 18:18:14 -04:00
David Yat Sin b22a4b566a Fix for some compile warnings 2012-06-12 18:07:42 -04:00
kapil 58dc659fbb adding code based on modified xml and cli code changes (rename the m2ua cli command to
"xmlshow" and adding cli code to show sctp state also in m2ua peerstatus command)
2012-06-12 18:43:01 +05:30
David Yat Sin 91f9374a9f Added code to treat sngss7_config section (same as sng_isup) 2012-06-11 13:23:37 -04:00
kapil 8102c1603c adding src/peer port into xml config 2012-06-11 18:45:56 +05:30
kapil 69bada7025 removign sctp/peer id from <m2ua_interface> config xml block 2012-06-11 12:43:08 +05:30
David Yat Sin 07a1093cf4 Fix for NFAS when one of the d-channels are down 2012-06-06 20:41:48 -04:00
kapil e4bd524b7d adding peerstatus and logging enable/disable CLI command 2012-06-05 21:33:13 +05:30
kapil 2b5875a258 adding M2UA/NIF CLI commands 2012-06-05 17:12:16 +05:30
kapil 117cbc1bf5 adding SCTP status CLI command 2012-06-04 22:52:26 +05:30
David Yat Sin eb0404d025 Merge remote branch 'fsorig/master' into releases.3.5
Conflicts:
	build/modules.conf.in
	libs/freetdm/mod_freetdm/mod_freetdm.c
2012-05-31 13:57:42 -04:00
David Yat Sin e05bd3fae8 Some changes to ss7 variables to be more consistent 2012-05-30 13:10:04 -04:00
kapil a3995ad16e Merge branch 'nsg-4.3' of ssh://git.sangoma.com/smg_freeswitch into nsg-4.3 2012-05-30 20:22:08 +05:30
kapil f1f78a8653 adding m2ua stack free code while unloading freetdm module 2012-05-30 20:20:58 +05:30
Kapil 889a0be2b3 issue fix 2012-05-30 16:41:31 +05:30
kapil 69501d091c adding M2UA configuration/alarm handling code 2012-05-30 12:31:25 +05:30
kapil d3c8429af9 Merge branch 'nsg-4.3' of ssh://git.sangoma.com/smg_freeswitch into nsg-4.3 2012-05-30 07:47:07 +05:30
kapil 076d9fbe67 M2UA xml configuration parsing code 2012-05-30 07:45:59 +05:30
Anthony Minessale 8bb55ed4bf abstract out originate_signal_bond to a function to avoid confustion and regressions 2012-05-29 13:10:15 -05:00
Kapil a941cad15d adding M2UA SG open endpoint request code 2012-05-29 15:06:25 +05:30
James 91dfa062bf ss7: adding iam_fwd_ind_HEX channel variable to set forward indicator
IE's heximal value.
     - add <action application="export" data="freetdm_iam_fwd_ind_HEX=2301"/>
       to dialplan with expected hex value. If the outgoing ftdm channel's
       forward indicator needs to be changed, "export" needs to be put in the
       incoming channel's dialplan to set this variable value accordingly.
     - this implementation takes bits of A, CB, D, E, F, HG, I from the hex
       value. Bits of KJ, L, P-M are not taken from the hex.
     - How to calculate hex value with wanted bits:
       . the hex value is H-A-P-I, H is the highest bit to A, and next is P-I.
         I is the lowest bit in the whole field, and H is the highest bit in
         the whole field. Refer to Q.763 chapter 3.23.
       . use a text pad to fill in the bits with 0 and 1. eventually fill all
         the 16 bits
       . copy the binary value into a calculator and convert it to hex
2012-05-28 17:07:52 -04:00
David Yat Sin e91e4d6816 renamed sip_h_X-FreeTDM-Access-Transport to sip_h_X-FreeTDM-Access-Transport-URLENC 2012-05-18 09:57:51 -04:00
kapil 4a99dc7fc7 added code to ftdm_sangoma_ss7_run api to avoid code execution for M2UA
SG
2012-05-18 12:24:27 +05:30
kapil 23ca7f8fed adding m2ua stack config/control code 2012-05-18 12:05:25 +05:30
James Zhang ce46a57b85 ss7: Adding support of Access Transport IE in IAM message
Adding sip x-header and channel variable to set the value
     of Access Transport IE
2012-05-17 17:56:50 -04:00
Jeff Lenk 4fbf8625ed OPENZAP-183 --resolve 2012-05-09 09:20:10 -05:00
Moises Silva 105ce9ff33 Fixes before merging sangoma repo with upstream 2012-05-07 16:26:48 -04:00
Moises Silva 1f08e2b0ec Merge remote branch 'fsorig/master' 2012-05-07 15:46:08 -04:00
Moises Silva f316f9307f freetdm: First GSM working version
- Manually merging latest code from gideon.gsm branch after review/inspection/modifications
2012-05-07 15:35:13 -04:00
Moises Silva cf9f937079 Merge branch 'master' into gsm.merge 2012-05-07 15:15:44 -04:00
Moises Silva cc79163da3 freetdm: refactor ftmod_gsm.c code to use proper core functions and interrupts to wait for io and state changes 2012-05-07 15:13:26 -04:00
Moises Silva de98034145 freetdm: - Extend ftdm interrupt object to notify which IO events are ready in the device
- Add definition of FTDM_MAX_SIG_PARAMETERS to have a standard limit for signaling module parameters
2012-05-07 15:13:26 -04:00
Moises Silva 06eee95da8 freetdm: update ftmod_gsm.c to match latest libwat changes 2012-05-07 15:13:26 -04:00
Gideon Sadan c268b388a7 freetdm: GSM - Finish adding status command + stabilizing 2012-05-07 15:13:21 -04:00
Gideon Sadan f891fefcb1 freetdm: GSM read and write initialization 2012-05-07 15:11:58 -04:00
Gideon Sadan 9cb67dd0c7 freetdm: initializing wat library interface 2012-05-07 15:11:01 -04:00
Moises Silva 412c808e0c freetdm: Added GSM module skeleton 2012-05-07 15:10:25 -04:00
David Yat Sin 67c43a0759 Initial commit 2012-05-04 18:42:59 -04:00
David Yat Sin 428340830b Fix for not handling T302 timeout in NET mode 2012-04-29 11:33:24 -04:00
David Yat Sin 5226489c39 Merge branch 'releases.3.4' into releases.3.5
Conflicts:
	libs/freetdm/mod_freetdm/mod_freetdm.c
	libs/freetdm/src/ftdm_state.c
	libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_handle.c
	libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c
	libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h
	libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_out.c
	libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c
2012-04-26 16:13:26 -04: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
Ken Rice c5554eb939 Copyright date update. 2012-04-18 11:52:02 -05:00
James Zhang 4f5a6557fc freetdm: fix queue full problem
- restore flushing queue when channel state goes to down
2012-04-18 10:52:01 -04:00
James Zhang e2f1b4ab27 freetdm: fix REL receiving leg always stay in TERMINATING stae in
native bridge mode
         - This is supposed to be included in commit of
           b324f86797. Somehow it's
           not included in that commit. Without this change, the
           REL receiving leg always stay in TERMINATING state when
           received an incoming REL message.
2012-04-16 13:48:35 -04:00
Stefan Knoblich 997550c511 ftmod_libpri: Check for required features in configure and remove old-style log callbacks
Non-PRI_NEW_SET_API logging callbacks were only available in libpri-1.0 and older,
which also lacks PRI_IO_FUNCS (required) and wouldn't work anyway.

Explicitly check for both PRI_* feature defines at configure time and reject libpri
versions that lack them.

Remove the non-PRI_NEW_SET_API logging callbacks in ftmod_libpri.c.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-04-14 01:39:25 +02:00
Stefan Knoblich 020724e103 ftmod_libpri: Improve libpri message logging.
Use the PRI_NEW_SET_API define provided by >=libpri-1.2 to distinguish
between old style and new style pri_set_error() and pri_set_message()
callback functions.

Improve message logging by using ftdm_log_chan() if per-span
data with a valid (d-)channel object is available.
NOTE: pri_get_userdata() returns NULL if pri is NULL.

This will reduce the horizontal space for libpri output a bit, but allows
us to see which span the message/error came from.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-04-14 01:13:22 +02:00
James cd2d67ace1 freetdm: fixed group block/unblock state dead lock when signal link
is down and recovered later
         To re-produce this bug:
             1. do CGB on one side
             2. unplug signaling link cable
             3. plug signaling link cable back
             4. do CGU on the blocking side
             5. cic state stay in RESTART for ever
         Fix this problem by sending cic to SUSPENDED state after
         receiving/sending CGU message
2012-04-13 17:26:48 -04:00
Brian West f263c0518e up this limit 2012-04-13 11:39:03 -05:00
James Zhang a796c6849c freetdm: fixed no ACM/CPG sending in some situations after native bridge
- clear up ACM_SENT & CPG_SENT flag in DOWN state in native
           bridge state machine
2012-04-13 11:18:53 -04:00
Stefan Knoblich 5f38a7f857 ftmod_misdn: Remove unused timerfd code.
Timer-based b-channel tx gating won't work anyway, so remove all those
"#if 0"-ed bits of cruft.

Also remove the mISDN-specific timerfd_create() check in configure.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-04-12 13:08:57 +02:00
James Zhang 8d1c382632 freetdm: INR/INF implementation
- fill in IEs in INF according to INR request
         - print debug information if IE requested but not supported
2012-04-11 15:14:29 -04:00
James Zhang 16d4f1f063 freetdm: INR/INF implementation
- When NSG receives INR from network, send back INF with calling
         party category information IE and calling number information IE.
         - Introduced a new global setting of "force-inr" for testing
         purpose. Stinga generated INR/INF packets are not acceptable by
         trillium stack since it misses call related information in the
         packets. If configure force-inr to true in freetdm.conf.xml, when
         NSG receives an incoming IAM, it'll send out INR packet regardless
         of incoming IAM's IEs, and keep waiting for INF response from the
         calling side.
         - T.39 timer is introduced in order to handle INR timeout. The
         default value of T.39 is 12 seconds and is configurable according
         to spec.
         - Only supports calling number IE and calling party category IE in
         current fix. The customer only needs the calling number IE right now.
         In ISUP spec, there are 6 optional IEs. NSG only supports calling
         party number and calling category information IE since the other
         IEs are not configurable in freetdm.conf.xml or included in IAM
         message.
         - In collect state, INR/INF implementation needs to work with existed
         SAM messages. If NSG sent out INR and wait for SAM, collect state
         check both INF received and enough dialed numbers received. If one
         of these conditions are not met, it'll stay in collect state and wait
         until either conditions met or timeout. After received INF and enough
         dailed number, state moves to dailing and proceed as regular calls.
2012-04-11 11:20:32 -04:00
David Yat Sin e3369119e0 Merge branch 'master' into releases.3.5 2012-04-03 18:16:36 -04:00
David Yat Sin 27e4cdb4dd Merge branch 'fsorig'
Conflicts:
	libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_cfg.c
	libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_hndl.c
2012-04-03 18:08:49 -04:00
David Yat Sin be4512be03 FreeTDM - ISDN fix for BRI lines with Q.921 layer going idle 2012-04-03 16:48:14 -04:00
James Zhang 339c45b2cb freetdm: Add documentation for SS7 native bridge 2012-04-03 11:27:25 -04:00
James Zhang b324f86797 freetdm: Clean up SS7 native bridge code to separate the call control, queuing and
resource-cleanup responsibilities clearly between the 2 channels involved in the bridge

   - Each channel is responsible for clearning its own peer_data and event queue
     at the end of the call (when moving to DOWN state)

   - Each channel dequeues messages only from its own queue and enqueues messages
     in the peer's queue, with the only exception being messages received before
     the bridge is stablished (IAM for sure and possible SAM messages) because
     if the bridge is not yet stablished the messages must be queued by the channel
     in its own queue temporarily until the bridge is ready

   - When the bridge is ready it is the responsibility of the incoming channel to
     move the messages that stored temporarily in its own queue to the bridged peer queue

   - During hangup, each channel is responsible for moving itself to DOWN. The procedure
     however differs slightly depending on the hangup conditions

     If the user requests hangup (ie, FreeSWITCH) the request will be noted by setting the
     FTDM_CHANNEL_USER_HANGUP flag but will not be processed yet because call control is
     driven only by the link messages (so no hangup from ESL or command line allowed)

     When REL message comes, the channel receiving it must move to TERMINATING state and:

           - If the user has not hangup yet (FTDM_CHANNEL_USER_HANGUP flag not set) then
             notify the user via SIGEVENT_STOP and wait for the user to move to HANGUP
             state by calling ftdm_channel_call_hangup() before sending RLC

           - If the user did hangup already (FTDM_CHANNEL_USER_HANGUP flag is set) then
             skip user notification and move to HANGUP state directly where the RLC message
             will be sent

   - On HANGUP state the RLC is sent and the channel is moved to DOWN, final state
     The peer channel will forward the REL message and wait for RLC from the network, when
     RLC is received the channel can move straight to DOWN itself because the peer channel
     is completing its own shutdown procedure when it received the REL message
2012-04-03 11:23:49 -04:00
David Yat Sin d730df77e4 Merge branch 'master' of ssh://git.freeswitch.org:222/freeswitch 2012-04-02 18:00:38 -04:00
David Yat Sin 38143e3035 freetdm - ISDN added check to treat calling number 0000000000 as empty calling number 2012-04-02 18:00:27 -04:00
Anthony Minessale 647740e9a4 cleanup after yourself 2012-04-02 16:20:40 -05:00
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
James Zhang 8a589435de freetdm: Adding condition to parse sip headers only for non-freetdm channels.
This fixes an issue where ss7 native bridge was accidentally enabled
         any time two freetdm channels were bridged regardless of the freetdm_native_sigbridge
         variable value.
2012-03-30 16:50:00 -04: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
James Zhang a2db3c24b3 freetdm: fixing more potential null pointers in native bridge mode. 2012-03-27 18:00:24 -04: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
James Zhang bfefbb5522 freetdm: fix isup timers default values 2012-03-21 10:12:59 -04:00
James Zhang 012bc154b0 Revert "freetdm: fixing default values for ISUP"
This reverts commit f1d80cd25d.
2012-03-21 10:00:27 -04:00
James Zhang fbc5322e65 freetdm: fixing wrong default timer values 2012-03-20 10:51:53 -04: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
James Zhang f1d80cd25d freetdm: fixing default values for ISUP 2012-03-16 16:09:54 -04:00
James Zhang 63a2c847eb freetdm: merge native bridge fix from releases.3.4
which solves the crash on outgoing calls after native bridge
2012-03-16 12:24:10 -04:00
James Zhang 10277be8d6 freetdm: synchronizing fixes in releases.3.5 version
- glare
         - cgb/cgu range bug
         - inhibit/uninhibit
2012-03-16 11:40:21 -04:00
James Zhang 46ddfc0ebb freetdm: fixing glare with different options 2012-03-16 11:19:01 -04:00
James Zhang 19f01bf50a freetdm: fixing a potential crash on a rarely happened situation 2012-03-15 18:05:47 -04:00
Moises Silva 3c4fdca9e0 freetdm: Fix redmine issue #2931 - Crash on SIP to SS7 call after sigbridge call
The code was improperly using peer_data as an indicator that the sigbridge
         ss7 mode was enabled. The channel flag FTDM_CHANNEL_NATIVE_SIGBRDIGE should
         be used instead
2012-03-07 19:04:31 -05:00
James Zhang eeec65265a freetdm: fixing format and loc_nadi value according to review board No. 98 2012-02-24 16:32:44 -05:00
James Zhang b5f69db10f freetdm: fixing printing in ftmod_sangoma_ss7_support.c functions 2012-02-24 16:21:21 -05:00
James Zhang 938fafb09e freetdm: fixing problem during review - review board number 98 2012-02-24 16:09:58 -05:00
James Zhang 6ed6fd2c1a freetdm: latest SPIROU fixes in releases.3.4 branch merged in releases.3.5 2012-02-24 15:43:23 -05:00
James Zhang 713b55cd58 freetdm: fixing improper log position in tx acm function 2012-02-16 18:33:00 -05:00
James Zhang 3f43b053a0 freetdm: adding x-ocn-* headers for incoming sip calls 2012-02-16 16:49:51 -05:00
Moises Silva 1f34c9301e freetdm: Remove optimistic sanity check, prints spurious error messages 2012-02-16 16:08:21 -05:00
James Zhang 4ccc26f08b freetdm: Fix improper logging statement when doing native ss7 bridge (peer_chan was set to the SIP leg) 2012-02-16 15:15:22 -05:00
James Zhang 8c8d649221 freetdm: Add support to set/receive location and original call number SS7 elements through variables (including SIP X headers) 2012-02-16 15:14:06 -05:00
Moises Silva a6e868f588 freetdm: Fix spirou certification native bridge issue
- The outgoing tdm leg should not move to UP until
           after the IAM is sent at the end of the function
         - The UP state should be processed immediately otherwise
           the state processor is not run due to the way the main
           ss7 processing loop currently works
2012-02-16 14:49:18 -05: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
James Zhang a46c03ef65 freetdm: fixing glare
- adding configuration of glare handling rule
         - fixed cic status remains COLLECTING
2012-02-10 17:29:28 -05: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
James Zhang 7b3a3d86b9 freetdm: fixed cgu/cgb commands wrongly setting cic status when
the range covers one or more signaling links
2012-02-09 14:32:08 -05:00
James Zhang b78b612b47 freetdm: fixing cgu with signaling link in unblock range 2012-02-09 14:11:21 -05:00
James Zhang 024a043e2c freetdm: initial fix to rx cgb 2012-02-09 14:04:45 -05:00
James Zhang b0ee65b45a freetdm: adding new commands and removing unused ones
- ftdm ss7 show
         - ftdm ss7 show span X
         - ftdm ss7 show status linkset X
         - ftdm ss7 inhibit X
         - ftdm ss7 uninhibit X
2012-02-09 11:15:48 -05: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