Commit Graph

6360 Commits

Author SHA1 Message Date
Jeff Lenk 59e1d56cb5 spandsp windows build fix 2012-08-26 16:04: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
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
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
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
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
Kapil Gupta 917609df1b removing "raw_ftdm_chan_open" API as we have M2UA sig type 2012-08-23 10:59:21 -04:00
Steve Underwood fa5569caac A line got deleted somewhere along the line. I didn't do it, honest.
Its them damn gremlins.
2012-08-21 20:09:59 +08:00
Kapil Gupta 12e61692dd adding signaling FTDM_SIGTYPE_M2UA type 2012-08-17 19:05:12 -04:00
Jeff Lenk bdb73beb8e FS-4526 --resolve 2012-08-17 19:46:54 -05:00
Jeff Lenk 0807b39c8d FS-4543 --resolve thanks Peter 2012-08-17 19:31:47 -05:00
Steve Underwood e399c69765 Fixed a typo in the fixed point image translate code 2012-08-17 18:36:29 +08:00
Moises Silva f3160f9ecf freetdm: ss7 - Fix bug where TDM alarms are not delivered when the span is in M2UA mode 2012-08-16 19:08:34 -04:00
kapil 106e17f7a2 Merge branch 'nsg-4.3' of ssh://git.sangoma.com/smg_freeswitch into nsg-4.3 2012-08-16 16:43:00 -04:00
kapil 583bd7a811 Added debugging to confirm echo_cancel event works 2012-08-16 16:42:17 -04:00
Anthony Minessale f454b79b9b fix color coding to be OS appropriate 2012-08-16 13:04:33 -05:00
Nenad Corbic a24706aed6 Changed EC ENABLE/DISABLE failure from ERROR to WARNING.
As some installations have no ec. I will have to test
without ec and confirm that we handle that case gracefully.
2012-08-16 02:06:10 -04:00
Mathieu Rene e07d588d10 turn on echo cancellation and turn it off in mg_notify 2012-08-16 01:29:43 -04:00
Mathieu Rene a7d51f5f4f turn on echo cancellation and turn it off in mg_notify 2012-08-16 01:28:32 -04:00
Robert Jongbloed cd21b67c1d Updated mod_opal to latest stable OPAL version.
Enhancements to trace logging, include threads and context ID.

Changed default opal_conf.xml to allow more than just G.711 uLaw and not to clutter log file with debug logs.

Added to opal_conf.xml item for "disable-transcoding".

Updated build/buildopal.sh to use correct ./configure items for PTLib, allow for something other than standard install directory for PTLib/OPAL and be able to easily bind to a specific release of PTLib/OPAL.
2012-08-16 14:23:48 +10:00
Anthony Minessale bb69310259 FS-4079 FS-4540 please update to this version 2012-08-15 22:51:41 -05:00
Kapil Gupta fd39c5b44a renaming CONFIG_ERROR macro to LOAD_ERROR 2012-08-15 16:11:13 -04:00
Kapil Gupta 4f8e843610 adding code to check return type of "ftdm_start_span" API 2012-08-15 14:26:09 -04:00
Stefan Knoblich 548222f9f3 FreeTDM: Add span start/stop callbacks to ftdm_io_interface.
Callbacks are invoked from ftdm_span_start/_stop().
I/O is started before SIG and shut down in reverse order.

This is needed for ftmod_misdn, to move the mISDN message handling
into a separate thread (solving the mISDN socket vs. FreeTDM API issues).

With these callbacks, the I/O thread can be started after the span I/O configuration
has been (successfully) completed and stopped before destroying the span.

NOTE: Both SIG and I/O callbacks are called with the span mutex locked,
so threads created or destroyed synchronously in either of the custom
start/stop functions, can not use ftdm_span_*() functions that lock
the span mutex (e.g. ftdm_span_get_channel_count()).

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-08-15 13:34:22 +02:00
Stefan Knoblich 431f7dd6bf spandsp: Fix libjpeg checks for --enable-builtin-tiff builds.
The --enable-builtin-tiff option appends libs/tiff-3.8.2/libtiff/libtiff.la
to LIBS, causing the AC_CHECK_LIB([jpeg]...) check to fail, because
libtiff.la does not exist at configure time.

