Commit Graph

26481 Commits

Author SHA1 Message Date
Matt Jordan 8e1b747284 Merge "res_pjsip_dlg_options: Fix MODULEINFO section." 2015-05-03 09:19:16 -05:00
Matt Jordan 2be861173a Merge "include/asterisk/channel.h: Fix typo" 2015-05-02 10:19:14 -05:00
Matt Jordan 32eb00b70a Merge "Astobj2: Fix initialization order of refdebug and AO2_DEBUG." 2015-05-02 10:17:31 -05:00
Corey Farrell 44bbdbe3a4 res_pjsip_dlg_options: Fix MODULEINFO section.
Removed the extra space before "MODULEINFO" in res_pjsip_dlg_options.
This extra space prevented any of the dependencies from being seen by
menuselect, so building with default options would fail if PJSIP was
not installed.

This also makes the tool that extracts information for menuselect
tolerant of multiple spaces in the future.

ASTERISK-25033 #close
Reported by: Peter Whisker

Change-Id: Iccd54846f70c4a7a50cb5bf70b7bb5cb4bab3698
2015-05-02 02:22:31 -05:00
Corey Farrell 8f3cee1258 Astobj2: Fix initialization order of refdebug and AO2_DEBUG.
This ensures that refdebug is initialized before AO2_DEBUG if
both are enabled, since AO2_DEBUG allocates a container.

This change also makes AO2_DEBUG initialization critical, a
failure will abort Asterisk startup.  This is needed since
the failure would be caused by reg_containers allocation
failure, and that would result in a segmentation fault by
ao2_container_register later in startup.

ASTERISK-25048 #close
Reported by: Corey Farrell

Change-Id: I9a243ea3fc5653b48b931ba6d61971cb2e530244
2015-05-01 14:40:50 -04:00
Matt Jordan 7ac28be04b main/pbx: Improve performance of dialplan reloads with a large number of hints
The PBX core maintains two hash tables for hints: a container of the
actual hints (hints), along with a container of devices that are watching that
hint (hintdevices). When a dialplan reload occurs, each hint in the hints
container is destroyed; this requires a lookup in the container of devices to
find the device => hint mapping object. In the current code, this performs an
ao2_callback, iterating over each of the device to hint objects in the
hintdevices container. For a large number of hints, this is extremely
expensive: dialplan reloads with 20000 hints could take several minutes
in just this phase.

This patch improves the performance of this step in the dialplan reloads
by caching which devices are watching a hint on the hint object itself.
Since we don't want to create a circular reference, we just cache the
name of the device. This allows us to perform a smarter ao2_callback on
the hintdevices container during hint removal, hashing on the name of the
device and returning an iterator to the matching names. The overall
performance improvement is rather large, taking this step down to a number of
seconds as opposed to minutes.

In addition, this patch also registers the hint containers in the PBX
core with the astobj2 library. This allows for reasonable debugging to
hash collisions in those containers.

ASTERISK-25040 #close
Reported by: Matt Jordan

Change-Id: Iedfc97a69d21070c50fca42275d7b3e714e59360
2015-05-01 08:35:18 -05:00
Matt Jordan 01f3d5b7d4 Merge "Prevent potential crash on blond transfer." 2015-05-01 06:55:23 -05:00
Corey Farrell 6b208d8c3b Sample Configs: Fix syntax error in pjsip.conf
The sample pjsip.conf has a few comment lines that are missing the
semicolons at the start of the comment, causing the config to fail
load.

Change-Id: I776a38c916a7df7ee3e072fd0b21dbf4cc457352
2015-04-30 15:59:36 -05:00
Joshua Colp 22d9ac0a10 Merge "Build System: Fix issue with addons moduleinfo." 2015-04-30 15:21:38 -05:00
Mark Michelson dc23204aca Prevent potential crash on blond transfer.
Scenario:
Alice calls Bob. Bob performs a blond transfer to Carol. Carol rejects
the incoming call (or some other immediate circumstance causes Carol not
to answer the call)

