Commit Graph

293 Commits

Author SHA1 Message Date
Mike Bradeen eb1d7ab53c ooh323c: not checking for IE minimum length
When decoding q.931 encoded calling/called number
now checking for length being less than minimum required.

ASTERISK-30103

Change-Id: I3dcfce0f35eca258dc450f87c92d4d7af402c2e7
2022-12-01 11:11:42 -06:00
George Joseph 4aa541683b GCC12: Fixes for 16+
Most issues were in stringfields and had to do with comparing
a pointer to an constant/interned string with NULL.  Since the
string was a constant, a pointer to it could never be NULL so
the comparison was always "true".  gcc now complains about that.

There were also a few issues where determining if there was
enough space for a memcpy or s(n)printf which were fixed
by defining some of the involved variables as "volatile".

There were also a few other miscellaneous fixes.

ASTERISK-30044

Change-Id: Ia081ca1bcfb329df6487c4660aaf1944309eb570
2022-05-09 08:21:45 -05:00
Sean Bright 0d62735f99 utils.c: Remove all usages of ast_gethostbyname()
gethostbyname() and gethostbyname_r() are deprecated in favor of
getaddrinfo() which we use in the ast_sockaddr family of functions.

ASTERISK-29819 #close

Change-Id: Ie277c0ef768d753b169c121ef570a71665692ab7
2022-01-06 09:45:56 -06:00
Alexander Traud 2024c2e476 addons: Fix for Doxygen.
ASTERISK-29742

Change-Id: Ie752cb9638ced1ebe3a55d710c6c18ef6bd0aafc
2021-11-18 10:52:17 -06:00
Josh Soref 01697d4836 addons: Spelling fixes
Correct typos of the following word families:

definition
listener
fastcopy
logical
registration
classify
documentation
explicitly
dialed
endpoint
elements
arithmetic
might
prepend
byte
terminal
inquiry
skipping
aliases
calling
absent
authentication
transmit
their
ericsson
disconnecting
redir
items
client
adapter
transmitter
existing
satisfies
pointer
interval
supplied

ASTERISK-29714

Change-Id: I8548438246f7b718d88e0b9e0a1eb384bbec88e4
2021-11-16 06:00:43 -06:00
Mike Bradeen 99a1a427a9 various: Fix GCC 11 compilation issues.
test_voicemail_api: Use empty char* for empty_msg_ids.
chan_skinny: Fix size of calledParty to be maximum extension.
menuselect: Change Makefile to stop deprecated warnings. Added comments
test_linkedlist: 'bogus' variable was manually allocated from a macro
and the test fails if this happens but the compiler couldn't 'see' this
and returns a warning. memset to all 0's after allocation.
chan_ooh323: Fixed various indentation issues that triggered misleading
 indentation warnings.

ASTERISK-29682
Reported by: George Joseph

Change-Id: If4fe42222c8444dc16828a42731ee53b4ce5cbbe
2021-10-21 13:18:41 -05:00
Joshua C. Colp 2f510d7a88 app_mysql: Remove deprecated module.
ASTERISK-29585

Change-Id: I262930d0387d043f2a3345e8a977b314528059bf
2021-08-17 10:35:14 -03:00
Joshua C. Colp 2a0e383e4f cdr_mysql: Remove deprecated module.
ASTERISK-29584

Change-Id: I4bd3695d089121f810d692a82361d39d2f97ae39
2021-08-17 10:34:34 -03:00
Joshua C. Colp 93870e7bb4 policy: Deprecate modules and add versions to others.
app_meetme is deprecated in 19, to be removed in 21.
app_osplookup is deprecated in 19, to be removed in 21.
chan_alsa is deprecated in 19, to be removed in 21.
chan_mgcp is deprecated in 19, to be removed in 21.
chan_skinny is deprecated in 19, to be removed in 21.
res_pktccops is deprecated in 19, to be removed in 21.
app_macro was deprecated in 16, to be removed in 21.
chan_sip was deprecated in 17, to be removed in 21.
res_monitor was deprecated in 16, to be removed in 21.