Temporarily store tiff and jpeg libs in TIFF_-/JPEG_LIBS variables and
append them to LIBS after all library checks have run.

Example error output:
    configure:20049: checking for jpeg_start_compress in -ljpeg
    configure:20074: cc -o conftest -O2 -pipe -fno-strict-aliasing    -L/usr/local/lib conftest.c -ljpeg  -lm  /usr/home/ports/net/freeswitch-core-devel/work/freeswitch-1.2.1/libs/tiff-3.8.2/libtiff/libtiff.la >&5
    cc: /usr/home/ports/net/freeswitch-core-devel/work/freeswitch-1.2.1/libs/tiff-3.8.2/libtiff/libtiff.la: No such file or directory

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-08-15 12:52:28 +02:00
Mathieu Rene bd84a23f51 set tdm pre buffer len to 200ms by default, and set it to 0 before fax calls 2012-08-14 16:22:31 -04:00
Steve Underwood 0b763a6286 Merge branch 'master' of git.freeswitch.org:freeswitch 2012-08-14 22:33:17 +08:00
Steve Underwood e30406cea6 Improvements to image translation 2012-08-14 22:32:30 +08:00
Jeff Lenk 3d9d42b798 FS-4517 --resolve 2012-08-13 21:31:46 -05:00
Jeff Lenk a293512f60 FS-4219 --resolve 2012-08-13 21:30:10 -05:00
Anthony Minessale fa5113557b stub for mod_html5 2012-08-13 15:20:41 -05:00
Anthony Minessale 61ab0b8878 libwebsocket inline configure 2012-08-13 14:29:04 -05:00
Anthony Minessale a05e414c41 fix libwebsocket build 2012-08-13 14:15:06 -05:00
Steve Underwood 5f12c3dc1c Improvements to T.4 end of image handling, and the related tests.
A lot of tiny tidy up edits
2012-08-12 22:11:06 +08:00
Steve Underwood e69a5a3037 Various little tweaks
A bug in end of image handling fixed, which could mean some T.85 images would
screw up.
2012-08-11 18:32:00 +08: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 036063d2a9 mod_freetdm: Fix typo.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-08-10 17:16:05 +02:00
Jeff Lenk 659c06d356 FS-4219 -- resolve windows version string. thanks Peter 2012-08-10 07:47:10 -05:00
Jeff Lenk 6e8736bb06 FS-4504 vs2008 pro still need express 2012-08-09 13:42:21 -05:00
Steve Underwood d3c89bae34 Fixed a misplaced #endif that only causes trouble when you hit the right
combination
2012-08-09 22:19:49 +08:00
Steve Underwood d1b45ae65b A couple of typos in spandsp
Improvements to image flattening in spandsp's image translate code
2012-08-09 21:58:22 +08:00
Jeff Lenk 3389f32363 FS-4504 - tweak 2012-08-08 21:29:06 -05:00
Jeff Lenk e9ce6ae0e9 FS-4504 vs2010 only - plus mod_sofia fix - anybody want to help with 2008 2012-08-08 21:18:06 -05:00
Michael Jerris 6fa2fd3678 add ws 2012-08-08 17:05:01 -05:00
Moises Silva 16692837c1 freetdm: Process OOB events even in M2UA mode 2012-08-08 09:58:41 -04:00
Steve Underwood 9a26b3a8a7 Fixed harmless typos in comments 2012-08-08 21:31:45 +08:00
Steve Underwood 42c5ab08d3 Image translate moves forward a little, towards colour support 2012-08-08 21:26:06 +08:00
Steve Underwood bb96d091fc Tweaks 2012-08-08 21:16:38 +08:00
Steve Underwood 65ffaa8ca9 Someone's been doing something odd to t30.h :-\ 2012-08-08 19:46:31 +08:00
SwK 3818cae3e6 Work around for compiler issues on centos 2012-08-07 14:46:23 -04: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 c6cf92d766 ftmod_isdn: Use ftdm_time_t for dialtone timeout.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-08-07 17:22:17 +02:00
Steve Underwood a117fd8fa3 Avoid quirky complaints about using the top bit of an integer as an enum 2012-08-07 23:06:17 +08:00
Steve Underwood 3ae2bdf4aa Improvements to dithering down colour and gray scale images to bi-level
images, for images with different illuminants.
2012-08-07 22:34:32 +08:00
Kapil 7b7256b55f fixing issues 2012-08-06 10:20:02 -04:00
Steve Underwood 04e93f4c0b Fix fixed point builds of spandsp, and improve logging of modem performance during tests 2012-08-05 22:20:39 +08:00
Steve Underwood 72566f6a3f Fixed V.22bis fixed point builds 2012-08-05 18:39:41 +08:00
Steve Underwood f088d971f3 Sorted out fixed point builds of the V.22bis modem 2012-08-05 18:38:47 +08:00
Jeff Lenk d1c3f910a6 windows -fix build for recent spandsp changes 2012-08-03 16:46:48 -05:00
Steve Underwood e523076274 FAX T.6 decompression fixed for images with black in the last pixel of lines.
Colour and grey images can down be dithered down to bi-level images for transmission as faxes.
More movement towards T.42 support
2012-08-04 03:45:09 +08:00
Kapil Gupta 34000bf188 adding "interface-identifier" field to configuration 2012-08-03 12:07:02 -04:00
Steve Underwood e35221b981 Fixed the way T.85/T.85-L0 selection is handled when decoding DCS messages 2012-08-03 20:26:30 +08: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
root 61f0237670 print modification 2012-08-01 13:21:47 -04:00
David Yat Sin d96687a352 Fix for TDM termination alarms 2012-08-01 13:18:37 -04:00
David Yat Sin 6906c00342 Merge branch 'releases.3.4' into releases.3.5
Conflicts:
	src/include/switch_channel.h
	src/switch_channel.c