What occurs in this case is that when the bridge between Alice and Bob
breaks, Alice is told to masquerade into Bob's channel that had placed
the call to Carol. The actual masquerade goes down without a hitch.
However, a channel fixup callback that attempts to publish dial events
over Stasis has a crash. The reason for this crash is that the datastore
on Bob's channel that placed the outbound call to Carol only had a bare
pointer to Carol's channel. Since Carol rejected the incoming call,
Carol's channel has been hung up and freed, meaning accessing her
channel results in a crash.

The fix here is simple. The dial fixup code has been altered to hold
references to the involved channels and to drop those references when
freeing data.

ASTERISK-25025 #close
Reported by Chet Stevens

Change-Id: I54eedda207b8ec7a69263353b43abe5746aea197
2015-04-30 15:20:43 -05:00
Corey Farrell 47fa2ad10b Build System: Fix issue with addons moduleinfo.
The build system now scans additional sources when generating
moduleinfo for menuselect.  Unfortunately the extra sources
for format_mp3 only exist if downloaded.

Use the Makefile macro 'wildcard' to allow moduleinfo generator
to ignore sources that do not exist.

Change-Id: I596604713b7345ce994f32197f8f6bfd9bcf4170
2015-04-30 15:40:48 -04:00
Joshua Colp bb6ddb3dc8 res_ari_device_states: Fix dependency on res_stasis_device_state.
The res_ari_device_states module depends on res_stasis_device_state,
not res_stasis_device_states.

Change-Id: I26e02ad37f9e36bcc859867e2fad1b90452ec3de
2015-04-30 13:44:57 -05:00
Mark Michelson 4475945a24 Merge "chan_dahdi: Add the chan_dahdi.conf force_restart_unavailable_chans option." 2015-04-30 11:11:19 -05:00
Richard Mudgett 03c51cf525 chan_dahdi: Add the chan_dahdi.conf force_restart_unavailable_chans option.
Some telco switches occasionally ignore ISDN RESTART requests.  The fix
for ASTERISK-19608 added an escape clause for B channels in the restarting
state if the telco ignores a RESTART request.  If the telco fails to
acknowledge the RESTART then Asterisk will assume the telco acknowledged
the RESTART on the second call attempt requesting the B channel by the
telco.  The escape clause is good for dealing with RESTART requests in
general but it does cause the next call for the restarting B channel to be
rejected if the telco insists the call must go on that B channel.

chan_dahdi doesn't really need to issue a RESTART request in response to
receiving a cause 44 (Requested channel not available) code.  Sending the
RESTART in such a situation is not required (nor prohibited) by the
standards.  I think chan_dahdi does this for historical reasons to deal
with buggy peers to get channels unstuck in a similar fashion as the
chan_dahdi.conf resetinterval option.

* Add the chan_dahdi.conf force_restart_unavailable_chans compatability
option that when disabled will prevent chan_dahdi from trying to RESTART
the channel in response to a cause 44 code.

ASTERISK-25034 #close
Reported by: Richard Mudgett

Change-Id: Ib8b17a438799920f4a2038826ff99a1884042f65
2015-04-30 10:24:57 -05:00
Joshua Colp 80aa9aee5d res_pjsip_outbound_registration: Fix double unref on error return.
When the PJSIP pjsip_regc_send function is invoked and an error
status returned the caller currently decrements the reference count
of the client state that it just incremented, assuming the
registration callback would not have been invoked. In practice
this is not correct. If the failure happens after the transaction
has been set up the callback will still be invoked. This will
cause the reference count to be incorrectly decremented twice, once
by the registration callback and second by the caller of
pjsip_regc_send.

This change makes it so that whether the callback is invoked or
not is known by the caller of pjsip_regc_send. Depending on
this it can know whether it is responsible for decrementing the
reference count of the client state or not.

ASTERISK-25037 #close
Reported by: Joshua Colp

