Commit Graph

27424 Commits

Author SHA1 Message Date
Russell Treleaven ce96d95c5e add support for cache directory
make configs use specific directory variables instead of just base_dir
so that one configuration can be used for fhs and legacy installations
2014-08-31 20:22:08 -04:00
Travis Cross acb439ca03 Avoid leaking memory while iterating hash tables
`switch_core_hash_first` allocates an iterator on each call that is
never freed except when the hash table is empty.

By using `switch_core_hash_first_iter` we allocate only one iterator,
and that iterator is freed after the last item is processed.
2014-08-30 03:49:51 +00:00
Travis Cross 75836b603f Suppress diff output for swig-generated files 2014-08-30 03:22:59 +00:00
Travis Cross df559e0aac Add back goodness refactored out 2014-08-30 01:32:57 +00:00
Travis Cross 9481d9843c Fix comment spelling 2014-08-30 01:19:09 +00:00
Travis Cross 6f2eac6876 Fix comment spelling 2014-08-30 00:52:16 +00:00
Travis Cross 63f16425bd Refactor mod_hash limit_release_hash a bit 2014-08-29 21:44:04 +00:00
Brian West 3e24b3e2c2 FS-6775 #resolve 2014-08-29 09:55:00 -05:00
Chris Rienzo 89b4b0c4ea mod_rayo: fix nested join to calls and conferences 2014-08-28 13:16:55 -04:00
Travis Cross 1c058e0f45 Check gcc support for -Wno-unused-result
We're using -Wno-unused-result to work around what is arguably a GCC
bug, but this option is not supported on older GCC versions.  So on
those versions we won't pass -Werror either.

ref: commit b874048efc
2014-08-28 13:37:37 +00:00
Chris Rienzo fa08c6b8db mod_unimrcp: remove some dead code and TODOs. Reworked error handling a bit to try and prevent stuck channel 2014-08-28 09:18:07 -04:00
Travis Cross 9dd7173b6e Avoid overaggressive chmod/chown on upgrade
It's reasonable for someone to change one or more of these directory
permissions after installation.  We shouldn't touch more than we need
on upgrade.  Each directory needs to be owned by the freeswitch user,
but past that we can leave discretion to the system administrator.
2014-08-28 12:24:44 +00:00
Travis Cross dc88617c99 Lower log level of limit increases and releases
In some configurations where many limits are used, the limit increases
and releases were generating a lot of noise and making it harder to
see when limits were exceeded, which was at the same log level.
2014-08-28 01:40:36 +00:00
Travis Cross 5a209a9680 Remove misleading `tport` example from configs
As an example of using mod_sofia's gateway parameter `contact-params`
we'd used the value `tport=tcp`.  Looking around, it's clear this has
misled people into believing you can specify `tport=tcp` to make the
gateway use TCP or `tport=tls` to make the gateway use TLS.  This does
not work.

The actual contact parameter is named `transport` rather than `tport`,
and you shouldn't use `transport` in `contact-params` because we
automatically add a `transport` to the Contact: based on the value of
`register-transport` (even if the gateway is set to not register).

It's clear why this would be confusing, so we'll just remove this as
an example.
2014-08-27 23:15:45 +00:00
Brian West 1dc44067cd FS-6770 #resolve 2014-08-27 13:28:15 -05:00
Nathan Neulinger 2db039bc5f mod_skinny: FS-6720 - fix issue with SLA - had to do with answering in wrong state 2014-08-27 10:38:16 -05:00
Travis Cross 323a3d617c Avoid output of junk text by fs_cli
In some cases where `redisplay()` is called immediately after a
command is run (e.g. `log ...`) we often get a prompt, junk output,
and a second prompt.  This is due to a (known) race.

We believe we're falling afoul of this code in `el_deletestr`:

    if (el->el_line.cursor < &el->el_line.buffer[n])
            return;

Basing the length of text to delete off of the cursor position
resolves the issue of junk text, but the real solution is to eliminate
the race conditions, which will also resolve the sometimes duplicated
prompt.

FS-6764 #resolve