2012-07-31 14:18:36 -04:00
root 0c87442dd7 adding termination service states(in-service/out-of-service) flags and
reject incoming megaco request if requested termination is not in service
2012-07-30 13:17:39 -04:00
root 22bc29b5e0 sending termination in-service/out-of-service service change for termination whenever there is alarm indication from freetdm 2012-07-30 12:32:46 -04:00
root da26b4de41 adding termination service-change code 2012-07-29 10:17:13 -04:00
David Yat Sin 2a1eb6e8fa Merge branch 'releases.3.4' of ssh://git.sangoma.com/smg_freeswitch into releases.3.4 2012-07-28 10:42:18 -04:00
David Yat Sin 4bbb8c014a Fixed compile error 2012-07-28 10:41:55 -04:00
David Yat Sin a6503b4952 Fixed compile warning 2012-07-28 09:59:47 -04:00
root 2dc5b322dd Added event system for TDM termination alarms 2012-07-27 21:31:24 -04:00
root 008bb4942b adding code for updating codec types 2012-07-27 16:11:46 -04:00
David Yat Sin 6895e46983 Fix compile warning 2012-07-27 15:02:45 -04:00
James Zhang a4255e140b freetdm: adding variables for ansi outgoing IAMs
. added called party number INN variable
           ie. <action application="export" data="freetdm_ss7_cld_inn=0"/>
         . added multiple variables to set User Service Information IE
           variables are :
              ss7_iam_usi_trans_cap
              ss7_iam_usi_code_standard
              ss7_iam_usi_trans_mode
              ss7_iam_usi_trans_rate_0
              ss7_iam_usi_trans_rate_1
              ss7_iam_usi_layer1_ident
              ss7_iam_usi_layer1_prot
              ss7_iam_usi_layer2_ident
              ss7_iam_usi_layer2_prot
              ss7_iam_usi_layer3_ident
              ss7_iam_usi_layer3_prot
              ss7_iam_usi_chan_struct
              ss7_iam_usi_config
              ss7_iam_usi_establish
              ss7_iam_usi_symmetry
              ss7_iam_usi_rate_multiplier

         . ss7_iam_usi_trans_cap is a string variable, the others are all integers
         . ss7_iam_usi_trans_cap has options of :
              - SPEECH
              - UNRESTRICTED
              - RESTRICTED
              - 31KHZ
              - 7KHZ
              - 15KHZ
              - VIDEO
           default value is SPEECH, if the parameter is wrong, set to SPEECH. If not
           set, this field is not present