ASTERISK-29548
ASTERISK-29549
ASTERISK-29550
ASTERISK-29551
ASTERISK-29552
ASTERISK-29553
ASTERISK-29558
ASTERISK-29567
ASTERISK-29572

Change-Id: Ic3bee31a10d42c4b3bbc913d893f7b2a28a27131
2021-08-11 08:14:51 -05:00
Alexander Traud 57ee79a563 Compiler fixes for GCC with -Og
ASTERISK-29144

Change-Id: I2a72c072083b4492a223c6f9d73d21f4f424db62
2020-11-03 17:08:07 -06:00
Kevin Harwell 3d1bf3c537 Compiler fixes for gcc 10
This patch fixes a few compile warnings/errors that now occur when using gcc
10+.

Also, the Makefile.rules check to turn off partial inlining in gcc versions
greater or equal to 8.2.1 had a bug where it only it only checked against
versions with at least 3 numbers (ex: 8.2.1 vs 10). This patch now ensures
any version above the specified version is correctly compared.

Change-Id: I54718496eb0c3ce5bd6d427cd279a29e8d2825f9
2020-06-10 09:33:28 -05:00
Peter Turczak 3303defd3f chan_mobile: Add smoother to make SIP/RTP endpoints happy.
In contrast to RFC 3551, section 4.2, several SIP/RTP clients misbehave
severly (up to crashing). This patch adds another smoother for the audio
received via bt. Therefore the audio frames sent to the core will be
CHANNEL_FRAME_SIZE.

ASTERISK-28832 #close

Change-Id: Ic5f9e2f35868ae59cc9356afbd1388b779a1267f
2020-04-27 09:40:38 -05:00
Jaco Kroon 5cd7230f3c addons/res_config_mysql: silense warnings about printf format errors.
Warnings without this:

res_config_mysql.c: In function 'update2_mysql':
res_config_mysql.c:741:15: warning: format '%llu' expects argument of type
    'long long unsigned int', but argument 6 has type 'my_ulonglong'
    {aka 'long unsigned int'} [-Wformat=]
ast_debug(1, "MySQL RealTime: Updated %llu rows on table: %s\n",
    numrows, tablename);

(reformatted for readability within line-wrap)

Change-Id: I2af4d419a37c1a7eeee750cf9ae4a9a2b3a37fd3
2020-02-24 16:16:26 +02:00
Joshua C. Colp ed394ce5b1 configure: Add check for MySQL client bool and my_bool type usage.
Instead of trying to use the defined MySQL client version from the
header use a configure check to determine whether the bool or my_bool
type should be used for defining a boolean.

ASTERISK-28604

Change-Id: Id2225b3785115de074c50c123ff1a68005b4a9c7
2019-12-16 10:36:25 -06:00
George Joseph a47cb71bb1 Build: Fix compile issues with seldom used modules
The following modules needed tweaks for API changes.

addons/cdr_mysql.c
addons/chan_ooh323.c
apps/app_meetme.c

ASTERISK-28604

Change-Id: Ib40e513ae55b5114be035cdc929abb6a8ce2d06d
2019-11-07 08:31:53 -05:00
Sean Bright 51850a79ef cdr_mysql: Don't clean up on unload unless we can unregister from CDRs
ASTERISK-28566 #close

Change-Id: I6daa4e5128e9406d04d3aed670c3bae98d38d40c
2019-10-04 16:00:56 -05:00
Alexander Anikin a8f1e26d34 chan_ooh323: fix h323 log file path
Change h323 log path relative to AST_LOG_DIR instead of
/var/log/asterisk hardcoded
Add return back error message from OOH323EP initialize

ASTERISK-28348 #close

Reported by: Dmitry Shubin

Change-Id: Ib102dd36bbe6c2a7a4ce6870ae9110d9000d7e98
2019-04-10 17:12:42 -06:00
Richard Mudgett 467f7c6724 Fix 'statement' typo throughout code.
Most were in comments.  A couple were in warning messages.