Thanks-to: Nathan Neulinger <nneul@neulinger.org>
2014-08-26 20:18:22 +00:00
Anthony Minessale 0f1494ae06 Improve conference recording 2014-08-26 09:52:55 -05:00
root 15d7706f8f clean up some injection issues in chat display 2014-08-25 18:42:07 -04:00
Mike Jerris e627422f3d Merge pull request #29 in FS/freeswitch from ~ITALOROSSI/freeswitch:bugfix/FS-5522-add-switchname-xml-json-cdr to master
* commit 'd55505ce2a713a409a2a2d37f34893f7d1ccaf4f':
  Adding switchname to xml_cdr and json_cdr
2014-08-25 10:50:12 -05:00
root 1ecc2c0c49 tweak in login seq in verto 2014-08-25 04:29:22 +05:00
Brian West f4a04e65f2 FS-6735 2014-08-22 16:39:52 -05:00
Brian West b6dc4a6c11 FS-6747 #resolve 2014-08-22 16:39:52 -05:00
Travis Cross b874048efc Handle gcc's overzealous unused-result warning
Modern static analyzers warn when a variable is set but not used.  GCC
warns when the result of a function marked as
`__attribute__((warn_unused_result))` is not set to some variable,
even when the function is cast to `(void)`, which is the recognized
way of indicating the intent to ignore the result.  We treat all
warnings as errors.

The combination of behaviors here makes it difficult if we really
don't care about the result of the function; the obvious workarounds
are precluded.

GCC's maintainers don't consider this to be a bug:

  Why do you think this is a bug?  warn_unused_result is for cases where
  "not checking the result is either a security problem or always a
  bug".

  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509#c1

GLIBC however marks functions like `read` and `write` with this
attribute.  While it certainly in most cases is correct to act on
their return value, in some cases we really just don't care.

So when we see that we're building with GCC, and that we're building
with all warnings enabled, we'll just pass -Wno-unused-result to
disable the warning.

ref: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509
ref: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
2014-08-22 20:13:39 +00:00
Italo Rossi d55505ce2a Adding switchname to xml_cdr and json_cdr 2014-08-22 15:35:49 -03:00
William King d06d004055 Adding the ability to add a radius param when a channel variable is not set in mod_xml_radius 2014-08-21 23:17:23 -07:00
Travis Cross aa1a05d0aa Help the static analyzer in `handle_ice`
Clang's static analyzer thinks we could be using `hosts` here when it
is NULL.  We probably weren't, but it's easy to see how it could think
so.  We were checking whether `from_addr` matched `ice->addr` three
times, and between the second on third time we might have modified the
`ice->addr`; however we only get there if it matched the second time,
so we could only make it not match at that point and avoid the third
branch.  We can't make it match where it did not before.

We'll simplify the logic a bit here so static analyzers (and humans)
can hopefully see this more readily.
2014-08-22 03:37:42 +00:00
Travis Cross 3c32dd3bc9 Return NULL from `sub_alloc` for zero size
When zero was passed for the size to `sub_alloc`, we were passing this
size on to `malloc` or `calloc`, which is unusual enough that static
analyzers warn about this (POSIX says that either NULL or a pointer
will be returned).

We'll instead just return NULL right away.
2014-08-22 02:47:04 +00:00
Travis Cross 959e672a94 Fix spelling "Couldnt" -> "Couldn't" 2014-08-22 02:19:45 +00:00
Travis Cross decc19ccd1 Handle zero channels when allocating for resampler
When the number of channels was zero, we were calling malloc with a
size of zero.  While defined, this is unusual.  And since we're
initializing the speex resampler as though there were one channel in
this case, we should probably just allocate the space for it.
2014-08-22 01:59:11 +00:00
Travis Cross 164fa133dc Refactor to avoid warning about realloc usage
Clang's static analyzer noticed the result of realloc was being
assigned to a pointer of a different type than was used to calculate
the new size.  We can make things simpler and more idiomatic here by
using the correct pointer type and letting C's pointer arithmetic
automatically handle some multiplication.