2012-07-27 11:53:00 -04:00
Mathieu Rene a668b9ddf6 automatically fail new tdm channel if ftdm_start_only is true 2012-07-27 11:06:23 -04:00
root 3350403d04 commit from testbox 2012-07-27 11:22:29 -04:00
Stefan Knoblich dc1422998a FreeTDM: Add FTDM_XINT64_FMT 64bit hex format string and use it in ftmod_misdn.
Fixes:
  src/ftmod/ftmod_misdn/ftmod_misdn.c: In function 'misdn_handle_mph_information_ind':
  src/ftmod/ftmod_misdn/ftmod_misdn.c:871:3: error: format '%lx' expects argument of type 'long unsigned int', but argument 13 has type 'uint64_t' [-Werror=format]

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-27 14:33:46 +02:00
David Yat Sin b10e73131e Merge branch 'nsg-4.3' of ssh://git.sangoma.com/smg_freeswitch into nsg-4.3 2012-07-26 16:43:29 -04:00
David Yat Sin 258900818a freetdm: Added thread to service events when there is no signalling module on a span 2012-07-26 16:43:18 -04: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
root f57825f1fe Merge branch 'nsg-4.3' of ssh://git.sangoma.com/smg_freeswitch into nsg-4.3 2012-07-25 23:16:53 -04:00
David Yat Sin 5dc8412f44 Merge branch 'nsg-4.3' of ssh://git.sangoma.com/smg_freeswitch into nsg-4.3 2012-07-25 23:16:42 -04:00
David Yat Sin a4bb00023c Reverted back clear-channel, used existing FTDM_SIGTYPE instead 2012-07-25 23:16:32 -04:00
root 491737fd4d Merge branch 'nsg-4.3' of ssh://git.sangoma.com/smg_freeswitch into nsg-4.3 2012-07-25 21:27:06 -04:00
Mathieu Rene 039c18638c allocate recv buffer for tdm 2012-07-25 21:26:53 -04:00
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
Jeff Lenk b2e28d68b5 fix windows build for last spandsp changes - trivial 2012-07-21 10:18:27 -05:00
Steve Underwood be6739e198 Updates to spands test data 2012-07-21 21:46:07 +08:00
Steve Underwood fd8c576c66 Some tidying of the V.17 modem. Brought the modem test programs up to date 2012-07-21 21:17:11 +08:00
Steve Underwood e58b2e7d97 Some modem cleanups, and movement towards efficient fixed point modem
implementations for platforms with slow floating point
2012-07-21 19:47:45 +08:00
Steve Underwood e9b4a497cc Tweaks 2012-07-21 07:18:27 +08:00
Steve Underwood b5f7443524 Started introducing T.42 JPEG support for FAXing, but its not plumbed into the
FAX engine yet.
2012-07-21 04:05:40 +08:00
Travis Cross cae357e784 gitignore some build products 2012-07-20 05:18:04 +00: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
Anthony Minessale 5867d0424d FS-4079 please try this 2012-07-18 21:48:53 -05: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
Steve Underwood 12aec908bb Various tweaks to spandsp. Cleaned up a few MSVC issues with spandsp 2012-07-18 21:46:58 +08:00
Jeff Lenk 682fb58bd5 OPENZAP-186 --resolve 2012-07-18 08:16:35 -05:00
Jeff Lenk 2dda038ba0 FS-4416 -- resolve 2012-07-15 21:52:02 -05:00
Jeff Lenk d2b940d9fc fix windows spandsp build for recent commits 2012-07-15 11:01:17 -05:00
Steve Underwood 4de4434afc Merge branch 'master' of git.freeswitch.org:freeswitch 2012-07-15 13:38:18 +08:00
Steve Underwood 4bcdafec68 T.85 compression has now been added to the FAX engine in spandsp 2012-07-15 13:37:39 +08:00
Anthony Minessale 545c387938 frick 2012-07-14 20:23:13 -05:00
Steve Underwood 232fe67722 More integration with the current spandsp 2012-07-15 01:47:55 +08:00
Steve Underwood 5d7e26141f Introducing T.85 encode and decodei to spandsp. This is not connected into the FAX engine in this update. 2012-07-14 23:59:01 +08:00
Steve Underwood 287678bc56 Tweaks to spandsp tests
Addition of tones to modem connect tones
Repeat function for V.18 TDD
2012-07-14 23:34:40 +08:00
Stefan Knoblich 6ff084492b esl-php: Create installation directories if they do not exist (+ other minor clean ups).
Fixes:

   cp ESL.so /var/tmp/por.../image/usr/lib64/php5.3/lib/extensions/no-debug-zts-20090626
   cp: cannot create regular file `/var/tmp/por.../image/usr/lib64/php5.3/lib/extensions/no-debug-zts-20090626': No such file or directory

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
2012-07-14 14:01:18 +02: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
Anthony Minessale 75b36c9545 tweaks 2012-07-11 16:48:56 -05: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
Anthony Minessale 2aebe2456f first pass on some new stuff 2012-07-11 15:15:50 -05: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
Michael S Collins eb7e640b59 Merge branch 'master' of ssh://git.freeswitch.org:222/freeswitch 2012-07-11 11:10:33 -07:00
Michael S Collins fbfa31d2d1 Add dump_events.pl script 2012-07-11 11:10:24 -07: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
Anthony Minessale 6c406aa0d9 add wait handler to forking code in ivrd 2012-07-10 13:32:35 -05:00
Anthony Minessale 27155bcb71 come to ClueCon its in one month 2012-07-10 12:05:26 -05:00
Jeff Lenk fa1276d949 FS-4219 --resolve 2012-07-08 09:10:28 -05: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
Steve Underwood 4a200ce3a0 More tweaks for spandsp. 2012-07-04 23:57:30 +08:00
Steve Underwood 2b75169c07 A lot of tweaks to clean up some inconsistencies in spandsp. They should
have no functional effect.
2012-07-04 22:51:46 +08: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
Michael Jerris 6068534c8e add to make sure config dir is there for AC_CONFIG_AUX_DIR 2012-07-02 17:46:21 -04:00
Anthony Minessale b2df2ee1d7 FS-4376 --resolve update and repeat 'make spandsp-reconf' 2012-07-02 14:24:23 -05:00
Jeff Lenk 7f41862156 build fix for recent spandsp commit - windows 2012-07-02 09:04:15 -05:00
Steve Underwood 5c259f26d2 Various little tweaks to spandsp to stop warnings with newer compilers
Various little tweaks to spandsp to bring it into line with the master versions
Addition of Ademco Contact ID protocol processing to spandsp
2012-07-02 21:31:04 +08: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
Travis Cross 5fd025eb66 Update AUTHORS 2012-06-25 08:51:49 +00:00
Travis Cross b8109bde58 Bootstrap bnlib without warnings or errors 2012-06-25 08:50:00 +00:00
Travis Cross 3b2df07f3e Fix bnlib call to AC_INIT 2012-06-25 08:48:19 +00:00