Change-Id: I749dc12f3a22115c49c5d7d95ff42a5fa45319de
2015-04-30 07:25:26 -05:00
Rodrigo Ramírez Norambuena 7ff3b2d479 include/asterisk/channel.h: Fix typo
Change-Id: Ie584b85e16a94c255e60d0b1732ef9686464fef3
2015-04-30 03:07:06 -04:00
Matt Jordan 7fe923d20b Merge "ARI: Fix missing dependencies." 2015-04-29 16:44:09 -05:00
Matt Jordan 08355350a2 Merge "res_fax: allow 2400 transmission rate according to v.27ter standard" 2015-04-29 16:42:17 -05:00
Matt Jordan 39d3e1ef6e main/rtp_engine: Fix DTLS double-free introduced by 0b6410c4f8
The patch in 0b6410c4f8 did correctly fix a memory leak of the DTLS
structures in the RTP engine. However, when a 'core reload' is issued, a
double free of the memory pointed to by the char *'s in the DTLS
configuration struct can occur, as ast_rtp_dtls_cfg_free does not set
the pointers to NULL when they are freed.

This patch sets those pointers to NULL, preventing a second call to
ast_rtp_dtls_cfg_free from corrupting memory.

ASTERISK-25022

Change-Id: I820471e6070a37e3c26f760118c86770e12f6115
2015-04-29 16:31:07 -05:00
Mark Michelson 8d547e4e88 Merge "cdr/cdr_csv.c: Add missing space after comma." 2015-04-29 16:11:27 -05:00
Kevin Harwell 5d0c182885 res_fax: allow 2400 transmission rate according to v.27ter standard
A previous set of patches (see: ASTERISK-22790 & ASTERISK-23231) made it so
a v.27 modem was not allowed to have a minimum transmission rate of 2400 bits
per second. This reverts all or some of those patches since according to the
v.27ter standard a rate of 2400 bits per second is also supported.

One of the original patches also added 9600 bits per second support for v.27.
This patch also removes that since v.27ter only supports 2400/4800 bits per
second.

Also, since Asterisk specifically supports v.27ter the enum was renamed to
better reflect this.

ASTERISK-24955 #close
Reported by: Matt Jordan

Change-Id: I4b9dfb6bf7eff08463ab47ee1a74224f27cae733
2015-04-29 15:39:11 -05:00
Matt Jordan 57cbb4bc8d Merge "Astobj2: Add ao2_weakproxy_ref_object function." 2015-04-29 13:37:20 -05:00
Joshua Colp 648b22f19d Merge "res_pjsip_outbound_registration: Don't fail on delayed processing." 2015-04-29 13:09:20 -05:00
Corey Farrell c9c03998cc Astobj2: Add ao2_weakproxy_ref_object function.
This function allows code to run ao2_ref against the real
object associated with a weakproxy.  It is useful when
all of the following conditions are true:
* You have a pointer to weakproxy.
* You do not have or need a pointer to the real object.
* You need to ensure the real object exists and is not
  destroyed during a process.

In this case it's wasteful to store a pointer to the real
object just for the sake of releasing it later.

Change-Id: I38a319b83314de75be74207a8771aab269bcca46
2015-04-29 13:28:54 -04:00
Mark Michelson 03261b9614 Merge "Git Conversion: Switch Non-C files to ASTERISK_REGISTER_FILE." 2015-04-29 12:28:24 -05:00
Mark Michelson 4f1db2070d res_pjsip_outbound_registration: Don't fail on delayed processing.
Odd behaviors have been observed during outbound registrations. The most
common problem witnessed has been one where a request with
authentication credentials cannot be created after receiving a 401
response. Other behaviors include apparently processing an incorrect SIP
response.

Inspecting the code led to an apparent issue with regards to how we
handle transactions in outbound registration code. When a response to a
REGISTER arrives, we save a pointer to the transaction and then push a
task onto the registration serializer. Between the time that we save the
pointer and push the task, it's possible for the transaction to be
destroyed due to a timeout. It's also possible for the address to be
reused by the transaction layer for a new transaction.

To allow for authentication of a REGISTER request to be authenticated
after the transaction has timed out, we now hold a reference to the
original REGISTER request instead of the transaction. The function for
creating a request with authentication has been altered to take the
original request instead of the transaction where the original request
was sent.

ASTERISK-25020
Reported by Mark Michelson