Pointed out by Jonathan H on the Asterisk users mailing list.

Change-Id: I6286939dff5d0a27a2758140570106f1cb351855
2018-10-18 12:44:10 -05:00
Alexander Traud 10de9fcbf1 chan_ooh323: IPTOS_MINCOST is not defined on Solaris.
Furthermore, <sys/sockio.h> is required for SIOCGIF*.

ASTERISK-27938

Change-Id: Idc9153ece769944765b66122efb11728d8d8ebde
2018-07-09 09:45:06 +02:00
Alexander Traud 9f2eb17005 ooh323c: GCC 8.1 warned about output truncated before terminating nul.
ASTERISK-27901

Change-Id: I5a8e894f4924ef52e3094f6870656a559d67f3d7
2018-06-07 14:19:39 +02:00
George Joseph 13ac76a230 Merge "cdr_mysql: my_connect_db(): reduce indentation" 2018-06-06 08:12:48 -05:00
George Joseph 5978883d13 Merge "cdr_mysql: split mysql init out of my_load_module" 2018-06-06 08:12:38 -05:00
Brian P. Martin 52ed6bcc8f chan_mobile: support handling of caller-id names ("cnam").
Add support to handle caller-ID names ("cnam") in addition to caller-ID
numbers.  The prior code ignored the caller-ID name altogether, and
used the local name for the cell phone (e.g. "my-iphone") in its place.

Note: as of this writing, at least some Android phones don't pass cnam to
us. This can be seen by issuing "core set debug 2" in the CLI and watching
the "CLIP" record when a call comes in.  If cnam isn't in the CLIP record,
there's nothing we can do to provide one.  We'll provide a null cnam field,
so later Asterisk processes know to try other sources (e.g. cidname database,
OpenCNAM, etc.).

Reported by: Brian Martin
Tested by: Brian Martin
ASTERISK-27726

Change-Id: I89490d85fa406c36261879c50ae5e65595538ba5
2018-05-17 15:24:34 -06:00
Corey Farrell b5914d90ac Fix GCC 8 build issues.
This fixes build warnings found by GCC 8.  In some cases format
truncation is intentional so the warning is just suppressed.

ASTERISK-27824 #close

Change-Id: I724f146cbddba8b86619d4c4a9931ee877995c84
2018-05-11 09:48:58 -04:00
Tzafrir Cohen f4c360143b cdr_mysql: my_connect_db(): reduce indentation
ASTERISK-27572

Change-Id: I00bd5363ac94c764c56d8626a5945ed7f3934fcb
2018-05-06 16:46:43 +03:00
Tzafrir Cohen 2e44adf1c3 cdr_mysql: split mysql init out of my_load_module
Split out mysql connection parts to a separate my_connect_db().

ASTERISK-27572

Change-Id: If2ee676056067cc693ff08be68ee4944bf35b49f
2018-05-06 16:45:20 +03:00
Jenkins2 8c1400bb57 Merge "chan_ooh323: introduce localras config parameter" 2018-04-26 11:42:06 -05:00
Richard Mudgett 0464e773d8 Merge "chan_ooh323: fix ooManualProgress/ooManualRingback on ooh323 debuggin on" 2018-04-25 10:46:05 -05:00
Alexander Anikin c481afe873 chan_ooh323: fix ooManualProgress/ooManualRingback on ooh323 debuggin on
Call ooManualProgress/Ringback outside of ast_debug function
when ooh323 debugging is on

ASTERISK-27812 #close
ASTERISK-26893 #close
Reported by: Dimos, Marco Giordani

Change-Id: I5873762e4f05824e7b6e94a19dd4eb56adbbbb79
2018-04-20 22:17:31 +03:00
Alexander Anikin 95e8450194 chan_ooh323: introduce localras config parameter
Introduce localras parameter that specify source IP
for connecting to Gatekeeper. Useful for multihome configurations.