We also use the distributive property here to simplify the calculation
for memset.
2014-08-22 01:36:59 +00:00
Travis Cross 2cf6fd728c Remove dead assignments in `switch.c` 2014-08-22 01:21:43 +00:00
Travis Cross 4f81e5942a Handle null argv in `switch.c` 2014-08-22 01:09:05 +00:00
Travis Cross e2d67d4ead Remove dead assignment 2014-08-22 00:58:53 +00:00
Travis Cross b5a87aea7f Avoid using undefined memory in `switch_fulldate_cmp`
The `switch_split_date` and `switch_split_time` functions only set as
many variables as they believe exist values in the input string.
Since we didn't have defaults assigned we would read undefined stack
memory if the input string didn't contain e.g. an hour.

With this commit, we use 1970 if no year is present, January if no
month is present, the first day of the month if none is given, and
zero for each of a missing hour, minute, or second.
2014-08-22 00:47:22 +00:00
Travis Cross bf42dd65f1 Refactor `switch_fulldate_cmp`
We're moving the variable declarations down to the smallest possible
scope (a good idea in general) so we can address the use of undefined
memory by the function in a later commit.
2014-08-22 00:43:27 +00:00
Travis Cross b2f59dd200 Add warning when using HTTPS with mod_curl
mod_curl currently does not verify the authenticity of the peer's
certificate, and does not verify whether the common name on the
certificate matches the server.  This makes mod_curl initiated TLS
connections completely insecure.  We should fix this, but until we do,
we'll warn people that it's not doing what they may think it is.

ref: http://curl.haxx.se/libcurl/c/CURLOPT_SSL_VERIFYPEER.html
ref: http://curl.haxx.se/libcurl/c/CURLOPT_SSL_VERIFYHOST.html
2014-08-21 22:24:04 +00:00
Travis Cross 6d1469d2fb Describe how to hard-wrap text in Emacs 2014-08-21 20:37:08 +00:00
Brian West 6e4cea308d Merge pull request #28 in FS/freeswitch from ~STANGOR/freeswitch:master to master
* commit 'c736cf2f22e4f0a5d490db995ebaed69b9963daa':
  Add sofia gateway parameter "destination-prefix"
  FS-5497 add sofia gateway parameter destination-prefix in case you need to send Invites with prefix only to this gateway
2014-08-21 13:59:37 -05:00
Giovanni Maruzzelli 2ada8286f3 skypopen: new skype client in install/install.pl 2014-08-21 20:52:14 +02:00
Chris Rienzo 0ba1b1efea mod_graylog2: channel variables can now be automatically added as gelf additional fields in logs w/ session UUID 2014-08-21 11:06:13 -04:00
Nathan Neulinger 5f6db1db3e mod_skinny: roll back, these are not expected to be null terminated, they are fixed length 2014-08-20 14:50:46 -05:00
Nathan Neulinger 84bc50e4ad mod_skinny: fix potential buffer size issue CID: 1214145 1214146 2014-08-20 14:32:02 -05:00
Travis Cross f2ca3c5211 Decode params to `curl_sendfile`
`curl_sendfile` generates a multipart message with Content-Type:
multipart/form-data with no separate Content-Type headers in the parts
for each non-file argument.  These parts therefore default to
text/plain.  However, prior to this commit, we were putting the URL
encoded POST data into these parts, which is not correct.  We should
be putting raw text into the parts.

With this commit, we urldecode each argument key and value before
composing the multipart message.

See:

  http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2
2014-08-20 10:37:24 +00:00
Stan Gor c736cf2f22 Merge branch 'master' of https://stash.freeswitch.org/scm/~stangor/freeswitch 2014-08-19 12:01:43 -07:00
Stan Gor 64060c7dbd Add sofia gateway parameter "destination-prefix"
FS-5497 add sofia gateway parameter destination-prefix in case you need to send Invites to your provider with prefix only to this gateway
2014-08-19 11:54:09 -07:00
Anthony Minessale 7bbdbadb42 tweak some cid display issues 2014-08-19 03:25:28 +05:00
Giovanni Maruzzelli eccf505a3b testing new hook FS-6677 #Waiting #comment this is a test 2014-08-18 21:55:03 +02:00
Giovanni Maruzzelli c086f9647b testing new hook TKT-6677 #Waiting #comment this is a test 2014-08-18 21:46:40 +02:00
Giovanni Maruzzelli 733db22f1d testing new hook FS-6677 #new_state #comment this is a test 2014-08-18 21:39:56 +02:00