Change-Id: I756c19ab05ada5d0503175db9676acf87c686d0a
2015-04-29 12:04:06 -05:00
Joshua Colp ed5715eb39 res_sorcery_config: Fix build issue due to syntax error.
Change-Id: Ic8322f04e37842848ad72cf2871bd0378f67c4ac
2015-04-29 10:48:14 -05:00
Matt Jordan 48d5971a82 Merge "chan_pjsip: Creating Channel Causes Asterisk to Crash When Duplicate AOR Sections Exist in pjsip.conf" 2015-04-29 10:13:03 -05:00
Matt Jordan d6ecbbac0a Merge topic 'ASTERISK-25027'
* changes:
  res_pjsip: Remove incorrect MODULEINFO from presence_xml.c.
  Git Migration: Create doc/rest-api when needed.
2015-04-29 09:49:43 -05:00
Matt Jordan f6202f5cf0 Merge "Build System: Prevent unneeded changes to asterisk/buildopts.h." 2015-04-29 09:47:58 -05:00
Corey Farrell f226bd6f60 ARI: Fix missing dependencies.
ARI modules that are generated by 'make ari-stubs' are all dependent on
res_ari_model.  Additionally some of the same modules depend on one or more
res_stasis_* modules.

ASTERISK-25027 #close
Reported by: Corey Farrell

Change-Id: I8e07fe7e81fedacb87232f2b6f8b5f47927b4153
2015-04-29 07:46:44 -04:00
Corey Farrell 881844297a res_pjsip: Remove incorrect MODULEINFO from presence_xml.c.
Remove incorrect MODULEINFO block and unneeded header includes
from presence_xml.c.

ASTERISK-25027
Reported by: Corey Farrell

Change-Id: I977c609ab9d1fe05373027c4138900f6985990eb
2015-04-29 07:46:03 -04:00
Corey Farrell c232ff3af0 Git Migration: Create doc/rest-api when needed.
Create the directory './doc/rest-api' at the start of 'make ari-stubs'
to prevent an error when documentation is generated.  The directory is
also added to git ignores.

ASTERISK-25027
Reported by: Corey Farrell

Change-Id: Iaccc7f0138501c23aa78feaca2f3cce9e68cbc1b
2015-04-29 06:24:51 -05:00
Joshua Colp 78ff328b0b Merge "chan_iax2: Ensure that IAX flags are 64 bits." 2015-04-29 05:31:05 -05:00
Corey Farrell 5d997ecc83 Build System: Prevent unneeded changes to asterisk/buildopts.h.
* Add AST_DEVMODE to BUILDOPTS
* Use BUILDOPTS to generate AST_BUILDOPT_SUM.
* Remove loop that defined AST_MODULE_*

These changes ensure that only ABI effecting options are considered for
AST_BUILDOPT_SUM.  This also reduces unneeded full system rebuilds caused
by enabling or disabling one module that another is dependent on.

ASTERISK-25028 #close
Reported by: Corey Farrell

Change-Id: I2c516d93df9f6aaa09ae079a8168c887a6ff93a2
2015-04-29 04:03:00 -04:00
Corey Farrell 55a780d211 Git Conversion: Switch Non-C files to ASTERISK_REGISTER_FILE.
This switches files used to generate other sources to use the new
ASTERISK_REGISTER_FILE macro.

ASTERISK-25026 #close
Reported by: Corey Farrell

Change-Id: Ieb2537b83421cad07c8955e5f90c405ccf079740
2015-04-29 01:02:10 -04:00
Joshua Colp 2415e94b07 Merge "res_pjsip_outbound_registration: Add debugging messages." 2015-04-28 19:18:29 -05:00
Mark Michelson 36a9bd994b Merge "CHANGES: Add missing spaces." 2015-04-28 16:38:12 -05:00
Yousf Ateya 5ebfed8ef3 chan_iax2: Ensure that IAX flags are 64 bits.
Flags are 64 bits.  Without LLU suffix the value of 1<<31 is negative.
Although it doesn't have an effect on the current implementation, it will
be problem if more flags are added.

Change-Id: Ic290c81cfbbbf062872392d99d3322932cc49487
2015-04-28 14:59:18 -05:00
Ashley Sanders 46cf643c75 chan_pjsip: Creating Channel Causes Asterisk to Crash When Duplicate AOR
Sections Exist in pjsip.conf