ASTERISK-25129 #close
Reported by: Dmitry Melekhov
Tested by: Dmitry Melekhov

Change-Id: I0b604b01793f3e02a776502659e07cd3fc7e3097
2018-04-18 13:46:30 +03:00
Alexander Anikin 446320f1d4 chan_ooh323: Fix cppcheck warnings
Fix cppcheck warnings about redundant conditions and possible
null pointer usage

ASTERISK-27793 #close
Reported by: Ilya Shipitsin
Tested by: Ilya Shipitsin

Change-Id: I0b31933b062a23331dbac9a82b8bcfe345f406f6
2018-04-18 13:38:09 +03:00
Evandro Cesar Arruda 429c758e48 cdr_mysql: Compile error because MYSQL_PORT definition is missing
If it is not defined, it will add MYSQL_PORT definition. After some
research on MySQL/MariaDB development tree, I couldn't find any reference
to MYSQL_PORT definition in include files.

ASTERISK-27782 #close

Change-Id: Ieee56c836fc2e8bd021c456145bba04c6068bb77
2018-04-11 14:26:18 -06:00
Corey Farrell 572a508ef2 loader: Convert reload_classes to built-in modules.
* acl (named_acl.c)
* cdr
* cel
* ccss
* dnsmgr
* dsp
* enum
* extconfig (config.c)
* features
* http
* indications
* logger
* manager
* plc
* sounds
* udptl

These modules are now loaded at appropriate time by the module loader.
Unlike loadable modules these use AST_MODULE_LOAD_FAILURE on error so
the module loader will abort startup on failure of these modules.

Some of these modules are still initialized or shutdown from outside the
module loader.  logger.c is initialized very early and shutdown very
late, manager.c is initialized by the module loader but is shutdown by
the Asterisk core (too much uses it without holding references).

Change-Id: I371a9a45064f20026c492623ea8062d02a1ab97f
2018-03-14 05:20:12 -04:00
Corey Farrell c8a521b6c8 Replace direct checks of option_debug with DEBUG_ATLEAST macro.
Checking option_debug directly is incorrect as it ignores file/module
specific debug settings.  This system-wide change replaces nearly all
direct checks for option_debug with the DEBUG_ATLEAST macro.

Change-Id: Ic342d4799a945dbc40ac085ac142681094a4ebf0
2018-03-07 16:03:01 -06:00
Alexander Traud 140f937c7e res_config_mysql: Avoid the header mysql_version.h.
ASTERISK-27607

Change-Id: I23d00ded955c4afd5f2c3c9dc96dcb48b3f74eec
2018-01-22 16:18:51 +01:00
Alexander Traud 797747afa7 chan_ooh323: Avoid typecasting an int to unsigned short.
clang 5.0 warned about this.

ASTERISK-27577

Change-Id: I898fe4255023138a9e8b579fe4482fcf582f2b78
2018-01-12 11:03:38 +01:00
Jenkins2 94e7a7675b Merge "General: Avoid implicit conversion to char when changes value to negative." 2018-01-08 06:51:40 -06:00
Jenkins2 26e5edd043 Merge "chan_ooh323: Limit outgoinglimit to positive values as intended." 2018-01-06 20:56:24 -06:00
Alexander Traud f84fcc1fc1 General: Avoid implicit conversion to char when changes value to negative.
clang 5.0 warned about this.

ASTERISK-27557

Change-Id: I7cceaa88e147cbdf81a3a7beec5c1c20210fa41e
2018-01-06 22:12:40 +01:00
Alexander Traud f0c8f04c73 chan_ooh323: Limit outgoinglimit to positive values as intended.
ASTERISK-27552

Change-Id: Ifbf9d51e7374ca2e8b27ec568f6770050fc1a854
2018-01-05 08:02:21 -06:00
Alexander Traud 09f339bda5 ooh323cDriver: Fix typo in header guard.
ASTERISK-27551

