This reverts commit bfe9e1b2e7.
Reason for revert: Per discussion on IRC we're sticking to policy.
Change-Id: I61691a9ffa1bc30807cbe618a4a72b4d214481aa
In order to reduce the amount of AMI and ARI events generated,
the global "Message/ast_msg_queue" channel can be set to suppress
it's normal channel housekeeping events such as "Newexten",
"VarSet", etc. This can greatly reduce load on the manager
and ARI applications when the Digium Phone Module for Asterisk
is in use. To enable, set "hide_messaging_ami_events" in
asterisk.conf to "yes" In Asterisk versions <18, the default
is "no" preserving existing behavior. Beginning with
Asterisk 18, the option will default to "yes".
NOTE: This change does not affect UserEvents or the ARI
TextMessageReceived events.
* Added the "hide_messaging_ami_events" option to asterisk.conf.
* Changed message.c to set the AST_CHAN_TP_INTERNAL property on
the "Message/ast_msg_queue" channel if the option is set in
asterisk.conf. This suppresses the reporting of the events.
Change-Id: Ia2e3516d43f4e0df994fc6598565d6bba2d7018b
The cleanup code in stasis shuts down applications if they are in a deactivated
state, and no longer have explicit subscriptions. When registering an app the
cleanup code was running before calling 'update'. When it should be executed
after 'update' since a call to register may re-activate the app. We don't want
it to shutdown before the 'update' otherwise the app won't be re-activated,
or registered.
This patch makes it so the cleanup code is executed post 'update'.
ASTERISK-28679 #close
Change-Id: I8f2c0b17e33bb8128441567b97fd4c7bf74a327b
(cherry picked from commit dc9875815c)
Calling 'app_send' eventually calls the app's message handler. It's possible
for a handler to obtain a lock on another object, and then need/want to lock
the app object. If the caller of 'app_send' locks the app object prior to
calling then there's a potential for a deadlock, if another thread calls
'app_send' without locking.
This patch makes it so 'app_send' is not called with the app object locked in
the section of code doing such.
ASTERISK-28423 #close
Change-Id: I6767c6d0933c7db1b984018966eefca4c0638a27
(cherry picked from commit e103339f02)
Each subscription needs to have a reference to the persisted data
for it, as well as the main JSON contained within the tree. When
recreating a subscription this did not occur and they both shared
the same reference.
ASTERISK-28714
Change-Id: I706abd49ea182ea367a4ac3feca2706460ae9f4a
(cherry picked from commit 4d32f5747c)
When Alice calls Bob and Bob does a blind transfer to Charlie,
Bob's bridge leave event generates a finalize on both the party_a
and party_b CDRs but while the party_a CDR has the correct end time
set from the event time, party_b's leg did not. This caused that
CDR's end time to be equal to the answered time and resulted in a
billsec of 0.
* We now pass the bridge leave message event time to
cdr_object_party_b_left_bridge_cb() and set it on that CDR before
calling cdr_object_finalize() on it.
NOTE: This issue affected transfers using chan_sip most of the
time but also occasionally affected chan_pjsip probably due to
message timing.
ASTERISK-28677
Reported by: Maciej Michno
Change-Id: I790720f1e7326f9b8ce8293028743b0ef0fb2cca
Add a new configuration option 'enable_status' which allows the
/httpstatus URI handler to be administratively disabled.
We also no longer unconditionally register the /static and /httpstatus
URI handlers, but instead do it based upon configuration.
Behavior change: If enable_static was turned off, the URI handler was
still installed but returned a 403 when it was accessed. Because we
now register/unregister the URI handlers as appropriate, if the
/static URI is disabled we will return a 404 instead.
Additionally:
* Change 'enablestatic' to 'enable_static' but keep the former for
backwards compatibility.
* Improve some internal variable names
ASTERISK-28710 #close
Change-Id: I647510f796473793b1d3ce1beb32659813be69e1
The no-entry timeout set to 999999 == 16⅔ minutes, change to INT_MAX
to match behavior of "no timeout" defined in comment.
ASTERISK-28702 #close
Change-Id: I4ea015986e061374385dba247b272f7aac60bf11
SILK @ 24kHz is not shown in the 'core show translation' output because of an
off-by-one-error. Discovered while looking into ASTERISK~19871.
ASTERISK-28706
Reported by: Sean Bright
Change-Id: Ie1a551a8a484e07b45c8699cc0c90f1061029510
In af90afd90c, Japanese language support
was added to app_voicemail and main/say.c, but the leading whitespace
is not consistent with Asterisk coding guidelines. This patch fixes
that.
Whitespace only, no functional change.
ASTERISK~23324
Reported by: Kevin McCoy
Change-Id: I72c725f5930084673749bd7c9cc426a987f08e87
lws2sws() does not stop trying to handle header continuation lines
even after all headers have been found. This is problematic if the
first character of a SIP message body is a space or tab character, so
we update to recognize the end of the message header.
ASTERISK-28693 #close
Reported by: Frank Matano
Change-Id: Idec8fa58545cd3fd898cbe0075d76c223f8d33df
ast_store_realtime() is not NULL tolerant, so we need to initialize
the field values we pass to it to the empty string to avoid a crash.
ASTERISK-23739 #close
Reported by: Stas Kobzar
Change-Id: I756c5dd0299c77f4274368f7c99eb0464367466c
If voicemail.conf exists but is empty, the config parsing process will
default a number of global variables to non-zero values. On the other
hand, if voicemail.conf is missing (arguably semantically equivalent
to an empty file), this process is skipped and the globals are
defaulted to 0.
Set the globals to the same values they would be set to if a
configuration were present. This allows voicemail configuration to be
done completely by Realtime without the need to create an empty
voicemail.conf file.
ASTERISK-27622 #close
Reported by: Jim Van Meggelen
Change-Id: Id907d280f310f12e542ca527e6a025432b9fb409
The QueueMemberPause AMI event includes two fields that return the
reason a member was paused.
* In release branches, deprecate Reason in favor of PausedReason.
* In master, remove the Reason field entirely.
ASTERISK-28349 #close
Reported by: Niksa Baldun
Change-Id: I01da58f2b0ab927baeee754870f62b51b7b3d296
The change in 9b99ef50b5 updated the
syntax of the 'realtime update2' CLI command but did not correctly
update the calls to ast_update2_realtime().
The issue this addresses was originally opened because we aren't
allowing a SQL NULL to be set as part of the update, but this is a
limitation of the Realtime API and is not a bug.
Additionally, this patch:
* Corrects the example in the command documentation to reflect
'update2' instead of 'update.'
* Fixes the leading spacing of the command documentation.
* Checks that the required 'NULL' literal argument is present where we
expect it to be.
ASTERISK-21794 #close
Reported by: Cédric Bassaget
Change-Id: Idda63a5dc50d5f9bcb34c27ea3238d90f733b2cd
We allow for 'maxredirs' to be set, but this value is ignored when
followlocation is not enabled which, by default, it is not.
ASTERISK-17491 #close
Reported by: candrews
Change-Id: I96a4ab0142f2fb7d2e96ff976f6cf7b2982c761a
ast_addressfamily_to_sockaddrize will determine the size that's
required, and ast_sockaddr_from_sockaddr then wraps this new function
and ast_sockaddr_copy_sockaddr to copy arbitrary sockaddr's (without
knowing the address family) into the ast_sockaddr structure.
Change-Id: Iee604e96e9096c79b477d6e5ff310cf0b06dae86
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
Additionally alter the warning to mention that it was "beep" which could
not be streamed to give admins a better clue about what the warning
means.
ASTERISK-28682
Change-Id: If5aed21226a173117ed17589f44826dd1ba6576e
This patch fixes some wrongly formatted documentation for the AgentLogin
application. A couple of "see also" links should contain only the function
name, and no parameters.
Change-Id: I3f788b47dce3292e311f8a9856938d59a0bd0661
If you do a "make all" when building Asterisk the xml documentation
produced will be missing certain AMI events where their
documentation is located not at the top of the c source file but
embedded further down next to the event's manager_event()
registration call. See main/manager_mwi.c for an example.
"make full" does produce the correct documentation so we're changing
it in the build script. A separate commit/issue will address the
problem with "make all".
ASTERISK-28507
Reported by: David Lee
Change-Id: I4a22635d6eef99eacecc0efb69e28360eebdb86c
Some body generators, such as dialog-info+xml, require storing state
information which is then conveyed in the NOTIFY request itself. Up
until now there was no way for such body generators to persist this
information.
Two new API calls have been added to allow body generators to set and
get persisted data. This data is persisted out alongside the normal
persistence information and allows the body generator to restore
state information or to simply use this for normal storage of state.
State is stored in the form of JSON and it is up to the body
generator to interpret this as needed.
The dialog-info+xml body generator has been updated to take advantage
of this to persist the version number.
ASTERISK-27759
Change-Id: I5fda56c624fd13c17b3c48e0319b77079e9e27de
Adds source port matching support when IP matching is used:
[example]
type = identify
match = 1.2.3.4:5060/32, 1.2.3.4:6000/32, asterisk.org:4444
If the IP matches but the source port does not, we reject and search for
alternatives. SRV lookups are still performed if enabled (srv_lookups = yes),
unless the configured FQDN includes a port number in which case just a host
lookup is performed.
ASTERISK-28639 #close
Reported by: Mitch Claborn
Change-Id: I256d5bd5d478b95f526e2f80ace31b690eebba92
The change to add setting hangupsource to sig_pri_queue_hangup()
made in https://gerrit.asterisk.org/c/asterisk/+/12857 casued
deadlocks when a hangup request was received from the core at the
same time a hanguprequest was received from the remote end via the
D channel.
Although the PRI's channel private structure was being unlocked
before setting the hangupsource, the PRI's own lock was still being
held during the process. If channel actions were also coming from
the core, a deadlock on the PRI could result. This deadlock could
then escalate to the entire DAHDI subsystem via DAHDI's global
interface list lock, especially if someone used the PRI CLI commands.
Fix:
* We now unlock the PRI as well as the PRI's channel private
structure before setting the hangupsource, then relock both
afterwards.
ASTERISK-28605
Reported by: Dirk Wendland
Change-Id: Id74aaa5d4e3746063dbe9deed188eb65193cb9c9
Dialplan has to be careful about passing an empty device list or empty
positions in the list. As a result, dialplan has to check for these
conditions before using ChanIsAvail. Simplify dialplan by making
ChanIsAvail handle these conditions gracefully.
* Made tolerate empty positions in the device list.
* Simplified the code and eliminated some unnecessary indention.
ASTERISK-28638
Change-Id: I9e4b67e2cbf26b2417c2d03485b8568e898931d3
When a topic is created for an object, its name is only
<object>:<uniqueid>
For example:
bridge:cb68b3a8-fce7-4738-8a17-d7847562f020
When a topic is added to a pool, its name has the pool's topic
name prepended. For example:
bridge:all/bridge:cb68b3a8-fce7-4738-8a17-d7847562f020
The topic_pool_entry's name however, is only what was passed
in to stasis_topic_pool_get_topic which is
bridge:cb68b3a8-fce7-4738-8a17-d7847562f020
That's actually correct because the entry is qualified by the
pool that's in.
When you're ready to delete the entry from the pool, you retrieve
the tropic name from the object but since it now has the pool's
topic name prepended, it won't be found in the pool container.
Fix:
* Modified stasis_topic_pool_delete_topic() to skip past the
pool topic's name, if it was prepended to the topic name,
before searching the container for a pool entry.
ASTERISK-28633
Reported by: Joeran Vinzens
Change-Id: I4396aa69dd83e4ab84c5b91b39293cfdbcf483e6
Dialplan has to be careful about passing an empty destination list or
empty positions in the list. As a result, dialplan has to check for
these conditions before using Dial. Simplify dialplan by making Dial
handle these conditions gracefully.
* Made tolerate empty positions in the dialed device list.
* Reduced some message log levels from notice to verbose.
ASTERISK-28638
Change-Id: I6edc731aff451f8bdfaee5498078dd18c3a11ab9
Dialplan has to be careful about passing an empty destination list or
empty positions in the list. As a result, dialplan has to check for
these conditions before using Page. Simplify dialplan by making Page
handle these conditions gracefully.
* Made tolerate empty positions in the paged device list.
* Reduced some warnings associated with the 's' option to verbose
messages. The warning level for those messages really serves no purpose
as that is why the 's' option exists.
ASTERISK-28638
Change-Id: I95b64a6d6800cd1a25279c88889314ae60fc21e3
The Bridge application was inconsistent if the channel to bridge with is
not specified. If no parameters are given then a warning is issued and
the current channel is hung up. If options are given but no channel is
specified then a warning is issued and the current channel is not hung up.
* Made the Bridge application give a verbose message instead of a warning
if the channel to bridge with is not specified and made not hang up the
current channel. As a result dialplan no longer needs to check if a
channel name is passed before calling Bridge and simply needs to check the
BRIDGERESULT channel variable instead. This is something you likely want
your dialplan to do anyway.
* Fixed up L() option warning message. It is up to the caller to
determine if the channel is hung up because of the warning. Dial() hangs
up the current channel while Bridge() does not.
Change-Id: I44349a8dc3912397f28852777de04f19e7bb9c73
ast_sorcery_changeset_create() is not commutative and will fail to detect
differences between two variable lists depending on what changed, so switch to
ast_variable_lists_match().
ASTERISK-28492 #close
Reported by: Jean-Denis Girard
Change-Id: I7b3256983ddfaa2138d3de92a444a53b5193a4e1
When TLS is in use, checking the readiness of the underlying FD is insufficient
for determining if there is data available to be read. So before polling the
FD, check if there is any buffered data in the TLS layer and use that first.
ASTERISK-28562 #close
Reported by: Robert Sutton
Change-Id: I95fcb3e2004700d5cf8e5ee04943f0115b15e10d
Fix use of frame-level wildcard usage in suppression file.
ASTERISK-27243 #close
Reported-by: Richard Kenner
Change-Id: I1c0c64c5f305d2c9aa124e11f1f64a2eec52dc51
The SIP transaction state was reset when emitting an UPDATE or a re-INVITE
related to a COLP, preventing RTP packets to be emitted.
ASTERISK-28647
Change-Id: Ie7a30fa7a97f711e7ba6cc17f221a0993d48bd8b
The db_init() function ultimately calls db_sync() which signals the
condition before it is initialized.
Change-Id: Id4a4e025b637bc4ac7d90557fcb71d56598892ab
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
ConfBridge has the ability to move between different sample
rates for mixing the conference bridge. Up until now there has
only been the ability to set the conference bridge to mix at
a specific sample rate, or to let it move between sample rates
as necessary. This change adds the ability to configure a
conference bridge with a maximum sample rate so it can move
between sample rates but only up to the configured maximum.
ASTERISK-28658
Change-Id: Idff80896ccfb8a58a816e4ce9ac4ebde785963ee
A previous review, 13174, made a change whereby on an incoming offer SDP
the pending topology was initialized to the configured. This caused a problem
for bundle with WebRTC where bundle could reference a stream that did not
actually exist if the configuration had both audio and video but the
offer SDP only contained audio.
This change undoes that review and instead fixes the original problem it
sought to solve by setting the state of created streams based on the
contents of the offer SDP. This way the stream state is not inactive
until negotiation later completes.
ASTERISK-28659
Change-Id: Ic5ae5a86437d3e686ac5afd91d133cc916198355
A previous patch:
Gerrit Change-Id: I73bb24799bfe1a48adae9c034a2edbae54cc2a39
made it so a T.38 Gateway tries to negotiate with both sides by sending T.38
negotiation request to both endpoints supported T.38 versus the previous
behavior of forwarding negotiation to the "other" channel once a preamble
was detected.
This had the unfortunate side effect of breaking some setups. Specifically
ones that set the max datagram option on an endpoint configuration (configured
max datagram was not propagated since Asterisk now initiates negotiations).
This patch adds a configuration option, "negotiate_both", that when enabled
makes it so Asterisk initiates the negotiation requests to both endpoints vs.
the previous behavior of waiting, and forwarding the request.
The default is disabled keeping with the old behavior.
ASTERISK-28660
Change-Id: I5deb875f3485e20bc75119ec743090655d864a1a
Temporary channel lifespan is very short and CDR deactivation request
through ast_cdr_set_property() may happen when CDR is not available
yet. Use CDR_PROP() dialplan function instead, it will first wait
for pending CDR insertion requests to be processed.
ASTERISK-28636
Change-Id: I1cbe09e8d2169c0962c1195133ff260d291f2074
Due to use in res_rtp_asterisk there is a need to be able to apply an
ACL without logging any invalid/denies. It's probably sensible to at
least validate the ACL once directly after load and report invalid ACLs.
Change-Id: I256169229d945ca7c1bbf228fc492d91df345843
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
add missing argument "rtt" and "status" to the documentation
The change to the dtd file allow an enumlist to contain one or many
configOptionToEnum or enum.
This is different from the previous patch I submitted when you could have a
configOptionToEnum or (a configOptionToEnum followed by one or manu enums) or
(one or many enums)
ASTERISK-28626
Change-Id: Ia71743ee7ec813f40297b0ddefeee7909db63b6d
This reverts commit 174e6426aa.
Reason for revert: Regression in XML validation.
validity error : Content model of enumlist is not determinist:
(configOptionToEnum | (configOptionToEnum , enum+) | enum+)
As we are preparing to do releases and this is not critical
I am reverting this for now until resolved.
Change-Id: I2c9656fb40b2d2f56f54caa35c8be02cc92babd0
In Asterisk 16+, there are a few places in ast_rtp_read where we've
allocated a frame list but return a null frame instead of the list.
In these cases, any frames left in the list won't be freed. In the
vast majority of the cases, the list is empty when we return so
there's nothing to free but there have been leaks reported in the
wild that can be traced back to frames left in the list before
returning.
The escape paths now all have logic to free frames left in the
list.
ASTERISK-28609
Reported by: Ted G
Change-Id: Ia1d7075857ebd26b47183c44b1aebb0d8f985f7a
chan_sip.c:3782 __sip_xmit: sip_xmit of 0x7f1478069230 (len 600) to
213.150.203.60:1492 returned -2: Interrupted system call
returned -2 implies this wasn't actually an OS error, so errno makes no
sense either. Internal error was already logged higher up, and -2
generally means that either there isn't a valid connection available, or
the pipe notification failed, and that is already correctly logged.
ASTERISK-28651 #close
Change-Id: I46eb82924beeff9dfd86fa6c7eb87d2651b950f2
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
RFC3261 Section 10 "Registrations", specifically paragraph
"10.2.4: Refreshing Bindings", states that a user agent compares
each contact address (in a 200 REGISTER response) to see if it
created the contact. If the Asterisk endpoint has the
rewrite_contact option set however, the contact host and port sent
back in the 200 response will be the rewritten one and not the
one sent by the user agent. This prevents the user agent from
matching its own contact. Some user agents get very upset when
this happens and will not consider the registration successful.
While this is rare, it is acceptable behavior especially if more
than 1 user agent is allowed to register to a single endpoint/aor.
This commit updates res_pjsip_nat (where rewrite_contact is
implemented) to store the original incoming Contact header in
a new "x-ast-orig-host" URI parameter before rewriting it, and to
restore the original host and port to the Contact headers in the
outgoing response.
This is only done if the request is a REGISTER and rewrite_contact
is enabled.
pjsip_message_filter was also updated to ensure that if a request
comes in with any existing x-ast-* URI parameters, we remove them
so they don't conflict. Asterisk will never send a request
with those headers in it but someone might just decide to add them
to a request they craft and send to Asterisk.
NOTE: If a device changes its contact address and registers again,
it's a NEW registration. If the device didn't unregister the
original registration then all existing behavior based
on aor/remove_existing and aor/max_contacts apply.
ASTERISK-28502
Reported-by: Ross Beer
Change-Id: Idc263ad2d2d7bd8faa047e5804d96a5fe1cd282e
The simple fix here is simply to NULL out username and password after we call
ast_free on them. Unfortunately, I noticed that we weren't checking for
allocation failures for username and password, and adding those checks made
things noisy and cumbersome.
So instead we partially rollback the recent LGTM patch, and move the alloca
calls into find_aor_name().
ASTERISK-28641 #close
Reported by: Ross Beer
Change-Id: Ic9d01624e717a020be0b0aee31f0814e7f1ffbe2
We're appropriately sizing the id_domain_alias buffer, but then copying the data
into the id_domain one. We were then using the uninitialized id_domain_alias
buffer we just allocated.
This is ASTERISK~28641 adjacent, but significant enough to warrant its own
patch.
Change-Id: I81c38724d18deab8c6573153e2b99dbb6e2f33d9
We need to copy the endpoint name before we call ao2_cleanup() on it,
otherwise we might try to access memory that has been reclaimed.
ASTERISK-28445 #close
Reported by: Bernhard Schmidt
Change-Id: I404b952608aa606e0babd3c4108346721fb726b3
The problem is essentially the same as in ASTERISK~28245. Besides
the direct media scenario we have an additional scenario where a
special client is involved. This device mutes audio by default in
transmit direction (no rtp frames) and activates audio only by a
foot switch. In this situation dtmf input (pin for conferences,
transfer features codes , etc) using SIP INFO mode is not
understood properly especially when SIP INFO messages are sent
quickly.
This patch ensures that SIP INFO frames are properly queued and
processed in the above scenario. The patch also corrects situations
where successive dtmf events are received quicker than the
signalled event duration (plus minimum gap/pause) allows, i.e. DTMF
events have to be buffered in the ast channel read queue and
emulation has to be processed asynchronously at slower speed.
Reported by: Thomas Arimont
patches:
trigger_dtmf_emulation.patch submitted by Thomas Arimont (license 5525)
Change-Id: I309bf61dd065c9978c8e48f5b9a936ab47de64c2
During capabilities selection (joint capabilities of us and peer,
configured capability for this peer, or general configured
capabilities), if sip_new() does not keep framing information,
then directmedia activation will fail for any framing different
from default framing.
ASTERISK-28637
Change-Id: I99257502788653c2816fc991cac7946453082466
* Use ast_cli_completion_add() to improve performance when large number of
cached items are present.
* Only complete one URI for commands that only accept a single URI.
* Change command documentation to wrap at 80 characters to improve
readability.
Change-Id: Iedb0a2c3541e49561bc231dca2dcc0ebd8612902
if asterisk offer T38 SDP with none error correction scheme and
the endpoint respond with redundancy EC scheme, asterisk switch
to that mode. Since we configure the endpoint as none EC mode
we should not switch to any other mode except none.
following logic implemented in code.
1. If asterisk offer none, and anything except none in answer
will be ignored.
2. If asterisk offer fec, answer with fec, redundancy and none will
be accepted.
3. If asterisk offer redundancy, answer with redundancy and none
will be accepted.
ASTERISK-28621
Change-Id: I343c62253ea4c8b7ee17abbfb377a4d484a14b19
When testing for the existance of a file, the media cache is searched even if
the file has no chance of being in it. This can cause performance issues
as the media cache size increases.
As a result, calls to applications like Read and Playback using local files
must scan through the media cache before playing. Under load and with a
large cache, this can delay the playback of those files.
This patch updates the function that checks for the existance of a file to
only consult the media cache database if the requested file is a remote path.
It introduces a new is_remote_path() function in main/file.c.
ASTERISK-28625 #close
Reported-by: kevin@phoneburner.com
Change-Id: If91137493732d9034dafa381c081c69274a7dcc9
If the name of a peer is known and a SIP request is sent using that
peer's name, the address of the peer will change even if the request
fails the authentication challenge. This means that an endpoint can
be altered and even rendered unusuable, even if it was in a working
state previously. This can only occur when the nat option is set to the
default, or auto_force_rport.
This change checks the result of authentication first to ensure it is
successful before setting the address and the nat option.
ASTERISK-28589 #close
Change-Id: I581c5ed1da60ca89f590bd70872de2b660de02df
If an AMI user without the "system" authorization calls the
Originate AMI command with the Originate application,
the second Originate could run the "System" command.
Action: Originate
Channel: Local/1111
Application: Originate
Data: Local/2222,app,System,touch /tmp/owned
If the "system" authorization isn't set, we now block the
Originate app as well as the System, Exec, etc. apps.
ASTERISK-28580
Reported by: Eliel Sardañons
Change-Id: Ic4c9dedc34c426f03c8c14fce334a71386d8a5fa
The original clone depth of 10 was causing the need to rebase
changes whose parent was older than the 10 commits. The clone
depth has been increased to 100.
Workspace cleanup was only happening for successful builds which
wasn't enough to keep the 8G workspace in-memory drives on the
docker slaves from filling up. Now the workspaces are cleaned up
after every build regardless of success/failure. If you need to
preserve builds temporarily, you can log into Jenkins/Manage
Jenkins/Configure System and change the CLEANUP_WS_* environment
variable for the job type you're troubleshooting to "FALSE".
Change-Id: I0d7366e87cea714e5dbc9488caf718802fce75ca
Fixes: error: ‘domain_name’ may be used uninitialized in this function
Found with gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008
Change-Id: I44413b49ea1205aa25538142161deb73883c79e8
ASTERISK_28143 attempted to fix an issue where calls with no audio would never
timeout. It did so by adding AST_FRAME_NULL as a frame type to process in its
calculations. Unfortunately these frames seem to show up at irregular time
intervals. This resulted in app_amd returning prematurely most of the time.
* Removed AST_FRAME_NULL from the calculations
* Added a check to see how much time has actually passed since app_amd began
ASTERISK-28608
Change-Id: I642a21b02d389b17e40ccd5357754b034c3daa42
Upon a short PRI disconnection, libpri may maintain Q.921 layer 'up' and
may thus not send PRI_EVENT_DCHAN_DOWN / PRI_EVENT_DCHAN_UP events.
If pri_event_alarm() clears DCHAN_UP status bit upon alarm detection
and no Q.921 reconnection sequence occurs, chan_dahdi will keep
seeing span status "Down" at the end of alarm.
This patch modifies pri_event_alarm() in order to keep DCHAN_UP bit
unchanged. libpri will send a PRI_EVENT_DCHAN_DOWN event if it detects
a disconnection of Q.921 layer and this will clear DCHAN_UP if required.
ASTERISK-28615
Change-Id: Ibe27df4971fd4c82cc6850020bce4a8b2692c996
OpenSSL can not tolerate if the packet sent out does not
match the length that it provided to the sender. This change
lies and says that each time the full packet was sent. If
a problem does occur then a retransmission will occur as
appropriate.
ASTERISK-28576
Change-Id: Id42455b15c9dc4eb987c8c023ece6fbf3c22a449
If the last line of a file does not have a terminating EOL sequence, we
potentially add garbage to the value returned from the FILE() function.
There is no overflow potential here as we are reading from a buffer of a
known size, we are just reading too much of it.
ASTERISK-26481 #close
Change-Id: I50dd4fcf416fb3c83150040a1a79a59d9eb1ae01
MOH continues to play to a channel if that channel was on hold prior to
entering a softmix bridge. MOH will not stop even if the original "holder"
attempts an unhold.
For the most part a softmix bridge ignores holds, so a participating channel
shouldn't join while on hold. This patch checks to see if the channel joining
the softmix bridge is currently on hold. If so then it indicates an unhold.
ASTERISK-28618
Change-Id: I66ccd4efc80f5b4c3dd68186b379eb442916392b
This patch fixes several issues reported by the lgtm code analysis tool:
https://lgtm.com/projects/g/asterisk/asterisk
Not all reported issues were addressed in this patch. This patch mostly fixes
confirmed reported errors, potential problematic code points, and a few other
"low hanging" warnings or recommendations found in core supported modules.
These include, but are not limited to the following:
* innapropriate stack allocation in loops
* buffer overflows
* variable declaration "hiding" another variable declaration
* comparisons results that are always the same
* ambiguously signed bit-field members
* missing header guards
Change-Id: Id4a881686605d26c94ab5409bc70fcc21efacc25
When user wants to send json data, the default Content-Type header
is incorect (application/x-www-form-urlencoded). This patch allows
to set any custom headers so the Content-Type header can be
overriden. User can set multiple headers by multiple calls of
curlopt(). This approach is not consistent with other parameters,
but is more readable in dialplan than one call with multiple
headers.
ASTERISK-28613
Change-Id: I4dd68c3f4e25362ef941d73a3861f58348dcfbf9
There exists a scenario where a thread can hold a lock on the
channels container while trying to lock a bridge. At the same
time another thread can hold the lock for said bridge while
attempting to retrieve a channel. This causes a deadlock.
This change fixes this scenario by retrieving a channel snapshot
instead of a channel, as information present in the snapshot
is all that is needed.
ASTERISK-28616
Change-Id: I68ceb1d62c7378addcd286e21be08a660a7cecf2
Found during some testing, there is a race condition between selecting an
appropriate bridge type for a call versus the applying of media on the callee's
session. In some instances a native bridge type would have been chosen, but
due to the callee's media not yet being established at bridge compatibility
check time the simple bridge type is picked instead.
When using chan_pjsip this initiates a topology change event. The topologies
are then compared for the two sessions. However, when the topology was created
for the caller its streams are initialized to "inactive". This topology is then
used as a base when creating the callee's topology, and streams. Soon after
the caller's topology's stream(s) get updated based on the sdp (get set to
sendrecv in the failing scenario).
Now when the topology change event is raised, and the two topologies are
compared, the comparison fails due to a stream state mismatch (sendrecv vs
inactive). And since they differ a reinvite is sent out (to the caller in
this case).
This patch makes it such that when the caller's topology is initially created
it gets created based on its configured endpoint's media topology. When the
endpoint's topology is created its stream's state(s) are initialized to
sendrecv instead of inactive. Subsequently, now when the callee's topology is
created its topology streams are now initialized to sendrecv. Thus when the
topology change event occurs due to the mentioned scenario the stream states
match for the given sessions, and the reinvite is not sent unless due to some
other valid mismatch.
Note, this patch only changes one pending media state's creation point. It's
possible other places *could* be changed, however for now it was deemed best
to only alter what's here.
Change-Id: I6ba3a6a75f64824a1b963044c37acbe951c389c7
resource_events:stasis_app_message_handler() was locking the session,
then attempting to determine if the app had debug enabled which
locked the app_registry container. res_stasis:__stasis_app_register
was locking the app_registry container then calling app_update
which caused app_handler (which locks the session) to run.
The result was a deadlock.
* Updated resource_events:stasis_app_message_handler() to determine
if debug was set (which locks the app_registry) before obtaining the
session lock.
* Updated res_stasis:__stasis_app_register to release the app_registry
container lock before calling app_update (which locks the sesison).
ASTERISK-28423
Reported by Ross Beer
Change-Id: I58c69d08cb372852a63933608e4d6c3e456247b4
The current code sets alert levels starting from index 1.
Need to set on whole pool starting from index 0.
Change-Id: I5decbb43160954fb9a512f04302637fc666b6f5d
MySql 8.0.1 replaced the "my_bool" type with "bool" so an #if
was added to use "bool" with MYSQL_VERSION_ID >= 80001.
ASTERISK-28604
Change-Id: I66a28d8f0011e33774edee13a6f8efd2302bb920
If the "max_retries" option is set to 0 then upon failure no
further attemps are made, so explicitly document the behavior.
ASTERISK-28602
Change-Id: I1e30daae9dd6c49ce18744164214d3def505acbf
Calling ne_uri_parse allocates memory that needs to be freed with a
corresponding call to ne_uri_free.
ASTERISK-28572 #close
Change-Id: I8a6834da27000a6807d89cb7a157b2a88fcb5e61
This change ensures that the module isn't unloaded when a
WebSocket is open. Previously it was possible to unload the
module manually or during shutdown which could cause a crash
when any active WebSockets were terminated.
ASTERISK-28585
Change-Id: I85c71ab112f99875b586419a34c08c8b34c14c5c
When we created the External Media addition to ARI we created an
ExternalMedia object to be returned from the channels/externalMedia
REST endpoint. This object contained the channel object that was
created plus local_address and local_port attributes (which are
also in the Channel variables). At the time, we thought that
creating an ExternalMedia object would give us more flexibility
in the future but as we created the sample speech to text
application, we discovered that it doesn't work so well with ARI
client libraries that a) don't have the ExternalMedia object
defined and/or b) can't promote the embedded channel structure
to a first-class Channel object.
This change causes the channels/externalMedia REST endpoint to
return a Channel object (like channels/create and channels/originate)
instead of the ExternalMedia object.
Change-Id: If280094debd35102cf21e0a31a5e0846fec14af9
During execution "pjsip show channelstats" cli command by an
external module asterisk crashed. It seems this is a separate
thread running to fetch and print rtp stats. The crash happened on
the ao2_lock method, just before it going to read the rtp stats on
a rtp instance. According to gdb backtrace log, it seems the
session media was already cleaned up at that moment.
ASTERISK-28578
Change-Id: Ib7c7f39996d942984394782296bb99aae67862e5
If you specify multiple formats in voicemail.conf, eg. "format = gsm|wav"
and are using realtime ODBC backend, only the first format gets stored
in the database. So when you forward a message later on, there is a bug
generating the email, related to the stored format (GSM) being different
than the desired email format (WAV) specified for the user. Sox can
handle this, but Asterisk needs to tell sox exactly what to do.
ASTERISK-22192
Change-Id: I7321e7f7e7c58adbf41dd4fd7191c887b9b2eafd
Now that both FIR and REMB are being sent in compound packets
these tests can be enabled.
This also extends the REMB nominal test to cover the REMB
contents itself.
Change-Id: Ibfee526ad780eefcce5dd787f53785382210024a
PostgreSQL 12 finally removed column adsrc from table pg_catalog.pg_attrdef
(column default values), which has been deprecated since version 8.0.
Since then, the official/correct/supported way to retrieve the column
default value from the catalog is function pg_catalog.pg_get_expr().
This change breaks compatibility with pre-8.0 PostgreSQL servers,
but has reached end-of-support more than a decade ago.
cdr_pgsql and res_config_pgsql still have support for pre-7.3
servers, but cleaning that up is perhaps a topic for a major release,
not this bugfix.
ASTERISK-28571
Change-Id: I834cb3addf1937e19e87ede140bdd16cea531ebe
When creating an unsolicited MWI aggregate subscription it was possible for
the subscription object to be double unref'ed. This patch removes the explicit
unref as it is not needed since the RAII_VAR will handle it at function end.
Less concerning there was also a bug that could potentially allow the aggregate
subscription object to be added to the unsolicited container twice. This patch
ensures it is added only once.
ASTERISK-28575
Change-Id: I9ccfdb5ea788bc0c3618db183aae235e53c12763
Fixes a failure in /main/taskprocesor unit test, only occurring in Ubuntu.
Newer versions of GCC require variable initialization.
Change-Id: I2994d8aab9307a8c2c7330584f287a27144a580c
Issues in pjproject 2.9 caused us to revert some of their changes
as a work around. This introduced another issue where pjproject
wouldn't build with older gcc versions such as that found on
CentOS 6. This commit replaces the reverts with the official
fixes for the original issues and allows pjproject to be built
on CentOS 6 again.
ASTERISK-28574
Reported-by: Niklas Larsson
Change-Id: I06f8507bea553d1a01b0b8874197d35b9d47ec4c
Here's the basic scenario that occurred when executing an AMI fast originate
while at the same time something else locks the channels container, and also
wants a lock on the dialed channel:
1. pbx_outgoing_attempt obtains a lock on a dialed channel
2. concurrently another thread obtains a lock on the channels container, and
subsequently requests a lock on the dialed channel. It waits on #1. For
instance, "core show channel <dialed channel"
3. the outgoing call does not fail, but ends before the pbx_outgoing_attempt
function exits
4. pbx_outgoing_attempt function exits, the outgoing structure destructs, and
attempts to hang up the dialed channel
5. hang up tries to obtain the channels container lock, but can't due to #2.
6. Asterisk is deadlocked.
The solution was to allow the pbx_outgoing_exec function to "steal" ownership
of the dialed channel, and handle hanging it up. The channel now is either hung
up prior to it being potentially locked by the initiating thread, or if locked
the hang up takes place in a different thread, thus alleviating the deadlock.
ASTERISK-28561
patches:
iliketrains.diff submitted by Joshua Colp (license 5000)
Change-Id: I51b42b92dde8f2215b69bb509e28667ee3a3853a
This reverts commit fd2e8d0da7.
Reason for revert: Problematic for users who store their voicemail
on network storage devices, or share voicemail storage between
multiple Asterisk instances.
ASTERISK-28567 #close
Change-Id: I3ff4ca983d8e753fe2971f3439bd154705693c41
On shutdown it's possible for the unsolicited mwi container to be freed before
other dependent threads are done using it. This patch ensures this can no
longer happen by wrapping the container in an ao2_global object. The solicited
container was also changed too.
ASTERISK-28552
Change-Id: I8f812286dc19a34916acacd71ce2ec26e1042047
Serializer pools have previously existed in Asterisk. However, for the most
part the code has been duplicated across modules. This patch abstracts the
code into an 'ast_serializer_pool' object. As well the code is now centralized
in serializer.c/h.
In addition serializer pools can now optionally be monitored by a shutdown
group. This will prevent the pool from being destroyed until all serializers
have completed.
Change-Id: Ib1e906144b90ffd4d5ed9826f0b719ca9c6d2971
Both res_pjsip and res_pjsip_mwi made use of serializer pools. However, they
both implemented their own serializer pool functionality that was pretty much
identical in each of the source files. This patch removes the duplicated code,
and uses the new 'ast_serializer_pool' object instead.
Additionally res_pjsip_mwi enables a shutdown group on the pool since if the
timing was right the module could be unloaded while taskprocessor threads still
needed to execute, thus causing a crash.
Change-Id: I959b0805ad024585bbb6276593118be34fbf6e1d
This avoids use of the global variable and ensures topic_all remains
active until all topics are freed.
ASTERISK-28553
patches:
ASTERISK-28553.patch by coreyfarrell (license 5909)
Change-Id: I9a8cd8977f3c3a6aa00783f8336d2cfb9c2820f1
Add a new dialplan function PJSIP_MOH_PASSTHROUGH that allows
the on-hold behavior to be controlled on a per-call basis
ASTERISK-28542 #close
Change-Id: Iebe905b2ad6dbaa87ab330267147180b05a3c3a8
There are some warning messages which are not informative without endpoint:
"No registered subscribe handler for event presence.winfo"
"No registered publish handler for event presence"
This patch adds an endpoint name to these messages.
Change-Id: Ia2811ec226d8a12659b4f9d4d224b48289650827
pbx_extension_helper takes two 'context' arguments. One (con) is a
pointer directly to a 'struct ast_context' and the other (context) is
the name of the context. In all cases, one of these arguments is NULL
and the other is non-NULL.
Functions that are ultimately called by pbx_extension_helper expect that
'context' will be non-NULL, so we set it unconditionally on entry into
this function.
ASTERISK-28534 #close
Change-Id: Ifbbc5e71440afd80efd441f7a9d72e8b10b6f47d
Added "like" support for 'core show taskprocessors'. Now you
can specify a specific set of taskprocessors (or just one) by
adding the keyword "like" to the above command, followed by
your search criteria.
Change-Id: I021e740201e9ba487204b5451e46feb0e3222464
If a permanent contact URI associated with an AOR is invalid, we add a
Contact header to REGISTER responses with a NULL URI, causing a crash.
ASTERISK-28463 #close
Change-Id: Id2b643e58b975bc560aab1c111e6669d54db9102
The following message:
"Subscription request from endpoint <blah> rejected. Expiration of 0 is invalid"
Would sometimes spam the log with warnings if Asterisk restarted and a bunch
of clients sent unsubscribes. This patch changes it from a warning to a debug
message.
Change-Id: I841ec42f65559f3135e037df0e55f89b6447a467
astobj2.c declares DEBUG_THREADS_LOOSE_ABI to avoid overhead of debug
threads tracking information in the internal structures of astobj2.
Unfortunately this means that ao2_global_obj contains the statically
allocated debug threads tracking fields which are used by initialization
and cleanup but main/astobj2.c believed those fields and associated
space did not exist.
Change-Id: Icef41ad97d88a8c1d1515e034ec8133cab3b1527
Added two new CLI commands to reset stats for taskprocessors. You can
reset stats for a single, specific taskprocessor ('core reset
taskprocessor <taskprocessor>'), or you can reset all taskprocessors
('core reset taskprocessors'). These commands will reset the counter for
the number of tasks processed as well as the max queue size.
Change-Id: Iaf17fc4ae29396ab0c6ac92408fc7bdc2f12362d
We've found a connection re-use regression in pjproject 2.9
introduced by commit
"Close #1019: Support for multiple listeners."
https://trac.pjsip.org/repos/changeset/6002https://trac.pjsip.org/repos/ticket/1019
Normally, multiple SSL requests should reuse the same connection
if one already exists to the remote server. When a transport
error occurs, the next request should establish a new connection
and any following requests should use that same one. With this
patch, when a transport error occurs, every new request creates
a new connection so you can wind up with thousands of open tcp
sockets, possibly exhausting file handles, and increasing memory
usage.
Reverting pjproject commit 6002 (and related 6021) restores the
expected behavior.
We also found a memory leak in SSL processing that was introduced by
commit
"Fixed #2204: Add OpenSSL remote certificate chain info"
https://trac.pjsip.org/repos/changeset/6014https://trac.pjsip.org/repos/ticket/2204
Apparently the remote certificate chain is continually recreated
causing the leak.
Reverting pjproject commit 6014 (and related 6022) restores the
expected behavior.
Both of these issues have been acknowledged by Teluu.
ASTERISK-28521
Change-Id: I8ae7233c3ac4ec29a3b991f738e655dabcaba9f1
Previous to this patch passing a NULL tag to ao2_alloc or ao2_ref based
functions would result in the reference not being logged under
REF_DEBUG. This could sometimes cause inaccurate logging if NULL was
accidentally passed to a reference action. Now reference logging is
only disabled by option passed to the allocation method.
Change-Id: I3c17d867d901d53f9fcd512bef4d52e342637b54
When a stale item was being updated the object was being retrieved, but its
reference was not being decremented after the update. This patch makes it so
the object is now appropriately de-referenced.
ASTERISK-28523
Change-Id: I9d8173d3a0416a242f4eba92fa0853279c500ec7
You can currently capture backtraces of memory allocations but they
only get displayed when you stop asterisk and the atexit hooks
are enabled. Now, if memory backtrace is on and you issue a
"memory show allocations" CLI command for a specific file, then
a backtrace will show for each allocation that occurred after
you turned "memory backtrace on". The backtrace display is shown
only when a specific file's allocations are displayed to prevent
a massive CLI dump of every file's allocations.
Change-Id: Ic657afc1fc6ec7205e16eb36a97a611d235a2b4f
It is possible for topic->name to be NULL, this causes the allocation
reference to not be logged. Use the name variable instead which has
been verified to be a non-empty.
Change-Id: I3d0031d03c8356e4808f00cdf2d5428712575883
ast_mwi_topic() returns a borrowed reference which should not be
unreferenced, doing so leads to a FRACK. This was hidden by the fact
that stasis_cache.c leaked the result of cache_remove in
caching_topic_exec.
Change-Id: I51101bf7d07b8dc8ce8fc46b6cb31fbbd213fbc7
This change adds support to the JITTERBUFFER dialplan function
for audio and video synchronization. When enabled the RTCP SR
report is used to produce an NTP timestamp for both the audio and
video streams. Using this information the video frames are queued
until their NTP timestamp is equal to or behind the NTP timestamp
of the audio. The audio jitterbuffer acts as the leader deciding
when to shrink/grow the jitterbuffer when adaptive is in use. For
both adaptive and fixed the video buffer follows the size of the
audio jitterbuffer.
ASTERISK-28533
Change-Id: I3fd75160426465e6d46bb2e198c07b9d314a4492
Allow the list of files to be played to be provided explicitly in the
music class's configuration. The primary driver for this change is to
allow URLs to be used for MoH.
Change-Id: I9f43b80b43880980b18b2bee26ec09429d0b92fa
When fax detection occurs on an outbound PJSIP channel the
redirect operation will result in a masquerade occurring and
the underlying channel on the session changing. The code
incorrectly relocked the new channel instead of the old
channel when returning. This resulted in the new channel
being locked indefinitely. The code now always acts on the
expected channel.
ASTERISK-28538
Change-Id: I2b2e60d07e74383ae7e90d752c036c4b02d6b3a3
On FreeBSD using the clang/llvm compiler build fails to build due
to the switch statement argument being a non integer type expression.
Switch to an if/else if/else construct to sidestep the issue.
ASTERISK-28536 #close
Change-Id: Idf4a82cc1e94580a2d017fe9e351c226f23e20c8
According to RFC3550, ALL RTCP packets must be sent in a compond packet
of at least two individual packets, including SR/RR and SDES. REMB,
FIR, and NACK were not following this format, and as a result, would
fail the packet check in ast_rtcp_interpret. This was found from writing
unit tests for RTCP. The browser would accept the way we were
constructing these RTCP packets, but when sending directly from one
Asterisk instance to another, the above mentioned problem would occur.
Change-Id: Ieb140e9c22568a251a564cd953dd22cd33244605
When modifying an already defined variable in some channel drivers they
add a new variable with the same name to the list, but that value is
never used, only the first one found.
Introduce ast_variable_list_replace() and use it where appropriate.
ASTERISK-23756 #close
Patches:
setvar-multiplie.patch submitted by Michael Goryainov
Change-Id: Ie1897a96c82b8945e752733612ee963686f32839
This change adds H.265/HEVC as a known codec and creates a cached
"h265" media format for use.
Note that RFC 7798 section 7.2 also describes additional SDP
parameters. Handling of these is not yet supported.
ASTERISK-28512
Change-Id: I26d262cc4110b4f7e99348a3ddc53bad0d2cd1f2
This fix allows a realtime moh class to be unregistered from the command
line. This is useful when the contents of a directory referenced by a
realtime moh class have changed.
The realtime moh class is then reloaded on the next request and uses the
new directory contents.
ASTERISK-17808
Change-Id: Ibc4c6834592257c4bb90601ee299682d15befbce
Added unit tests for RTCP video stats. These tests include NACK, REMB,
FIR/FUR/PLI, SR/RR/SDES, and packet loss statistics. The REMB and FIR
tests are currently disabled due to a bug. We expect to receive a
compound packet, but the code sends this out as a single packet, which
the browser accepts, but makes Asterisk upset.
While writing these tests, I noticed an issue with NACK as well. Where
it is handling a received NACK request, it was reading in only the first
8 bits of following packets that were also lost. This has been changed
to the correct value of 16 bits.
Also made a minor fix to the data buffer unit test.
Change-Id: I56107c7411003a247589bbb6086d25c54719901b
The Channel resource has a new sub-resource "externalMedia".
This allows an application to create a channel for the sole purpose
of exchanging media with an external server. Once created, this
channel could be placed into a bridge with existing channels to
allow the external server to inject audio into the bridge or
receive audio from the bridge.
See https://wiki.asterisk.org/wiki/display/AST/External+Media+and+ARI
for more information.
Change-Id: I9618899198880b4c650354581b50c0401b58bc46
When the remote ISDN party ends an ISDN call on a PRI link
(DISCONNECT), CHANNEL(hangupsource) information is not available.
chan_dahdi already contains an ast_set_hangupsource() in
__dahdi_exception() function but it seems that ISDN message processing
does not use this part of code.
Two other channel modules associate ast_queue_hangup() and
ast_set_hangupsource() functions calls:
- chan_pjsip in chan_pjsip_session_end() function,
- chan_sip in sip_queue_hangup_cause() function.
chan_iax2 separates them, in iax2_queue_hangup()/iax2_destroy() and
set_hangup_source_and_cause().
Thus, I propose to add ast_set_hangupsource() beside
ast_queue_hangup() in sig_pri_queue_hangup(), like chan_pjsip and
chan_sip already do.
ASTERISK-28525
Change-Id: I0f588a4bcf15ccd0648fd69830d1b801c3f21b7c
ChanIsAvail() creates a temporary channel with ast_request() to test
resource availability. It should not generate a CDR when it hangs up
this temporary channel.
This patch disables CDR generation for the temporary channel with
ast_cdr_set_property().
ASTERISK-28527
Change-Id: I7b0555c6909c7d322e452dde97c9ea5b111552d1
This change removes the assumption that a frame will always have
a src set on it. This assumption is incorrect.
Given a scenario where an RTP packet is received with no payload
the resulting audio frame will have no samples. If this frame goes
through a signed linear translation path an interpolated frame can
be created (if generic packet loss concealment is enabled) that has
minimal data on it, including no src. If this frame is given to a
translation path a crash will occur due to the lack of src.
ASTERISK-28499
Change-Id: I024d10dd98207eb8a6b35b59880bcdf1090538f8
After receiving a 200 OK with a declined stream in response to a T.38
initiated re-invite Asterisk would crash when attempting to dereference
a NULL session media object.
This patch checks to make sure the session media object is not NULL before
attempting to use it.
ASTERISK-28495
patches:
ast-2019-004.patch submitted by Alexei Gradinari (license 5691)
Change-Id: I168f45f4da29cfe739acf87e597baa2aae7aa572
Module res_adsi.so is deprecated, therefore it does not load by default.
Module not loaded causes it to yield a FAIL when tested by tests/test_utils.c.
This fix checks if the corresponding module is loaded at the start of the test,
and if not, it passes the test and exits with a message.
This fix is applied to all versions where the module is marked deprecated.
Change-Id: I52be64c8f6af222e15148a856d1f10cb113e1e94
On reading information about initial client packet unistim use dirty
implementation of destination ip address retrieval. This fix uses
CMSG_*(..) to get ip address and make clang compile without warning.
ASTERISK-25592 #close
Reported-by: Alexander Traud
Change-Id: Ic1fd34c2c2bcc951da65bf62e3f7a8adff8351b1
res_pjsip_mwi allows both solicited and unsolicited MWI subscription types.
While both can be set in the configuration for a given endpoint/aor, only
one is allowed. Precedence is given to unsolicited. Meaning if an endpoint/aor
is configured to allow both types then the solicited subscription is rejected
when it comes in. However, there is a configuration option to override that
behavior:
mwi_subscribe_replaces_unsolicited
When set to "yes" then when a solicited subscription comes in instead of
rejecting it Asterisk is suppose to replace the unsolicited one if it exists.
Prior to this patch there was a bug in Asterisk that allowed the solicted one
to be added, but did not remove the unsolicited. As a matter of fact a new
unsolicited subscription got added everytime a SIP register was received.
Over time this eventually could "flood" a phone with SIP notifies.
This patch fixes that behavior to now make it work as expected. If configured
to do so a solicited subscription now properly replaces the unsolicited one.
As well when an unsubscribe is received the unsolicited subscription is
restored. Logic was also put in to handle reloads, and any configuration changes
that might result from that. For instance, if a solicited subscription had
previously replaced an unsolicited one, but after reload it was configured to
not allow that then the solicited one needs to be shutdown, and the unsolicited
one added.
ASTERISK-28488
Change-Id: Iec2ec12d9431097e97ed5f37119963aee41af7b1
Current implementation of ast_channel_tech send_digit_begin hook uses
same function for tone playback as key press handler. This cause every
incoming dtmf send back to asterisk. In case of two unistim phones
connected to each other, it'll cause indefinite DTMF loop. Fix add
separate function for dtmf tone phone play.
Change-Id: I5795db468df552f0c89c7576b6b3858b26c4eab4
This patch fixes one-way oudio that users expirienced on
big-endian architechtires. RTP port number bytes was stored
in improper order and phone sent RTP to wrong RTP port.
Reported-by: Andrey Ionov
Change-Id: I9a9ca7f26e31a67bbbceff12923baa10dfb8a3be
The UnicastRTP channel driver provided by chan_rtp now accepts
"<hostname>:<port>" as an alternative to "<ip_address>:<port>"
in the destination. The first AAAA (preferred) or A record resolved
will be used as the destination. The lookup is synchronous so beware
of possible dialplan delays if you specify a hostname.
Change-Id: Ie6f95b983a8792bf0dacc64c7953a41032dba677
The new function takes in a pointer to an ast_sockaddr structure,
a hostname and an optional port and then dispatches parallel
"AAAA" and "A" record queries. If an "AAAA" record is returned,
it's parsed into the ast_sockaddr structure along with the port
if it was supplied. If no "AAAA" record was returned, the
first "A" record returned (if any) is parsed instead.
This is a synchronous call. If you need asynchronous lookups,
use ast_dns_query_set_resolve_async and roll your own.
Change-Id: I194b0b0e73da94b35cc35263a868ffac3a8d0a95
NEC SIP Station interface with authenticated registration only supports cnonce
up to 32 characters. In Linux, PJSIP would generate 36 character cnonce
which included hyphens. Teluu developed this patch adding a compile time
setting to default to not include the hyphens. They felt it best to still
generate the UUID and strip the hyphens.
They have indicated it will be part of PJSIP 2.10.
ASTERISK-28509
Reported-by: Dan Cropp
Change-Id: Ibdfcf845d4f8c0a14df09fd983b11f2d72c5f470
In chan_sip, there was variable SIPFROMDOMAIN that allows to set
From header URI domain per channel. This patch introduces res_pjsip
variable SIPFROMDOMAIN for backward compatibility with chan_sip.
ASTERISK-28489
Change-Id: I715133e43172ce2a1e82093538dc39f9e99e5f2e
Given the following request path and 2 handler paths...
Request: /channels/externalMedia
Handler: /channels/{channelId} "wildcard"
Handler: /channels/externalmedia "non-wildcard"
...if /channels/externalMedia was registered as a handler after
/channels/{channelId} as shown above, the request would automatically
match the wildcard handler and attempt to parse "externalMedia" into
the channelId variable which isn't what was intended. It'd work
if the non-wildard entry was defined in rest-api/api-docs/channels.json
before the wildcard entry but that makes the json files
order-dependent which isn't a good thing.
To combat this issue, the search loop saves any wildcard match but
continues looking for exact matches at the same level. If it finds
one, it's used. If it hasn't found an exact match at the end of
the current level, the wildcard is used. Regardless, after
searching the current level, the wildcard is cleared so it won't
accidentally match for a different object or a higher level.
BTW, it's currently not possible for more than 1 wildcard entry
to be defined for a level. For instance, there couldn't be:
Handler: /channels/{channelId}
Handler: /channels/{channelName}
We wouldn't know which one to match.
Change-Id: I574aa3cbe4249c92c30f74b9b40e750e9002f925
There are 4 scenarios to consider when capturing audio from a channel
with an audiohook:
1. There is no rx and no tx audio, so return nothing.
2. There is rx but no tx audio, so return rx.
3. There is tx but no rx audio, so return tx.
4. There is rx and tx audio, so mix them and return.
The file passed as the primary argument to MixMonitor will be written to
in scenarios 2, 3, and 4. However, if you pass the r() and t() options
to MixMonitor, a frame will only be written to the r() file if there was
rx audio and a frame will only be written to the t() file if there was
tx audio.
If you subsequently take the r() and t() files and try to mix them, the
sides of the conversation will 'drift' and be non-representative of the
user experience.
This patch adds a new 'S' option to MixMonitor that injects a frame of
silence on either the r() side or the t() side of the channel so that
when later mixed, there is no such drift.
Change-Id: Ibf5ed73a811087727bd561a89a59f4447b4ee20e
The function leave_voicemail checks if expungeonhangup is set,
but does not check if IMAP stream is closed,
so it could call imap function with NULL stream.
This leads to segfault.
ASTERISK-28505 #close
Change-Id: Ib66c57c1f1ba97774e447b36349198e2626a8d7c
Because keypad() is exported by libtinfo, it needs to be explicitly
added to the linker options.
ASTERISK-28487 #close
Change-Id: I6c2ad5b95f422c263d078b5c0e84c111807dffc6
Somehow it's possible for the srtp session object to be NULL even though the
Asterisk srtp object itself is valid. When this happened it would cause a
crash down in the srtp code when attempting to protect or unprotect data.
After looking at the code there is at least one spot that makes this situation
possible. If Asterisk fails to unprotect the data, and after several retries
it still can't then the srtp->session gets freed, and set to NULL while still
leaving the Asterisk srtp object around. However, according to the original
issue reporter this does not appear to be their situation since they found
no errors logged stating the above happened (which Asterisk does for that
situation).
An issue was found however, where a possible race condition could occur between
the pjsip incoming negotiation, and the receiving of RTP packets. Both places
could attempt to create/setup srtp for the same rtp instance at the same time.
This potentially could be the cause of the problem as well.
Given the above this patch adds locking around srtp setup for a given rtp, or
rtcp instance. NULL checks for the session have also been added within the
protect and unprotect functions as a precaution. These checks should at least
stop Asterisk from crashing if it gets in this situation again.
This patch also fixes one other issue noticed during investigation. When doing
a replace the old object was freed before creating the replacement. If the new
replacement object failed to create then the rtp/rtcp instance would now point
to freed srtp data which could potentially cause a crash as well when the next
attempt to reference it was made. This is now fixed so the old srtp object is
kept upon replacement failure.
Lastly, more logging has been added to help diagnose future issues.
ASTERISK-28472
Change-Id: I240e11cbb1e9ea8083d59d50db069891228fe5cc
To make throttling by label fully active, the "throttle" option
has to be specified with a specific label.
You can now specify "skip_gate" in the Gerrit comments when you
do a +2 code review to tell Jenkins not to actually run the
gate. You'd do this if you plan to manually merge the change.
Also updated the "printenv" debug output to better sort multi-line
comments.
Change-Id: I4c0b1085acec4805f2ca207eebac50aad81f27e2
When updating times on CDR or CEL records using the time at which
it is done can result in times being incorrect if the system is
heavily loaded and stasis message processing is delayed.
This change instead makes it so CDR and CEL use the time at which
the stasis messages that drive the systems are created. This allows
them to be backed up while still producing correct records.
ASTERISK-28498
Change-Id: I6829227e67aefa318efe5e183a94d4a1b4e8500a
Originally, the eligible nodes for a job were labelled only by
"swdev-docker". So basically any node could run any job. We had
found that allowing a node to run more than 1 gate at a time was
problematic so we limited the nodes to processing 1 job at a time.
With the creation of the Asterisk 17 branches however, we now have
so many active branches that getting checks and gates through in
a timely manner is problematic when a node can run only 1 job
at a time.
Now the nodes are also labelled by the job type they can run.
For instance: "asterisk-check", "asterisk-gate", etc. With the
"Throttle Concurrent Builds" plugin, we can now allow a node to
run more than 1 job BUT throttle by job type. For instance:
Allow 2 jobs but only 1 asterisk-gate at a time.
Now a node can run 2 checks or 1 check and 1 gate or 1 gate but
not 2 gates at a time.
Change-Id: I2032bf6afbcec5c341d9b852214c0c812d3d6db5
There were still a few places in the code that could overflow when "packing"
a json object with a value outside the base type integer's range. For instance:
unsigned int value = INT_MAX + 1
ast_json_pack("{s: i}", value);
would result in a negative number being "packed". In those situations this patch
alters those values to a ast_json_int_t, which widens the value up to a long or
long long.
ASTERISK-28480
Change-Id: Ied530780d83e6f1772adba0e28d8938ef30c49a1
The code for gathering contacts could result in the same contact
being retrieved and added to the list multiple times. The container
which stores the contacts to display will now only allow a contact
to be added to it once instead of multiple times.
ASTERISK-28228
Change-Id: I805185cfcec03340f57d2b9e6cc43c49401812df
incorrect handling of UDPTL squence number wrap arounds causes
loss of packets every time the wrap around occurs
ASTERISK-28483 #close
Change-Id: I33caeb2bf13c574a1ebb81714b58907091d64234
The functions that build manager message headers do so in a way that
results in a single messages being split across multiple packets. While
this doesn't matter to the remote end, it makes network captures noisier
and harder to follow, and also means additional system calls.
With this patch, we build up more of the message content into the TLS
buffer before flushing to the network. This change is completely
internal to the manager code and does not affect any of the existing
API's consumers.
Change-Id: I50128b0769060ca5272dbbb5e60242d131eaddf9
When a module fails to register itself (usually a coding error
in the module), dlerror() can return NULL. We weren't checking
for that in load_dlopen() before trying to strdup the error message
so a SEGV was thrown. dlerror() is now surrounded with an S_OR
so we don't SEGV.
Change-Id: Ie0fb9316f08a321434f3f85aecf3c7d2ede8b956
We don't support non-core modules for Certified releases but we
were enabling them for CI builds which was causing lots of test
failures. Now we don't.
Change-Id: I0b3254c08a2479f3d39151690350cce5ce5ad766
Otherwise, OpenR2 threads go crazy and consume almost all CPU resources
Change-Id: I10a41f617613fe7399c5bdced5c64a2751173f28
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Details:
- The memcpy() call copied part of "dahdi_conf" and not "dahdi_conf.mfcr2"
- As a result, the memcmp() in dahdi_r2_get_link() always fails
- This cause dahdi_r2_get_link() to create new link for every channel
(instead of a new link for every ~30 channels)
- With the fix, far less links are generated -- so we use far less threads
Change-Id: I7259dd6272f5e46e8a6c7f5bf3e8c2ec01b8c132
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
We're at the point where there are enough Jenkins jobs for
Asterisk branches than even cleaned checkouts of Asterisk
will add up to more disk space than is available on the
in-memory workspace mount. Since we archive all relevent
artifacts anyway, there's no need to keep the workspace
around after the job finishes, whether it succeeds or fails.
Change-Id: I1cd3b73ebb045a987df0f62526d152a510210c39
Previously, when a Transfer (REFER) was performed, chan_pjsip would set
the TRANSFERSTATUS to SUCCESS when the REFER was queued up. This did not
reflect a successful/unsuccessful transfer the way chan_sip did.
Added a callback module to process the refer subscription information.
Now depends on res_pjsip_pubsub so call transfer progress can be monitored
and reported
ASTERISK-26968 #close
Reported-by: Dan Cropp
Change-Id: If6c27c757c66f71e8b75e3fe49da53ebe62395dc
When fixing ASTERISK~24212, a change was done so a scheduled callback could not
be removed while it was running. The caller of ast_sched_del would have to wait.
However, when the caller of ast_sched_del is the callback itself (however wrong
this might be), this new check would cause a deadlock: it would wait forever
for itself.
This changeset introduces an additional check: if ast_sched_del is called
by the callback itself, it is immediately rejected (along with an ERROR log and
a backtrace). Additionally, the AST_SCHED_DEL_UNREF macro is adjusted so the
after-ast_sched_del-refcall function is only run if ast_sched_del returned
success.
This should fix the following spurious race condition found in chan_sip:
- thread 1: schedule sip_poke_peer_now (using AST_SCHED_REPLACE)
- thread 2: run sip_poke_peer_now
- thread 2: blank out sched-ID (too soon!)
- thread 1: set sched-ID (too late!)
- thread 2: try to delete the currently running sched-ID
After this fix, an ERROR would be logged, but no deadlocks (in do_monitor) nor
excess calls to sip_unref_peer(peer) (causing double frees of rtp_instances and
other madness) should occur.
(Thanks Richard Mudgett for reviewing/improving this "scary" change.)
Note that this change does not fix the observed race condition: unlocked
access to peer->pokeexpire (and potentially other scheduled items in chan_sip),
causing AST_SCHED_DEL_UNREF to look at a changing id. But it will make the
deadlock go away. And in the observed case, it will not have adverse affects
(like memory leaks) because the scheduled item is removed through a different
path.
ASTERISK-28282
Change-Id: Ic26777fa0732725e6ca7010df17af77a012aa856
Two new Makefile targets have been added... "install-headers" and
"uninstall-headers" to separately control header installation.
The existing behavior has not changed so "make install" and
"make uninstall" will continue to also install/uninstall the headers.
The new targets were added for forward compatibility with Asterisk 17
in which the headers are no longer installed/uninstalled with the
"install" and "uninstall" targets.
Also corrects an issue where /usr/include/asterisk.h was never
being removed at all.
Change-Id: Ia7399f3a0203a4825fc4a9f43b9034dae9a2b643
When manager debugging is turned on, this patch makes it so incoming AMI actions
are now also logged.
Change-Id: I8047524510e7ac97d99482b2448f8e368f29cd47
We now check that a body exists and it has a length > 0 before
attempting to process it.
ASTERISK-28447
Reported-by: Gil Richard
Change-Id: Ic469544b22ab848734636588d4c93426cc6f4b1f
The chan_sip module performs a T.38 re-invite using a single media
stream of udptl, and expects the SDP answer to be the same.
If an SDP answer is received instead that contains an additional
media stream with no joint codec a crash will occur as the code
assumes that at least one joint codec will exist in this
scenario.
This change removes this assumption.
ASTERISK-28465
Change-Id: I8b02845b53344c6babe867a3f0a5231045c7ac87
Fixes a crash in chan_dahdi occurring on 32-bit systems. A previous
patch introduced a variable of type unassigned long long which is 64-bits.
Casting it as 'ast_json_int_t' along with JSON type 'I' makes it work
with 32-bit systems.
ASTERISK-28457
Change-Id: I9cef6b5f2d826fc5c93f2f6a1c997c4e3e6c93fe
Where possble, hostname and port has been added to error
messages, mostly on the server side.
ASTERISK-26006
Reported by: Oleksandr Natalenko
Change-Id: Iff4f897277bc36ce8c5b493b71d0a4a7b74e62f0
Most SSL/TLS error messages coming from pjproject now have either
the peer address:port or peer hostname, depending on what was
available at the time and code location where the error was
generated.
ASTERISK-28444
Reported by: Bernhard Schmidt
Change-Id: I41770e8a1ea5e96f6e16b236692c4269ce1ba91e
Now AMD algorithm will not ignore AST_FRAME_NULL, As I think using manual
wait time instead of `framelength` is enough to fix timeout / TOOLONG issue.
ASTERISK-28419 #close
Change-Id: I16ea2d6295bc99b975e8c092e5f9fbd9214debdb
We were using the presence of /usr/lib64 to determine where
shared libraries should be installed. This only existed on
Redhat based systems and was safe. If it existed, use it,
otherwise use /usr/lib.
Unfortunately, Ubuntu 19 decided to create a /usr/lib64 BUT
NOT INCLUDE IT IN THE DEFAULT ld.so.conf. So if anything is
installed there, it won't work.
The new method, just looks for $ID in /etc/os-release and if it's
centos or fedora, uses /usr/lib64 and if ubuntu, uses /usr/lib.
NOTE: This applies only to the CI scripts. Normal asterisk
build and install is not affected.
Change-Id: Iad66374b550fd89349bedbbf2b93f8edd195a7c3
Fixed format-truncation issues in chan_dahdi.c and
sig_analog.c. Since they're related to fields provided
by dahdi-tools we can't change the buffer sizes so we're just
checking the return from snprintf and printing an errior if we
overflow.
Change-Id: Idc1f3c1565b88a7d145332a0196074b5832864e5
There is WARNING "no samples for ..." on each Playtones.
The function ast_playtones_start calls ast_activate_generator,
which calls ast_prod.
The function ast_prod calls ast_write with empty audio frame.
In this case it's spam log.
Change-Id: Id4ac309489d9ff281bad02abdef341cecdede660
When a channel already in a conference bridge is attended transfered
to another extension, or when an existing call is attended
transferred into a conference bridge, we now generate ConfbridgeJoin
and ConfbridgeLeave events for the entering and departing channels.
Change-Id: Id7709cfbceb26fbcb828b2d0d2a6b2fbeaf028e1
This change adds support for larger TLS certificates by allowing
OpenSSL to fragment the DTLS packets according to the configured
MTU. By default this is set to 1200.
This is accomplished by implementing our own BIO method that
supports MTU querying. The configured MTU is returned to OpenSSL
which fragments the packet accordingly. When a packet is to be
sent it is done directly out the RTP instance.
ASTERISK-28018
Change-Id: If2d5032019a28ffd48f43e9e93ed71dbdbf39c06
We have seen some rare case of segmentation fault in hangup function
and we could notice that channel pointer was NULL. Debug log shows
that there is a 200 OK answer and SIP timeout at the same time. It
looks that while the SIP session was being destroyed due to timeout
call hangup due to answer event lead to race condition and channel
is being destroyed from two different places. The check ensures we
check it not to be NULL before freeing it.
ASTERISK-25371
Change-Id: I19f6566830640625e08f7b87bfe15758ad33a778
Fixes an error occurring in function pgsql_reconnect() caused when value of
hostname is blank. Which in turn will cause the connection string to look
like this: "host= port=xx", which creates a sintax error. This fix now checks
if the corresponding values for host, port, dbname, and user are blank. Note
that since this is a reconnect function the database library will replace any
missing value pairs with default ones.
ASTERISK-28435
Change-Id: I0a921f99bbd265768be08cd492f04b30855b8423
AttendedTransfer queues up attended transfer to the given extension.
This application can be useful with Custom Dynamic Features.
For example to make attended transfer to a predefined number.
features.conf
;;;
[applicationmap]
my_atxfer => *7,self,GoSub,"my_atxfer,s,1",default
;;;
extensions.conf
;;;
[globals]
DYNAMIC_FEATURES=my_atxfer
TRANSFER_CONTEXT=my_transfer
[my_atxfer]
exten => s,1,AttendedTransfer(1234567890)
same => n,Return()
[my_transfer]
include => default
;;;
This application also can be used to completly redefine Attended transfer
feature using dialplan. For example:
features.conf
;;;
[featuremap]
atxfer => *7
[applicationmap]
custom_atxfer => *2,self,GoSub,"custom_atxfer,s,1",default
;;;
extensions.conf
;;;
[globals]
DYNAMIC_FEATURES=custom_atxfer
TRANSFER_CONTEXT=my_transfer
[custom_atxfer]
exten => s,1,
same => n,Playback(pbx-transfer)
same => n,Read(dest,dial,10,i,3,3)
same => n,AttendedTransfer(${dest})
same => n,Return()
[my_transfer]
include => default
;;;
Change-Id: Ie5cfa455d0813cffd5c85a6fb117f07d8f0b903b
According T.38 Gateway 'Use case 3'
https://wiki.asterisk.org/wiki/display/AST/T.38+Gateway
T.38 Gateway should send T.38 negotiation request to called endpoint
if FAX preamble (using V.21 detector) generated by called endpoint.
But it does not, because fax_gateway_detect_v21 constructs T.38
negotiation request, but forwards it only to other channel,
not to the channel on which FAX preamble is detected.
Some SIP endpoints could be improperly configured to rely on the other side
to initiate T.38 re-INVITEs.
With this patch the T.38 Gateway tries to negotiate with both sides
by sending T.38 negotiation request to both endpoints supported T.38.
Change-Id: I73bb24799bfe1a48adae9c034a2edbae54cc2a39
This patch adds a channel name to output of CLI 'fax show session'
and also expands the channel name field up to 30 characters on
CLI 'fax show sessions'
Change-Id: Id059c43ff41811f5e76712b83fb63b8f246da953
The change #10017 "Handle fax gateway being started more than once"
introdiced a bug which leads to segfault in res_fax_spandsp.
The res_fax_spandsp module does not support reserving sessions, so
fax_session_reserve returns a fax session with state AST_FAX_STATE_INACTIVE.
The fax_gateway_start does not create a real fax session if the fax session
is already present and the state is not AST_FAX_STATE_RESERVED.
But the "reserved" session created for res_fax_spandsp has state
AST_FAX_STATE_INACTIVE, so fax_gateway_start not starting.
Then when fax_gateway_framehook is called and gateway T.38 state is
NEGOTIATED the call of gateway->s->tech->write(gateway->s, f) leads to
segfault, because session tech_pvt is not set, i.e. the tech session
was not initialized/started.
This patch adds check also on AST_FAX_STATE_INACTIVE to the "reserved"
session created for res_fax_spandsp will start.
This patch also adds extra check and log ERROR if tech_pvt is not set
before call tech->write.
ASTERISK-27981 #close
Change-Id: Ife3e65e5f18c902db2ff0538fccf7d28f88fa803
One of the change files doesn't conform to the format that the release
scripts need in order to parse it.
Change-Id: Ie0b634cf27e4cbc671b9fe92993b6f2ecf60254c
After some definitions have been moved to asterisk/mwi.h the files
channels/chan_dahdi.h channels/sig_pri.c are missing this new
include.
ASTERISK-28427 #close
Change-Id: Ia8cc595eeda653324643f40dcd9799d4c3f0ac91
Using timestamp with signed int will cause timestamps exceeding max value
to be negative.
This causes the jitterbuffer to do passthrough of the packet.
ASTERISK-28421
Change-Id: I9dabd0718180f2978856c50f43aac4e52dc3cde9
BlindTransfer redirects all channels currently bridged to the
caller channel to the specified destination.
This application can be useful with Custom Dynamic Features.
For example to make blind transfer to a predefined number.
features.conf
;;;
[applicationmap]
my_blindxfer => *6,self,GoSub,"my_blindxfer,s,1",default
;;;
extensions.conf
;;;
[globals]
DYNAMIC_FEATURES=my_blindxfer
[my_blindxfer]
exten => s,1,BlindTransfer(1234567890,default)
same => n,Return()
;;;
This application also can be used to completly redefine Blind transfer
feature using dialplan. For example:
features.conf
;;;
[featuremap]
blindxfer =>
[applicationmap]
custom_blindxfer => ##,self,GoSub,"custom_blindxfer,s,1",default
;;;
extensions.conf
;;;
[globals]
DYNAMIC_FEATURES=custom_blindxfer
[custom_blindxfer]
exten => s,1,
same => n,Playback(pbx-transfer)
same => n,Read(dest,dial,10,i,3,3)
same => n,BlindTransfer(${dest},default)
same => n,Return()
;;;
Change-Id: I9d55e7f69ccfd4472dec00d62771d6de8803215a
This patch adds the 'p' option.
The extension entered will be considered complete when a # is entered.
Change-Id: If77c40c9c8b525885730821e768f5dea71cf04c1
You can now add the "include_local_address" flag to an entry in
rtp.conf "[ice_host_candidates]" to include both the advertized
address and the local address in ICE negotiation:
[ice_host_candidates]
192.168.1.1 = 1.2.3.4,include_local_address
This causes both 192.168.1.1 and 1.2.3.4 to be advertized.
Change-Id: Ide492cd45ce84546175ca7d557de80d9770513db
The caller endpoint hears dead silence if a callee replies 180 (without SDP)
and the caller already received 183 (with SDP).
It happens because Asterisk sends 180 (WITH SDP) to the caller,
there are not incoming RTP packets from the callee
and Asterisk does not generate inband ringing,
so there are not any outgoing RTP packets to the caller.
This patch replaces 180 by 183 if SDP negotiation has completed,
as if the caller endpoint is configured with "inband_progress=yes".
In this case Asterisk will generate inband ringing untill Asterisk receive
incoming RTP packets from the callee.
ASTERISK-27994 #close
Change-Id: I7450b751083ec30d68d6abffe922215a15ae5a73
Various fixes for issues caught by gcc 9. Mostly snprintf
trying to copy to a buffer potentially too small.
ASTERISK-28412
Change-Id: I9e85a60f3c81d46df16cfdd1c329ce63432cf32e
This change fixes two bugs which both resulted in the packet loss
count exceeding 65,000.
The first issue is that the sequence number check to determine if
cycling had occurred was using the wrong variable resulting in the
check never seeing that cycling has occurred, throwing off the
packet loss calculation. It now uses the correct variable.
The second issue is that the packet loss calculation assumed that
the received number of packets in an interval could never exceed
the expected number. In practice this isn't true due to delayed
or retransmitted packets. The expected will now be updated to
the received number if the received exceeds it.
ASTERISK-28379
Change-Id: If888ebc194ab69ac3194113a808c414b014ce0f6
When multiple endpoints try to register close together using the same
AOR with qualify_frequency set, one contact would qualify immediately
while the other contacts would have to wait out the duration of the
timer before being able to qualify. Changing the conditional to check
the contact container count for a non-zero value allows all contacts to
qualify immediately.
Change-Id: I79478118ee7e0d6e76af7c354d66684220db9415
Added a conversion for umax (largest maximum sized integer allowed). Adjusted
the other current conversion functions (uint and ulong) to be derivatives of
the umax conversion since they are simply subsets of umax.
Also made the negative check move the pointer on spaces since strtoumax does it
anyways.
Change-Id: I56c2ef2629d49b524c8df58af12951c181f81f08
When we use early bridge with create and dial from stasis using Local channel
and the dialplan does not any entry the it is returned from core_local.c with
No such extension .
In such case asterisk locks up till the channel is not hangup with the error
Exceptionally long voice queue length
* Found that in such case app_control_dial fails on ast_call method and
return -1
* Since it is called from stasis_app_send_command_async and return -1 does
not cause resources to be freed and since no PBX exist it is not able to
read from channel causing exceptionally long queue
* After putting this code found that the channel was releasing immediately
and resources were freed.
ASTERISK-28399
Reported by: Abhay Gupta
Tested by: Abhay Gupta
Change-Id: I0a55c923fc6995559f808d63b9488762b4489318
When the gcc version is >= 8.2.1, we were already setting the
--fno-partial-inlining flag for Asterisk source files to get around
a gcc bug but we weren't passing the flag down to the bundled
builds of pjproject and jansson.
ASTERISK-28392
Change-Id: I99ede9bc35408ecd096f7d5369e8192d3dc75704
Updated ast_sip_create_rdata_with_contact and registrar_find_contact
to check the return from pjsip_parse_uri before attempting to
use the uri returned.
ASTERISK-28402
Reported-by: Ross Beer
Change-Id: I9810b3b163c45ed5a56ec743586e5ce107f13ba7
The dial bridge is meant to hold channels which have been created
and dialed in stasis. It handles the frames coming from them and raises
the appropriate events.
It was possible for the code to mistakenly place calls which came
from the dialplan into the dial bridge if they were not in an
answered state. These channels are not outgoing channels and
should not be placed into the dial bridge.
The code now checks to ensure that only stasis created channels are
placed into the dial bridge by checking that a PBX does not exist
on the channel.
ASTERISK-27756
Change-Id: Ideee69ff06c9a0b31f7ed61165f5c055f51d21b6
After a bridge has been deleted the stasis control will depart
the channel and might attempt to re-add it to the dial bridge.
The later can fail and this can lead to a situation that the stasis
control is unlinked but the after_bridge_cb_failed cb is executed trying
to access a dangling control object.
Fix it by calling the after_cb's before bridge_channel_impart_signal.
ASTERISK-26718
Change-Id: Ib4e8f70d7a21bd54afe3cb51cc6717ef7c355496
When producing a combined REMB value the normal behavior
is to have a REMB value which is unique for each sender
based on all of their receivers. This can result in one
sender having low bitrate while all the rest are high.
This change adds "all" variants which produces a bridge
level REMB value instead. All REMB reports are combined
together into a single REMB value that is the same for
each sender.
ASTERISK-28401
Change-Id: I883e6cc26003b497c8180b346111c79a131ba88c
The transport-cc draft is a mechanism by which additional information
about packet reception can be provided to the sender of packets so
they can do sender side bandwidth estimation. This is accomplished
by having a transport specific sequence number and an RTCP feedback
message. This change implements this in the receiver direction.
For each received RTP packet where transport-cc is negotiated we store
the time at which the RTP packet was received and its sequence number.
At a 1 second interval we go through all packets in that period of time
and use the stored time of each in comparison to its preceding packet to
calculate its delta. This delta information is placed in the RTCP
feedback message, along with indicators for any packets which were not
received.
The browser then uses this information to better estimate available
bandwidth and adjust accordingly. This may result in it lowering the
available send bandwidth or adjusting how "bursty" it can be.
ASTERISK-28400
Change-Id: I654a2cff5bd5554ab94457a14f70adb71f574afc
When compiling in dev mode, stasis statistics are enabled and can cause
a crash at shutdown due to the following:
- Containers are freed
- Topics and subscriptions remain
- When those topics and subscriptions are deallocated, they go to do
things with the container
This changes the containers to global ao2 objects, and whenever needed
in the code, a reference must be obtained and checked before any
operations can be done.
ASTERISK-28353 #close
Change-Id: Ie7d5e907fcfcb4d65bd36d5e4eb923126fde8d33
Added RINGTIME, RINGTIME_MS, PROGRESSTIME, PROGRESSTIME_MS variables filled
at the earliest received PROGRESS or RINGING.
Added millisecond versions of DIALEDTIME and ANSWEREDTIME.
Added millisecond versions of ast_channel_get_up_time and
ast_channel_get_duration in channel.c.
ASTERISK-28363
Change-Id: If95f1a7d8c4acbac740037de0c6e3109ff6620b1
There is enough MWI functionality to warrant it having its own 'c' and header
files. This patch moves all current core MWI data structures, and functions
into the following files:
main/mwi.h
main/mwi.c
Note, code was simply moved, and not modified. However, this patch is also in
preparation for core MWI changes, and additions to come.
Change-Id: I9dde8bfae1e7ec254fa63166e090f77e4d3097e0
main/json.c: Added app_name, app_data to channel type
res/res_ari: Added ARI resource /ari/channels/{channelId}/rtp_statistics
res/res_ari: Added timestamp as a requirement for all ARI events
Change-Id: I6363f2a3e757cfd59b2ee5d056388ec47659a0c9
Make compiler check use the output of the actual compiler being
used as reported by the CC variable, instead of unconditionally
running the "gcc" binary. Also only run the check if the compiler
is gcc or a cross-compile gcc.
ASTERISK-28374
Change-Id: Icaacf6d93686ad21076878aa1504a23b4fc9d0f4
We changed the validation of autocomplete parameter in the "indications
remove" command to avoid continue the execution of the command after
asking for autocomplete out of range parameters.
ASTERISK-28391
Reported by: lmendes86
Change-Id: I92b24131fd02f2e3c7fec966eea6f7a663310d40
Added a new PJSIP global setting called norefersub.
Default is true to keep support working as before.
res_pjsip_refer: Configures PJSIP norefersub capability accordingly.
Checks the PJSIP global setting value.
If it is true (default) it adds the norefersub capability to PJSIP.
If it is false (disabled) it does not add the norefersub capability
to PJSIP.
This is useful for Cisco switches that do not follow RFC4488.
ASTERISK-28375 #close
Reported-by: Dan Cropp
Change-Id: I0b1c28ebc905d881f4a16e752715487a688b30e9
One of the downaides of having things like test configuration
in the git repo is that it can't be changed at runtime. You have
to create a review for the changes and merge it mefore it will
take effect.
This review moves the data currently held in
tests/CI/periodic-dailyTestGroups.json and
tests/CI/gateTestGroups.json into a Jenkins Config File attached
to the job definitions. This allows us to alter it from the
Jenkins UI at runtime. The original files stay in the repo
as documentation.
Change-Id: I14b9702f6285ce1fb2420287ba0e7d3b59109763
Because the per-mailbox options are the last thing on a line, don't look
for or stomp on any subsequent commas.
ASTERISK-27935 #close
Reported by: Sébastien Duthil
Change-Id: I07b2eb4a33c303d0c7114d5b906f8c067c60a153
Because hyphens are not matched literally in Asterisk dialplan, we need
to ignore them in our candidate extensions as well.
ASTERISK-17695 #close
Reported by: test011
Change-Id: I227f02301577b1633e8a55b9fe9dc149935c03f0
If Asterisk crashes while a VM directory is locked, lock files in the VM
spool directory will not get properly cleaned up. We now clear them on
module load.
ASTERISK-20207 #close
Reported by: Steven Wheeler
Change-Id: If40ccd508e2f6e5ade94dde2f0bcef99056d0aaf
An earlier contributor apparently forgot to run 'make ari-stubs'
before committing after making ARI model changes.
Change-Id: I7813e5638e2821d11f4b968dc2aeab4f725190a6
Reset the internal counter that the AEL2 compiler uses for unique label
names before compiling. This keeps dialplan labels consistent across
reloads assuming the AEL2 has not changed.
ASTERISK-17799 #close
Reported by: Kirill Katsnelson
Change-Id: I30b3cc887d1ee0644d3f341e2fef16f525d7fae5
In AEL2, if a 'for' statement contains macro* calls, like:
for (&iterator(${TRY},A); "${A}" != ""; &iterate(A)) {
The AEL2 parser will translate these into calls to the deprecated Macro
dialplan application and use the antiquated pipe delimiter.
Instead, convert these into calls to the Gosub dialplan application and
use commas as argument separators.
ASTERISK-18593 #close
Reported by: Luke-Jr
* 'macro' in this context means AEL2 macros, not the 'Macro' application
Change-Id: I3d73716033b8e3e42e0209d355bf5f10c97045fc
When generating the regular expression that matches against existing
extensions, we need to escape literal characters that can also be
regular expression metacharacters. This was already being done for '*'
but we need to do the same for '+'.
In passing, remove some unreachable code - strcmp() is already run
immediately when entering extension_matches().
ASTERISK-14939 #close
Reported by: klaus3000
Change-Id: I8d2cccb3479168fba1b0a6704c52198b396468f1
If the target of a Goto is a label that starts with a number, we
erroneously treat the leading digits as a priority.
ASTERISK-20182 #close
Reported by: Janu
Change-Id: Ia78408c0805a729103917247ecfc802f6fafc94b
This changes the way that we handle adding changes to CHANGES and
UPGRADE.txt. The reason for this is because whenever someone needed to
make a change to one of these files and someone else had already done
so, you would run into merge conflicts. With this new setup, there will
never be merge conflicts since all changes will be documented in the
doc/<file>-staging directory. The release script is now responsible for
merging all of these changes into the appropriate files.
There is a special format that these files have to follow in order to be
parsed. The files do not need to have a meaningful name, but it is
strongly recommended. For example, if you made a change to pjsip, you
may have something like this "res_pjsip_relative_title", where
"relative_title" is something more descriptive than that. Inside each
file, you will need a subject line for your change, followed by a
description. There can be multiple subject lines. The file may look
something like this:
Subject: res_pjsip
Subject: Core
A description that explains the changes made and why. The release
script will handle the bulleting and section separators!
You can still separate with new lines within your
description.
The headers ("Subject" and "Master-Only") are case sensative, but the
value for "Master-Only" ("true" or "True") is not.
For more information, check out the wiki page:
https://wiki.asterisk.org/wiki/display/AST/CHANGES+and+UPGRADE.txt
ASTERISK-28111 #close
Change-Id: I19cf4b569321c88155a65e9b0b80f6d58075dd47
When extconfig.conf file is parsed, the code previously searched for
character comma without verifying if error (null or blank). This caused
a segmentation error.
Change-Id: Id76b452d8f330d11c2742c37232761ad71472a8b
When the dtmf_mode on an endpoint is configured as "auto_info"
Asterisk will produce an inband DTMF tone alongside an INFO
message when sending DTMF.
ASTERISK-28371
Change-Id: I1380b82f006e110a1b83fbb50c9873edd13a5d9a
It was difficult to check the channel's current application and
parameters using ARI for current channels. Added app_name, app_data
items to show the current application information.
ASTERISK-28343
Change-Id: Ia48972b3850e5099deab0faeaaf51223a1f2f38c
Asterisk assumes that dlopen() will always run the constructor of a
shared library and every dlclose() will run its destructor. But dlopen()
may be permanent, meaning the constructor will only be run once, as is
the case with musl libc.
With a permanent dlopen() the Asterisk module loader does not work
correctly, because it's expectations regarding when the constructors and
destructors are run are not met. In fact a segmentation fault will occur
when the first module is "re-opened" that has AST_MODFLAG_GLOBAL_SYMBOLS
set (the dlopen() does not call the constructor, resource_being_loaded
is not set to NULL, then strlen is called with NULL instead of a string,
see issue ASTERISK-28319).
This commit adds code to the loader that will manually run the
constructors/destructors of the (non-builtin) modules where needed. To
achieve this a new ao2 container (linked list) is started and filled
with objects that contain the names of the modules and the pointers to
their respective info structs.
This behavior can be activated when configuring Asterisk
(--enable-permanent-dlopen). By default this is disabled, of course.
ASTERISK-28319 #close
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
Change-Id: I86693a0ecf25d5ba81c73773a03df4abc3426875
The new option disables dev mode, TEST_FRAMEWORK and
MALLOC_DEBUG making the build more production-like.
Change-Id: Ieb72497d4d91d5416684aaed702cc3f532099738
The compiler complained about a couple of variables that weren't
initialized but were being used. Initializing them to NULL resolves the
warnings/errors.
ASTERISK-28362 #close
Change-Id: I6243afc5459b416edff6bbf571b0489f6b852e4b
REMB's exponent is 6-bits (0..63) and has a mantissa of 18-bits. We were using
an unsigned integer to represent the bitrate. However, that type is not large
enough to hold all potential bitrate values. If the bitrate is large enough
bits were being shifted off the "front" of the mantissa, which caused the
wrong value to be sent to the browser.
This patch makes it so it now uses a float type to hold the bitrate. Using a
float allows for all bitrate values to be correctly represented.
ASTERISK-28255
Change-Id: Ice00fdd16693b16b41230664be5d9f0e465b239e
It looks like we're not properly calculating jitter values on received
video streams. This patch enables the code that does jitter calculations
for those streams.
Change-Id: Iaac985808829c8f034db8c57318789c4c8c11392
* Always set member->lastpause when setting member->paused
* Fixed typo (using member->lastcall instead of member->lastpause) in
'queue show' output.
* Use a constant 'now' in 'queue show' output for a better point-in-time
view of time based stats.
ASTERISK-27541 #close
Reported by: César Benjamín García Martínez
Change-Id: Ib41ced90cfdb66f9bb1e7b263d0f6fc1ac6e18fa
When trying to upgrade using alembic, a couple different errors kept
popping up that prevented the upgrade. An additional parameter was
needed when changing the schema for mwi_subscribe_replaces_unsolicited
from an integer to an enum. When changing from a string to an enum, the
type needed to be cast for postgresql. The other issue was a parameter
being used during column creation that did not exist.
After fixing the upgrade process, it revealed errors with the downgrade
process. One was a variable not being defined in the downgrade function,
and the other was tables not existing when using MySQL. This was due to
a context check that should have encompassed MySQL, but in the end was
not doing so.
Change-Id: Ib4d70cf3ce5080023a50be496272a777b55d6c8e
Added topic_all container for centralizing the topic. This makes more
easier to managing the topics.
Added cli commands.
stasis show topics : It shows all registered topics.
stasis show topic <name> : It shows speicifed topic's detail info.
ASTERISK-28264
Change-Id: Ie86d125d2966f93de74ee00f47ae6fbc8c081c5f
Added ARI resource for channel statistics.
GET /ari/channels/{channelId}/rtp_statistics : It returns given
channel's rtp statistics detail.
ASTERISK-28320
Change-Id: I4343eec070438cec13f2a4f22e7fd9e574381376
This is the first step in changing the release process so that changes
made to the CHANGES and UPGRADE.txt files do not result in merge
conflicts every time multiple people modify these files. The changes
made will go in these new directories: doc/CHANGES-staging and
doc/UPGRADE-staging. The README.md files explain how things will work,
but here's a little overview. When you make a change that would go in
either CHANGES or UPGRADE.txt, this should instead be documented in a
new file in the doc/CHANGES-staging or doc/UPGRADE-staging directory,
respectively. The format will look like this:
Subject: res_pjsip
A description that explains the changes made and why. The release
script will handle the bulleting and section separators! The
'Subject:' header is case-sensitive.
You can still separate with new lines within your description.
Subject: res_ari
Master-Only: true
You can have more than one subject, and they don't have to be the
same! Also, the 'Master-Only' header should always be true and is
also case-sensitive (but the value is not - you can have 'true' or
'True'). This header will only ever be present in the master branch.
For more information, check out the wiki page:
https://wiki.asterisk.org/wiki/display/AST/CHANGES+and+UPGRADE.txt
This is an initial change for ASTERISK_28111. Functionally, this will
make no difference, but it will prep the directories for when the
changes from CHANGES and UPGRADE.txt are extracted.
Change-Id: I8d852f284f66ac456b26dcb899ee46babf7d15b6
It was a copy/paste of the QUEUE_MEMBER_COUNT function's synopsis.
ASTERISK-20986 #close
Reported by: Olivier Krief
Change-Id: If51ec481feb35824a4e78ab5600b197b819b10be
When notifying a manager session that new events were available
the same lock was used that was also held when doing things within
the session (such as sending events out). If the manager session
blocked for a period of time this would cause a back up of messages
in Stasis and would also block any other sessions from receiving
events.
This change adds a separate lock to the manager session which is
strictly used for notifying it that new events are available.
ASTERISK-28350
Change-Id: Ifbcac007faca9ad0231640f5e82a6ca9228f261b
The next usage of PJSIP_PARSE_URI will crash asterisk
${PJSIP_PARSE_URI(tel:+1234567890,host)}
or
${PJSIP_PARSE_URI(192.168.1.1:5060,host)}
The function pjsip_parse_uri successfully parses then, but returns
struct pjsip_other_uri *.
This patch restricts parsing only SIP/SIPS URIs.
Change-Id: I16f255c2b86a80a67e9f9604b94b129a381dd25e
Changed to requirement to having timestamp for all of ARI events.
The below ARI events were changed to having timestamp.
PlaybackStarted, PlaybackContinuing, PlaybackFinished,
RecordingStarted, RecordingFinished, RecordingFailed,
ApplicationReplaced, ApplicationMoveFailed
ASTERISK-28326
Change-Id: I382c2fef58f5fe107e1074869a6d05310accb41f
Passing negative intervals to the scheduler rips a hole in the
space-time continuum.
ASTERISK-25792 #close
Reported by: Paul Sandys
Change-Id: Ie706f21cee05f76ffb6f7d89e9c867930ee7bcd7
If Realtime @ variable value is NULL or empty or contains only whitespaces
then when we try to retrieve it using PJSIP_ENDPOINT we get WARNING
pjsip_endpoint_function_read: Unknown property @my_var for PJSIP endpoint.
And the variable is missing in the result of CLI pjsip show endpoint.
This patch keeps empty sorcery extended field.
ASTERISK-28341 #close
Change-Id: I221fccc04cbfa2be17ce971f64ae0e74e465eea0
Since the new names went in, the maximum taskprocessor name is too
short. This patch increases the name field to a length to better
handle the new names.
Change-Id: I32f32d6926f25c8ef5a91303fd2988d2c2858877
Added ability to specifiy a wizard is read-only when applying
it to a specific object type. This allows you to specify
create, update and delete callbacks for the wizard but limit
which object types can use them.
Added the ability to allow an object type to have multiple
wizards of the same type. This is indicated when a wizard
is added to a specific object type.
Added 3 new sorcery wizard functions:
* ast_sorcery_object_type_insert_wizard which does the same thing
as the existing ast_sorcery_insert_wizard_mapping function but
accepts the new read-only and allot-duplicates flags and also
returns the ast_sorcery_wizard structure used and it's internal
data structure. This allows immediate use of the wizard's
callbacks without having to register a "wizard mapped" observer.
* ast_sorcery_object_type_apply_wizard which does the same
thing as the existing ast_sorcery_apply_wizard_mapping function
but has the added capabilities of
ast_sorcery_object_type_insert_wizard.
* ast_sorcery_object_type_remove_wizard which removes a wizard
matching both its name and its original argument string.
* The original logic in __ast_sorcery_insert_wizard_mapping was moved
to __ast_sorcery_object_type_insert_wizard and enhanced for the
new capabilities, then __ast_sorcery_insert_wizard_mapping was
refactored to just call __ast_sorcery_insert_wizard_mapping.
* Added a unit test to test_sorcery.c to test the read-only
capability.
Change-Id: I40f35840252e4313d99e11dbd80e270a3aa10605
Because StasisEnd's timestamp created it's own timestamp, it makes
wrong timestamp, compare to other channel event(ChannelDestroyed).
Fixed to getting a timestamp from the Channel's timestamp.
ASTERISK-28333
Change-Id: I5eb8380fc472f1100535a6bc4983c64767026116
This might be useful in situations where you are loading an undetermined number
of items into a vector and don't want to keep (potentially) 2x the necessary
memory around indefinitely.
Change-Id: I9711daa0fe01783fc6f04c5710eba84f2676d7b9
A size_t is not always an unsigned long.
* Use the %zu format specifier in the ast_cli() printf format string since
AST_VECTOR_SIZE() returns a size_t value.
Change-Id: Ib102dd36bbe6c2a7a4ce6870ae9110d978dd7e98
As part of an earlier voicemail refactor, ast_delete_mwi_state_full
was modified to remove the pool topic for a mailbox when the state
was deleted. This was an attempt to prevent stale topics from
accumulating when app_voicemail was reloaded and a mailbox went
away. Unfortunately because of the fact that when app_voicemail
reloads, ALL mailboxes are deleted then only current ones recreated,
topics were being removed from the pool that still had subscribers
on them, then recreated as new topics of the same name. So now
modules like res_pjsip_mwi are listening on a topic that will
never receive any messages because app_voicemail is publishing on
a different topic that happens to have the same name. The solutiuon
to this is not easy and given that accumulating topics for
deleted mailboxes is less evil that not sending NOTIFYs...
* Removed the call to stasis_topic_pool_delete_topic in
ast_delete_mwi_state_full.
Also:
* Fixed a topic reference leak in res_pjsip_mwi
mwi_stasis_subscription_alloc.
* Added some debugging to mwi_stasis_subscription_alloc,
stasis_topic_create, and topic_dtor.
* Fixed a topic reference leak in an error path in
internal_stasis_subscribe.
ASTERISK-28306
Reported-by: Jared Hull
Change-Id: Id7da0990b3ac4be4b58491536b35f41291247b27
When variable ALTCONF is defined, the command start prints the message
"Unable to open specified master config file '"/etc/asterisk/asteris..."
and use default configurations.
ASTERISK-28332
Change-Id: I7595e582a0ee2c1051ea35435e247e27906957ef
Increasing the non-breaking AMI and ARI version numbers due to changes and
additions in those API's. Note, some changes may be forthcoming (will be added
between now and the next release of Asterisk), thus not listed here. As well
a few changes listed below may have been released in a previous release of
Asterisk, but the API version numbers were not increased at that time, so
including here.
AMI:
* app_queue: set the wrapuptime from AddQueueMember application - e806990
* res_pjsip: option for ContactStatus event updates - 7f22c9f
ARI:
* bridging: Add creation timestamps - 0d70120
* res_stasis: Add ability to switch applications - 50a4b61
* ARI event type filtering - 1c5def4
* Added ARI resource /ari/asterisk/ping - 19fc99a
ASTERISK-28314
Change-Id: Iebc813840f8230afa6b20579772e15549064b787
The download_externals script wasn't getting the PJPROJECT_BUNDLED
environment variable passed down to it so it wasn't downloading
the appropriate variant of res_digium_phone. This could cause
crashes in the DPMA.
Change-Id: I5daa9369c7af1fd556d892e89a85f279a2533425
Apply flag -fno-partial-inlining on default optimization if and only if
gcc version >= 8.2.1 (this is the current ver on Fedora and Ubuntu).
This is done to avoid a bug that causes arithmetic calculations to fail
if the following conditions are met:
1. TEST_FRAMEWORK on
2. DONT_OPTIMIZE off
3. Fedora and Ubuntu
4. GCC 8.2.1
5. There must exist a certain combination of multithreading.
6. Optimization level -O2 and -O3
7. Flag -fpartial-inline activated (default when optimization level>=2)
The following link points to a similar gcc bug reported in 2015. This leads me
to believe the bug has regressed. Note I am not able to replicate this bug
in an environment other than Asterisk + Test Framework + Test_cel because the
multithreading combination that causes it seems to be unique. Therefore I
am temporarily abandoning any thoughts of reporting the new occurrence of this
bug to gcc.gnu.org. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65307
Change-Id: Ibd1afe60e0a38b88e85fdcd9b051004601c2f102
Topic names now follow: <subsystem>:<functionality>[/<object>]
This ensures that they are all unique, and also provides better
insight in to what each topic is for.
Subscriber ids now also use the main topic name they are
subscribed to and an incrementing integer as their identifier to
make it easier to understand what the subscription is primarily
responsible for.
Both the CLI commands for listing topic and subscription statistics
now sort to make it a bit easier to see what is going on.
Subscriptions will now show all topics that they are receiving messages
from, not just the main topic they were subscribed to.
ASTERISK-28335
Change-Id: I484e971a38c3640f2bd156282e532eed84bf220d
Currently, when the Asterisk calculates rtp statistics, it uses
sample_count as a unsigned integer parameter. This would be fine
for most of cases, but in case of large enough number of sample_count,
this might be causing the divide by zero error.
ASTERISK-28321
Change-Id: If7e0629abaceddd2166eb012456c53033ea26249
Add logical group at DAHDIChannel event
and create "dahdi_group" at CHANNEL function.
ASTERISK-28317
Change-Id: Ic1f834cd53982a9707a9748395ee746d6575086a
chan_sip will always ignore 183 responses that do not contain SDP
however, chan_pjsip will currently always translate it into a
183 with SDP. This new flag allows chan_pjsip to have the same
behavior as chan_sip.
ASTERISK-28322 #close
Change-Id: If81cfaa17c11b6ac703e3d71696f259d86c6be4a
Add a json_pack at startup that will fail if runtime links against a
library older than jansson-2.11.
Change-Id: I101aebafe0f9407650206f7c552dad3d69377b5a
Added the ability to move between Stasis applications within Stasis.
This can be done by calling 'move' in an application, providing (at
minimum) the channel's id and the application to switch to. If the
application is not registered or active, nothing will happen and the
channel will remain in the current application, and an event will be
triggered to let the application know that the move failed. The event
name is "ApplicationMoveFailed", and provides the "destination" that the
channel was attempting to move to, as well as the usual channel
information. Optionally, a list of arguments can be passed to the
function call for the receiving application. A full example of a 'move'
call would look like this:
client.channels.move(channelId, app, appArgs)
The control object used to control the channel in Stasis can now switch
which application it belongs to, rather than belonging to one Stasis
application for its lifetime. This allows us to use the same control
object instead of having to tear down the current one and create
another.
ASTERISK-28267 #close
Change-Id: I43d12b10045a98a8d42541889b85695be26f288a
Fixes an intermittent segmentation fault which occured when accessing
nativeformats of a channel which entered into a queue.
ASTERISK-27964
Reported by: Francisco Seratti
Change-Id: Ic87fa7a363f3b487c24ce07032f4b2201c22db9e
While the 'interface' column is a NOT NULL, the empty string is still
allowed. res_config_odbc treats the empty string as a NULL and we crash
when trying to dereference.
Also cleaned up an adjacent error message for consistency.
ASTERISK-28168 #close
Change-Id: I55e012b540fbcda99bb40bede3099b7ae5db8202
In Asterisk configuration, a multiline comment starts with ;-- as long as it is
not followed by another dash (i.e. ;--- is not a multiline comment).
ASTERISK-28323 #close
Change-Id: I32dc38e0fac01d3c0805d27d35d2365a7c37ca72
The res_pjsip_websocket module requires the res_http_websocket
module so ensure it is loaded. As well the res_pjsip_notify
module needs the pjsip_notify.conf configuration file so
ensure it is installed.
ASTERISK-28272
Change-Id: I261659b84e7a6ac4cb49990d9badb4b2ad01bacd
This small feature will help to checking the bridge's status to
figure out which bridge is in old/zombie or not. Also added
detail items for the 'bridge show *' cli to provide more detail
info. And added creation item to the ARI as well.
ASTERISK-28279
Change-Id: I460238c488eca4d216b9176576211cb03286e040
PJSIP assumes that these header names are not allocated, and does not
clone the name strings when reusing headers.
Block unload of res_pjsip_diversion until shutdown to ensure static
memory stays valid.
ASTERISK-28312 #close
Change-Id: Ibd6ea55ec4a604bbd43ac07f8d0b54da2c39b8b9
This file was added to the Subversion repository on 2007-03-15 by
Russell Bryant, a Digium employee at the time.
ASTERISK-24173 #close
Change-Id: Ie866fa9d31d550467613d362b35b03c031ee594d
apply_negotiated_sdp_stream was returning a "1" when no joint
capabilities were found on an outgoing call instead of a "-1".
This indicated to res_pjsip_session that the handler DID handle
the sdp when in fact it didn't. Without the appropriate setup,
a subsequent media frame coming in would have an invalid stream_num
and cause a seg fault when the stream was attempted to be retrieved.
apply_negotiated_sdp_stream now returns the correct "-1" and any
media is now discarded before it reaches the core stream processing.
ASTERISK-28260
Reported by: Sotiris Ganouris
Change-Id: Ia095cb16b4862f2f6ad6d2d2a77453fa2542371f
This reverts commit d524ad523d.
Reason for revert: This causes Contact and Via headers to have the wrong
transport address.
ASTERISK-28309 #close
Change-Id: Ibba4d6176f68e39279fcd9a545f81d56e747bed8
If both send_registrations and send_auth are both set to yes,
outbound_auth/username must be set or we crash.
ASTERISK-27992 #close
Change-Id: I6418d56de1ae53f80393b314c2584048fbf7f11d
Rather than calling ast_odbc_find_table() in the prepare callback, call
it beforehand and pass it in to the callback to avoid the need for a
second connection.
ASTERISK-28166 #close
Change-Id: I6f8a0b9990d636fd6bc1a92ed70f7050d2436202
When a contact was removed by the registrar it did not always check to see if
the circumstances involved a monitored reliable transport. For instance, if the
'remove_existing' option was set to 'true' then when existing contacts were
removed due to 'max_contacts' being reached, those existing contacts being
removed did not unregister the transport monitor.
Also, it was possible to add more than one monitor on a reliable transport for
a given aor and contact.
This patch makes it so all contact removals done by the registrar also remove
any associated transport monitors if necessary. It also makes it so duplicate
monitors cannot be added for a given transport.
ASTERISK-28213
Change-Id: I94b06f9026ed177d6adfd538317c784a42c1b17a
The recent upgrade of Gerrit to 2.16 elimiated referencing a
repository in a way the jenkinsfiles were relying on so
the URL references were changed to a more consistent and supported
format.
Change-Id: I2e8e3f213b9a96bb1b27665eca4a9a24bc49820e
(cherry picked from commit 5ce084579f)
This module allows presence subscriptions to voicemail boxes. This
allows common BLF keys to act as voicemail waiting indicators.
ASTERISK-28301
Change-Id: I62a246c24f3d7d432e33e22d7a4a57c15c292fdd
Delivery timeval in the smoother object will fall behind while a DTMF is
being generated. This can eventually lead to invalid rtp timestamps.
To prevent this from happening the smoother needs to be reset after every
DTMF to keep the timing up to date.
ASTERISK-28303 #close
Change-Id: Iaba3f7b428ebd72a4caa90e13b829ab4f088310f
Including line breaks (<br>, <br/>, <br />) in certain parts of the rest-api
json definition (e.g. summary, notes) displays them correctly in swagger.
However, when the field gets converted to the wiki format those breaks get
escaped and show up in the text as the actual string literal "<br>" etc...
This patch makes it so when converting to the wiki format it replaces all line
break values (<br>, etc...) with line feeds ('\n').
Change-Id: Ie1c9faa0d1c5d622804cc0a21ce769095b08aa3d
When listing the applications the apps lock was incorrectly
locked twice instead of being locked and then unlocked.
ASTERISK-28302
Change-Id: If7d064592a9e88c0f1049214c50e02be6dabf79e
When processing SSRC attributes we were iterating through
all of them, even though we only need to know the remote
SSRC once. This was problematic because some browsers group
SSRCs together on a stream, and due to our negotiation only
end up using the first one. Since we set the second one as
the remote SSRC we would drop the received media from them
instead of allowing it through.
In the future this may be extended to allow SSRC groups
and to use information from the attributes.
Change-Id: I4dc87087dbe56a83aa65f0f897bbd4ca75ec1270
Currently, the Asterisk does not support seperated HTTP request.
This patch make the Asterisk enables to wait lest part of HTTP request.
Also increases acceptable HTTP body length to 40k to support more
larger request.
ASTERISK-28236
Change-Id: I48a401aa64a21c3b37bf3cb4e0486d64b7dd8aa1
The current settings AST_PBX_MAX_STACK is 128 entries which is
too low for some FreePBX installations with complex parking
arrangements. Increased to 512 if LOW_MEMORY is not defined.
ASTERISK-28300
Change-Id: I7c4b540bc92e6642df0f3da639b003f7da8b1299
This change provides an easier mechanism to determine which
subscribers are subscribed to a topic. Using this you can
inspect the specific subscribers for further details.
Change-Id: I8deea21703cd5c5357b85593b46c3eaf24e18c0c
To prevent one subsystem's taskprocessors from causing others
to stall, new capabilities have been added to taskprocessors.
* Any taskprocessor name that has a '/' will have the part
before the '/' saved as its "subsystem".
Examples:
"sorcery/acl-0000006a" and "sorcery/aor-00000019"
will be grouped to subsystem "sorcery".
"pjsip/distributor-00000025" and "pjsip/distributor-00000026"
will bn grouped to subsystem "pjsip".
Taskprocessors with no '/' have an empty subsystem.
* When a taskprocessor enters high-water alert status and it
has a non-empty subsystem, the subsystem alert count will
be incremented.
* When a taskprocessor leaves high-water alert status and it
has a non-empty subsystem, the subsystem alert count will be
decremented.
* A new api ast_taskprocessor_get_subsystem_alert() has been
added that returns the number of taskprocessors in alert for
the subsystem.
* A new CLI command "core show taskprocessor alerted subsystems"
has been added.
* A new unit test was addded.
REMINDER: The taskprocessor code itself doesn't take any action
based on high-water alerts or overloading. It's up to taskprocessor
users to check and take action themselves. Currently only the pjsip
distributor does this.
* A new pjsip/global option "taskprocessor_overload_trigger"
has been added that allows the user to select the trigger
mechanism the distributor uses to pause accepting new requests.
"none": Don't pause on any overload condition.
"global": Pause on ANY taskprocessor overload (the default and
current behavior)
"pjsip_only": Pause only on pjsip taskprocessor overloads.
* The core pjsip pool was renamed from "SIP" to "pjsip" so it can
be properly grouped into the "pjsip" subsystem.
* stasis taskprocessor names were changed to "stasis" as the
subsystem.
* Sorcery core taskprocessor names were changed to "sorcery" to
match the object taskprocessors.
Change-Id: I8c19068bb2fc26610a9f0b8624bdf577a04fcd56
Event type filtering is now enabled, and configurable per application. An app is
now able to specify which events are sent to the application by configuring an
allowed and/or disallowed list(s). This can be done by issuing the following:
PUT /applications/{applicationName}/eventFilter
And then enumerating the allowed/disallowed event types as a body parameter.
ASTERISK-28106
Change-Id: I9671ba1fcdb3b6c830b553d4c5365aed5d588d5b
This change add ability to set the wrapuptime per-member using the
AddQueueMember application.
The feature to set wrapuptime per member was include in the issue
ASTERISK-27483 for static member by configuration file and was not
added to set from AddQueueMember.
ASTERISK-28055 #close
Change-Id: I7c7ee4a6f804922cd7c42cb02eea26eb3806c6cf
Currently, the pjsip show channelstats cli does not show channel's
stats after hits the invalid channel info. This makes hard to use
this cli. Changed to keep iterate after hits the invalid channel
info.
ASTERISK-28292
Change-Id: I3efdff1c9e1b1efd3c971fb82ae77aa133a6f43c
Currently, the Asterisk's pjsip_session module does not keeping the
rtcp's stats info after it was removed. But by adding the results
vector and keeping it until session is destroying, it can give more
useful information for other modules.
ASTERISK-28253
Change-Id: Ib25c2d3fc4da084aecfde2a82c1b1d733bd64fa5
Some tests require Asterisk to execute scripts which
are stored in /tmp. When mount is used for tmpfs there
is no ability to allow scripts to be executed from
that location.
This change switches to using tmpfs which can be told
to allow executables to be run from /tmp.
Change-Id: I0e598ca2b76af1f7f2d29f0da7b1731a214a291a
Added 'ast_json_object_string_get' to the JSON wrapper in order to make it a
little easier to retrieve a string field from the JSON object.
Also added an 'ast_strings_equal' function that safely checks (checks for NULLs)
for equality between two strings.
Change-Id: I26f0a16d61537505eb41b4b05ef2e6d67fc2541b
p2p_write updates txformat but doesn't require a smoother. If a smoother
was created by another bridge type the smoother could fall out of date causing
one way audio issues. To prevent this the smoother is now destroyed on the
start of native bridge.
ASTERISK-28284 #close
Change-Id: I84e67f144963787fff9b4d79ac500514fb40cdc6
This change makes it so that even if non-code changes
occur (such as commit message changing) unit tests
will still be run and result in a verification.
ASTERISK-28251
Change-Id: I6491fff7c93e5d5cd8e41054486968bf66c4f608
A previous patch attempt to mitigate blocked threads on transport shutdown for
a given contact. It was thought that a second lock could be avoided by checking
the 'removing' flag on the transport monitor twice (once before and once after
the normal named aor locking). However as with usual threading issues if the
timing was right the original problem still occured.
This patch adds locking around the first 'removing' flag check and set, thus
nullifying the secondary check, so it was removed.
ASTERISK-28213
Change-Id: Iaa8e36e5311789549b76d8de42dfcea96013b2ed
When Asterisk is connected and used with a database the response
time of the database can cause problems in Asterisk if it is long.
Normally the only way to see this problem would be to retrieve a
backtrace from Asterisk and examine where things are blocked, or
examine the database to see if there is any indication of a
problem.
This change adds some basic query logging to make it easier to
investigate such a problem. When logging is enabled res_odbc will
now keep track of the number of queries executed, as well as the
query that has taken the longest time to execute. There is also
an option which will cause a WARNING message to be output if a
query takes longer than a configurable amount of time to execute.
This makes it easier and clearer for users that their database may
be experiencing a problem that could impact Asterisk.
ASTERISK-28277
Change-Id: I173cf4928b10754478a6a8c27dfa96ede0f058a6
The CDR was overwriting the start time when the call continued the
dialplan from the ARI stasis or a Local channel was originated.
This change fixes this by no longer reinitializing the CDR when
transitioning out of the dialed pending state to the single state.
ASTERISK-28181
Change-Id: I921bc04064b6cff1deb2eea56a94d86489561cdc
Split destroy_hint method to separate hint removal and extension hint
state changed callback, the latter now called via stasis.
This avoids deadlock between res_parking reload that is removing the
parking lot and the related hint and subscribe requests coming for the
same parking lot.
ASTERISK-28173
Change-Id: I5b03c3455b3b12b6f83cea4cc34f4b4b20444f7e
Added ARI resource.
GET /ari/asterisk/ping : It returns "pong" message with timestamp
and asterisk id. It would be useful for simple heath check.
Change-Id: I8d24e1dcc96f60f73437c68d9463ed746f688b29
At AstriCon, there was a strong desire for the ability to completely
bypass dialplan when using ARI. This is possible through the automatic
creation of a context and a couple of extensions whenever an application
is started.
For example, if you have an application named 'ari-example', a context
named 'stasis-ari-example' will be automatically created whenever this
application is started as long as one does not already exist. Two
extensions (a match-all extension for Stasis and a 'h' extension) are
created within this context. Any endpoint that registers to Asterisk
within this context will send all calls to the corresponding Stasis
application. When the application is destroyed, the context is removed.
ASTERISK-28104 #close
Change-Id: Ie35bd93075e05b05e3ae129a83c9426931b7ebac
On OpenSuse Leap, libjansson.a is installed in
third-party/jansson/dest/lib64 instead of lib (which is where
the top-level makeopts looks). This causes a link failure.
* Updated jansson/Makefile to add an explicit --libdir to force
the installation to third-party/jansson/dest/lib.
ASTERISK-28271
Reported by: David Wilcox
Change-Id: Ibf8af75e5da13562105fcc39ed898c6ef0b5a5f3
The context specified by 'regcontext' was not being created, so when Asterisk
attempted to later dynamically add an extension it would fail. This patch now
creates the context if a 'regcontext' is specified.
ASTERISK-28238
Change-Id: I0f36cf4ab0a93ff4b1cc5548d617ecfd45e09265
Testing revealed that the cache added no benefit but that it could
consume excessive memory.
Two new index related functions were created:
ast_sounds_get_index_for_file() and ast_media_index_update_for_file()
which restrict index updating to specific sound files.
The original ast_sounds_get_index() and ast_media_index_update()
calls are still available but since they no longer cache the results
internally, developers should re-use an index they may already have
instead of calling ast_sounds_get_index() repeatedly. If information
for only a single file is needed, ast_sounds_get_index_for_file()
should be called instead of ast_sounds_get_index().
The media_index directory scan code was elimininated in favor of
using the existing ast_file_read_dirs() function.
Since there's no more cache, ast_sounds_index_init now only
registers the sounds cli commands instead of generating the
initial index and subscribing to stasis format register/unregister
messages.
"sounds" is no longer a valid target for the "module reload"
command.
Both the sounds cli commands and the sounds ari resources were
refactored to only call ast_sounds_get_index() once per invocation
and to use ast_sounds_get_index_for_file() when a specific sound
file is requested.
Change-Id: I1cef327ba1b0648d85d218b70ce469ad07f4aa8d
The option value "sdp" for some of the settings was removed a while back,
however the sample conf was not updated.
This patch removes any wording with regards to the old "sdp" option value,
and adjusts the defaults to what they are now.
ASTERISK-28263
Change-Id: I41bfa44e9f69446bcc5c8fd92e3675c676fdc445
Added support for the seek function in format_g726
so playback can start from anywhere.
Before the fix, playback of g726 files
always started from the beginning.
ASTERISK-28246
Change-Id: I626235bc4642df1479050d3d06828412603a9b40
Bundled pjproject and jansson must be configured with the host and build
parameters provided to the configure script.
Autotools do not permit to check for the existence of local header files, so
the control of hrirs.h must not be done when cross-compiling.
ASTERISK-28250
Change-Id: If0a76e52a87d4ab82b7d4c72d27d8759ca931880
Control frames (PING / PONG / CLOSE) can be received in the middle of a
fragmented message. In order to ensure they do not interfere with the
reassembly buffer, we exit early and do not return the payload to the
caller.
ASTERISK-28257 #close
Change-Id: Ia5367144fe08ac6141bba3309517a48ec7f013bc
To avoid the stream name collide if there're more than one video track
in one client. If client has multi video tracks, the name of ast_stream
which represents each video track may be the same. Use the MSID:LABEL
here because it's identifiable.
ASTERISK-28196 #close
Reported-by: xiemchen
Change-Id: Ib62b2886e8d3a30e481d94616b0ceaeab68a870b
The type value extracted from stasis message data in channel_hangup_handler_cb
isn't compared against the valid values "run", "pop" and "push". Thus the
manager events HangupHandlerPush, HangupHandlerPop and HangupHandlerRun are
never thrown.
This regression was introduced by ASTERISK_21462.
ASTERISK-28252
Change-Id: I9956e35e18da1873113644df1ddc3c7cd37bf524
A bug in GCC causes TEST_CEL to return failure under the following
conditions:
1. TEST_FRAMEWORK on
2. DONT_OPTIMIZE off
3. Fedora and Ubuntu
4. GCC 8.2.1
5. Test name: test_cel_dial_pickup
6. There must exist a certain combination of multithreading.
The bug affects arithmetic calculations when the optimization level
is bigger than O1 and the -fpartial-inline flag is on. Provided these
conditions, function ast_str_to_lower() fails to convert to lower case
due to said function being of type force_inline. The solution is to
remove the "force_inline" type declaration from function ast_str_to_lower()
Change-Id: Ied32e0071f12ed9d5f3b4cdd878b2532a1c769d7
You can now define an "aliases" context in voicemail.conf
whose entries point to actual mailboxes. These can be used anywhere
the mailbox is specified.
Example:
[general]
aliasescontext = myaliases
[default]
1234 = yadayada
[myaliases]
4321@devices = 1234@default
Now you can use 4321@devices to refer to the 1234@default mailbox.
This can be useful to provide channel drivers with constant
mailbox specifications such as <extension>@devices leaving
app_voicemail to control exactly which mailbox the alias points to.
Now, only voicemail has to be reloaded to make changes instead of
individual channel drivers which are usually more expensive to
reload.
Change-Id: I395b9205c91523a334fe971be0d1de4522067b04
When a reliable transport is shutdown it's possible for the pjsip registrar
resource shutdown handler to get called multiple times. If this happens and one
of the threads is taking "too long" (slow database call for instance) then the
others get blocked waiting to delete.
Since it only takes one to delete the contact then the other threads should be
able to continue on if one of the threads is currently "deleting". This patch
makes it so now when a thread enters the shutdown handler it checks to see if a
thread is currently already "deleting". If so, then the thread does not attempt
to get the lock, and instead continues on thus avoiding the blockage.
ASTERISK-28213 #close
Change-Id: I7563ca596312b1dff4f3ab41483e89fe2862328a
Fixed#2172: Avoid double reference counter decrements in
timer in the scenario of race condition between
pj_timer_heap_cancel() and pj_timer_heap_poll().
Change-Id: If000e9438c83ac5084b678eb811e902c035bd2d8
The transport management code that checks for idle connections keeps a
reference to PJSIP's transport for IDLE_TIMEOUT milliseconds (32000 by
default). Because of this, if the transport is closed before this
timeout, the idle checking code will keep the transport from actually
being shutdown until the timeout expires.
Rather than passing the AO2 object to the scheduler task, we just pass
its key and look it up when it is time to potentially close the idle
connection. The other transport management code handles cleaning up
everything else for us.
Additionally, because we use the address of the transport when
generating its name, we concatenate an incrementing ID to the end of the
name to guarantee uniqueness.
Related to ASTERISK~28231
Change-Id: I02ee9f4073b6abca9169d30c47aa69b5e8ae9afb
If the Monitor is started with the i option the read_stream will be
NULL. One code path in channel.c checks if write_stream is set but than
uses read_stream instead causing a segfault.
ASTERISK-28249
Change-Id: I1bae9126537be54895c7fea2d08dd9488d8cc525
Previously both AMI and ARI used a default route on
their stasis message router to handle some of the
messages for publishing out their respective
connection. This caused messages to be given to
their subscription that could not be formatted
into AMI or JSON.
This change adds an API call to the stasis message
router which allows a default route to be set as well
as formatters that the default route is expecting.
This allows both AMI and ARI to specify that their
default route only wants messages of their given
formatter. By doing so stasis can more intelligently
filter at publishing time so that they do not receive
messages which will not be turned into AMI or JSON.
ASTERISK-28244
Change-Id: I65272819a53ce99f869181d1d370da559a7d1703
This ensures that Asterisk responds properly to frames received from a
client with opcode 8 (CLOSE) by echoing back the status code in its own
CLOSE frame.
Handling of the CLOSE opcode is moved up with the rest of the opcodes so
that unmasking gets applied. The payload is no longer returned to the
caller, but neither ARI nor the chan_sip nor pjsip made use of the
payload, which is a good thing since it was masked.
ASTERISK-28231 #close
Change-Id: Icb1b60205fc77ee970ddc91d1f545671781344cf
When --enable-dev-mode is used, pjsip_tpmgr_receive_packet() will assert
if passed a payload length of 0, so treat empty frames as if we didn't
receive them.
Change-Id: I9c5fdccd89cc8d2f3ed7e3ee405ef0fc78178f48
During Bridging of two channels if masquerade operation is performed on a
channel (clone channel) which was created with endpoint details
(ast_channel_alloc_with_endpoint()) and the original channel which is created
without endpoint details (ast_channel_alloc()) then both the channels must
exchange their endpoint details or else after masquerade when clone channel
is being destroyed the endpoint cleanup callbacks will be destroyed too and
after call completion unique_id of original channel will still be there in
ast_endpoint structure's channel_ids container.
ASTERISK-28197
Change-Id: Ied0451f378a3f2a36acc8c0984959a69895efa17
This prevents use-after-scope issues when unwinding the stack,
which happens in reverse order. The varname variable needs to
remain alive for the destruction to be able to access it.
Issue was found using clang + address-sanitizer.
ASTERISK-28232 #close
Change-Id: I00811c34ae910836a5fb6d22304528aef92624db
The commit I2f97ebfa79969a36a97bb7b9afd5b6268cf1a07d removed sending out
the ContactStatus AMI event when a contact is updated.
Thist change broke things which rely on old behavior.
This patch adds a new PJSIP global configuration option
'send_contact_status_on_update_registration' to be able to preserve old
ContactStatus behavior.
By default new behavior, i.e. the ContactStatus event will not be sent when a
device refreshes its registration.
Change-Id: I706adf7584e7077eb6bde6d9799ca408bc82ce46
For video streams it was possible for the abs-send-time information
to be placed into RTP streams even if not negotiated. Depending on
the endpoint in use this could cause video to not flow.
We now only enable abs-send-time for negotiation if WebRTC is enabled.
ASTERISK-28230
Change-Id: I0eb682302f8da3a4ea3c42e839208d55f825ed0c
The remote side may start a new stream when renegotiating RTP.
Need to reset the DTMF last sequence number and the timestamp
of the last END packet on RTP renegotiation.
If the new time stamp is lower then the timestamp of the last DTMF END packet
the asterisk drops all DTMF frames as out of order.
This bug was caught using Cisco ip-phone SPA5XX and codec g722.
On SIP session update the SPA50X resets stream and a new timestamp is twice
smaller then the previous.
ASTERISK-28162 #close
Change-Id: Ic72b4497e74d801b27a635559c1cf29c16c95254
If a voicemail is marked "urgent" then the VM_MESSAGEFILE channel variable is
not updated correctly since urgent messages are in a different directory. The
fix is to update the channel variable when the path to the urgent message is
created.
ASTERISK-28225
Change-Id: I8efbace06e6122ea0793f7bdb073d4378e8274ca
When using the 'b' option to Queue with a queue that was not configured
for ring all a crash would occur as the wrong pointer would be used.
ASTERISK-28218
Change-Id: If1390f64e321047dff24fd2410c95dde74904980
An int64_t is not likely the same size as a long.
* Changed the int64_t values in the statistics structs to longs so casting
is not necessary when generating the formatted CLI output. The offending
members did not need to be int64_t anyway as they were only set by an int
type variable which was already truncating bits.
* Reordered the statistics structs to reduce potential padding bytes.
Change-Id: Ic090a070e9dc4ca650ebdb9c01ed50a581289962
This commit caused issues with polling when combined with
the revert commit "Revert "app_voicemail: Remove need to subscribe to stasis"
This reverts commit 17d6d9e1e7.
ASTERISK-28222
Reported by: abelbeck
Change-Id: Ib6a16cbe2c0b74c76c64264f525ab647959c1483
In order to get a dump of the running process, we need to find the
pid of the main asterisk process. This can be tricky if there are
also instances of "asterisk -r" running or if an alternate location
for asterisk.conf was specified on the command line with the -C
option that also specified an alternation location for the pid file.
So now...
1. We find the asterisk executable with "which" or the --asterisk-bin
command line option.
2. If there's only 1 process with an executable path that matches,
we use that pid. If not...
3. We try "<asterisk-bin> -rx 'core show settings'" and parse the
output to find the pidfile, then read that for the pid. If that
didn't work...
4. We get a list of all the pids matching <asterisk-bin> and look
in /proc/<pid>/cmdline for a -C argument and retry the "core show
settings" using the same -C option. We can't parse the output
of "ps" to get the -C path because it may contain spaces. The
contents of /proc/<pid>/cmdline are delimited by NULLs. For BSDs
we may have to mount /proc first. :(
ASTERISK-28221
Reported by: Andrew Nagy
Change-Id: I8aa1f3f912f949df2b5348908803c636bde1d57c
The backtrace library bfd.h include file does not get the sizes of
pointers and ints right on some platforms. On my old test box the size
of bfd_vma is 8 while the size of a pointer is 4. gcc on the box
complains of the integer casting to/from pointers size mismatch.
* uintptr_t to the rescue by doing an appropriate two stage cast.
Change-Id: Icb2621583f50c8728de08a3c824d95fe53cc45d0
The free_user function was automatically deleting the stasis mailbox
state but this only makes sense when the mailbox is actually
deleted, not just the structure freed. This was causing issues
where leave_voicemail would publish the mwi message to stasis and
delete the state before the message could be processed by
res_pjsip_mwi.
* Removed the delete of state from free_user().
* Created a new free_user_final() function that both frees the data
structure and deletes the state. This function is only called
during module load/unload where it's appropriate to delete the
state.
ASTERISK-28215
Change-Id: I305e8b3c930e9ac41d901e5dc8a58fd7904d98dd
All of the fields that were removed were no longer referenced except for
'lastrxts' and 'rxseqno' which were only ever written to.
Change-Id: I5a5d31eb33e97663843698f58d0d97f22a76627c
The profile-iop octet (the 2nd) of profile-level-id can be zero
according to RFC 6184 Section 8.1. So we ignore its value when deciding
to include profile-level-id in the outgoing SDP.
ASTERISK-27959 #close
Reported by: David Kuehling
Change-Id: Id28cd916a3d7748058fe9609b585d07d9e243f73
This is how features behaved up through Asterisk 11, but was changed
when the new bridging framework was implemented in Asterisk 12.
Reported by rrittgarn in #asterisk.
Change-Id: I72cf86223947a8118c75f46e2c603dbc11e3125b
Currently the file sound_only_person is not played when a marked
user (with announce_only_user=yes) joins an empty conference.
This patch fixes it.
ASTERISK-28201 #close
Change-Id: I85b67687e6b220939c3af8091d83a70a7b174cf4
This change adds statistics gathering to Stasis topics,
subscriptions, and message types. These can be viewed using
CLI commands and provide insight into how Stasis is used
and how long certain operations take to execute.
These are only available when Asterisk is compiled in
developer mode and do not have any impact under normal
operation.
ASTERISK-28117
Change-Id: I94411b53767f89ee01714daaecf0c2f1666e863f
The ARI DELETE /channels command takes a "reason" parameter
Previously, there were only five reasons implemented
This patch adds more reasons to choose from for more
complex setups
ASTERISK-28198 #close
Change-Id: I85996f1076c9946d65c778413f040a845a90fecc
Some platforms provide an implementation of socket() and pipe2() that allow the
caller to specify that the resulting file descriptors should be non-blocking.
Using these allows us to potentially elide 3 calls into 1 by avoiding extraneous
calls to fcntl() to set the O_NONBLOCK flag afterwards.
In passing, change ast_alertpipe_init() to use pipe2() directly instead of the
wrapper if it is available.
Change-Id: I3ebe654fb549587537161506c6c950f4ab298bb0
A subscriber can now indicate that it only wants messages
that have formatters of a specific type. For instance,
manager can indicate that it only wants messages that have a
"to_ami" formatter. You can combine this with the existing
filter for message type to get only messages with specific
formatters or messages of specific types.
ASTERISK-28186
Change-Id: Ifdb7a222a73b6b56c6bb9e4ee93dc8a394a5494c
* Added ---no-configure, --no-menuselect, --no-make and --no-alembic
options that prevent those actions from being performed. Useful
for testing and re-running portions of the build after fixing
earlier failures.
* Added "set -e" to abort the script on command failure.
Not sure why this wasn't there in the first place.
* Fixed a few echos that were redirecting to stderr when they shouldn't
have been.
* Catch more alembic failures by actually trying to generate the SQL.
Change-Id: I9f395fa4e9254be7299e7c1014f1a13db78faffb
This adds documentation to handle_cli_malloc_trim() indicating how it
can be useful when debugging OOM conditions.
Change-Id: I1936185e78035bf123cd5e097b793a55eeebdc78
We've had multiple opportunities where Richard Mudgett's
malloc_trim patch has been useful. Let's get it
pushed up to gerrit and merged.
Since malloc_trim is only available in libc, an entry is
added to configure.ac to create a definition for
HAVE_MALLOC_TRIM.
Change-Id: Ia38308c550149d9d6eae4ca414a649957de9700c
This test was occasionally failing, with:
WARNING[5812]: http.c:1939 httpd_helper_thread: Failed to set
TCP_NODELAY on HTTP connection: Bad file descriptor
ERROR[5812]: iostream.c:91 ast_iostream_nonblock: Failed to get
fcntl() flags for file descriptor: Bad file descriptor
ERROR[5812]: iostream.c:569 ast_iostream_close: close() failed: Bad
file descriptor
Disabled for now by making the test explicit only.
Change-Id: I778f6cbb6104c6b4e89737a2eaf1a9540888d351
In ASTERISK-27095 an issue had been fixed because of which chan_pjsip was not
trying to send UPDATE messages when connected_line_method was set to invite.
However this only solved the issue for incoming INVITES. For outgoing INVITES
(important when transferring calls) the options variable needs to be updated
at a different place.
ASTERISK-28182 #close
Reported-by: nappsoft
Change-Id: I76cc06da4ca76ddd6dce814a8b97cc66b98aaf29
This reverts commit 29115e2384.
That commit closed a long standing hole which allowed subscriptions
to mailboxes that weren't configured in voicemail.conf. This
caused an issue with FreePBX which depdended on that behavior.
The commit is being reverted until FreePBX can handle the new
behavior.
ASTERISK-28151
Reported by: Ronald Raikes
Change-Id: I57b7b85e75d7dd97c742b5c69d718a0f61260c15
These are only a few of the leaks. The large number of macros
and return paths in this file would make a weeks worth of work
to plug them all.
Change-Id: Ie2369fa944023d44767871c5c30974cb077ffb56
This brings in jansson-2.12, removes all patches that were merged
upstream. README is created in third-party/jansson/patches to explain
how to add patches but also because the patches folder must exist for
the build process to succeed.
Change-Id: If0f2d541c50997690660c21fb7b03d625a5cdadd
The marker bit set on the voice packet indicates the start
of a new stream and a new time stamp.
Need to reset the DTMF last sequence number and the timestamp
of the last END packet.
If the new time stamp is lower then the timestamp of the last DTMF END packet
the asterisk drops all DTMF frames as out of order.
This bug was caught using Cisco ip-phone SPA50X and codec g722.
On SIP session update the SPA50X resets stream indicating it with market bit
and a new timestamp is twice smaller then the previous.
ASTERISK-28162 #close
Change-Id: If9c5742158fa836ad549713a9814d46a5d2b1620
Replace usage of ao2_container_alloc with ao2_container_alloc_hash or
ao2_container_alloc_list.
ao2_container_alloc is now restricted to modules only and is being
removed from Asterisk 17.
Change-Id: I0907d78bc66efc775672df37c8faad00f2f6c088
Create ao2_container_dup_weakproxy_objs to perform a similar function to
ao2_container_dup. This function expects the source container to have
weakproxy objects, inserts the associated non-weak objects into the
destination container. Orphaned weakproxy objects are ignored.
Create test for this new function and for ao2_weakproxy_find.
Change-Id: I898387f058057e08696fe9070f8cd94ef3a27482
This patch makes it so only matching non-empty key names, and keys created by
the HASH function are eligible for inclusion in the comma separated string. It
also fixes a bug where it was possible to write to a negative index if the
result buffer was empty.
ASTERISK-28159
patches:
ASTERISK-28159.diff submitted by Michael Walton (license 6502)
Change-Id: I6e57fe7307dfd856271753aed5ba64c59b511487
The job timeouts were hard coded in the jenkinsfiles which
means changes had to go through gerrit. Now they are taken
from the following environment variables (and their defaults) that
can be set in Jenkins configuration...
TIMEOUT_GATES = "60 MINUTES"
TIMEOUT_DAILIES = "3 HOURS"
TIMEOUT_REF_DEBUG = "24 HOURS"
TIMEOUT_UNITTESTS = "30 MINUTES"
Change-Id: I673a551c1780bf665a3bc160b245da574aa4bbab
When a subscribe or unsubscribe occurs a message is published
containing this information. This change makes it so that the
message no longer uses stringfields or a lock, as both are not
really needed for the message.
Change-Id: I3f4831931d79f94fd979baf48048738df5dc1632
This replaces the inline functions with macros. This removes the need
to directly use __ao2_ref, opts instead for standard ao2_bump and
ao2_cleanup macros.
Change-Id: If4e04e9bab2e3c883188437cb9f487b3e498a21b
We've been seeing crashes in libbfd when we attempt to generate
a stack trace from multiple threads. It turns out that libbfd
is NOT thread-safe. It can cache the bfd structure and give it to
multiple threads without protecting itself. To get around this,
we've added a global mutex around the bfd functions and also have
refactored the use of those functions to be more efficient and
to provide more information about inlined functions.
Also added a few more tests to test_pbx.c. One just calls
ast_assert() and the other calls ast_log_backtrace(). Neither are
run by default.
WARNING: This change necessitated changing the return value of
ast_bt_get_symbols() from an array of strings to a VECTOR of
strings. However, the use of this function outside Asterisk is not
likely.
ASTERISK-28140
Change-Id: I79d02862ddaa2423a0809caa4b3b85c128131621
The res_ari(POST /channels/create handler) deos not check the endpoint
parameter length. And it causes core
dump.
Fixed it to check the parameter length. Also fixed memory leak.
ASTERISK-28169
Change-Id: Ibf10a9eb8a2e3a9ee1e13fbe748b2ecf955c3993
New dialplan function PJSIP_PARSE_URI added to parse an URI and return
a specified part of the URI.
This is useful when need to get part of the URI instead of cutting it
using a CUT function.
For example to get 'user' part of Remote URI
${PJSIP_PARSE_URI(${CHANNEL(pjsip,remote_uri)},user)}
ASTERISK-28144 #close
Change-Id: I5d828fb87f6803b6c1152bb7b44835f027bb9d5a
This change adds the ability for subscriptions to indicate
which message types they are interested in accepting. By
doing so the filtering is done before being dispatched
to the subscriber, reducing the amount of work that has
to be done.
This is optional and if a subscriber does not add
message types they wish to accept and set the subscription
to selective filtering the previous behavior is preserved
and they receive all messages.
There is also the ability to explicitly force the reception
of all messages for cases such as AMI or ARI where a large
number of messages are expected that are then generically
converted into a different format.
ASTERISK-28103
Change-Id: I99bee23895baa0a117985d51683f7963b77aa190
The testsuite can now use a user-specified work directory for
all it's temp files. This allows the docker containers to use
a tmpfs backed directory for the temp files instead of it's
own write-layer image.
* runTestsuite.sh now accepts a --work-dir command line argument
that gets exported as AST_WORK_DIR before running the testsuite.
* gates.jenkinsfile now specifies --work-dir to be
<testsuite_dir>/astroot.
Since the Asterisk CI docker hosts now mount /srv/jenkins/workspace
on a tmpfs, asterisk should be compiled and the testsuite run all in
memory.
Change-Id: If5ee905a15821296c355bb84cda38950ad8edc45
(cherry picked from commit a335f4c9ad)
There seems to be a race condition between starting the asterisk
daemon and attempting to use 'asterisk -r' that can cause the
control socket file to not be created. Since all of the Jenkins
slaves have 'expect' installed, the runUnittests script can use
it to start asterisk in the forground and issue the commands
interactively. This is much more reliable and it can also make
startup errors more visible since they'll be in the Jenkins console
output.
If 'expect' isn't installed, the original daemon/asterisk -r
process is used.
Also added a "core show settings" before running the tests
and added "notice,warning,error" to the console log.
Change-Id: Idd656085f854afede813ac241b9e312b31358160
Task processors are retrieved using a 'get or create' pattern. The
singleton container was unlocked between the get and create steps so
it's possible that two threads could create task processors with the
same name at the same time.
Change-Id: Id64fae94a6a1e940ddf38fde622dcd4391635382
We previously allowed resample and g711 codecs to be built when
TEST_FRAMEWORK was enabled. This could cause errors if the testsuite
was run without this option enabled. Switch the build system to allow
those codecs to be built when --enable-dev-mode is used. This removes a
chance for strange testsuite errors from use of an inadequate pjsua
binary.
Change-Id: Iee8a3613cdb711fa7e7d217c5a775a575907ae22
PJSIP assumes that these header names are not allocated, does not clone
the name strings when reusing headers.
Block unload of res_pjsip_caller_id until shutdown to ensure static
memory stays valid. It was previously unsafe to unload while any
sessions are active.
Change-Id: I190854dea943d6e441cf03733f8a0da661aea27f
The presence of Record-Route in re-invites is optional, thus it is
important to make sure the dialog doesn't have a routset before
rewriting the contact header.
ASTERISK-28129 #close
Change-Id: Ic8ceb54ccfc93f7e315e476c514a2c777f2da7dc
We cannot use need_el_end and SIGURG when restarting. Instead we need
to run el_end within the SIGHUP restartnow handler.
ASTERISK-28158
Change-Id: Ia852276363c81bdcf1aa29eb4558c5c2fa1218a0
When dn_expand was being called on SRV and NAPTR results, the
return value was being used to calculate the size of the buffer
needed to store the host names. Since dn_expand returns the
length of the COMPRESSED name the buffer could be too short
to hold the EXPANDED name. The expanded name is NULL terminated
so using strlen() is the correct way to determine the length
actually needed for the buffer.
ASTERISK-28127
Reported by: Jan Hoffmann
patches:
patch.diff submitted by janhoffmann (license 6986)
Change-Id: I4d35d6c431c6c6836cb61d37b1378cc47f0b414d
It's possible for a 4th task to be spawned before we cancel. This
results in a write to the already freed test_data1. Wait long enough to
verify success of the cancelation before freeing test_data1.
Change-Id: I057e2fcbe97f8a175e50890be89c28c20490a20f
Merge storage for the stats object and name string into the main
allocation for struct ast_taskprocessor.
Change-Id: I74fe9a7f357f0e6d63152f163cf5eef6428218e1
* Ignore console=yes configuration option in remote console processes.
* Use new flag to tell consolethread to run el_end and exit when needed.
ASTERISK-28158
Change-Id: I9e23b31d4211417ddc88c6bbfd83ea4c9f3e5438
pack_string crashed on non-NULL strings returned when s->has_error was
true if the string was the result of 's' format without '#', '%' or '+'.
Change-Id: Ic125df691d81ba2cbc413e37bdae657b304d20d0
If multiple [globals] sections are used (for example via separate
included files), only the first one is processed. This can result in
lost global variables when using a modular extensions.conf.
ASTERISK-28146 #close
Change-Id: Iaac810c0a7c4d9b1bf8989fcc041cdb910ef08a0
When Asterisk's taskprocessors get overloaded we need to reduce the work
load. res_pjsip currently ignores new SIP requests and relies on SIP
retransmissions in the hope that the overload condition will clear soon
enough to handle the retransmitted SIP request.
This change adds the following code after ast_taskprocessor_alert_get()
has returned TRUE:
1- identifies transport type. If non-udp then send a 503 response
2- if transport type is udp/udp6 then ignore, as before.
Change-Id: I1c230b40d43a254ea0f226b7acf9ee480a5d3836
The use of a '|' in the "global/debug" synopsis documentation caused the
generated html table on the wiki to add an extra column that included the
text after the pipe.
This patch replaces the pipe with a comma.
ASTERISK-28150
Change-Id: I3d79a6ca6d733d9cb290e779438114884b98a719
The current round-robin method does not take the current taskprocessor
load into consideration when distributing requests. Using the least-size
method the request goes to the taskprocessor that is servicing the least
number of active tasks at the current time.
Longer running tasks with the round-robin method can delay processing
tasks.
* Change the algorithm from round-robin to least-size for picking the
PJSIP taskprocessor from the default serializer pool.
Change-Id: I7b8d8cc2c2490494f579374b6af0a4868e3a37cd
As mentioned in the comment I've added in the code there is no
ability to unsubscribe all subscribers from a topic and explicitly
destroy it. This is not currently a problem as we have two types of
topics:
Long lived topics which exist for the lifetime of the system.
Ephemeral topics which feed a long lived topic.
In the case of the ephemeral topics there is no subscriber which does
not have its lifetime managed by the same entity that has created
the topic. This ensures that when the topic is being unreferenced the
subscribers are also unsubscribed and destroyed, allowing the topic
to ultimately be destroyed as well.
Change-Id: Ic5e244da7b16b1895ba1fc5ece481ebba5809c9a
When a call pickup is performed using and invite with replaces header
the ast_do_pickup method is attempted and a PICKUP stasis message is sent.
ASTERISK-28081 #close
Reported-by: Luit van Drongelen
Change-Id: Ieb1442027a3ce6ae55faca47bc095e53972f947a
Using the --quiet or -q option in conjonction with /dev/stdout as the output
file allow the output to be used as a valid configuration.
Given a script that generates a valid sip.conf I can pipe the output of that
script into `sip_to_pjsip.py -q /dev/stdin /dev/stdout`. This allow me to use
that piped command in my pjsip.conf using the `exec` command.
ASTERISK-28136
Change-Id: I7b0e2e90e2549f3f8e01dc96701f111b5874c88d
This patch adds new options 'trust_connected_line' and 'send_connected_line'
to the endpoint.
The option 'trust_connected_line' is to control if connected line updates
are accepted from this endpoint.
The option 'send_connected_line' is to control if connected line updates
can be sent to this endpoint.
The default value is 'yes' for both options.
Change-Id: I16af967815efd904597ec2f033337e4333d097cd
The module 'res_pjsip_notify' inefficiently makes a lot of DB requests
on CLI completion on the endpoint.
For example if there are 10k endpoints the module makes 10k requests
of these 10k records.
Even if a part of the endpoint entered
the module makes the same 10k requests and then filtered them by itself.
This patch gathers endpoints container by prefix
and adds all gathered endpoints to completion at once.
ASTERISK-28137 #close
Change-Id: Ic20024912cc77bf4d3e476c4cd853293c52b254b
Given a sip.conf with the following content:
setvar FOO=1
setvar BAR=42
I want my generated pjsip.conf to containt the following set_vars
set_var FOO=1
set_var BAR=42
in the matching endpoint section.
Change-Id: I6c822401fda4133c3b44bf31e655b4eb939d4d26
Add a new global flag to res_pjsip to allow the callerid to be used
as the username in the contact header. This allows chan_pjsip to have
the same behavour as chan_sip
ASTERISK-28087 #close
Change-Id: I9a720e058323f6862a91c62f8a8c1a4b5c087b95
Default logging was not setup correctly when there was no logger.conf.
This resulted in many expected log messages not actually getting out to
the console.
Change-Id: I542e61c03b2f630ff5327f9de5641d776c6fa70c
The 'I' option currently blocks initial CONNECTEDLINE or REDIRECTING updates
from the called parties to the caller.
This patch also blocks updates in the other direction before call is
answered.
ASTERISK-27980
Change-Id: I6ce9e151a2220ce9e95aa66666933cfb9e2a4a01
Adding the "label" attribute used for participant info correlation
was previously done in app_confbridge but it wasn't working
correctly because it didn't have knowledge about which video
streams belonged to which channel. Only bridge_softmix has that
data so now it's set when the bridge topology is changed.
ASTERISK-28107
Change-Id: Ieddeca5799d710cad083af3fcc3e677fa2a2a499
These macros have been documented as legacy for a long time but are
still used in new code because they exist. Remove all references to:
* ao2_container_alloc_options
* ao2_t_container_alloc_options
* ao2_t_container_alloc
These macro's are still available for use but only in modules. Only
ao2_container_alloc remains due to it's use in over 100 places.
Change-Id: I1a26258b5bf3deb081aaeed11a0baa175c933c7a
__ast_mutex_logger used the variable `canlog` without accepting it as a
argument. Replace with internal macro `log_mutex_error` which takes
canlog as the first arguement. This will prevent confusion when working
with lock.c code, many of the function declare the canlog variable and
in some cases it previously appeared to be unused.
Change-Id: I83b372cb0654c5c18eadc512f65a57fa6c2e9853
* Update the post-answer documentation and example. The Dial example was
incorrect and misleading for the post-answer subroutine useage.
* Fix note and warning paragraphs in option descriptions. They don't show
up in the wiki.
Change-Id: I81019a1fd75d5b9151f76b52c38e2a90da682d14
Most were in comments. A couple were in warning messages.
Pointed out by Jonathan H on the Asterisk users mailing list.
Change-Id: I6286939dff5d0a27a2758140570106f1cb351855
* The dependency ensures that res_pjproject cannot be manually unloaded
before res_rtp_asterisk.
* The dependency allows startup loading errors to report that
res_rtp_asterisk depends upon res_pjproject.
Change-Id: Icf5e7581f4ddd6189929f6174c74dd951f887377
Add attribute_warn_unused_result to ast_taskprocessor_push,
ast_taskprocessor_push_local and ast_threadpool_push. This will help
ensure we perform the necessary cleanup upon failure.
Change-Id: I7e4079bd7b21cfe52fb431ea79e41314520c3f6d
This patch is not in the upstream pjproject and does unsafe things with
the timer->_timer_id and timer->_grp_lock values in pj_timer_entry_reset()
outside of the timer heap lock. pj_timer_entry_reset() is also called for
timers that are not about to be rescheduled in a few places.
Change-Id: I4fe0b4bc648f7be5903cf4531b94fc87275713c1
This allows us to process AO2 statistics for total objects, memory
usage, memory overhead and lock usage.
* Install refstats.py and reflocks.py into the Asterisk scripts folder.
* Enable support for reflocks.py without DEBUG_THREADS.
Steal a bit from the ao2 magic to flag when an object lock is used.
Remove 'lockobj' from reflocks.py since we can now record 'used' or
'unused' for those objects.
Add comments to explain thread safety of the 'struct __priv_data'
bitfields.
Change-Id: I84e9d679cc86d772cc97c888d9d856a17e0d3a4a
This patch sets the callerid_tag to empty string by default.
If the callerid_tag is set to NULL then the tag does not
become part of a connected line update.
For example:
Alice's tag is "Alice".
Bob's tag is empty.
Charlie's tag is "Charlie".
Alice calls Bob and then does attended transfer to Charlie.
When Alice hangs up the CONNECTEDLINE(tag) is "Alice"
on the interception routine on the Charlie's channel, but should be empty.
Ths patch also fix memory leaks if there are more then one options
"callerid", "callerid_tag", "voicemail_extension" and "contact_user"
in the pjsip.conf endpoint definition.
Change-Id: I86ba455c4677ca8d516d9a04ce7fb4d24dd576e4
thread_worker_pair, set_size_data and task_pushed_data structures are
allocated with AO2 objects, passed to a taskprocessor, then released.
They never have multiple owners or use locking so AO2 only adds
overhead.
Change-Id: I2204d2615d9d952670fcb48e0a9c0dd1a6ba5036
The field used to store call arguments was not large enough to hold the
arguments string that can be constructed for 'open'. Expand it to
prevent this warning/error.
Change-Id: I514927f256481bc84df10a51b19d5b5fb1bc387e
The return status when there was no change in statsd.conf was incorrect.
This resulted in the wrong status message on the CLI when reloading the
module.
* Fixed cleanup on initial load if initializing statsd failed.
Change-Id: Id24fae75f1a7ff584a444a5680e867d989792481
ast_sendtext_data() would create an incorrect T.140 text frame which
length include the null terminator byte. It causes ultimately RTP
packets to be send with this trailing 0. The proposed fix just set the
correct length to the text frame
ASTERISK-28089
Reported by: Emmanuel BUU
Tested by: Emmanuel BUU
Change-Id: I7ab1b9ed1e21683b2b667ea0a59d9aba3c77dd96
This has no effect on startup since AST_MODULE_LOAD_FAILURE aborts
startup, but it's possible for this code to be returned on manual load
of a module after startup.
It is an error for a module to not have a load callback but this is not
a fatal system error. In this case flag the module as declined, return
AST_MODULE_LOAD_FAILURE only if a required module is broken.
Expand doxygen documentation for AST_MODULE_LOAD_*.
Change-Id: I3c030bb917f6e5a0dfd9d91491a4661b348cabf8
* Make load_module() cleanup if it failed to setup the module.
* Make unload_module() always return 0. It is silly to fail unloading if
the hook function we try to unregister was not even registered.
Change-Id: I280fc6e8ba2a7ee2588ca01d870eebaf74b4ffe6
If codec_speex fails to register a translator it would cause Asterisk to
exit instead of continue as a DECLINED module.
* Make unload_module() always return 0. It is silly to fail unloading if
any translators we try to unregister were not even registered.
Change-Id: Ia262591f68333dad17673ba7104d11c88096f51a
Fix redirection to /dev/null of cleanup commands. The '2' was being
interpreted as part of the command instead of part of the redirect.
Change-Id: I2e3a591b165e0288c4b82b9ef475fdfd5392a90a
I think this module is so screwed up that it doesn't work anymore. Even
with these attempts to fix things it still won't gracefully shut down.
The module refs will not go to zero to allow unloading the module.
* Fix module ref counting dealing with the SMDI interface object. There
were several off-nominal paths that unbalanced the module ref count. Also
the destructor freed the ao2 object itself which is bad. Made the
smdi_read thread not hold its own ref to the SMDI interface object so when
all refs go away the destructor will stop the listener thread.
* Fixed the smdi_load() return code of 1 concerning the number of
listeners. The test was inverted.
Change-Id: Ic288db51b58e395d6a2fc3847f77176c16988784
This module is an optional dependency of a couple of other modules. If it
declines to load, it then forces other modules that can optionally use
this module to also decline.
* Made use the default configuration if the config file does not exist and
simplified some of the logic.
Change-Id: Ib93191f1fe28c0dd9ebe3d84c7762b32f83c4eb9
There is currently no way to indicate to Asterisk that TLS certificates
and/or keys have been updated other than by modifying http.conf or
restarting Asterisk.
There is already code in main/tcptls.c that determines if a reload is
actually necessary based on the hashes of the certicate and dependent
files, so this change merely gives us a way to request a reload without
explicitly modifying http.conf.
Change-Id: Ie795420dcc7eb3d91336820688a29adbcc321276
* ACO options
* Indications
* Module loader ref_debug object
* Media index info and variants
* xmldoc items
These allocation locations were identified using reflocks.py on the
master branch.
Change-Id: Ie999b9941760be3d1946cdb6e30cb85fd97504d8
This module is an optional dependency of many modules. If it declines to
load it then forces other modules that can optionally use this module to
also decline.
* Made use default configuration if there is a config error or the config
file does not exist.
Change-Id: If1068a582ec54ab7fb437265cb5370a97a825737
When a module reload fails we never set AST_MODULE_RELOAD_ERROR. This
caused reload failures to incorrectly report 'No module found'.
Change-Id: I5f3953e0f7d135e53ec797f24c97ee3f73f232e7
* Display list of unavailable dependencies when they cause another
module to fail loading.
* When a module declines to load find all modules which depend on it so
they can be declined and listed together.
* Prevent retry of declined modules during startup.
* When a module fails to dlopen try loading it with RTLD_LAZY so we can
attempt to display the list of missing dependencies.
These changes are meant to reduce logger spam that is caused when a
module has many dependencies and declines to load. This also fixes some
error paths which failed to recognize required modules.
Module load/start errors are delayed until the end of loader startup.
Change-Id: I046052c71331c556c09d39f47a3b92975f3e1758
If a channel creates an AST_TEXT_FRAME with datalen == 0, the ast_frdup()
and ast_frisolate() functions could create a clone frame with an invalid
data.ptr which would cause a crash. The proposed fix is to make sure that
for such empty text frames, ast_frdup() and ast_frisolate() return cloned
text frames with a valid data.ptr.
ASTERISK-28076
Reported by: Emmanuel BUU
Tested by: Emmanuel BUU
Change-Id: Ib882dd028598f13c4c233edbfdd7e54ad44a68e9
When DEBUG_THREADS is enabled we can know if the astobj2 mutex / rwlock
was ever used, so it can be recorded in the REF_DEBUG destructor entry.
Create contrib/scripts/reflocks.py to process locking used by
allocator. This can be used to identify places where
AO2_ALLOC_OPT_LOCK_NOLOCK should be used to reduce memory usage.
Change-Id: I2e3cd23336a97df2692b545f548fd79b14b53bf4
Declining the queue_member_status_type stasis message in stasis.conf
causes these messages to leak json objects.
* Add missing ast_json_unref() if the type is NULL in
queue_publish_member_blob().
ASTERISK-28084
Change-Id: I691ecf49bd1f7d9c29182e1eee8c4bb7103be9fc
CLI command 'pjsip show contacts' inefficiently make a lot of DB requests.
For example if there are 10k aors then asterisk requests these 10k records
of aor and then does 10k requests of contact - one request per aor.
Even if use 'like <pattern>' the asterisk requests all aor's and contact's
records and then filters them by itself.
This patch gathers contact's container by
- retrieving all dynamic contacts by regex (filtered by reg_server)
- retrieving all aors with permanent contacts
- finally filters container by regex
ASTERISK-28077 #close
Change-Id: Id0ad65d14952a02fb213273a90f3f680a8149618
Add a volatile flag to lock tracking structures so we only need to use
the global lock when first initializing tracking.
Additionally add support for DEBUG_THREADS_LOOSE_ABI. This is used by
astobj2.c to eliminate storage for tracking fields when DEBUG_THREADS is
not defined.
Change-Id: Iabd650908901843e9fff47ef1c539f0e1b8cb13b
The first attempt at publishing confbridge events to participants
involved publishing them at the same time stasis events were
created. This caused issues with bridge and channel locks. The
second attempt involved publishing them when the stasis events
were received by the code that published the confbridge AMI events.
This caused timing issues because, depending on resources available,
the event could be received before channels actually joined the
bridge and would therefore fail to send messages to the participant.
This attempt reverts to the original mechanism with one exception.
The join and leave events are published via bridge join and leave
hooks. This guarantees the states of the channels and bridge and
provides deterministic timing for event publishing.
Change-Id: I2660074f8a30a5224cb953d5e047ee84484a9036
Reduce options to 2-bit field, magic to 30 bit field. Move ref_counter
next to options and explicitly use int32_t so the fields will pack.
This reduces memory overhead for every ao2 object by 8 bytes on x86_64.
Change-Id: Idc1baabb35ec3b3d8de463c4fa3011eaf7fcafb5
* In main/config.c, AST_INCLUDE_GLOB is fixed to '1' making the #ifdefs
pointless.
* In utils/extconf.c, AST_INCLUDE_GLOB is never defined so there is a
lot of dead code.
Change-Id: I1bad1a46d7466ddf90d52cc724e997195495226c
When REF_DEBUG and AO2_DEBUG are both enabled we closed the refs log
before we shutdown astobj2_container. This caused the AO2_DEBUG
container registration container to be reported as a leak.
Change-Id: If9111c4c21c68064b22c546d5d7a41fac430430e
This issue related to setting of holdtime, announcements, member delays.
It works well if we set the member delays to "0" and no announcements
and no holdtime.This issue will happen if we set member delays to "1",
"2"... or announcements or holdtime and hangs up the call during
processing it.
And here is the reason:
(At the step of answering a phone.)
It takes care any holdtime, announcements, member delays,
or other options after a call has been answered if it exists.
Normally, After the call has been aswered,
and we wait for the processing one of the cases of the member delays
or hold time or announcements finished, "if (ast_check_hangup(peer))"
will be not executed, then queue will be updated at update_queue().
Here, pending member will be removed.
However, after the call has been aswered,
if we hangs up the call during one of the cases of the member delays
or hold time or announcements, "if (ast_check_hangup(peer))"
will be executed.
outgoing = NULL and at hangupcalls, pending members will not be removed.
* This fixed patch will remove the pending member from container
before hanging up the call with outgoing is NULL.
ASTERISK-27920
Reported by: Cao Minh Hiep
Tested by: Cao Minh Hiep
Change-Id: Ib780fbf48ace9d2d8eaa1270b9d530a4fc14c855
Fixed an issue that resulted in "Allocation failed" each time an ARI
request was made to start playing MOH on a bridge.
In bridge_moh_create() we were attaching the after bridge callbacks to
chan which is the ;1 channel of the unreal channel pair. We should have
attached them to the ;2 channel which is pushed into the bridge by
ast_unreal_channel_push_to_bridge(). The callbacks are called when the
specific channel leaves the bridging system. Since the ;1 channel is
never put into a bridge the callbacks never get called. The callbacks
then never remove the moh_wrapper from the app_bridges_moh container. As
a result we cannot find the channel associated with the wrapper to start
MOH because it has hungup. This is the reason causing the reported issue.
* Rather than using after bridge callbacks to cleanup, we now have
moh_channel_thread() doing the cleanup when the channel hangs up.
* Fixed moh_channel_thread() accumulating control frames on the stasis
bridge MOH channel until MOH is stopped. Control frames are no longer
accumulated while MOH is playing.
* Fixed channel ref counting issue. stasis_app_bridge_moh_channel() may
or may not return a channel ref. As a result ast_ari_bridges_start_moh()
wouldn't know it may have a channel ref to release.
stasis_app_bridge_moh_channel() will now return a ref with the channel it
returns.
* Eliminated RAII_VAR in bridge_moh_create().
ASTERISK-26094 #close
Change-Id: Ibff479e167b3320c68aaabfada7e1d0ef7bd548c
When networks experience disruptions, there can be large gaps of time
between receiving packets. When strictrtp is enabled, this created
issues where a flood of packets could come in and be seen as an attack.
Another option - seqno - has been added to the strictrtp option that
ignores the time interval and goes strictly by sequence number for
validity.
Change-Id: I8a42b8d193673899c8fc22fe7f98ea87df89be71
On SQL error there is not diagnostic information about this error.
There is only
WARNING res_odbc.c: SQL Execute error -1!
The function ast_odbc_print_errors calls a SQLGetDiagField to get the number
of available diagnostic records, but the SQLGetDiagField returns 0.
However SQLGetDiagRec could return one diagnostic records in this case.
Looking at many example of getting diagnostics error information
I found out that the best way it's to use only SQLGetDiagRec
while it returns SQL_SUCCESS.
Also this patch adds calls of ast_odbc_print_errors on SQL_ERROR
to res_config_odbc.
ASTERISK-28065 #close
Change-Id: Iba5ae5470ac49ecd911dd084effbe9efac68ccc1
With tls and udp enabled asterisk generates a warning about sending
message via udp instead of tls.
sip notify command via cli works as expected and without warning.
asterisk has to set the connection information accordingly to connection
and not on presumption
ASTERISK-28057 #close
Change-Id: Ib43315aba1f2c14ba077b52d8c5b00be0006656e
In order to do this and provide good feedback, a new macro was
created (AST_EXT_LIB_EXTRA_CHECK) which does the normal check and
path setups for the library then compiles, links and runs a supplied
code fragment to do the final determination. In this case, the
final code fragment compares UNBOUND_VERSION_MAJOR
and UNBOUND_VERSION_MINOR to determine if they're greater than or
equal to 1.5.
Since we require version 1.5, some code in res_resolver_unbound
was also simplified.
ASTERISK-28045
Reported by: Samuel Galarneau
Change-Id: Iee94ad543cd6f8b118df8c4c7afd9c4e2ca1fa72
This change raises a testsuite event to provide what port
Asterisk has actually allocated for RTP. This ensures that
testsuite tests can remove any assumption of ports and instead
use the actual port in use.
ASTERISK-28070
Change-Id: I91bd45782e84284e01c89acf4b2da352e14ae044
Use json_vsprintf from versions which contain fix for va_copy leak.
Apply fixes from jansson master:
* va_copy leak fix.
* Avoid potential invalid memory read in json_pack.
* Rename variable that shadowed another.
Change-Id: I7522e462d2a52f53010ffa1e7d705c666ec35539
* Use "o*" format specifier for optional fields in ast_json_party_id.
* Stop using ast_json_deep_copy on immutable objects, it is now thread
safe to just use ast_json_ref.
Additional changes to ast_json_pack calls in the vicinity:
* Use "O" when an object needs to be bumped. This was previously
avoided as it was not thread safe.
* Use "o?" and "O?" to replace NULL with ast_json_null(). The
"?" is a new feature of ast_json_pack starting with Asterisk 16.
Change-Id: I8382d28d7d83ee0ce13334e51ae45dbc0bdaef48
When writing an RTCP report to json the code attempts to pack the "ssrc" and
"source_ssrc" unsigned integer values as a signed int value type. This of course
means if the ssrc's unsigned value is greater than that which can fit into a
signed integer value it gets converted to a negative number. Subsequently, the
negative value goes out in the json report.
This patch now packs the value as a json_int_t, which is the widest integer type
available on a given system. This should make it so the value no longer
overflows.
Note, this was caught by two failing tests hep/rtcp-receiver/ and
hep/rtcp-sender.
Change-Id: I2af275286ee5e795b79f0c3d450d9e4b28e958b0
The append_mailbox function wasn't calculating the correct length
to pass to ast_alloca and it wasn't handling the case where context
might be empty.
Found by the Address Sanitizer.
Change-Id: I7eb51c7bd18a7a8dbdba261462a95cc69e84f161
does_id_conflict() was passing a pointer to an int to a callback
that expected a pointer to a size_t.
Found by the Address Sanitizer.
Change-Id: I0ff542067eef63a14a60301654d65d34fe2ad503
ast_rtp_new free'd rtp upon failure, but rtp_engine.c would also call
the destroy callback. Remove call to ast_free from ast_rtp_new, leave
it to rtp_engine.c to initiate the full cleanup. Add error detection
for the ssrc_mapping vector initialization. In rtp_allocate_transport
set rtp->s = -1 in the failure path where we close that FD to ensure we
don't try closing it twice.
ASTERISK-27854 #close
Change-Id: Ie02aecbb46228ca804e24b19cec2bb6f7b94e451
'rtpchecksums' and 'rtcpinterval' are not being reset to their defaults
if they are not present in the updated configuration file.
Change-Id: I1162e40199314d46cf3225d5e1271c4c81176670
app_voicemail wasn't properly cleaning up the stasis cache or the
mwi topic pool when the module was unloaded or when a user was
deleted as a result of a reload. This resulted in leaks in both
areas.
* app_voicemail now calls ast_delete_mwi_state_full when it frees
a user structure and ast_delete_mwi_state_full in turn now calls
the new stasis_topic_pool_delete_topic function to clear the topic
from the pool.
Change-Id: Ide23144a4a810e7e0faad5a8e988d15947965df8
The HTTP request processing in res_http_websocket allocates additional
space on the stack for various headers received during an Upgrade request.
An attacker could send a specially crafted request that causes this code
to overflow the stack, resulting in a crash.
* No longer allocate memory from the stack in a loop to parse the header
values. NOTE: There is a slight API change when using the passed in
strings as is. We now require the passed in strings to no longer have
leading or trailing whitespace. This isn't a problem as the only callers
have already done this before passing the strings to the affected
function.
ASTERISK-28013 #close
Change-Id: Ia564825a8a95e085fd17e658cb777fe1afa8091a
There's been a long standing leak when using topic pools. The
topics in the pool get cleaned up when the last pool reference is
released but you can't remove a topic specifically. If you reloaded
app_voicemail for instance, and mailboxes went away, their topics
were left in the pool.
* Added stasis_topic_pool_delete_topic() so modules can clean up
topics from pools.
* Registered the topic pool containers so it can be examined from
the CLI when AO2_DEBUG is enabled. They'll be named
"<topic_pool_name>-pool".
Change-Id: Ib7957951ee5c9b9b4482af7b9b4349112d62bc25
Fixes random asterisk crash on start or reload with TLS phones.
ASTERISK-28034 #close
Reported-by: David Hajek
Change-Id: I2a859f97dc80c348e2fa56e918214ee29521c4ac
This adds a module which registers a CLI command that can set the
REMB bitrate value for REMB as it enters or exits Asterisk. This
allows you to ignore what Asterisk or a client produces and is
useful for demonstrations.
This does not generate REMB frames, however, but just modifies
them as they flow to or from a channel.
Change-Id: Ib089427c46a4a36d645cecfe02406adb38c17bec
Stasis message types are global ao2 objects and we make stasis messages
and cache entries hold references to them. Since there are currently
situations where cache objects are never deleted, the reference count on
the types can exceed 100000 and generate a FRACK assertion message. The
stasis message cache could conceivably also have that many messages
legitimately on large systems.
The only down side to not holding the message type ref in the stasis
message is it only makes a crash either at shutdown or when manually
unloading a busy module slightly more likely. However, this is more
exposing a pre-existing stasis shutdown ordering issue than a problem with
not holding a message type ref in stasis messages.
* Made stasis messages and cache entries no longer hold a ref to the
message type.
Change-Id: Ibaa28efa8d8ad3836f0c65957192424c7f561707
* Create the stasis message object without a lock as it is immutable.
* Create the stasis message type object without a lock as it is immutable.
* Creating the stasis message type could crash if the passed in type name
is NULL and REF_DEBUG is enabled. Added missing NULL check when passing
the ao2 object tag string.
Change-Id: I28763c58bb9f0b427c11971d0103bf94055e7b32
This change brings in PJSIP 2.8, removes all the patches
that were merged upstream, and makes a minor change to
support a breaking change that was done.
ASTERISK-28059
Change-Id: I5097772b11b0f95c3c1f52df6400158666f0a189
In the original commit introducing the feature the column in the alembic
script was called 'suppress_q850_reason_header'.
In the code however the option is called 'suppress_q850_reason_headers'
(trailing 's'). This leads to errors when ARI push configuration is used.
Change-Id: Ie84808adbca6fcc9136556e4f5d741adbef5d14f
app_voicemail was using the stasis cache to build and maintain a
list of mailboxes that had subscribers. It then used this list
to determine if a mailbox should be polled for new messages if
polling was enabled. For this to work, stasis had to cache every
subscription and unsubscription to the mailbox which caused a lot of
overhead, both cpu and memory related.
Since polling is only required when changes are being made to
mailboxes outside of app_voicemail and since the number of mailboxes
that don't have any subscribers is likely to be very low, all
mailboxes are now polled instead of just the ones with subscribers.
This paves the way for disabling the caching of stasis subscription
change messages.
Also fixed cleanup in some of the unit tests that not only left
test users in the users list but also caused segfaults if the tests
were run more than once.
ASTERISK-27121
Change-Id: I5cceb737246949f9782955c64425b8bd25a9e9ee
Given a scenario where a session refresh was done with a removed
stream we would always add a removed stream to the outgoing SDP
even if one did not already exist.
This change makes it so that a removed stream is only placed into
the SDP if one already exists.
ASTERISK-28047
Change-Id: Ibb97d21cdeb87a8acae0c720861b0ff255708442
Both pjsip_tx_data.tp_info.dst_name and pjsip_rx_data.pkt_info.src_name
store IPv6 addresses without enclosing brackets. This causes some log
output to be confusing because it is difficult to separate the IPv6
address from a port specification.
* Use pj_sockaddr_print() along with pjsip_tx_data.tp_info.dst_addr and
pjsip_rx_data.pkt_info.src_addr where possible for consistent IPv6
output.
* When a pj_sockaddr is not available, explicitly wrap IPv6 addresses
in brackets.
* When assigning pjsip_rx_data.pkt_info.src_name ourselves, make sure
to also set pjsip_rx_data.pkt_info.src_addr.
Change-Id: I5cfe997ced7883862a12b9c7d8551d76ae02fcf8
Can't do anonymous http checkout from Security-testsuite.
Need to use same credentials as the gerrit review checkout.
Change-Id: I87af68c995cb8926f5e87f9af245600d76984f05
Since app_voicemail no longer uses the cache to maintain its state
there is no longer a need to cache these messages.
ASTERISK-27121
Change-Id: I321c708505f5ad8d00e1b0afc4c27dc2ac12ecb4
As they're not actively used, they only grow stale. The moduleinfo field itself
is kept in Asterisk 13/15 for ABI compatibility.
ASTERISK-28046 #close
Change-Id: I8df66a7007f807840414bb348511a8c14c05a9fc
The documentation already specified EVENT_FLAG_DIALPLAN for this
event, but the implementation was using EVENT_FLAG_CALL.
Using EVENT_FLAG_DIALPLAN allows AMI clients to opt out of receiving
this highly verbose event.
ASTERISK-28033
Change-Id: I45b3119f30e4dbc17b49831f2b1a4f2c1beadafe
The bundled version of pjproject has a patch for Solaris compatability
that changes the definition of various socket structures which we need
to account for when compiling against a non-bundled version.
ASTERISK-28049 #close
Change-Id: Ia1ea47c433fc2d915115193ee889a752373925f0
If Asterisk is built using a DESTDIR this will cause the bundled jansson
to be installed to an unexpected location and we will fail to find it.
Change-Id: Id033e2813261e0d45232383d44c6391122169548
On MOH activation, moh_files_readframe() is called while the current
stream attached to the channel is NULL and it calls ast_moh_files_next()
immediately. However, it won't call ast_moh_files_next() again if sample
reading fails. The failure may occur because res_musiconhold retains the
last sample reading position in the channel data and MOH during the
previous hold/retrieve just reached EOF. Obviously, a bit of bad luck is
required here.
* Restructured moh_files_readframe() to try a second time to start MOH if
there was no stream setup and the saved position was at EOF. Also added
comments describing what is going on for each step.
ASTERISK-28029
Change-Id: I1508cf2c094f8feca22d6f76deaa9fdfa9944860
Generators provide such functionality as tone generation or
silence generation. RTCP frames provide RTCP information and
should not stop generators from operating.
ASTERISK-28005
Change-Id: Ieadada07b068a7aa426e8763f1b73a18e1ac34a9
Currently, to convert from a pj_sockaddr to an ast_sockaddr, the address
needs to be rendered to a string and then parsed into the correct
structure. This also involves a call to getaddrinfo(3). The same is true
for the inverse operation.
Instead, because we know the internal structure of both ast_sockaddr and
pj_sockaddr, we can translate directly between the two without the
need for an intermediate string.
Change-Id: If0fc4bba9643f755604c6ffbb0d7cc46020bc761
The stasis cache provides a way to reconstruct the current state
of topic subscribers. Unfortunately, since every subscribe and
unsubscribe is cached, the cache continues to grow unabated while
asterisk is running. This patch removes subscribe messages from
the cache when the corresponding unsubscribe is received.
This patch also registers the cache containers with ao2 so that if
AO2_DEBUG is turned on, you can list the container and get its
stats from the CLI.
ASTERISK-27121
Change-Id: I3d18905e477f3721815da91f30da8d3fbb2d4f56
Added decline if extensions.conf file not available
when loading pbx_config, and also made sure everything
gets properly unregistered and/or destroyed on unload.
Change-Id: Ib00665106043b1be5148ffa7a477396038915854
Added a check when we receive a HTTP request line or header line that is
too long. We now return an error response to the sender because we are
not able to process the request.
Change-Id: I6df2705435fd7dde4d5d3bdf7acec859cfb7c12d
Providing a buffer larger than the internal buffer of ast_iostream_gets()
fails to get lines longer than the internal buffer.
* Made ast_iostream_gets() fill the supplied buffer with read data until
either a '\n' is found or the supplied buffer is filled just like fgets().
Change-Id: If18b3f6ee500e22f0633a68779ed09f7e0f305ed
Fix not show the error
"/bin/sh: /etc/os-release: No such file or directory" when the command
'make config' is run in a System without systemv.
The instruction 'make config' pre execute the syntax
"$(shell . /etc/os-release && echo $$ID)" to identified if system is a
Slackware and Opensuse.
This change prevent show the message and is send to the /dev/null
Change-Id: I7f43e281a8d9405b2519fc653de82d9b8b645fdf
The T.38 fax gateway state machine can cause the fax gateway
to be started more than once on a channel depending on the
responses of the remote endpoint. This would previously leak
the channel name, channel unique id, and underlying fax engine
state. This change instead makes it so that if the fax gateway
session is already present and not reserved the fax gateway
is not started again.
ASTERISK-27981
Change-Id: I552d95086860cb18f2522ee40ef47b13b6da2e0e
SIP responses over WebSockets when the client is using IPv6 have invalid
Via headers according to RFC 3261. The 'received' header parameter
should not be wrapped in brackets if it is an IPv6 address.
When src_name is populated by the built-in PJSIP transports, the code
uses pj_sockaddr_print() with 'flags' set to 0, meaning that the
brackets are not rendered around IPv6 addresses.
This may be related to ASTERISK~27101.
See also: https://github.com/onsip/SIP.js/pull/594
ASTERISK-28020 #close
Change-Id: I8ea9d289901b837512bee2ca2535e3dc14f04d77
This new option can be passed for ./configure or
./tests/CI/buildAsterisk.sh to prevent download/install of binary
modules.
Normally enabling the categories MENUSELECT_CODECS or MENUSELECT_RES
will result in binary modules being enabled even if the build target is
incompatible with those modules. This includes CI scripts which enable
categories before disabling specific modules.
If more binary modules are offered in the future this will help avoid
accidentally downloading them if unwanted or incompatible. Adding a
binary module will only require creating a new menuselect entry similar
to the existing ones, it will not be necessary to modify the CI scripts.
Change-Id: I6b1bd1c75a2e48f05b8b8a45b7a7a2d00a079166
The realtime text timer pops regularly and sends text frames even if
the buffer is empty. This causes a lot of unecessary debug logging.
* Made red_write() test if we need to send a frame before calling
ast_rtp_write()
ASTERISK-28002
Reported by: Emmanuel BUU
Tested by: Emmanuel BUU
Change-Id: Icf81310c3b8080b615a42060afc02ab41f9523dd
Also remove function peer_ipcmp_cb since it's not used (according to
rmudgett).
Prior to b2c4e8660a (ASTERISK_27457)
insecure=port was the defacto standard. That commit also prevented
insecure=port from being applied for sip/tcp or sip/tls.
Into consideration there are three sets of behaviour:
1. "previous" - before the above commit.
2. "current" - post above commit, pre this one.
3. "new" - post this commit.
The problem that the above commit tried to address was guests over TCP.
It succeeded in doing that but broke transport!=udp with host!=dynamic.
This commit attempts to restore sane behaviour with respect to
transport!=udp for host!=dynamic whilst still retaining the guest users
over tcp.
It should be noted that when looking for a peer, two passes are made, the
first pass doesn't have SIP_INSECURE_PORT set for the searched-for peer,
thus looking for full matches (IP + Port), the second pass sets
SIP_INSECURE_PORT, thus expecting matches on IP only where the matched
peer allows for that (in the author's opinion: UDP with insecure=port,
or any TCP based, non-dynamic host).
In previous behaviour there was special handling for transport=tcp|tls
whereby a peer would match during the first pass if the utilized
transport was TCP|TLS (and the peer allowed that specific transport).
This behaviour was wrong, or dubious at best. Consider two dynamic tcp
peers, both registering from the same IP (NAT), in this case either peer
could match for connections from an IP. It's also this behaviour that
prevented SIP guests over tcp.
The above referenced commit removed this behaviour, but kept applying
the SIP_INSECURE_PORT only to WS|WSS|UDP. Since WS and WSS is also TCP
based, the logic here should fall into the TCP category.
This patch updates things such that the previously non-explicit (TCP
behaviour) transport test gets performed explicitly (ie, matched peer
must allow for the used transport), as well as the indeterministic
source-port nature of the TCP protocol is taken into account. The new
match algorithm now looks like:
1. As per previous behaviour, IP address is matched first.
2. Explicit filter with respect to transport protocol, previous
behaviour was semi-implied in the test for TCP pure IP match - this now
made explicit.
3. During first pass (without SIP_INSECURE_PORT), always match on port.
4. If doing UDP, match if matched against peer also has
SIP_INSECURE_PORT, else don't match.
5. Match if not a dynamic host (for non-UDP protocols)
6. Don't match if this is WS|WSS, or we can't trust the Contact address
(presumably due to NAT)
7. Match (we have a valid Contact thus if the IP matches we have no
choice, this will likely only apply to non-NAT).
To logic-test this we need a few different scenarios. Towards this end,
I work with a set number of peers defined in sip.conf:
[peer1]
host=1.1.1.1
transport=tcp
[peer2]
host=1.1.1.1
transport=udp
[peer3]
host=1.1.1.1
port=5061
insecure=port
transport=udp
[peer4]
host=1.1.1.2
transport=udp,tcp
[peer5]
host=dynamic
transport=udp,tcp
Test cases for UDP:
1 - incoming UDP request from 1.1.1.1:
- previous:
- pass 1:
* peer1 or peer2 if from port 5060 (indeterminate, depends on peer
ordering)
* peer3 if from port 5061
* peer5 if registered from 1.1.1.1 and source port matches
- pass 2:
* peer3
- current: as per previous.
- new:
- pass 1:
* peer2 if from port 5060
* peer3 if from port 5061
* peer5 if registered from 1.1.1.1 and source port matches
- pass 2:
* peer3
2 - incoming UDP request from 1.1.1.2:
- previous:
- pass 1:
* peer5 if registered from 1.1.1.2 and port matches
* peer4 if source port is 5060
- pass 2:
* no match (guest)
- current: as previous.
- new as previous (with the variation that if peer5 didn't have udp as
allowed transport it would not match peer5 whereas previous
and current code could).
3 - incoming UDP request from anywhere else:
- previous:
- pass 1:
* peer5 if registered from that address and source port matches.
- pass 2:
* peer5 if insecure=port is additionally set.
* no match (guest)
- current - as per previous
- new - as per previous
Test cases for TCP based transports:
4 - incoming TCP request from 1.1.1.1
- previous:
- pass 1 (indeterministic, depends on ordering of peers in memory):
* peer1; or
* peer5 if peer5 registered from 1.1.1.1 (irrespective of source port); or
* peer2 if the source port happens to be 5060; or
* peer3 if the source port happens to be 5061.
- pass 2: cannot happen since pass 1 will always find a peer.
- current:
- pass 1:
* peer1 or peer2 if from source port 5060
* peer3 if from source port 5060
* peer5 if registered as 1.1.1.1 and source port matches
- pass 2:
* no match (guest)
- new:
- pass 1:
* peer 1 if from port 5060
* peer 5 if registered and source port matches
- pass 2:
* peer 1
5 - incoming TCP request from 1.1.1.2
- previous (indeterminate, depends on ordering):
- pass 1:
* peer4; or
* peer5 if peer5 registered from 1.1.1.2
- pass 2: cannot happen since pass 1 will always find a peer.
- current:
- pass 1:
* peer4 if source port is 5060
* peer5 if peer5 registered as 1.1.1.2 and source port matches
- pass 2:
* no match (guest).
- new:
- pass 1:
* peer4 if source port is 5060
* peer5 if peer5 registered as 1.1.1.2 and source port matches
- pass 2:
* peer4
6 - incoming TCP request from anywhere else:
- previous:
- pass 1:
* peer5 if registered from that address
- pass 2: cannot happen since pass 1 will always find a peer.
- current:
- pass 1:
* peer5 if registered from that address and port matches.
- pass 2:
* no match (guest)
- new: as per current.
It should be noted the test cases don't make explicit mention of TLS, WS
or WSS. WS and WSS previously followed UDP semantics, they will now
enforce source port matching. TLS follow TCP semantics.
The previous commit specifically tried to address test-case 6, but broke
test-cases 4 and 5 in the process.
ASTERISK-27881 #close
Change-Id: I61a9804e4feba9c7224c481f7a10bf7eb7c7f2a2
All HTTP/AMI message headers are being sent to the verbose channel.
There are multiple places this is happening. Consolidate the loop into
a function. Drop the debug/verbose message.
Convert to using ast_asprintf to perform the length calculation, memory
allocation and snprintf all in one step.
Change-Id: Ic45e673fde05bd544be95ad5cdbc69518207c1a1
Change disables loading of res_hep.so in default installation. Loading
res_hep has a performance impact whether it's used or not. This disables
loading of it in sample config files.
Change-Id: I5ec150cf941634fabc72973e5bf1a965cb0ef9d0
(cherry picked from commit c8bacd45f1)
When mobile SIP clients register with Asterisk that use some sort of
push notifications, the URI can get quite lengthy due to the
additional push-service annotations (things like tokens, pn-type, etc.)
contained in it.
ASTERISK-28022 #close
Change-Id: I6c55013bafe79f7e7a1fb6722d2558f553709f2e
I'm only seeing an error in 14+, so I assume it is due to different
compiler options:
app_queue.c: In function ‘handle_queue_add_member’:
app_queue.c:10234:19: error: ‘%d’ directive writing between 1 and 11
bytes into a region of size 3 [-Werror=format-overflow=]
sprintf(num, "%d", state);
^~
app_queue.c:10234:18: note: directive argument in the range
[-2147483648, 99]
sprintf(num, "%d", state);
^~~~
Compiler: gcc version 8.0.1 20180414 (experimental)
[trunk revision 259383] (Ubuntu 8-20180414-1ubuntu2)
Change-Id: I18577590da46829c1ea7d8b82e41d69f105baa10
When a Contact is updated the only material change that qualify
support cares about is the underlying configuration for the AOR.
In this case we will update things with the new AOR information but
otherwise the callback to indicate the Contact has changed can be
ignored.
This is because it is only when a Contact is added or deleted that
material changes occur within the qualify support. An update can't
change the URI since it would result in a new Contact so it can be
ignored.
Change-Id: I2f97ebfa79969a36a97bb7b9afd5b6268cf1a07d
We were still getting crashes after the first fix. Somehow we receive a
non-2xx final response before we get a 200 final response. With the
failure response we had already cleaned up and destroyed some data
structures. When the unexpected 200 response comes in we crash.
* Add protection code to prevent processing another final T.38 reINVITE
response.
ASTERISK-27944
Change-Id: I8b5baba8d07fe4d63f0d7d05d3eb9a3d27d40a74
The allow_unqualified_fetch option for the sorcery realtime backend
blocked actually fetching all rows when the option is set to warn.
* Made issue a warning and actually do the request when
allow_unqualified_fetch=warn is set.
Change-Id: I74456c80a03a62dce66fc3dc3cb0cf2351ac4312
* In destroy_peer(), fixed memory leaks of lookup history strings and
qualify transactions when destroying peers.
* In destroy_peer(), fixed leaving the registerexpire scheduled callback
active when a peer is destroyed on a reload. The reload marks and sweeps
peers so any peers not explicitly configured get destroyed. Peers created
dynamically from the '*' peer will not exist until they re-register after
the reload. These destroyed peers caused memory corruption when the
registerexpire timer expired.
* Made build_peer() not schedule any callbacks on the '*' peer
(empty_eid). It is a special peer that is cloned to dynamically created
peers so it doesn't actually get involved in any message transactions.
* Made do_register_expire() remove the dundi/dpeers AstDB entry when a
peer registration expires.
* Fix deep_copy_peer() to not copy some things that cannot be copied to
the cloned peer structure. Timers, message transactions, and lookup
history are specific to a peer instance.
* Made set_config() lock around processing the mappings configuration.
* Reordered unload_module() to handle load_module() declining the load due
to error.
Change-Id: Ib846b2b60d027f3a2c2b3b563d9a83a357dce1d6
* Fixed a typo in the name of the REGREQ frame decode string array.
* Fixed off by one range check indexing into the frame decode string
array.
* Removed some unneeded casts associated with the decode string array.
Change-Id: I77435e81cd284bab6209d545919bf236ad7933c2
Compiling without SRTP support installed resulted in some unused variable
warnings. These warnings also showed that the srtp variable was obtained
and passed around some functions but not really used even when a system
has SRTP installed.
Change-Id: I6daad34be3e89b19adef6e2fbe738018975155fc
If the review to be tested is in a project with restricted access,
we need to use the jenkins user's gerrit https credentials when we
do the checkout or the checkout will fail.
Change-Id: I9dc9994763c5ebfeb9f1cff60fb53f6902b7fd5f
If in the initial sdp the caller doesn't include the line
a=rtcp-mux
Then asterisk shoud not include rtcp-mux in the response regardless
of rtcp-mux being enabled on the endpoint
ASTERISK-28007 #close
Change-Id: I58e9b9f40a139afc0da5de41906cc608fb62adc7
sip_options_get_endpoint_state_compositor_state leaked a reference to
the first available endpoint state compositor that was found.
Change-Id: Idb6be19f7219b6eed1dfb19c1e740dd40cb3fdc7
Changing any Menuselect option in the `Compiler Flags` section causes a
full rebuild of the Asterisk source tree. Every enabled option causes
a #define to be added to buildopts.h, thus breaking ccache caching for
every source file that includes "asterisk.h". In most cases each option
only applies to one or two files. Now we only define those options for
the specific sources which use them, this causes much better cache
matching when working with multiple builds. For example testing code
with an without MALLOC_DEBUG will now use just over half the ccache
size, only main/astmm.o will have two builds cached instead of every
file.
Reorder main/Makefile so _ASTCFLAGS set on specific object files are all
together, sorted by filename. Stop adding -DMALLOC_DEBUG to CFLAGS of
bundled pjproject, this define is no longer used by any header so only
serves to break cache.
The only code change is a slight adjustment to how main/astmm.c is
initialized. Initialization functions always exist so main/asterisk.c
can call them unconditionally. Additionally rename the astmm
initialization functions so they are not exported.
Change-Id: Ie2085237a964f6e1e6fff55ed046e2afff83c027
This change adds the "party" parameter to the Remote-Party-ID header
which indicates which party the header information is applicable
to. In Asterisk this is determined on whether we are the calling
or called party. This is added to improve interoperability with some
implementations.
ASTERISK-28006
Change-Id: I1eec3e377ffff8633b5c1dd59a05e9533122cfca
Enable coverage with `./tests/CI/buildAsterisk.sh --coverage`. This
will cause Asterisk to be compiled with coverage support. It also
initializes 'before' coverage data for all sources. Accept
--tested-only to disable modules which are not run by any test.
Enabling coverage also sets tested-only true by default. To build
everything with coverage enabled use `--coverage --tested-only=0`.
./tests/CI/processCoverage.sh is used to process the coverage and
generate HTML reports.
Fix utils/check_expr2 which failed to compiled with coverage enabled.
Add status output 5 times per stage of astobj2_test_perf to ensure
remote CLI does not timeout when compiled with coverage. Remote CLI
disconnects if no output is received for 60 seconds. When coverage is
enabled it takes about 70 seconds for my laptop to run the stages of
this test, so with the change a message is printed every 14 seconds.
Change-Id: I890f7d5665087426ad7d3e363187691b9afc2222
When a conference contained a mixture of audio/video and audio-only
users, a NOTICE message would pop up stating there are no joint
capabilities between streams. This happens because streams can never be
removed, but they can be in a REMOVED state. If we have the scenario
where user A joins with audio/video, user B joins with audio-only, and
user C joins with audio/video, then user A leaves, the message would
be triggered. That removed stream is still in the SDP, but Asterisk
would pass it through, causing it to be seen as a ulaw stream. A check
has been added for removed streams, setting their status to REMOVED when
handling negotiated SDPs.
Also addressed an issue where user A joins, then user B joins but does
not receive video until much later. Full frames were not being sent,
causing some PLI from the browser. Because the video was flowing in one
direction, the browser sets the SSRC to 1, but Asterisk was dropping the
PLI because of that. Added a check to see if the SSRC is 1 or not, which
sends full frames and allows video to flow between user A and user B.
This should only happen when dealing with PSFB or FUR, and in the case
of PSFB, only for PLI.
ASTERISK-27398
Change-Id: I26e7c6f101bc119549eeca406b5bcd25ad8ebc5e
When a call leaves a queue on leaveempty condition, QUEUESTATUS
must be set to LEAVEEMPTY, no matter whether Queue was executed with or
without the "c" (continue) option.
The regression was introduced in the fix for ASTERISK_25665.
The following fix (ASTERISK_27065) was incomplete, as QUEUESTATUS was
overwritten in case when "c" is set, regardless of what was the cause
for leaving the queue.
ASTERISK-27973 #close
Reported-by: Valentin Safonov
Change-Id: Iec013fe6a26a4e825ca572a1dda4f3cee5f6f80c
It is valid for a config file to be empty or contain only comments, but
not valid for a config value to be set when no uncommented context
exists. This caused an error to be loged numerous times during start
when loading the default pjsip.conf.
Change-Id: Icf3b0d69b4ecb6e935eecd43c99ed8b32a5a1cf6
When the stasis cache is used a hash is calculated for
retrieving or inserting messages. This change calculates
a hash when the message type is initialized that is then
used each time needed. This ensures that the hash is
calculated only once for the message type.
Change-Id: I4fe6bfdafb55bf5c322dd313fbd8c32cce73ef37
The authors of PJProject undef s_addr because of some issue in Microsoft
Windows. However in Oracle Solaris, s_addr is not a structure member, but
defined to map to the real structure member.
Updates the patch from ASTERISK_20366
ASTERISK-27997
Change-Id: I8223026d4d54e2a46521085fcc94bfa6ebe35b11
* Don't include pjlib.h twice in res_pjsip.h
* Consistently use #include <> form for pjproject includes.
(pjsip.h and pjlib.h)
Change-Id: I3f7b42044840de64edf7e9d7695cb60c45990dc7
If asterisk offer an endpoint with SRTP and that endpoint respond
with non srtp, in that case channel(rtp,secure,audio) reply wrong
status.
Why delete flag AST_SRTP_CRYPTO_OFFER_OK while check identical remote_key:
Currently this flag has being set redundantly. In either case identical
or different remote_key this flag has being set. So if we
don't set it while we receive identical remote_key or non SRTP SDP
response then we can take decision of srtp use by using that flag.
ASTERISK-27999
Change-Id: I29dc2843cf4e5ae2604301cb4ff258f1822dc2d7
The script configure from Teluu expects shared libraries (.so) in a subfolder
called 'lib', when --with-xyz=PATH is specified. However for OpenSSL, the
default location is the root of the source folder = PATH. Furthermore, Asterisk
supports both, 'lib' and root. For consistency and because Asterisk is using
(only) OpenSSL in PJProject, it is enhanced to support both locations, just
like Asterisk.
ASTERISK-27995
Change-Id: I8eb916a88b6b8c22e29bb40bee8faaca6c73406f
This change removes a sorcery lookup for retrieving all
contacts at the end of the registration process by keeping
track of the contacts that are added/updated/deleted.
This ensures at the end of the process the container of
contacts we have is the current state.
Pool usage has also been reduced by allocating one for
usage throughout the handling of a REGISTER and resetting
it to a clean state. This ensures that in most cases
we allocate once and just reuse it.
ASTERISK-28001
Change-Id: I1a78b2d46f9a2045dbbff1a3fd6dba84b612b3cb
The tdata containing the response can be shared by both the dialog
object and the tsx object. In order to prevent the race condition
between the tsx retransmission and the dialog sending a response,
clone the tdata before modifying it for the dialog send response.
ASTERISK-27966 #close
Change-Id: Ic381004a3a212fe1d8eca0e707fe09dba4a6ab4e
The check for the library ncurses should use not use the header <curses.h> but
<ncurses.h>, because on some platforms <curses.h> is not a drop-in replacement
for <ncurses.h>: For example in Solaris, the symbol initscr is a typedef in
<curses.h> to a symbol which does not exist in the library ncurses (initscr32).
Simply use <ncurses.h> when you link to ncurses.
Furthermore in Solaris, the header <ncurses.h> is in a subdirectory
/usr/include/ncurses and not available via pkg-config.
ASTERISK-15331
ASTERISK-14935
ASTERISK-12382
ASTERISK-9107
Change-Id: Ife367776b0ccf17d3fefed868245376bfb93745d
In Solaris, the header <jansson.h> is in /usr/include/jansson. To find
Jansson even in such a subdirectory, the tool pkg-config is queried via
AST_PKG_CONFIG_CHECK. For those platforms, which do not list Jansson via
pkg-config, the previous check remains and is executed thereafter.
Because the check for the NetBSD Editline library uses the tool pkg-config
the code of PKG_PROG_PKG_CONFIG must be used. Because that check happens
earlier than Jansson, it must be placed in front of that.
ASTERISK-27991
Change-Id: I69ea0f379f87a50049654b2487c76ee1c04fa53a
This patch adds regular expression support to make the identify section's
match_header option more useful when attempting to match complex headers
like the 'To' or 'From' headers. The 'From' header has variable
components such as the tag parameter that you cannot predict. To specify
a regular expression put slashes around the regular expression in place of
the header value.
[identify-alice]
type=identify
endpoint=alice
match_header=From: /<sip:alice@127\\.0\\.0\\.1>/
* Added regex support to match_header so you could match a 'To' header
among other complex headers.
Fixed reported crashes when trying to match special headers like 'Contact'.
The identify section's match_header method used code that assumed you were
matching a generic header. Any other type of header could cause a crash
if the header structure variant did not match the generic header enough.
* Made use code that will work for any header type instead of code
specific to generic headers.
Other fixes while in the area:
* Made check all headers of the requested name.
* Added some more sanity checks to the configured identify matching
options when applying the configuration.
ASTERISK-27548
Change-Id: I27dfd4ff5e2259b906640e3c330681b76b4ed1f1
The alembic for the PJSIP subscription persistence table has the
"prune_on_boot" field as a boolean. While in Asterisk we are
tolerant of many different definitions of true and false in the
database we only accept "yes" and "no". This change makes the
field treated as a yes/no instead of an integer, thus storing
"yes" and "no" instead of "1" and "0".
Change-Id: Ic8b9211b36babefe78f70def6828a135a6ae7ab6
OpenSSL is an optional external library and should stay optional even when
Developer Mode is configured.
ASTERISK-27990
Change-Id: Ia68a4cd5474b26d45e0f43b04032ad598022853b
With the new module loader it was missed that built-in modules never
parsed dependencies from mod->info into vectors of mod. This caused
manager to be initialized before acl (named_acl). If manager.conf
used any named ACL's they would not be found and result in no ACL being
applied to the AMI user.
In addition to the manager ACL fix this adds "extconfig" to all builtin
modules which support realtime configuration. This only matters if one
of the builtin modules is configured with 'preload', depending on
"extconfig" will cause config.c to automatically be initialize during
the preload stage.
Change-Id: I482ed6bca6c1064b05bb538d7861cd7a4f02d9fc
When realtime text packets are to be sent, the text is accumulated in a
buffer and sent regularly by a timer. It can happen that commands such as
a backspace, CR, or LF get merged with regular text. This breaks some
UAs.
The proposed change:
* We test if the current packet contains a command. If so we send the
buffer immediately.
* We test if the buffer contained a command. If so we send the buffer
immediately.
* We accumulate the text (or the command) in the buffer.
ASTERISK-27970
Change-Id: Ifbe993311410fa855cb8aa4a12084db75f413462
This target requires specifying CONFIG_SRC=path_to_configs. This can be
used to install custom configs for the Asterisk build while still
performing directory replacements on asterisk.conf.
Modify internal INSTALL_CONFIGS so first argument requires full path to
the config sources relative to Asterisk source root.
Change-Id: Idcd841df3c8d5bfe23d566bb9e2e448e9df4f8ab
When converting from a json object to an ast variables list the conversion
algorithm was doing a complete traversal of the entire variables list for
every item appended from the json structure.
This patch makes it so the list is no longer traversed for each new ast
variable being appended.
Change-Id: I8bf496a1fc449485150d6db36bfc0354934a3977
When publishing a device state the change can be marked as being
cachable or not. If it is not cached the change is just published
to all interested and not stored away for later query. This was not
fully taken into account when publishing in stasis. The act of
publishing would create a topic for the device even if it may be
ephemeral.
This change makes it so messages which are not cached won't create
a topic for the device. If a topic does already exist it will be
published to but otherwise the change will only be published to
the device state all topic.
ASTERISK-27591
Change-Id: I18da0e8cbb18e79602e731020c46ba4101e59f0a
Update the bundled jansson Makefile to do nothing during Asterisk
install, use a target that is not phony to initiate the jansson make and
install.
Change-Id: I7643cc3d39af9feba8fc0da676b646efc5f8b3bb
If a SIP MESSAGE is triggered for an endpoint that is currently not registered
- and therefore has no valid contact associated - an error message was logged.
Since this is a valid request in a valid use cases this is now changed to a
warning, as discussed with Matt Fredrickson on the asterisk-dev mailing list.
Change-Id: I55eb62d2712818a58c7532119dec288bd98cf0c0
Remove AST_DEVMODE from the AST_BUILDOPTS list and the AST_BUILDOPTS_SUM
calculation as it no longer affects API/ABI compatibility.
Change-Id: Id5bd6dfade173a53b3a49f715586b86e3fb24acb
The --test-command argument has now been split, unit tests now use
`--unittest-command` and the testsuite uses --testsuite-command.
This will make it easier to create a script which run everything by
forwarding the same arguments to all CI scripts.
Change-Id: Ia54aa4848eaffbdf13175fcda40fc0b23080ad71
The "xmldoc dump" cli command was simply concatenating xml documents
into the output file. The resulting file had multiple "xml"
processing instructions and multiple root elements which is illegal.
Normally this isn't an issue because Asterisk has only 1 main xml
documentation file but codec_opus has its own file so if it's
downloaded and you do "xmldoc dump", the result is invalid.
* Added 2 new functions to xml.c:
ast_xml_copy_node_list creates a copy of a list of children.
ast_xml_add_child_list adds a list to an existing list.
* Modified handle_dump_docs to create a new output document and
add to it the children from each input file. It then dumps the
new document to the output file.
Change-Id: I3f182d38c75776aee76413dadd2d489d54a85c07
Use .gitreview defaultbranch setting to determine the mainline branch.
This allows the script to be used against other directories which might
not be on the same defaultbranch. This can be used by CI scripts to
report the testsuite version being used:
./build_tools/make_version ${TESTSUITE_DIR}
Change-Id: Ifdad4a9d8a26138c41bc6b630ecc3e34ea1c2758
In the past there was an assertion in the ast_sched_del function
and in order to ensure it was useful the calling function name,
line number, and filename had to be passed in. This cause the ABI
to be different between dev mode and non-dev mode.
This assertion is no longer present so the special logic can be
removed to make it the same between them both.
Change-Id: Icbc69c801e357d7004efc5cf2ab936d9b83b6ab8
A change recently went in which disabled the built-in PJSIP
keepalive. This defaulted to 90 seconds and kept TCP/TLS
connections alive. Disabling this functionality has resulted
in a behavior change of not doing keepalives by default resulting
in TCP/TLS connections dropping for some people.
This change makes our default keepalive interval 90 seconds
to match the previous behavior and preserve it.
ASTERISK-27978
Change-Id: Ibd9a45f3cbe5d9bb6d2161268696645ff781b1d6
* Use the replacement function ast_sip_push_task_wait_servant() instead of
the deprecated ast_sip_push_task_synchronous().
Change-Id: I145b550ba7054640c7faa3b644e63137f505c612
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><title>Release Summary - asterisk-16.8.0</title><h1align="center"><aname="top">Release Summary</a></h1><h3align="center">asterisk-16.8.0</h3><h3align="center">Date: 2020-02-04</h3><h3align="center"><asteriskteam@digium.com></h3><hr><h2align="center">Table of Contents</h2><ol>
</ol><hr><aname="summary"><h2align="center">Summary</h2></a><center><ahref="#top">[Back to Top]</a></center><p>This release is a point release of an existing major version. The changes included were made to address problems that have been identified in this release series, or are minor, backwards compatible new features or improvements. Users should be able to safely upgrade to this version if this release series is already in use. Users considering upgrading from a previous version are strongly encouraged to review the UPGRADE.txt document as well as the CHANGES document for information about upgrading to this release series.</p><p>The data in this summary reflects changes that have been made since the previous release, asterisk-16.7.0.</p><hr><aname="contributors"><h2align="center">Contributors</h2></a><center><ahref="#top">[Back to Top]</a></center><p>This table lists the people who have submitted code, those that have tested patches, as well as those that reported issues on the issue tracker that were resolved in this release. For coders, the number is how many of their patches (of any size) were committed into this release. For testers, the number is the number of times their name was listed as assisting with testing a patch. Finally, for reporters, the number is the number of issues that they reported that were affected by commits that went into this release.</p><tablewidth="100%"border="0">
<trvalign="top"><tdwidth="33%">20 Sean Bright <sean.bright@gmail.com><br/>7 George Joseph <gjoseph@digium.com><br/>6 Richard Mudgett <rmudgett@digium.com><br/>5 Joshua C. Colp <jcolp@sangoma.com><br/>4 Kevin Harwell <kharwell@digium.com><br/>3 Asterisk Development Team <asteriskteam@digium.com><br/>3 Jaco Kroon <jaco@uls.co.za><br/>2 Pascal Cadotte Michaud <pcm@wazo.io><br/>1 Kevin Reeves <kevin@phoneburner.com><br/>1 Frederic LE FOLL <frederic.lefoll@c-s.fr><br/>1 Joshua Colp <jcolp@sangoma.com><br/>1 Jean Aunis <jean.aunis@prescom.fr><br/>1 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com><br/>1 Boris P. Korzun <drtr0jan@yandex.ru><br/>1 Andrew Siplas <andrew@asiplas.net><br/>1 Corey Farrell <git@cfware.com><br/>1 snuffy <snuffy22@gmail.com><br/></td><tdwidth="33%"><tdwidth="33%">3 Sean Bright <sean.bright@gmail.com><br/>3 Ross Beer <ross.beer@voicehost.co.uk><br/>3 cmaj <chris@penguinpbx.com><br/>2 Pascal Cadotte Michaud <pascal.cadotte@gmail.com><br/>2 Joshua C. Colp <jcolp@digium.com><br/>1 Robert Sutton <rsutton@noojee.com.au><br/>1 Kevin Flyn<br/>1 Ted G<br/>1 Maciej Michno <maciej.michno@xtb.com><br/>1 AvayaXAsterisk<br/>1 Jean Aunis - Prescom <jean.aunis@prescom.fr><br/>1 George Joseph <gjoseph@digium.com><br/>1 Jaco Kroon <jaco@uls.co.za><br/>1 Kevin Reeves <kevin@phoneburner.com><br/>1 candrews <candrews@integralblue.com><br/>1 Andrew Siplas <andrew@asiplas.net><br/>1 Frank Matano <ftalarico99@gmail.com><br/>1 Cédric Bassaget<br/>1 Kevin Harwell <kharwell@digium.com><br/>1 Dan Jenkins <dan@nimbleape.com><br/>1 kevin@phoneburner.com<br/>1 Maciej Michno<br/>1 Dirk Wendland <dirk@starface.de><br/>1 Jim Van Meggelen <jim.vanmeggelen@clearlycore.com><br/>1 Stas Kobzar<br/>1 Jean-Denis Girard<br/>1 Stas Kobzar <stas@modulis.ca><br/>1 Boris P. Korzun <drtr0jan@yandex.ru><br/>1 Cedric BASSAGET <cedric@oceanet.com><br/>1 Niksa Baldun <niksa.baldun@gmail.com><br/>1 Ted G <tgwaste@gmail.com><br/>1 Corey Farrell <git@cfware.com><br/>1 Richard Kenner<br/>1 Frank Matano<br/>1 Joeran Vinzens <vinzens@sipgate.de><br/>1 Frederic LE FOLL <frederic.lefoll@c-s.fr><br/>1 Kevin Flyn <kevflynn69@gmail.com><br/>1 David M. Lee <dlee@digium.com><br/>1 Dirk Wendland<br/>1 Bryan Nelson <bnelson@fluentstream.com><br/>1 Richard Kenner <kenner@gnat.com><br/>1 Ross Beer<br/>1 Francois Blackburn <fblackburn@wazo.io><br/>1 Joeran Vinzens<br/>1 Jonathan Harris <lardconcepts@gmail.com><br/>1 Jonathan Harris<br/>1 Dan Jenkins<br/>1 AvayaXAsterisk <joh.zuerner@yahoo.de><br/>1 Sean Bright<br/>1 Jean-Denis Girard <jd.girard@sysnux.pf><br/>1 nappsoft <infos@nappsoft.ch><br/>1 Joshua C. Colp<br/>1 Niksa Baldun<br/>1 Mitch Claborn<br/>1 Robin Leffmann <robin@stolendata.net><br/>1 Jim Van Meggelen<br/>1 David Lee<br/>1 Robert Sutton<br/></td></tr>
</table><hr><aname="closed_issues"><h2align="center">Closed Issues</h2></a><center><ahref="#top">[Back to Top]</a></center><p>This is a list of all issues from the issue tracker that were closed by changes that went into this release.</p><h3>New Feature</h3><h4>Category: Functions/func_curl</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-17491">ASTERISK-17491</a>: CURLOPT() needs a "followlocation" parameter / "maxredirs" doesn't do anything<br/>Reported by: candrews<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=f69da94fab0cab6968292c0b2f3b1eb46fddf510">[f69da94fab]</a> Sean Bright -- func_curl: Add 'followlocation' option to CURLOPT()</li>
</ul><br><h4>Category: Resources/res_pjsip_endpoint_identifier_ip</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28639">ASTERISK-28639</a>: res_pjsip_endpoint_identifier_ip: Add ability to match on source port<br/>Reported by: Sean Bright<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=f8b0c2c9331e55820dec08bf3eb2aef5b8e8947c">[f8b0c2c933]</a> Sean Bright -- res_pjsip_endpoint_identifier_ip.c: Add port matching support</li>
</ul><br><h3>Bug</h3><h4>Category: Applications/app_chanisavail</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28636">ASTERISK-28636</a>: app_chanisavail+cdr: ChanIsAvail sometimes fails to deactivate CDR.<br/>Reported by: Frederic LE FOLL<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=aa06c6ea297ccb82ae30a11f66f523dc1b18652c">[aa06c6ea29]</a> Frederic LE FOLL -- app_chanisavail/cdr: ChanIsAvail sometimes fails to deactivate CDR.</li>
</ul><br><h4>Category: Applications/app_meetme</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28604">ASTERISK-28604</a>: app_meetme, chan_ooh323 and cdr_mysql don't build on 17.0.0<br/>Reported by: George Joseph<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=7167fd6d463ad046dacd890dd4fe6a3ccc34e026">[7167fd6d46]</a> Joshua C. Colp -- configure: Add check for MySQL client bool and my_bool type usage.</li>
</ul><br><h4>Category: Applications/app_queue</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28349">ASTERISK-28349</a>: Pause reason not reported in QueueMember AMI event<br/>Reported by: Niksa Baldun<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=5fded77e7f7c1a62a02d9e99054fc5e95f385d0e">[5fded77e7f]</a> Sean Bright -- app_queue: Deprecate the QueueMemberPause.Reason field</li>
</ul><br><h4>Category: Applications/app_record</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28682">ASTERISK-28682</a>: app_record: Lack of `beep` audio file causes application to return error and hangup<br/>Reported by: Corey Farrell<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=0c07a7ee00374665fcc82bd170383fc165f92f45">[0c07a7ee00]</a> Corey Farrell -- app_record: Do not hang up if beep audio is missing</li>
</ul><br><h4>Category: Applications/app_voicemail</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-23739">ASTERISK-23739</a>: [patch]Segfault forwarding voicemail with ODBC storage enabled and realtime voicemail_data is used<br/>Reported by: Stas Kobzar<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=293600724dd285b305974520754a2be0707cf163">[293600724d]</a> Sean Bright -- app_voicemail: Prevent crash when saving message with realtime voicemail</li>
</ul><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-27622">ASTERISK-27622</a>: empty voicemail.conf required for ARA (realtime) voicemail to leave message<br/>Reported by: Jim Van Meggelen<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=e379fe48e1ffebd8eb3a4fc250a2f5978a922c78">[e379fe48e1]</a> Sean Bright -- app_voicemail: Set globals to default values when voicemail.conf missing</li>
</ul><br><h4>Category: Applications/app_voicemail/ODBC</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-23739">ASTERISK-23739</a>: [patch]Segfault forwarding voicemail with ODBC storage enabled and realtime voicemail_data is used<br/>Reported by: Stas Kobzar<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=293600724dd285b305974520754a2be0707cf163">[293600724d]</a> Sean Bright -- app_voicemail: Prevent crash when saving message with realtime voicemail</li>
</ul><br><h4>Category: CDR/General</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28677">ASTERISK-28677</a>: CDR billsec is always 0 for transferred calls<br/>Reported by: Maciej Michno<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=1b452ebb51b6d29e9d48d877d2aa54f67dfc5a18">[1b452ebb51]</a> George Joseph -- cdr.c: Set event time on party b when leaving a parking bridge</li>
</ul><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28636">ASTERISK-28636</a>: app_chanisavail+cdr: ChanIsAvail sometimes fails to deactivate CDR.<br/>Reported by: Frederic LE FOLL<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=aa06c6ea297ccb82ae30a11f66f523dc1b18652c">[aa06c6ea29]</a> Frederic LE FOLL -- app_chanisavail/cdr: ChanIsAvail sometimes fails to deactivate CDR.</li>
</ul><br><h4>Category: Channels/chan_dahdi</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28702">ASTERISK-28702</a>: chan_dahdi: holding a channel via flash to dialtone times out after 0:16:40<br/>Reported by: Andrew Siplas<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=9895e94dba8cd4b9985f5c73562b94be17e823e1">[9895e94dba]</a> Andrew Siplas -- chan_dahdi: Change 999999 to INT_MAX to better reflect "no timeout"</li>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=63b8664bfa7cb971a27940fdb09aa8b98ad71d9b">[63b8664bfa]</a> George Joseph -- res_pjsip_nat: Restore original contact for REGISTER responses</li>
</ul><br><h4>Category: Channels/chan_sip/General</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28647">ASTERISK-28647</a>: chan_sip: RTP frames not transmitted after emitting a COLP<br/>Reported by: Jean Aunis - Prescom<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=82a870c8c7e4f328b2bc4c19fed1515fc5f2b60c">[82a870c8c7]</a> Jean Aunis -- chan_sip: voice frames are no longer transmitted after emitting a COLP</li>
</ul><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28651">ASTERISK-28651</a>: chan_sip logs errors on tx to non-existent TCP connections<br/>Reported by: Jaco Kroon<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=055737d645d56c61c246b6342f2ae4eddd2420b2">[055737d645]</a> Jaco Kroon -- chan_sip: in case of tcp/tls, be less annoying about tx errors.</li>
</ul><br><h4>Category: Channels/chan_sip/Messaging</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28693">ASTERISK-28693</a>: chan_sip: SIP MESSAGE beginning with a whitespace appears empty in the dialplan<br/>Reported by: Frank Matano<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=31027f33db11dbdd5c49b06f7f6811d8367862c9">[31027f33db]</a> Sean Bright -- chan_sip.c: Stop handling continuation lines after reading headers</li>
</ul><br><h4>Category: Channels/chan_sip/Transfers</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28677">ASTERISK-28677</a>: CDR billsec is always 0 for transferred calls<br/>Reported by: Maciej Michno<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=1b452ebb51b6d29e9d48d877d2aa54f67dfc5a18">[1b452ebb51]</a> George Joseph -- cdr.c: Set event time on party b when leaving a parking bridge</li>
</ul><br><h4>Category: Codecs/codec_silk</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28706">ASTERISK-28706</a>: silk 24hHz doesn't show up in 'core show translation' output<br/>Reported by: Sean Bright<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=efecc9d139e9107fe45e2ee7e96a615fc7fb3dcd">[efecc9d139]</a> Sean Bright -- translate.c: Fix silk 24kHz truncation in 'core show translation'</li>
</ul><br><h4>Category: Configs/Basic-PBX</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28667">ASTERISK-28667</a>: Asterisk ignores parsing of config files if a Byte order mark is present<br/>Reported by: Robin Leffmann<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=a78758d0a219c291d065203d56da6b48d350ceab">[a78758d0a2]</a> Sean Bright -- config.c: Skip UTF-8 BOMs if present when reading config files</li>
</ul><br><h4>Category: Contrib/General</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-27243">ASTERISK-27243</a>: contrib: valgrind.supp doesn't suppress what it's supposed to due to invalid syntax<br/>Reported by: Richard Kenner<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=b9b50774f54a495d3a814c1acc9c0e3e7cccc9c4">[b9b50774f5]</a> snuffy -- contrib/valgrind: Fix use of frame-level suppression</li>
</ul><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28664">ASTERISK-28664</a>: "trustrpid" is misspelled in sip_to_pjsip.py<br/>Reported by: Pascal Cadotte Michaud<ul>
</ul><br><h4>Category: Core/Streams</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28625">ASTERISK-28625</a>: Playback of local files impacted by large media cache<br/>Reported by: Kevin Reeves<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=e013f502b1b5abda167206a3ec2dbe50ff59a585">[e013f502b1]</a> Kevin Reeves -- main/file.c: Limit media cache usage to remote files.</li>
</ul><br><h4>Category: Documentation</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-24484">ASTERISK-24484</a>: Update documentation for statsd module - usage requirements unclear<br/>Reported by: Dan Jenkins<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=04c81f9748d7d380d0fe2f957b34afc492185acf">[04c81f9748]</a> Sean Bright -- res_statsd: Document that res_statsd does nothing on its own</li>
</ul><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-25429">ASTERISK-25429</a>: res_pjsip_endpoint_identifier_ip: Document support for hostnames<br/>Reported by: Joshua C. Colp<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=8d87fef5a1701eff8929cdb4c0686e6339aab253">[8d87fef5a1]</a> Sean Bright -- res_pjsip_endpoint_identifier_ip: Document support for hostnames</li>
</ul><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28507">ASTERISK-28507</a>: Wiki docs missing for MessageWaiting<br/>Reported by: David M. Lee<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=4cf32f2578cc65360ae951bd607a842694037876">[4cf32f2578]</a> George Joseph -- CI: Update buildAsterisk.sh to do a "make full"</li>
</ul><br><h4>Category: Functions/General</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28626">ASTERISK-28626</a>: Missing arguments in PJSIP_CONTACT function documentation<br/>Reported by: Pascal Cadotte Michaud<ul>
</ul><br><h4>Category: Functions/func_odbc</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28497">ASTERISK-28497</a>: func_odbc: truncating Unicode string on readsql<br/>Reported by: Boris P. Korzun<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=e54299cd3e2b93937d26ef866afc2f65095507f9">[e54299cd3e]</a> Boris P. Korzun -- func_odbc: acf_odbc_read() and cli_odbc_read() unicode support</li>
</ul><br><h4>Category: General</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28609">ASTERISK-28609</a>: Memory Leak in res_rtp_asterisk.c<br/>Reported by: Ted G<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=8af0dea0c785a40b18559bb4eb1d26aa46faa1a5">[8af0dea0c7]</a> George Joseph -- res_rtp_asterisk: Add frame list cleanups to ast_rtp_read</li>
</ul><br><h4>Category: PBX/General</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28695">ASTERISK-28695</a>: core: minmemfree watermark uses free RAM, not available RAM<br/>Reported by: Kevin Flyn<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=f5a1e8b04d2349c1df3c05e4f30c2e845b4cbd70">[f5a1e8b04d]</a> Sean Bright -- pbx.c: Include filesystem cache in free memory calculation</li>
</ul><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28605">ASTERISK-28605</a>: chan_dahdi: Deadlock in Hangup Scenarios with concurrent command pri show span X<br/>Reported by: Dirk Wendland<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=64692a3c7204e2644209d6a9fbf45ca825ed1aaa">[64692a3c72]</a> George Joseph -- sig_pri: Fix deadlock caused by sig_pri_queue_hangup</li>
</ul><br><h4>Category: Resources/res_ari</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28679">ASTERISK-28679</a>: stasis application is destroyed after its creation<br/>Reported by: Francois Blackburn<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=1627e8eddc378b7df54f298ca0f4a89294a10864">[1627e8eddc]</a> Kevin Harwell -- res_stasis: trigger cleanup after update</li>
</ul><br><h4>Category: Resources/res_fax</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28660">ASTERISK-28660</a>: res_fax: wrap Asterisk initiated negotiation with config option<br/>Reported by: Kevin Harwell<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=d17bbcb9f179e6bd4df78a744d44d6ee836f3f5f">[d17bbcb9f1]</a> Kevin Harwell -- res_fax: wrap v21 detected Asterisk initiated negotiation with config option</li>
</ul><br><h4>Category: Resources/res_http_websocket</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28562">ASTERISK-28562</a>: SIP WSS message not processed until next frame arrives<br/>Reported by: Robert Sutton<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=47ba42f4a054d97f0c71027594b0e2868317a19f">[47ba42f4a0]</a> Sean Bright -- websocket: Consider pending SSL data when waiting for socket input</li>
</ul><br><h4>Category: Resources/res_pjsip_endpoint_identifier_ip</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-25429">ASTERISK-25429</a>: res_pjsip_endpoint_identifier_ip: Document support for hostnames<br/>Reported by: Joshua C. Colp<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=8d87fef5a1701eff8929cdb4c0686e6339aab253">[8d87fef5a1]</a> Sean Bright -- res_pjsip_endpoint_identifier_ip: Document support for hostnames</li>
</ul><br><h4>Category: Resources/res_pjsip_notify</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-27775">ASTERISK-27775</a>: res_pjsip_notify: Multiple Event headers can be present instead of just one<br/>Reported by: AvayaXAsterisk<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=0a56edca4d4d0a446bafc90314c897844f3f5737">[0a56edca4d]</a> Sean Bright -- res_pjsip_notify: Only allow a single Event header to be added to a NOTIFY</li>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=939e18d63eee6c228446c4b14021ba8940761574">[939e18d63e]</a> Joshua C. Colp -- res_pjsip_pubsub: Increment persistence data ref when recreating.</li>
</ul><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-27759">ASTERISK-27759</a>: res_pjsip_pubsub: Subscription persistence does not preserve XML <dialog-info> version number<br/>Reported by: Bryan Nelson<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=8318b05f2513adf97aa6ff9ebcafafc5737ebc53">[8318b05f25]</a> Joshua C. Colp -- res_pjsip_pubsub: Add ability to persist generator state information.</li>
</ul><br><h4>Category: Resources/res_pjsip_sdp_rtp</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28659">ASTERISK-28659</a>: res_pjsip_sdp_rtp: Bundle includes non-existent media stream if codecs create additional streams and offer does not have them<br/>Reported by: nappsoft<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=186c4e9b36e66bb9526acb2a845a52dc18c3b844">[186c4e9b36]</a> Joshua C. Colp -- res_pjsip_session: Set stream state on created streams for incoming SDP.</li>
</ul><br><h4>Category: Resources/res_pjsip_session</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28659">ASTERISK-28659</a>: res_pjsip_sdp_rtp: Bundle includes non-existent media stream if codecs create additional streams and offer does not have them<br/>Reported by: nappsoft<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=186c4e9b36e66bb9526acb2a845a52dc18c3b844">[186c4e9b36]</a> Joshua C. Colp -- res_pjsip_session: Set stream state on created streams for incoming SDP.</li>
</ul><br><h4>Category: Resources/res_realtime</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-21794">ASTERISK-21794</a>: CLI command 'realtime update2' syntax failure when using according to usage help<br/>Reported by: Cedric BASSAGET<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=fbe18165d5155c3c687b40fbd13c8d7175ee3bfe">[fbe18165d5]</a> Sean Bright -- res_realtime: Fix 'realtime update2' argument handling</li>
</ul><br><h4>Category: Resources/res_stasis</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28423">ASTERISK-28423</a>: ARI causes STASIS Deadlock<br/>Reported by: Ross Beer<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=42c51263b9ec8a0bb349af39e28ff51ed3d682ee">[42c51263b9]</a> Kevin Harwell -- stasis/app: don't lock an app before a call to send</li>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=dd82ebecd34bd18fe6569b950402e23786a05664">[dd82ebecd3]</a> George Joseph -- stasis.c: Use correct topic name in stasis_topic_pool_delete_topic</li>
</ul><br><h4>Category: Resources/res_statsd</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-24484">ASTERISK-24484</a>: Update documentation for statsd module - usage requirements unclear<br/>Reported by: Dan Jenkins<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=04c81f9748d7d380d0fe2f957b34afc492185acf">[04c81f9748]</a> Sean Bright -- res_statsd: Document that res_statsd does nothing on its own</li>
</ul><br><h3>Improvement</h3><h4>Category: Applications/app_confbridge</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28658">ASTERISK-28658</a>: app_confbridge: Add support for setting maximum sample rate<br/>Reported by: Joshua C. Colp<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=5622df0a94a9d7762d07fa08d88c40fc2a566d28">[5622df0a94]</a> Joshua C. Colp -- confbridge: Add support for specifying maximum sample rate.</li>
</ul><br><h4>Category: Bridges/bridge_softmix</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28658">ASTERISK-28658</a>: app_confbridge: Add support for setting maximum sample rate<br/>Reported by: Joshua C. Colp<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=5622df0a94a9d7762d07fa08d88c40fc2a566d28">[5622df0a94]</a> Joshua C. Colp -- confbridge: Add support for specifying maximum sample rate.</li>
</ul><br><h4>Category: Channels/chan_pjsip</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28638">ASTERISK-28638</a>: Simplify dialplan for Dial, Page, and ChanIsAvail<br/>Reported by: cmaj<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=a7692ce2f4cf1d2a591cb94e176fda16199113c6">[a7692ce2f4]</a> Richard Mudgett -- app_chanisavail.c: Simplify dialplan using ChanIsAvail.</li>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=144b774b850c20202bcc2784530258e0800eb4ed">[144b774b85]</a> Richard Mudgett -- app_dial.c: Simplify dialplan using Dial.</li>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=2780be334d44a0124f82e8c6e05660c1d32aa2fe">[2780be334d]</a> Richard Mudgett -- app_page.c: Simplify dialplan using Page.</li>
</ul><br><h4>Category: Core/HTTP</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28710">ASTERISK-28710</a>: Should be able to disable the /httpstatus URI in the built-in HTTP server<br/>Reported by: Sean Bright<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=a2a4e1026cf2de03d9978c320b37652aca3b45b6">[a2a4e1026c]</a> Sean Bright -- http: Add ability to disable /httpstatus URI</li>
</ul><br><h4>Category: Documentation</h4><ahref="https://issues.asterisk.org/jira/browse/ASTERISK-28673">ASTERISK-28673</a>: GET FULL VARIABLE documentation clarification<br/>Reported by: Jonathan Harris<ul>
<li><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=60fd1322d795f51f027019dc77ce4e56324bc3ec">[60fd1322d7]</a> Sean Bright -- res_agi: Improve GET FULL VARIABLE documentation</li>
</ul><br><hr><aname="commits"><h2align="center">Commits Not Associated with an Issue</h2></a><center><ahref="#top">[Back to Top]</a></center><p>This is a list of all changes that went into this release that did not reference a JIRA issue.</p><tablewidth="100%"border="1">
<tr><td><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=126beb3e6c6b647a14cf9bbfb1d18659684b6d0a">126beb3e6c</a></td><td>Joshua Colp</td><td>REVERT: Add option to suppress the Message channel AMI and ARI events</td></tr>
<tr><td><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=bfe9e1b2e7a489b7eb49a98d290f2e3a68a34dca">bfe9e1b2e7</a></td><td>George Joseph</td><td>message.c: Add option to suppress the Message channel AMI and ARI events</td></tr>
<tr><td><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=c92e2bb09f2b12a0bba06c7d95c194f097a0bba3">c92e2bb09f</a></td><td>Asterisk Development Team</td><td>Update for 16.8.0-rc2</td></tr>
<tr><td><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=b7b813eb3498223daf9a2ac883aadafec6fa65cb">b7b813eb34</a></td><td>Asterisk Development Team</td><td>Update for 16.8.0-rc1</td></tr>
<tr><td><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=eb1ec0498d10f8824ccd85146606808fb1b54dc7">eb1ec0498d</a></td><td>Asterisk Development Team</td><td>Update CHANGES and UPGRADE.txt for 16.8.0</td></tr>
<tr><td><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=a7aaca9eaa698309f0ee837cd15590f343d0417d">a7aaca9eaa</a></td><td>Sean Bright</td><td>func_odbc.conf.sample: Add example lookup</td></tr>
<tr><td><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=f49517efb9ce9c7d39d71effb1d1cd01ffc7b3d6">f49517efb9</a></td><td>Rodrigo Ramírez Norambuena</td><td>queue_log: Add alembic script for generate db table for queue_log</td></tr>
<tr><td><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=13fa33588fbe106c3d79f372f62637f13f014194">13fa33588f</a></td><td>Sean Bright</td><td>app_voicemail, say: Fix various leading whitespace problems</td></tr>
<tr><td><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=b92b0469ff17273fbf97a7c33ec2573fafc4d09e">b92b0469ff</a></td><td>Jaco Kroon</td><td>netsock2: ast_addressfamily_to_sockaddrsize and ast_sockaddr_from_sockaddr.</td></tr>
<tr><td><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=de078debab0b7aef82511a81f7af740eb0a3af76">de078debab</a></td><td>Kevin Harwell</td><td>app_agent_pool: Update XML docs for AgentLogin</td></tr>
<tr><td><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=11753d94d8799f18a2e13b660e6b596197284797">11753d94d8</a></td><td>Richard Mudgett</td><td>features.c: Make Bridge application tolerate unspecified channel.</td></tr>
<tr><td><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=00e745066c4a7e0ad0cfa624dc6098cc16aff570">00e745066c</a></td><td>Richard Mudgett</td><td>app_chanspy.c: Reduce log message level from notice to verbose.</td></tr>
<tr><td><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=198f4cbdbf034814fbba03b1921ffe710263e828">198f4cbdbf</a></td><td>Richard Mudgett</td><td>app_softhangup.c: Reduce unnecessary warning to verbose message.</td></tr>
<tr><td><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=efa13eb0a076cc9958681d6f07288d059305472a">efa13eb0a0</a></td><td>Sean Bright</td><td>db: Initialize condition primitive before use</td></tr>
<tr><td><ahref="https://code.asterisk.org/code/changelog/asterisk?cs=77941efad9063cf1cb0d8e3382d47ced2d05ac0c">77941efad9</a></td><td>Jaco Kroon</td><td>ACL: ast_apply_acl_nolog - identical to ast_apply_acl but without logging.</td></tr>
</table><hr><aname="diffstat"><h2align="center">Diffstat Results</h2></a><center><ahref="#top">[Back to Top]</a></center><p>This is a summary of the changes to the source code that went into this release that was generated using the diffstat utility.</p><pre>asterisk-16.7.0-summary.html | 309 ---
snprintf(sqlcmd,sizeof(sqlcmd),"SELECT a.attname, t.typname, a.attlen, a.attnotnull, d.adsrc, a.atttypmod FROM (((pg_catalog.pg_class c INNER JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace AND c.relname = '%s' AND n.nspname = %s%s%s) INNER JOIN pg_catalog.pg_attribute a ON (NOT a.attisdropped) AND a.attnum > 0 AND a.attrelid = c.oid) INNER JOIN pg_catalog.pg_type t ON t.oid = a.atttypid) LEFT OUTER JOIN pg_attrdef d ON a.atthasdef AND d.adrelid = a.attrelid AND d.adnum = a.attnum ORDER BY n.nspname, c.relname, attnum",
snprintf(sqlcmd,sizeof(sqlcmd),"SELECT a.attname, t.typname, a.attlen, a.attnotnull, pg_catalog.pg_get_expr(d.adbin, d.adrelid) adsrc, a.atttypmod FROM (((pg_catalog.pg_class c INNER JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace AND c.relname = '%s' AND n.nspname = %s%s%s) INNER JOIN pg_catalog.pg_attribute a ON (NOT a.attisdropped) AND a.attnum > 0 AND a.attrelid = c.oid) INNER JOIN pg_catalog.pg_type t ON t.oid = a.atttypid) LEFT OUTER JOIN pg_attrdef d ON a.atthasdef AND d.adrelid = a.attrelid AND d.adnum = a.attnum ORDER BY n.nspname, c.relname, attnum",
<membername="codec_opus"displayname="Download the Opus codec from Digium. See http://downloads.digium.com/pub/telephony/codec_opus/README.">
<support_level>external</support_level>
<conflict>no_binary_modules</conflict>
<depend>xmlstarlet</depend>
<depend>bash</depend>
<depend>res_format_attr_opus</depend>
@ -7,24 +8,28 @@
</member>
<membername="codec_silk"displayname="Download the SILK codec from Digium. See http://downloads.digium.com/pub/telephony/codec_silk/README.">
<support_level>external</support_level>
<conflict>no_binary_modules</conflict>
<depend>xmlstarlet</depend>
<depend>bash</depend>
<defaultenabled>no</defaultenabled>
</member>
<membername="codec_siren7"displayname="Download the Siren7 codec from Digium. See http://downloads.digium.com/pub/telephony/codec_siren7/README.">
<support_level>external</support_level>
<conflict>no_binary_modules</conflict>
<depend>xmlstarlet</depend>
<depend>bash</depend>
<defaultenabled>no</defaultenabled>
</member>
<membername="codec_siren14"displayname="Download the Siren14 codec from Digium. See http://downloads.digium.com/pub/telephony/codec_siren14/README.">
<support_level>external</support_level>
<conflict>no_binary_modules</conflict>
<depend>xmlstarlet</depend>
<depend>bash</depend>
<defaultenabled>no</defaultenabled>
</member>
<membername="codec_g729a"displayname="Download the g729a codec from Digium. A license must be purchased for this codec. See http://downloads.digium.com/pub/telephony/codec_g729/README.">