ASTERISK_28702 previously attempted to fix an
issue with flash hook hold timing out after
just under 17 minutes, when it should have never
been timing out. It fixed this by changing 999999
to INT_MAX, but it did so in chan_dahdi, which
is the wrong place since ss_thread is now in
sig_analog and the one in chan_dahdi is mostly
dead code.
This fixes this by porting the fix to sig_analog.
ASTERISK-30336 #close
Change-Id: I05eb69cc0b5319d357842a70bd26ef64d145cb15
Currently, chan_dahdi will wait for at least one
ring before an incoming call can enter the dialplan.
This is generally necessary in order to receive
the Caller ID spill and/or distinctive ringing
detection.
However, if neither of these is required, then there
is nothing gained by waiting for one ring and this
unnecessarily delays call setup. Users can now
use immediate=yes to make FXO channels (FXS signaled)
begin processing dialplan as soon as Asterisk receives
the call.
ASTERISK-30305 #close
Change-Id: I20818b370b2e4892c7f40c8a8753fa06a81750b5
unicast_rtp_request() was setting the channel variables like this:
pbx_builtin_setvar_helper(chan, "UNICASTRTP_LOCAL_ADDRESS",
ast_sockaddr_stringify_addr(&local_address));
ast_rtp_instance_get_local_address(instance, &local_address);
pbx_builtin_setvar_helper(chan, "UNICASTRTP_LOCAL_PORT",
ast_sockaddr_stringify_port(&local_address));
...which made it appear that UNICASTRTP_LOCAL_ADDRESS was being
set before local_address was set. In fact, the address part of
local_address was set earlier in the function, just not the port.
This was confusing however so ast_rtp_instance_get_local_address()
is now being called before setting UNICASTRTP_LOCAL_ADDRESS.
ASTERISK-30281
Change-Id: I872ac49477100f4eb33891d46efc6ca21ec81aa4
This fixes dahdi_request to properly set the cause
code to CONGESTION instead of BUSY if no channels
were actually available.
Currently, the cause is erroneously set to busy
if the channel itself is found, regardless of its
current state. However, if the channel is not available
(e.g. T1 down, card not operable, etc.), then the
channel itself may not be in a functional state,
in which case CHANUNAVAIL is the correct cause to use.
This adds a simple check to ensure that busy tone
is only returned if a channel is encountered that
has an owner, since that is the only possible way
that a channel could actually be busy.
ASTERISK-30274 #close
Change-Id: Iad5870223c081240c925b19df8d6af136953b994
This change allows TEL URI requests to come through for basic calls. The
allowed requests are INVITE, ACK, BYE, and CANCEL. The From and To
headers will now allow TEL URIs, as well as the request URI.
Support is only for TEL URIs present in traffic from a remote party.
Asterisk does not generate any TEL URIs on its own.
ASTERISK-26894
Change-Id: If5729e6cd583be7acf666373bf9f1b9d653ec29a
With gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0:
> chan_dahdi.c:4129:18: error: ‘%s’ directive output may be truncated
> writing up to 255 bytes into a region of size between 242 and 252
> [-Werror=format-truncation=]
This removes the error-prone sizeof(...) calculations in favor of just
doubling the size of the base buffer.
Change-Id: I2d276785286730d3d5d0a921bcea2e065dbf27c5
Adjusts some logging levels to be more or less important,
that is more prominent when actual problems occur and less
prominent for less noteworthy things.
ASTERISK-30153 #close
Change-Id: Ifc8f7df427aa018627db462125ae744986d3261b
There are several things wrong with analog Caller ID
handling that are fixed by this commit:
callerid.c's Caller ID generation function contains the
logic to use the presentation to properly send the proper
Caller ID. However, currently, DAHDI does not pass any
presentation information to the Caller ID module, which
means that presentation is completely ignored on all calls.
This means that lines could be getting Caller ID information
they aren't supposed to.
Part of the reason this has been obscured is because the
simple switch logic for handling the built in *67 and *82
is completely wrong. Rather than modifying the presentation
for the call accordingly (which is what it's supposed to do),
it simply blanks out the Caller ID or fills it in. This is
wrong, so wrong that it makes a mockery of the specification.
Additionally, it would leave to the "UNAVAILABLE" disposition
being used for Caller ID generation as opposed to the "PRIVATE"
disposition that it should have been using. This is now fixed
to only update the presentation and not modify the number and
name, so that the simple switch *67/*82 work correctly.
Next, sig_analog currently only copies over the name and number,
nothing else, when it is filling in a duplicated caller id
structure. Thus, we also now copy over the presentation
information so that is available for the Caller ID spill.
Additionally, this meant that "valid" was implicitly 0,
and as such presentation would always fail to "Unavailable".
The validity is therefore also copied over so it can be used
by ast_party_id_presentation.
As part of this fix, new API is added so that all the relevant
Caller ID information can be passed in to the Caller ID generation
functions. Parameters that are also completely missing from the
Caller ID spill have also been added, to enhance the compatibility,
correctness, and completeness of the Asterisk Caller ID implementation.
ASTERISK-29991 #close
Change-Id: Icc44a5e09979916f4c18a440f96e10dc1c76ae15
Adds a POLARITY function which can be used to
retrieve the current polarity of an FXS channel
as well as set the polarity of an FXS channel
to idle or reverse at any point during a call.
ASTERISK-30000 #close
Change-Id: If6f50998f723e4484bf68e2473f5cedfeaf9b8f1
ASTERISK_30007 accidentally made OpenSSL a
required depdendency. This adds an ifdef so
the relevant code is compiled only if OpenSSL
is available, since it only needs to be executed
if OpenSSL is available anyways.
ASTERISK-30083 #close
Change-Id: Iad05c1a9a8bd2a48e7edf8d234eaa9f80779e34d
Three-way calling for analog lines is currently broken.
If party A is on a call with party B and initiates a
three-way call to party C, the behavior differs depending
on whether the call is conferenced prior to party C
answering. The post-answer case is correct. However,
if A flashes before C answers, then the next flash
disconnects B rather than C, which is incorrect.
This error occurs because the subs are not swapped
in the misbehaving case. This is because the flash
handler only swaps the subs if C has answered already,
which is wrong. To fix this, we swap the subs regardless
of whether C has answered or not when the call is
conferenced. This ensures that C is disconnected
on the next hook flash, rather than B as can happen
currently.
ASTERISK-30043 #close
Change-Id: I96c5bf6c9b7eb2636136b716c677c82c079b6f06
If a switch is invoked using chan_iax2, deadlock can result
because the PBX core is autoservicing the channel while chan_iax2
also then attempts to service it while waiting for the result
of the switch. This removes servicing of the channel to prevent
any conflicts.
ASTERISK-30064 #close
Change-Id: Ie92f206d32f9a36924af734ddde652b21106af22
When a PJSIP channel is set on hold or off hold, all streams were set
on/off hold. This is not the desired behaviour and caused issues
when there were multiple streams in the topology.
Now, only the default audio stream is set on/off hold when a hold is
indicated.
ASTERISK-30051
Change-Id: I04f1110565fd05fea565f5539b534b54549d4f71
This change exposes the channel driver's unique id (i.e. the Call-ID
for chan_sip/chan_pjsip based channels) to ARI channel resources
as `protocol_id`.
ASTERISK-30027
Reported by: Moritz Fain
Tested by: Moritz Fain
Change-Id: I7cc6e7a9d29efe74bc27811d788dac20fe559b87
Currently, the operator services mode in DAHDI is broken and unusable.
The actual operator recall functionality works properly; however,
when the operator hangs up (which is the only way that such a call
is allowed to end), both lines are permanently taken out of service
until "dahdi restart" is run. This prevents this feature from being
used.
Operator mode is one of the few factors that can cause the general
analog event handling in sig_analog not to be used. Several years
back, much of the analog handling was moved from chan_dahdi to
sig_analog. However, this was not done fully or consistently at
the time, and when operator mode is active, sig_analog does not
get used. Generally this is correct, but in the case of hangup
it should be using sig_analog regardless of the operator mode;
otherwise, the lines do not properly clear and they become unusable.
This bug is fixed so the operator can now hang up and properly
release the call. It is treated just like any other hangup. The
operator mode functionality continues to work as it did before.
ASTERISK-29993 #close
Change-Id: Ib2e3ddb40d9c71e8801e0b4bb0a12e2b52f51d24
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
Documents the Dial syntax for DAHDI, namely the channel group,
distinctive ring, answer confirmation, and digital call options
that are specified in the resource itself.
ASTERISK-24827 #close
Change-Id: Ib95e78497fb00dc5cbfde1c93a69f034bfd08c30
For lines that have mailboxes configured on them, with
FSK MWI, DAHDI will periodically try to dispatch FSK
to update MWI. However, this is never supposed to be
done when a channel is not idle.
There is currently an edge case where MWI FSK can
extraneously get spooled for the channel if a caller
hook flashes and hangs up, which triggers a recall ring.
After one ring, the on hook time threshold in this if
condition has been satisfied and an MWI update is spooled.
This means that when the phone is picked up again, the
answerer gets an FSK spill before being reconnected to
the party on hold.
To prevent this, we now explicitly check to ensure that
subchannel 0 has no owner. There is no owner when DAHDI
channels are idle, but if the channel is "in use" in some
way (such as in the aforementioned scenario), then there
is an owner, and we shouldn't process MWI at this time.
ASTERISK-28518 #close
Change-Id: Ia3904434fd81688d71742f7e84358b7e1c38e92a
Currently, if any custom ring cadences are specified, they are
appended to the array of cadences from wherever we left off
last time. This works properly the first time, but on subsequent
dahdi restarts, it means that the existing cadences are left
alone and (most likely) the same cadences are then re-added
afterwards. In short order, the cadence array gets maxed out
and the user begins seeing warnings that the array is full
and no more cadences may be added.
This buggy behavior persists until Asterisk is completely
restarted; however, if and when dahdi restart is run again,
then the same problem is reintroduced.
This fixes this behavior so that cadence parsing is more
idempotent, that is so running dahdi restart multiple times
starts adding cadences from the beginning, rather than from
wherever the last cadence was added.
As before, it is still not possible to revert to the default
cadences by simply removing all cadences in this manner, nor
is it possible to delete existing cadences. However, this
does make it possible to update existing cadences, which
was not possible before, and also ensures that the cadences
remain unchanged if the config remains unchanged.
ASTERISK-29990 #close
Change-Id: Ie32ea3e8a243b766756b1afce684d4a31ee7421d
Currently, if attempting to place a call to a peer that only allows
RSA authentication, if we fail to provide an outkey when placing
the call, Asterisk will crash.
This exposes the broader issue that IAX2 is prone to causing a crash
if encryption or decryption is attempted but we never initialized
the encryption and decryption keys. In other words, if the logic
to use encryption in chan_iax2 is not perfectly aligned with the
decision to build keys in the first place, then a crash is not
only possible but probable. This was demonstrated by ASTERISK_29264,
for instance.
This permanently prevents such events from causing a crash by explicitly
checking that keys are initialized properly before setting the flags
to use encryption for the call. Instead of crashing, the call will
now abort.
ASTERISK-30007 #close
Change-Id: If925c3d86099ceac7f621804f2532baac5050c9a
According to chan_dahdi.conf, up to 64 groups (numbered
0 through 63) can be used when dialing DAHDI channels.
However, currently dialing round robin with a group number
greater than 31 fails because the array for the round robin
structure is only size 32, instead of 64 as it should be.
This fixes that so the round robin array size is consistent
with the actual groups capacity.
ASTERISK-29994
Change-Id: I4caa08d7025f78ac75a0539f71aaf3eb3e85b3b7
Adds version information for applications, functions,
and manager events/actions.
This is not completely exhaustive by any means but
covers most new things added that have release
versioning information in the issue tracker.
ASTERISK-29940 #close
Change-Id: I506401e93c799715dbbe97c0a8ba18af2bf5e131
If Asterisk receives a SIP REFER with Session-Timers UAC
maintain Session-Timers when sending UPDATE"
ASTERISK-29843
Change-Id: I8e9a21c13bf757fa34d778f49ba3cf859b29ae5c
PJSIP currently is capable of receiving flash events
and converting them to FLASH control frames, but it
currently lacks support for doing the reverse: taking
a FLASH control frame and converting it into a flash
event in the SIP domain.
This adds the ability for PJSIP to process flash control
frames by converting them into the appropriate SIP INFO
message, which can then be sent to the peer. This allows,
for example, flash events to be sent between Asterisk
systems using PJSIP.
ASTERISK-29941 #close
Change-Id: I1590221a4d238597f79672fa5825dd4a920c94dd
if Asterisk need to send an UPDATE before answer
on a channel that uses Record-Route:
it will not include a Route header
ASTERISK-29955
Change-Id: Id1920ecbfea7739a038b14dc94487ecfe7b57eef
added new global config option "allow_sending_180_after_183"
that if enabled will preserve 180 after a 183
ASTERISK-29842
Change-Id: I8a53f8c35595b6d16d8e86e241b5f110d92f3d18
Change RTP timer behavior for detecting RTP only after two-way
SDP channel establishment. Ignore detecting after receiving 183
with SDP or while direct media is used.
Make rtp_timeout and rtp_timeout_hold options consistent to rtptimeout
and rtpholdtimeout options in chan_sip.
ASTERISK-26689 #close
ASTERISK-29929 #close
Change-Id: I07326d5b9c40f25db717fd6075f6f3a8d77279eb
The iax2 show netstats command previously didn't contain
enough spacing in the header to properly align the table
header with the table body. This caused column headers
to not align with the values on longer channel names.
Some spacing is added to account for the longest channel
names that display (before truncation occurs) so that
columns are always properly aligned.
ASTERISK-29895 #close
patches:
61205_misaligned2.patch submitted by Birger Harzenetter (license 5870)
Change-Id: I450ce6bb81157b9d6d149007e53b749f237b6d9f
ASTERISK_22025 introduced a regression that shows
the host IP and port as the perceived IP and port
again, as opposed to showing the actual perceived
address. This fixes this by showing the correct
information.
ASTERISK-29048 #close
Change-Id: I0ad3e25bc6b449e83ce72ea5d1a1cdba72aa304a
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
Attempting to access ${CHANNEL(ruri)} in a pre-dial handler before
initiating an outgoing call will cause Asterisk to crash. This is
because a null field is accessed, resulting in an offset from null and
subsequent memory access violation.
Since RURI is not guaranteed to exist, we now check if the base
pointer is non-null before calculating an offset.
ASTERISK-29772
Change-Id: Icd3b02f07256bbe6615854af5717074087b95a83
Since Doxygen 1.8.16, a special comment block is required. Otherwise
(pure C comment), the group command is ignored. Additionally, several
unbalanced group commands were fixed.
ASTERISK-29732
Change-Id: I4687857b9d56e6f44fd440b73af156691660202e
Most examples in the XML documentation use the
example tag to demonstrate examples, which gets
parsed specially in the Wiki to make it easier
to follow for users.
This fixes a few modules to use the example
tag instead of vanilla para tags to bring them
in line with the standard syntax.
ASTERISK-29777 #close
Change-Id: I9acb6cc5faf1d220e73c6dd28592371d768d279b
Fixes compiler warning caused by a truncated copy of the ANI2 into a
buffer of size 10. This could prevent the null terminator from being
copied if the copy value exceeds the size of the buffer. This increases
the buffer size to 101 to ensure there is no way for truncation to occur.
ASTERISK-29702 #close
Change-Id: Ief9052212952840fa44de6463b8699fdb3e163d0
Historically, the dial syntax for IAX2 has held that
an outkey (used only for RSA authenticated calls)
and a secret (used only for plain text and MD5 authenticated
calls, historically) were mutually exclusive, and thus
the same position in the dial string was used for both
values.
Now that encryption is possible with RSA authentication,
this poses a limitation, since encryption requires a
secret and RSA authentication requires an outkey. Thus,
the dial syntax is extended so that both a secret and
an outkey can be specified.
The new extended syntax is backwards compatible with the
old syntax. However, a secret can now be specified after
the outkey, or the outkey can be specified after the secret.
This makes it possible to spawn an encrypted RSA authenticated
call without a corresponding peer being predefined in iax.conf.
ASTERISK-29707 #close
Change-Id: I1f8149313ed760169d604afbb07720a8b07dd00e
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
Adds support for encryption to RSA-authenticated
calls. Also prevents crashes if an RSA IAX2 call
is initiated to a switch requiring encryption
but no secret is provided.
ASTERISK-20219
Change-Id: I18f1f9d7c59b4f9cffa00f3b94a4c875846efd40
Adds parsing of ANI II digits (Originating
Line Information) to PJSIP, on par with
what currently exists in chan_sip.
ASTERISK-29472
Change-Id: Ifc938a7a7d45ce33999ebf3656a542226f6d3847
Adds an information element for ANI2 so that
Originating Line Information can be transmitted
over IAX2 channels.
ASTERISK-29605 #close
Change-Id: Iaeacdf6ccde18eaff7f776a0f49fee87dcb549d2
This changeset is intended to address compatibility issues encountered
when interfacing Asterisk to electromechanical telephone switches that
implement ANI-B, ANI-C, or ANI-D.
In particular the behaviours that this impacts include:
- FGC-CAMA did not work at all when using MF signaling. Modified the
switch case block to send calls to the correct part of the
signaling-handling state machine.
- For FGC-CAMA operation, the delay between called number ST and
second wink for ANI spill has been made configurable; previously
all calls were made to wait for one full second.
- After the ANI spill, previous behavior was to require a 'ST' tone
to advance the call. This has been changed to allow 'STP' 'ST2P'
or 'ST3P' as well, for compatibility with ANI-D.
- Store ANI2 (ANI INFO) digits in the CALLERID(ANI2) channel variable.
- For calls with an ANI failure, No. 1 Crossbar switches will send
forward a single-digit failure code, with no calling number digits
and no ST pulse to terminate the spill. I've made the ANI timeout
configurable so to reduce dead air time on calls with ANI fail.
- ANI info digits configurable. Modern digital switches will send 2
digits, but ANI-B sends only a single info digit. This caused the
ANI reported by Asterisk to be misaligned.
- Changed a confusing log message to be more informative.
ASTERISK-29518
Change-Id: Ib7e27d987aee4ed9bc3663c57ef413e21b404256