This patch modifies the current loading strategy of the pjsip configuration. If
duplicate sections (e.g. sections containing the same [id/type]) are defined in
[pjsip.conf], the loader will consider the configuration for the given type as
invalid when the duplicate section is encountered. The entire configuration
(including what was previously loaded) for the duplicate [id/type] sections
will be rejected and destroyed, an error message is logged and the load
processing for the given stops.

ASTERISK-24996
Reported By: Ashley Sanders

Change-Id: I35090ca4cd40f1f34881dfe701a329145c347aef
2015-04-28 14:01:54 -05:00
Richard Mudgett 0bbe2c35cf chan_vpb: Fix compile error due to use of ASTERISK_FILE_VERSION.
Change-Id: I51179e2a83937423676da522b766f1126de4059e
2015-04-28 12:22:33 -05:00
Mark Michelson f47fed2e12 res_pjsip_outbound_registration: Add debugging messages.
When problems occur regarding outbound registrations, it currently
is difficult to debug. Most off-nominal paths had warning messages,
but sometimes we want to know what's going on before hitting the
off-nominal path. This patch adds lots of debugging output that
should give a clearer picture of what is happening with regards
to outbound registrations.

ASTERISK-25020
Reported by Mark Michelson

Change-Id: I577bde7860be0a6c872b5bcb4d5047340bf45d45
2015-04-28 10:43:38 -05:00
Joshua Colp 7c18edaa10 Merge "Example script for scan-build (the llvm static analyzer)" 2015-04-28 07:15:47 -05:00
Steve Davies 5e96584829 res_rtp_asterisk: Resolve 2 discrete memory leaks in DTLS
ao2 ref leak in res_rtp_asterisk.c when a DTLS policy is created.
The resources are linked into a table, but the original alloc refs
are never released. ast_strdup leak in rtp_engine.c. If
ast_rtp_dtls_cfg_copy() is called twice on the same destination struct,
a pointer to an alloc'd string is overwritten before the string is free'd.

ASTERISK-25022
Reported by: one47

Change-Id: I62a8ceb8679709f6c3769136dc6aa9a68202ff9b
2015-04-28 06:57:44 -05:00
Joshua Colp b2153f1f49 Merge "cdr/cdr_odbc.c: Added to record new columns add on CDR 1.8 Asterisk Version" 2015-04-28 06:55:30 -05:00
Matt Jordan e43fa9868b Merge "Astobj2: Allow reference debugging to be enabled/disabled by config." 2015-04-28 06:42:30 -05:00
Rodrigo Ramírez Norambuena d6a2d92353 cdr/cdr_csv.c: Add missing space after comma.
Change-Id: I3866a20019b1a3a2f10fe36640053929330b0fcb
2015-04-28 05:28:37 -04:00
Rodrigo Ramírez Norambuena 542bfee881 CHANGES: Add missing spaces.
Change-Id: I534ea0f22759e3633585dfa9b145b4a284efe67f
2015-04-27 23:01:25 -04:00
Corey Farrell 5c1d07baf0 Astobj2: Allow reference debugging to be enabled/disabled by config.
* The REF_DEBUG compiler flag no longer has any effect on code that uses
  Astobj2.  It is used to determine if reference debugging is enabled by
  default.  Reference debugging can be enabled or disabled in asterisk.conf.
* Caller information is provided in logger errors for ao2 bad magic numbers.
* Optimizes AO2 by merging internal functions with the public counterpart.
  This was possible now that we no longer require a dual ABI.

ASTERISK-24974 #close
Reported by: Corey Farrell

Change-Id: Icf3552721fe999365ba8a8cf00a965aa6b897cc1
2015-04-27 18:37:26 -04:00
George Joseph 356568dc7f res_pjsip: Fix SEGV on pending-qualify contacts
Permanent contacts that hadn't been qualified yet were missing
their contact_status entries causing SEGVs when running CLI
commands.

This patch makes sure that contact_statuses are created for
both dynamic and permanent contacts when they are created.
It also adds checks in the CLI code to make sure there's a
contact_status, just in case.

ASTERISK-25018 #close
Reported-by: Ivan Poddubny
Tested-by: Ivan Poddubny
Tested-by: George Joseph

Change-Id: I3cc13e5cedcafb24c400368b515b02d7fb81e029
2015-04-27 12:19:06 -05:00