Change-Id: I39ff66031e3373e895e2bc47b23a5e860ea4e012
2018-01-05 13:19:36 +01:00
Sean Bright 898b3b080a cdr_mysql: Make sure connection charset is always set
When the MYSQL_OPT_RECONNECT option is enabled, the MySQL client API
will transparently reconnect when it needs to. Ideally this simplifies
our code, but when this reconnection occurs all connection state is
lost. Because we are not notified that this has happened, we don't know
to set our character set again (with "SET NAMES 'xyz'").

Rather than calling SET NAMES, we instead set the MYSQL_SET_CHARSET_NAME
option which will do it for us under the hood on each connect. This
option has been present in the MySQL C API for at least 15 years, so it
should be safe for most installations.

I also snuck a few other changes into this patch:

* Default the MySQL port to MYSQL_PORT (3306) instead of 0 if it's not
  defined.

* Fix some erroneous and/or silly checks on the contents of the
  configuration ast_str values.

ASTERISK-27366 #close
Reported by: Halil İbrahim YILDIZ

Change-Id: I36bf8dc5d5f83584e803b3b1a151dea9396ab8f5
2017-12-28 09:38:37 -06:00
Sean Bright fd0ca1c3f9 Remove as much trailing whitespace as possible.
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2017-12-22 09:23:22 -05:00
Corey Farrell 1b80ffa495 Fix Common Typo's.
Fix instances of:
* Retreive
* Recieve
* other then
* different then
* Repeated words ("the the", "an an", "and and", etc).
* othterwise, teh

ASTERISK-24198 #close

Change-Id: I3809a9c113b92fd9d0d9f9bac98e9c66dc8b2d31
2017-12-20 12:40:01 -05:00
Alexander Anikin fcd9ba2b87 add cmd connection creation on creation ooh323 call data structure
ASTERISK-27353 #close

Reported by: Marco Giordani

Change-Id: I455096bd7da016b871afe09af86067c2c7c9f33f
2017-11-23 03:54:36 +03:00
Tzafrir Cohen 11cefdf621 cdr_mysql: avoid releasing a config string
Fixes a memory corruption issue after a reload of cdr_mysql.

Issue was accidentally included in 747beb1ed1 .

ASTERISK-27270 #close

Change-Id: I90b6a9d18710c0f9009466370bd5f4bac5d5d12e
2017-10-10 17:52:20 +03:00
alex 1199927fc0 cdr_mysql.c: Apply cdrzone to start and answer
Change-Id: I7de0a5adc89824a5f2b696fc22c80fc22dff36b0
2017-09-18 07:03:20 -05:00
Sean Bright ef8eb9d11b chan_ooh323: Fix confusing indentation warning
ASTERISK-27177 #close
Reported by: Tzafrir Cohen

Change-Id: I40311c404edb2302a7543ad5ca7a06b2a38f2d97
2017-09-01 13:17:15 -05:00
Corey Farrell 58d032112b Fix compiler warnings on Fedora 26 / GCC 7.
GCC 7 has added capability to produce warnings, this fixes most of those
warnings.  The specific warnings are disabled in a few places:

* app_voicemail.c: truncation of paths more than 4096 chars in many places.
* chan_mgcp.c: callid truncated to 80 chars.
* cdr.c: two userfields are combined to cdr copy, fix would break ABI.
* tcptls.c: ignore use of deprecated method SSLv3_client_method().

ASTERISK-27156 #close

Change-Id: I65f280e7d3cfad279d16f41823a4d6fddcbc4c88
2017-08-01 15:42:38 -06:00
Sean Bright 045d7b8cb7 format_mp3: Re-work menuselect/build issues
Rather than removing format_mp3 from ALL_C_MODS (which caused format_mp3
to not show up in menuselect), use .PHONY targets when the necessary
source files are not present.

ASTERISK-23951
Reported by: Tzafrir Cohen

Change-Id: I0a7512c51acc9e86043671795020b0de725bd9e8
2017-05-30 10:57:03 -04:00