Compare commits

...

215 Commits
master ... 17.1

Author SHA1 Message Date
Asterisk Development Team 9b0dfc66df Update for 17.1.0 2019-12-23 11:50:55 -05:00
Asterisk Development Team de2b8ef23a Update for 17.1.0-rc2 2019-12-18 10:51:49 -05:00
Friendly Automation 5a824f8382 Merge "Revert "chan_dahdi: set CHANNEL(hangupsource) when a PRI channel hangs up"" into 17.1 2019-12-18 09:42:29 -06:00
George Joseph a76d3103fb Revert "chan_dahdi: set CHANNEL(hangupsource) when a PRI channel hangs up"
There are reports that this commit causes deadlocks when issuing
a "pri show" CLI command and a channel is in the process of being
hung up.  Further work is in progress to determine the cause of
the deadlock and provide a permanent fix.

ASTERISK~28605  #keeping open
Reported by: Dirk Wendland

This reverts commit c6b17b5212.

Change-Id: Iddd900c1abdd5074ff39c17cdce855f2f436cef9
2019-12-18 07:42:31 -07:00
George Joseph 27a4a3c761 res_rtp_asterisk: Add frame list cleanups to ast_rtp_read
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
2019-12-18 08:05:17 -06:00
Friendly Automation 7a73da2bf9 Merge "configure: Add check for MySQL client bool and my_bool type usage." into 17.1 2019-12-18 07:04:10 -06:00
Joshua C. Colp 3d29b06e37 configure: Add check for MySQL client bool and my_bool type usage.
Instead of trying to use the defined MySQL client version from the
header use a configure check to determine whether the bool or my_bool
type should be used for defining a boolean.

ASTERISK-28604

Change-Id: Id2225b3785115de074c50c123ff1a68005b4a9c7
2019-12-16 10:36:16 -06:00
Joshua C. Colp 5949f9a86a res_pjsip_session: Set stream state on created streams for incoming SDP.
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
2019-12-16 05:24:12 -06:00
Asterisk Development Team c8563727d5 Update for 17.1.0-rc1 2019-12-12 06:29:08 -05:00
Asterisk Development Team 08a6e8c553 Update CHANGES and UPGRADE.txt for 17.1.0 2019-12-12 06:04:48 -05:00
George Joseph 87d5fb1196 Merge "Revert "PJSIP_CONTACT: add missing argument documentation"" into 17 2019-12-11 10:36:42 -06:00
Joshua Colp 6a89784b78 Revert "PJSIP_CONTACT: add missing argument documentation"
This reverts commit 450173a0ae.

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: I47a6714bb555b35a371861d434daf5b97c0cdcbd
2019-12-11 07:01:23 -06:00
Friendly Automation 5fb0d1d562 Merge "res_pjsip_registrar.c: Prevent potential double free if AOR is not found" into 17 2019-12-09 10:34:41 -06:00
Friendly Automation ffbfc09fc1 Merge "app_queue: Fix old confusing comment about when the members are called" into 17 2019-12-06 13:27:59 -06:00
George Joseph 2526c8e562 Merge "channel.c: Resolve issue with receiving SIP INFO packets for DTMF" into 17 2019-12-06 12:41:09 -06:00
Friendly Automation af079f5085 Merge "res_pjsip_outbound_registration: add support for SRV failover" into 17 2019-12-06 09:35:43 -06:00
Friendly Automation 6685a1862c Merge "res_pjsip_registrar.c: Prevent possible buffer overflow with domain aliases" into 17 2019-12-06 09:09:02 -06:00
Friendly Automation e17bde758b Merge "PJSIP_CONTACT: add missing argument documentation" into 17 2019-12-04 18:45:22 -06:00
Friendly Automation aa2765d366 Merge "chan_sip+native_bridge_rtp: no directmedia for ptime other than default ptime." into 17 2019-12-04 18:02:33 -06:00
Friendly Automation 478a602e70 Merge "res_pjsip_session.c: Prevent use-after-free with TEST_FRAMEWORK enabled" into 17 2019-12-04 17:45:05 -06:00
Friendly Automation 77b5ec3e7a Merge "parking: Fall back to parker channel name even if it matches parkee." into 17 2019-12-04 17:07:48 -06:00
Sean Bright 4e057eb9d2 res_pjsip_registrar.c: Prevent potential double free if AOR is not found
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
2019-12-04 16:18:53 -06:00
Sean Bright f26e5bacc0 res_pjsip_registrar.c: Prevent possible buffer overflow with domain aliases
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
2019-12-04 16:15:19 -06:00
Walter Doekes e1eb5e8dc2 app_queue: Fix old confusing comment about when the members are called
ASTERISK-28644

Change-Id: I2771a931d00a8fc2b9f9a4d1a33ea8f1ad24e06b
2019-12-04 11:38:56 -06:00
Frederic LE FOLL 3e73893e53 chan_sip+native_bridge_rtp: no directmedia for ptime other than default ptime.
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
2019-12-04 05:01:29 -06:00
Sean Bright 4d56adf8fb res_pjsip_session.c: Prevent use-after-free with TEST_FRAMEWORK enabled
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
2019-12-03 15:44:43 -06:00
George Joseph c0ab241cc0 Merge "media_cache.c: Various CLI improvements" into 17 2019-12-02 16:01:42 -06:00
George Joseph 88150323a2 channel.c: Resolve issue with receiving SIP INFO packets for DTMF
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
2019-12-02 08:39:36 -06:00
George Joseph 5b15a1c639 CI: Turn off shallow cloning altogether
Change-Id: I73ed4aef33a92f20080128aafc34e19fd4457196
2019-12-02 07:54:25 -05:00
Joshua Colp 41d58a4ce2 parking: Fall back to parker channel name even if it matches parkee.
ASTERISK-28631

Change-Id: Ia74d084799fbb9bee3403e30d2391aacd46243cc
2019-11-25 12:56:51 +00:00
Sean Bright cc59e21409 media_cache.c: Various CLI improvements
* 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
2019-11-22 16:38:17 -05:00
Salah Ahmed 4ac0299bfb res_pjsip_t38: T.38 error correction mode selection at 200 ok received
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
2019-11-21 16:10:17 -05:00
Friendly Automation e9b9141d09 Merge "manager.c: Prevent the Originate action from running the Originate app" into 17 2019-11-21 14:03:02 -06:00
Ben Ford 665a94cb76 chan_sip.c: Prevent address change on unauthenticated SIP request.
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
2019-11-21 09:46:26 -06:00
George Joseph 6b1ba58967 manager.c: Prevent the Originate action from running the Originate app
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
2019-11-21 09:40:52 -06:00
George Joseph 6aa9ee1661 Merge "chan_dahdi: PRI span status may stay "Down, Active" after a short alarm" into 17 2019-11-21 09:23:42 -06:00
Friendly Automation 715e4d0e72 Merge "app_senddtmf: Add receive mode to AMI Action PlayDTMF" into 17 2019-11-21 08:38:53 -06:00
Pascal Cadotte Michaud 450173a0ae PJSIP_CONTACT: add missing argument documentation
add missing argument "rtt" and "status" to the documentation

ASTERISK-28626
Change-Id: I8419e4c8203e411b87d93dc395acdbcf7526dedf
2019-11-21 09:23:29 -05:00
Kevin Harwell b1c9176b3f Merge "app_amd: Fixed timeout issue" into 17 2019-11-20 16:14:47 -06:00
Kevin Harwell 8c99930375 res_pjsip_outbound_registration: add support for SRV failover
ASTERISK-28624

Change-Id: I8da7c300dd985ab7b10dbd5194aff2f737808561
2019-11-20 13:56:49 -05:00
Friendly Automation ecdc5405f9 Merge "func_curl.c: Support custom http headers" into 17 2019-11-20 09:49:42 -06:00
George Joseph 8a02454ec6 Merge "res_pjsip_registrar: Fix uninitlized variable warning" into 17 2019-11-20 08:59:38 -06:00
George Joseph 2a92e6b576 CI: Fix missing script block in jenkinsfiles
Change-Id: I9f44a3d5085ea7880fad1a3883a4820907e29ea3
(cherry picked from commit 95213b01d2)
2019-11-19 13:13:22 -05:00
George Joseph f0d1ce50af CI: Fix missing script block in jenkinsfiles
Change-Id: Ib4b6e4887695f230ea7a5b0c879b29fc5a13be4f
(cherry picked from commit d60f23ecbd)
(cherry picked from commit ce8a23fdf9)
2019-11-19 13:03:58 -05:00
George Joseph 46dceab33f CI: Increase clone depth and do better cleanup
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
2019-11-19 11:58:58 -05:00
Friendly Automation 43a7e44fbe Merge "serializer: set high/low alert levels on whole pool" into 17 2019-11-19 10:13:55 -06:00
Sean Bright 76ef36fafc res_pjsip_registrar: Fix uninitlized variable warning
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
2019-11-19 10:32:56 -05:00
Michael Cargile e23b2856d0 app_amd: Fixed timeout issue
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
2019-11-19 10:07:19 -05:00
Frederic LE FOLL d3dd4c5459 chan_dahdi: PRI span status may stay "Down, Active" after a short alarm
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
2019-11-19 02:20:14 -05:00
lvl 6345a00228 app_senddtmf: Add receive mode to AMI Action PlayDTMF
ASTERISK-28614

Change-Id: I183501297ae1dc294ae56b34acac9b0343eb2664
2019-11-18 18:10:13 -05:00
Friendly Automation f1f28aa9e3 Merge "parking: Fix case where we can't get the parker." into 17 2019-11-18 15:19:49 -06:00
George Joseph 16066ce5fc Merge "various files - fix some alerts raised by lgtm code analysis" into 17 2019-11-18 11:42:03 -06:00
Friendly Automation d75099b845 Merge "func_env: Prevent FILE() from reading garbage at end-of-file" into 17 2019-11-18 10:40:21 -06:00
Friendly Automation cb58d4cc2d Merge "res_rtp_asterisk: Always return provided DTLS packet length." into 17 2019-11-18 10:37:09 -06:00
Alexei Gradinari 649733612d serializer: set high/low alert levels on whole pool
The current code sets alert levels starting from index 1.
Need to set on whole pool starting from index 0.

Change-Id: I5decbb43160954fb9a512f04302637fc666b6f5d
2019-11-18 11:03:29 -05:00
Joshua Colp 0c486e7edf res_rtp_asterisk: Always return provided DTLS packet length.
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
2019-11-18 08:34:15 -06:00
Sean Bright 92bb381d5d func_env: Prevent FILE() from reading garbage at end-of-file
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
2019-11-18 08:32:41 -06:00
Kevin Harwell 8b4610acfe bridge_softmix: clear hold when joining a softmix bridge
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
2019-11-18 08:31:56 -06:00
Kevin Harwell 8bc6fa0fbd various files - fix some alerts raised by lgtm code analysis
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
2019-11-18 08:30:25 -06:00
Martin Tomec d579ec9cdf func_curl.c: Support custom http headers
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
2019-11-15 09:13:11 -05:00
Joshua Colp de433cdcaf parking: Fix case where we can't get the parker.
ASTERISK-28616

Change-Id: Iabe31ae38d01604284fcc5c2438d44e29a32ea4d
2019-11-15 06:49:19 -04:00
Joshua Colp d638d9c6c6 parking: Use channel snapshot instead of channel.
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
2019-11-14 17:20:22 -06:00
Kevin Harwell 3084a6c617 Merge "res_pjsip_session: initialize pending's topology to endpoint's" into 17 2019-11-14 13:12:20 -06:00
Kevin Harwell ea3daa94c8 res_pjsip_session: initialize pending's topology to endpoint's
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
2019-11-12 15:41:19 -05:00
George Joseph 7202624b3b stasis: Don't hold app_registry and session locks unnecessarily
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
2019-11-10 19:45:25 -05:00
George Joseph 36b28c98dd Build: Fix compile issues with seldom used modules
The following modules needed tweaks for API changes.

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

ASTERISK-28604

Change-Id: Ib40e513ae55b5114be035cdc929abb6a8ce2d06d
2019-11-07 07:31:20 -06:00
Joshua Colp eea2d499f4 res_pjsip_outbound_registration: Extend documentation for "max_retries".
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
2019-10-31 11:54:56 -05:00
Joshua Colp 43ea6e21db Merge "res_calendar: Resolve memory leak on calendar destruction" into 17 2019-10-29 10:24:49 -05:00
Sean Bright b3792e1288 res_calendar: Resolve memory leak on calendar destruction
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
2019-10-24 09:18:28 -05:00
Joshua Colp e37d546109 res_ari_events: Add module reference when a WebSocket is open.
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
2019-10-24 05:26:46 -05:00
George Joseph 1b4502ec5d Merge "ExternalMedia: Change return object from ExternalMedia to Channel" into 17 2019-10-21 13:53:10 -05:00
Friendly Automation 8b0661df75 Merge "utils.h: Set lower bound for thread stack size to PTHREAD_STACK_MIN" into 17 2019-10-21 13:31:34 -05:00
Joshua Colp 0cfe9186b0 Merge "app_voicemail.c: Support multiple file formats for forwarded messages." into 17 2019-10-21 10:31:47 -05:00
Friendly Automation 500e5f488f Merge "Crash during "pjsip show channelstats" execution" into 17 2019-10-21 07:26:19 -05:00
Sean Bright b3c56c7fa5 utils.h: Set lower bound for thread stack size to PTHREAD_STACK_MIN
ASTERISK-28590 #close

Change-Id: I51abce00c04d0a06550bda5205580705185b9c1c
2019-10-18 13:53:32 -05:00
Joshua Colp 4d67cd10ba Merge "res_rtp_asterisk: Remove a log message that slipped in." into 17 2019-10-18 09:37:45 -05:00
George Joseph 2d665091a3 ExternalMedia: Change return object from ExternalMedia to Channel
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
2019-10-18 08:09:01 -05:00
Salah Ahmed 40acd7d198 Crash during "pjsip show channelstats" execution
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: I3e05980dd4694577be6d39be2c21a5736bae3c6f
2019-10-18 11:30:48 +02:00
Joshua Colp b8ae799ca9 res_rtp_asterisk: Remove a log message that slipped in.
This was only supposed to be for testing, so now it can be
removed.

Change-Id: I3dfc2e776e70b3196aeed5688372ea80c0214b59
2019-10-17 05:50:38 -05:00
Sean Bright 4bc1c170cd README-SERIOUSLY.bestpractices.md: Speling correetions.
ASTERISK-28586 #close

Change-Id: I43dc4e8bd9dc685b17695b215a5360314074734f
2019-10-16 16:07:30 -05:00
Joshua Colp b590e8f23e Merge "test_res_rtp: Enable FIR and REMB nominal tests." into 17 2019-10-16 07:43:55 -05:00
cmaj aa0973f868 app_voicemail.c: Support multiple file formats for forwarded messages.
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
2019-10-14 17:24:59 -05:00
George Joseph 3c712391c6 Merge "res_pjsip_mwi: potential double unref, and potential unwanted double link" into 17 2019-10-14 12:00:51 -05:00
Joshua Colp ba688e6891 test_res_rtp: Enable FIR and REMB nominal tests.
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
2019-10-14 11:49:05 -05:00
Friendly Automation bbf995320e Merge "pbx: deadlock when outgoing dialed channel hangs up too quickly" into 17 2019-10-14 06:56:25 -05:00
Friendly Automation 236ff0af7a Merge "cdr_pgsql cel_pgsql res_config_pgsql: compatibility with PostgreSQL 12" into 17 2019-10-14 06:29:35 -05:00
Christoph Moench-Tegeder 79cc8ae3b8 cdr_pgsql cel_pgsql res_config_pgsql: compatibility with PostgreSQL 12
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
2019-10-14 05:07:46 -05:00
George Joseph 5b77f572e3 Merge "pjproject_bundled: Replace earlier reverts with official fixes." into 17 2019-10-11 09:32:36 -05:00
Kevin Harwell 45c0d99185 res_pjsip_mwi: potential double unref, and potential unwanted double link
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
2019-10-10 15:30:15 -05:00
csavinovich c84135d2a3 test_taskprocessor.c: Fix test failure on Ubuntu
Fixes a failure in /main/taskprocesor unit test, only occurring in Ubuntu.
Newer versions of GCC require variable initialization.

Change-Id: I2994d8aab9307a8c2c7330584f287a27144a580c
2019-10-10 15:23:05 -05:00
Friendly Automation b25e529ad8 Merge "Revert "app_voicemail: Cleanup stale lock files on module load"" into 17 2019-10-10 10:05:37 -05:00
George Joseph d869882697 Merge changes from topic "pjsip_shutdown" into 17
* changes:
  res_pjsip_mwi: use an ao2_global object for mwi containers
  res_pjsip/res_pjsip_mwi: use centralized serializer pools
2019-10-10 09:13:48 -05:00
George Joseph 82372fa816 Merge "serializer: move/add asterisk serializer pool functionality" into 17 2019-10-10 09:09:22 -05:00
Friendly Automation 804f5ddfeb Merge "chan_pjsip: Prevent segfault when running PlayDTMF on hungup channel" into 17 2019-10-10 08:43:57 -05:00
George Joseph 2652bda3a0 pjproject_bundled: Replace earlier reverts with official fixes.
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
2019-10-10 06:43:14 -05:00
Kevin Harwell ae761c7473 pbx: deadlock when outgoing dialed channel hangs up too quickly
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
2019-10-09 16:07:08 -05:00
Friendly Automation 6bedd43b98 Merge "cdr_mysql: Don't clean up on unload unless we can unregister from CDRs" into 17 2019-10-08 07:27:22 -05:00
Sean Bright b903994987 Revert "app_voicemail: Cleanup stale lock files on module load"
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
2019-10-08 06:34:55 -05:00
lvl 71f86e78b6 chan_pjsip: Prevent segfault when running PlayDTMF on hungup channel
ASTERISK-28086 #close

Change-Id: Ib3baadc89b9f0477a6f25a63861433812368c5ea
2019-10-08 02:31:11 -05:00
Kevin Harwell 996fc40e2b res_pjsip_mwi: use an ao2_global object for mwi containers
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
2019-10-07 16:53:17 -05:00
Kevin Harwell 37ec88c4c8 serializer: move/add asterisk serializer pool functionality
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
2019-10-07 16:53:17 -05:00
Kevin Harwell 299ba78b09 res_pjsip/res_pjsip_mwi: use centralized serializer pools
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
2019-10-07 16:53:17 -05:00
Friendly Automation 119a18ef08 Merge "channel/chan_pjsip: add dialplan function for music on hold" into 17 2019-10-07 08:01:36 -05:00
Sean Bright 1dc3451a34 cdr_mysql: Don't clean up on unload unless we can unregister from CDRs
ASTERISK-28566 #close

Change-Id: I6daa4e5128e9406d04d3aed670c3bae98d38d40c
2019-10-04 16:00:46 -05:00
Corey Farrell 25fbe79793 stasis_state: Create internal stasis_state_proxy object.
This improves the way which stasis_state reference counting works.
Since manager->states holds onto the proxy object instead of the real
object this allows stasis_state objects to be freed when appropriate
without use of a special state_remove function.  Additionally each
distinct eid associated with the state holds a reference to the state to
prevent early release and potentially allow easier debug of leaks.

Change-Id: I400e0db4b9afa3d5cb4ac7dad60907897e73f9a9
2019-10-04 07:08:00 -05:00
Joshua Colp 57fa604571 stasis: Pass bumped topic_all reference to proxy_dtor.
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
2019-10-01 09:05:49 -05:00
Friendly Automation f7ed688ae8 Merge "res_pjsip_pubsub: add endpoint to some warning" into 17 2019-10-01 06:28:54 -05:00
Torrey Searle 55b760d762 channel/chan_pjsip: add dialplan function for music on hold
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
2019-10-01 02:06:28 -05:00
Alexei Gradinari 4b47d4774d res_pjsip_pubsub: add endpoint to some warning
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
2019-09-27 17:12:52 -05:00
Sean Bright 6527eb8213 res_pjsip_transport_websocket: Don't put brackets around local_name if IPv6
ASTERISK-28544 #close

Change-Id: I8e62c444d107674c298f472e3545661de8a80dce
2019-09-27 13:07:57 -05:00
George Joseph 0257a039e4 Merge "basic-pbx: Bring forward queue configuration from 13" into 17 2019-09-27 08:59:17 -05:00
George Joseph 23858b7ef4 Merge "pbx: Prevent Realtime switch crash on invalid priority" into 17 2019-09-27 08:58:30 -05:00
George Joseph a398196fd0 Merge "res_musiconhold: Add new 'playlist' mode" into 17 2019-09-27 08:57:23 -05:00
George Joseph cc82a0c66c Merge "taskprocessor.c: Added "like" support to 'core show taskprocessors'" into 17 2019-09-27 08:56:28 -05:00
Jonathan Rose d223419bcd basic-pbx: Bring forward queue configuration from 13
Original commit: cfbf5fbe91

Change-Id: I34a841d73c429ca8d944481f8dccb756ee231c9c
2019-09-26 08:21:47 -05:00
George Joseph 2fcf9c7e49 Merge "res_pjsip_registrar: Validate Contact URI before adding to responses" into 17 2019-09-26 07:08:12 -05:00
Sean Bright 8d0edf2b37 pbx: Prevent Realtime switch crash on invalid priority
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
2019-09-26 04:48:08 -05:00
Ben Ford 8269fcbf03 taskprocessor.c: Added "like" support to 'core show taskprocessors'
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
2019-09-25 14:01:41 -05:00
Asterisk Development Team 37139e16a5 Update CHANGES and UPGRADE.txt for 17.0.0-rc2 2019-09-25 12:21:13 -05:00
George Joseph 048c0f3a04 Merge "core: Fix ABI mismatch of ao2_global_obj." into 17 2019-09-25 08:10:40 -05:00
George Joseph 93973eb90f Merge "res_pjsip_pubsub: change warning to debug" into 17 2019-09-25 07:04:28 -05:00
Friendly Automation d8523dccb7 Merge "taskprocessor.c: Add CLI commands to reset taskprocessor stats." into 17 2019-09-25 06:43:05 -05:00
Sean Bright 7550a82fe0 res_musiconhold: Add new 'playlist' mode
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
2019-09-25 06:23:58 -05:00
Sean Bright 51cf060c6c res_pjsip_registrar: Validate Contact URI before adding to responses
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
2019-09-25 06:21:06 -05:00
Friendly Automation 5b8e0fef34 Merge "core: Add AO2_ALLOC_OPT_NO_REF_DEBUG option." into 17 2019-09-25 06:02:19 -05:00
George Joseph ad4a358595 Merge "pjproject_bundled: Revert pjproject 2.9 commits causing leaks" into 17 2019-09-24 15:37:27 -05:00
Kevin Harwell 175a7ccac7 res_pjsip_pubsub: change warning to debug
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
2019-09-24 11:24:30 -05:00
Corey Farrell 5bedd4a9b4 core: Fix ABI mismatch of ao2_global_obj.
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
2019-09-24 11:20:12 -05:00
Ben Ford f181dfc065 taskprocessor.c: Add CLI commands to reset taskprocessor stats.
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
2019-09-24 10:42:16 -05:00
George Joseph d95a76edd3 Merge "astmm.c: Display backtrace with memory show allocations" into 17 2019-09-24 08:27:49 -05:00
George Joseph 7c0435f854 pjproject_bundled: Revert pjproject 2.9 commits causing leaks
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/6002
https://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/6014
https://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
2019-09-24 08:16:22 -05:00
Friendly Automation 3b485b3e5a Merge "res_sorcery_memory_cache: stale item update leak" into 17 2019-09-24 08:14:10 -05:00
Kevin Harwell 1d322dc071 Merge "stasis: refcounter.py can incorrectly report skewed objects." into 17 2019-09-23 15:45:50 -05:00
Friendly Automation 09d211b611 Merge "app_voicemail: Fix module unload leak." into 17 2019-09-23 13:27:01 -05:00
Corey Farrell ec712cfab2
core: Add AO2_ALLOC_OPT_NO_REF_DEBUG option.
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
2019-09-23 13:34:33 -04:00
Kevin Harwell f821e81071 res_sorcery_memory_cache: stale item update leak
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
2019-09-23 11:05:34 -05:00
George Joseph b1c5753b78 astmm.c: Display backtrace with memory show allocations
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
2019-09-23 07:25:15 -05:00
Corey Farrell af0ccbc45e stasis: refcounter.py can incorrectly report skewed objects.
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
2019-09-20 08:31:25 -05:00
Corey Farrell fd7fc3d7a5
stasis: Fix leaks
* Release reference returned by cache_remove
* state_alloc unconditionally bumped state_topic even when it was
  locally allocated.

Change-Id: I51101bf7d07b8dc8ce8fc46b6cb31fbbd213fbc7
2019-09-19 18:36:47 -04:00
Corey Farrell 78f329dad9 app_voicemail: Fix module unload leak.
Change-Id: Ib9a06565b9a178822d3bbb67eccf51432e12d84a
2019-09-19 11:16:05 -05:00
Joshua Colp 6e75e2565d Merge "func_jitterbuffer: Add audio/video sync support." into 17 2019-09-19 08:22:58 -05:00
Joshua Colp d2087607b6 Merge "core: Add H.265/HEVC passthrough support" into 17 2019-09-19 06:34:21 -05:00
Joshua Colp 926053d7bd func_jitterbuffer: Add audio/video sync support.
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
2019-09-18 15:24:49 -05:00
Joshua Colp 69e8a44039 Merge "chan_pjsip: Relock correct channel during "fax" redirect." into 17 2019-09-18 15:13:52 -05:00
George Joseph b7e9c8437e Merge "chan_dahdi: Fix build with clang/llvm" into 17 2019-09-17 09:30:11 -05:00
Florian Floimair d7a3e4f5cf core: Add H.265/HEVC passthrough support
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
2019-09-17 13:41:51 +02:00
Joshua Colp 4d1baa3ae8 chan_pjsip: Relock correct channel during "fax" redirect.
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
2019-09-16 08:42:29 -05:00
Guido Falsi 5ff2f7a016 chan_dahdi: Fix build with clang/llvm
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
2019-09-14 10:10:50 -05:00
Ben Ford 1d960195c2 res_rtp_asterisk.c: Send RTCP as compound packets.
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
2019-09-13 09:48:21 -05:00
Sean Bright 2fa296e7d4 channels: Allow updating variable value
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
2019-09-12 15:59:51 -05:00
Friendly Automation cb9fdc21d1 Merge "res_rtp: Add unit tests for RTCP stats." into 17 2019-09-12 15:16:36 -05:00
George Joseph 492da93771 Merge "ChanIsAvail() generates a CDR when unanswered=yes in cdr.conf." into 17 2019-09-11 09:04:06 -05:00
Friendly Automation db1da38649 Merge "res_musiconhold: Added unregister realtime moh class" into 17 2019-09-11 09:02:35 -05:00
Joshua Colp 377f56bdc0 Merge "chan_sip: Update links referenced in deprecation notice" into 17 2019-09-11 07:12:33 -05:00
Joshua Colp 9f5a027aa3 Merge "chan_dahdi: set CHANNEL(hangupsource) when a PRI channel hangs up" into 17 2019-09-11 07:09:19 -05:00
Joshua Colp e82a765169 Merge "codec_resample: Ensure OUTSIDE_SPEEX is defined when necessary" into 17 2019-09-11 06:19:38 -05:00
sungtae kim 9e26136ee6 res_musiconhold: Added unregister realtime moh class
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
2019-09-11 02:31:48 -05:00
Ben Ford 5dad4f4ea1 res_rtp: Add unit tests for RTCP stats.
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
2019-09-10 13:10:59 -05:00
Frederic LE FOLL 50997de887 ChanIsAvail() generates a CDR when unanswered=yes in cdr.conf.
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
2019-09-10 11:45:14 -05:00
Frederic LE FOLL 9e67c92502 chan_dahdi: set CHANNEL(hangupsource) when a PRI channel hangs up
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
2019-09-10 10:59:02 -05:00
George Joseph 44068cc6bf ARI: External Media
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
2019-09-10 10:44:00 -05:00
Friendly Automation 03625b4bc6 Merge "test_utils.c: Skip test adsi_loaded_test if module not loaded." into 17 2019-09-10 08:32:57 -05:00
Friendly Automation 70ebcf26c0 Merge "chan_unistim: Fix clang warning: variable sized type not at end of a struct" into 17 2019-09-10 08:32:22 -05:00
George Joseph c060ef7dee chan_sip: Update links referenced in deprecation notice
The links in the deprecation notice were the shortened
variety but it makes better sense to show the unshortened
links as they're more descriptive.

I.E.
wiki.asterisk.org/wiki/display/AST/Migrating+from+chan_sip+to+res_pjsip
rather than
wiki.asterisk.org/wiki/x/tAHOAQ

Change-Id: If2da5d5243e2d4a6f193b15691d23e7e5a7c57a9
2019-09-10 06:34:55 -06:00
Sean Bright 75d6418d8e codec_resample: Ensure OUTSIDE_SPEEX is defined when necessary
ASTERISK-28511

Change-Id: If0d58598ce14aad3c786a1c0127b5f7b200b737d
2019-09-08 10:54:02 -05:00
George Joseph e35918235e Merge "AST-2019-005 - translate: Don't assume all frames will have a src." into 17 2019-09-05 07:52:30 -05:00
Joshua Colp 61c01df560 AST-2019-005 - translate: Don't assume all frames will have a src.
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
2019-09-05 05:28:20 -05:00
Kevin Harwell 9d4f1e8ebe AST-2019-004 - res_pjsip_t38.c: Add NULL checks before using session media
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
2019-09-05 05:25:19 -05:00
Chris-Savinovich 7d99710fa6 test_utils.c: Skip test adsi_loaded_test if module not loaded.
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
2019-09-04 16:51:57 -05:00
Igor Goncharovsky 056ddf76ce chan_unistim: Fix clang warning: variable sized type not at end of a struct
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
2019-09-03 22:59:52 -05:00
George Joseph 16ae4cd2db Merge "res_pjsip_mwi: add better handling of solicited vs unsolicited subscriptions" into 17 2019-09-03 05:34:51 -05:00
George Joseph 2cd5b84af8 Merge "chan_unistim: Fix code, causing all incoming DTMF sent back to asterisk" into 17 2019-09-03 05:31:54 -05:00
George Joseph 0aae0499da Merge "codec_resample: Upgrade speex_resample to fix up-sampling bug" into 17 2019-08-30 07:45:31 -05:00
Kevin Harwell a36fb473fe res_pjsip_mwi: add better handling of solicited vs unsolicited subscriptions
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
2019-08-28 18:21:33 -05:00
Igor Goncharovsky 95b3c9839d chan_unistim: Fix code, causing all incoming DTMF sent back to asterisk
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
2019-08-27 02:53:08 -05:00
Igor Goncharovsky e7f1f7eefd chan_unistim: Fix RTP port byte order for big-endian arch
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
2019-08-26 04:49:14 -05:00
Sean Bright 34ab9964f5 codec_resample: Upgrade speex_resample to fix up-sampling bug
ASTERISK-28511 #close

Change-Id: Idd07bf341e89ac999c7f5701d9b72b8a9cb11e82
2019-08-23 16:39:50 -05:00
Friendly Automation 7f64921a37 Merge "Fix misname 'res_external_mwi' to 'res_mwi_external' in comments." into 17 2019-08-23 07:51:54 -05:00
Friendly Automation e33ab894bf Merge "pjproject: Configurable setting for cnonce to include hyphens or not" into 17 2019-08-22 19:49:58 -05:00
Alexei Gradinari a0b0c7540c Fix misname 'res_external_mwi' to 'res_mwi_external' in comments.
Change-Id: Ic784be8500e5cb75dcb34bae9f03cfd93b6b34fb
2019-08-22 19:04:42 -05:00
George Joseph 581ffdf6a9 chan_rtp: Accept hostname as well as ip address as destination
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
2019-08-22 07:39:12 -05:00
George Joseph b3d9f6ef6c dns_core: Create new API ast_dns_resolve_ipv6_and_ipv4
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
2019-08-22 07:33:33 -05:00
Dan Cropp a1d38e19a2 pjproject: Configurable setting for cnonce to include hyphens or not
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
2019-08-21 18:44:17 -05:00
Friendly Automation 61edef60a1 Merge "res_pjsip: Channel variable SIPFROMDOMAIN" into 17 2019-08-21 09:03:44 -05:00
Friendly Automation 8f7052f8dc Merge "res_ari.c: Prefer exact handler match over wildcard" into 17 2019-08-21 07:48:56 -05:00
Stas Kobzar 3a246c2a69 res_pjsip: Channel variable SIPFROMDOMAIN
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
2019-08-21 07:05:14 -05:00
George Joseph f6ab42df26 res_ari.c: Prefer exact handler match over wildcard
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
2019-08-20 13:19:16 -05:00
Sean Bright e123d1ccc5 audiohook.c: Substitute silence for unavailable audio frames
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
2019-08-20 08:43:48 -05:00
Alexei Gradinari 052ab9d966 app_voicemail/IMAP: check mailstream not NULL in leave_voicemail
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
2019-08-15 09:47:52 -05:00
Sean Bright a5f05eed70 menuselect: Fix curses build on Gentoo Linux
Because keypad() is exported by libtinfo, it needs to be explicitly
added to the linker options.

ASTERISK-28487 #close

Change-Id: I6c2ad5b95f422c263d078b5c0e84c111807dffc6
2019-08-09 10:08:41 -05:00
George Joseph 5c9ae25090 Merge "srtp: Fix possible race condition, and add NULL checks" into 17 2019-08-09 07:51:44 -05:00
George Joseph 71f89ce175 Merge "cdr / cel: Use event time at event creation instead of processing." into 17 2019-08-08 13:26:06 -05:00
George Joseph 5489ad5574 CI: Escape backslashes in printenv/sort/tr
Change-Id: I52be64c8f6af2bbe15148a856d1f10cb113e1e94
(cherry picked from commit c6558e09af)
2019-08-08 12:15:26 -05:00
Kevin Harwell 5daa9bbaee srtp: Fix possible race condition, and add NULL checks
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
2019-08-08 11:31:00 -05:00
George Joseph aa44e723c5 CI: Add "throttle" label and "skip_gate" capability
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
2019-08-08 09:49:06 -05:00
Friendly Automation 90a14a0a90 Merge "app_voicemail: Remove extra menuselect build options" into 17 2019-08-08 06:44:14 -05:00
Friendly Automation b4ab3dab90 Merge "CI: Make node labels job-specific" into 17 2019-08-07 11:19:18 -05:00
Joshua Colp 108b1abbd9 cdr / cel: Use event time at event creation instead of processing.
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
2019-08-07 04:48:34 -06:00
George Joseph ec7cd3b0a5 Merge "res_musiconhold: Use a vector instead of custom array allocation" into 17 2019-08-06 11:05:39 -05:00
George Joseph 8652140794 CI: Make node labels job-specific
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
2019-08-06 09:51:34 -06:00
Friendly Automation 261cb42ccb Merge "various modules: json integer overflow" into 17 2019-08-06 10:08:07 -05:00
Friendly Automation a2a4e9c717 Merge "main/udptl.c: correctly handle udptl sequence wrap around" into 17 2019-08-06 09:34:08 -05:00
Sean Bright 87f8ca2812 app_voicemail: Remove extra menuselect build options
You now select voicemail backends like normal dialplan applications, so
there is no longer a need for their own menuselect category.

Reported by snuff-work in #asterisk-dev

Change-Id: Idfa4c9c8349726074318a9e6b68d24c374521005
2019-08-06 09:21:18 -04:00
Kevin Harwell a305f2fdcb various modules: json integer overflow
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
2019-08-01 15:31:34 -06:00
Sean Bright 1976db6ffd res_musiconhold: Use a vector instead of custom array allocation
Change-Id: Ic476a56608b1820ca93dcf68d10cd76fc0b94141
2019-08-01 13:44:16 -06:00
Joshua Colp 20459d4cac res_pjsip: Fix multiple of the same contact in "pjsip show contacts".
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
2019-08-01 04:11:49 -06:00
George Joseph 7300bdd382 Merge "loader.c: Fix possible SEGV when a module fails to register" into 17 2019-07-31 08:56:52 -05:00
George Joseph cccad75517 Merge "res_musiconhold: Use ast_pipe_nonblock() wrapper" into 17 2019-07-31 08:56:14 -05:00
Torrey Searle 44af3e9018 main/udptl.c: correctly handle udptl sequence wrap around
incorrect handling of UDPTL squence number wrap arounds causes
loss of packets every time the wrap around occurs

ASTERISK-28483 #close

Change-Id: I33caeb2bf13c574a1ebb81714b58907091d64234
2019-07-30 06:48:59 -06:00
Sean Bright c748187bbf manager: Send fewer packets
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
2019-07-29 12:09:49 -06:00
Asterisk Development Team f1e0c9d1b8 Update CHANGES and UPGRADE.txt for 17.0.0 2019-07-29 11:46:38 -05:00
George Joseph 4f2ad5a55d doc: Add "master-only" flag back to the CHANGES and UPGRADE files
In order to run the documentation scripts the flags needs to be
added back to the staging files.

Change-Id: Ia10a153c50c970cfa1e85815208dfaddb3f2ccd4
2019-07-29 10:10:28 -06:00
Sean Bright a66ccb90ac res_musiconhold: Use ast_pipe_nonblock() wrapper
Change-Id: Ib0a4b41e5ececbe633079e2d8c2b66c031d2d1f2
2019-07-29 09:04:38 -06:00
George Joseph e821a637a8 loader.c: Fix possible SEGV when a module fails to register
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
2019-07-29 07:39:08 -06:00
George Joseph 80d8dce6af Prepare Asterisk 17 Branch
Change-Id: Idb79a69646d2511e7bf1573b9b0322cc22ea54e8
2019-07-26 12:06:57 -06:00
211 changed files with 98106 additions and 1911 deletions

View File

@ -1,5 +1,5 @@
[gerrit]
defaultbranch=master
defaultbranch=17
#
# Intentional padding to ensure it is possible to point a commit
# to an alternative gerrit server/repository without breaking

1
.lastclean Normal file
View File

@ -0,0 +1 @@
40

1
.version Normal file
View File

@ -0,0 +1 @@
17.1.0

225
CHANGES
View File

@ -12,6 +12,231 @@
===
==============================================================================
------------------------------------------------------------------------------
--- Functionality changes from Asterisk 17.0.0 to Asterisk 17.1.0 ------------
------------------------------------------------------------------------------
ARI Channels
------------------
* 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.
Core
------------------
* H.265/HEVC is now a supported video codec and it can be used by
specifying "h265" in the allow line.
Please note however, that handling of the additional SDP parameters
described in RFC 7798 section 7.2 is not yet supported.
app_mixmonitor
------------------
* An option 'S' has been added to MixMonitor. If used in combination with
the r() and/or t() options, if a frame is available to write to one of
those files but not the other, a frame of silence if written to the file
that does not have an audio frame. This should prevent the two files
from "drifting" when mixed after the fact.
app_voicemail
------------------
* A feature was added in Asterisk 13.27.0 and 16.4.0 that removed lock files from
the Asterisk voicemail directory on startup. Some users that store their
voicemails on network storage devices experienced slow startup times due to the
relative expense of traversing the voicemail directory structure looking for
orphaned lock files. This feature has now been removed.
Users who require the lock files to be removed at startup should modify their
startup scripts to do so before starting the asterisk process.
chan_pjsip
------------------
* A new dialplan function, PJSIP_MOH_PASSTRHOUGH, has been added to chan_pjsip. This
allows the behaviour of the moh_passthrough endpoint option to be read or changed
in the dialplan. This allows control on a per-call basis.
chan_rtp
------------------
* 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.
func_curl
------------------
* A new parameter, httpheader, has been added to CURLOPT function. This parameter
allows to set custom http headers for subsequent calls off CURL function.
Any setting of headers will replace the default curl headers
(e.g. "Content-type: application/x-www-form-urlencoded")
func_jitterbuffer
------------------
* The JITTERBUFFER dialplan function now has an option to enable video synchronization
support. When enabled and used with a compatible channel driver (chan_sip, chan_pjsip)
the video is buffered according to the size of the audio jitterbuffer and is
synchronized to the audio.
res_musiconhold
------------------
* 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.
* A new mode - playlist - has been added to res_musiconhold. This mode allows the
user to specify the files (or URLs) to play explicitly by putting them directly
in musiconhold.conf.
taskprocessor.c
------------------
* 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.
* 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.
------------------------------------------------------------------------------
--- New functionality introduced in Asterisk 17.0.0 --------------------------
------------------------------------------------------------------------------
Bridging
------------------
* The bridging core no longer uses the stasis cache for bridge
snapshots. The latest bridge snapshot is now stored on the
ast_bridge structure itself.
The following APIs are no longer available since the stasis cache
is no longer used:
ast_bridge_topic_cached()
ast_bridge_topic_all_cached()
A topic pool is now used for individual bridge topics.
The ast_bridge_cache() function was removed since there's no
longer a separate container of snapshots.
A new function "ast_bridges()" was created to retrieve the
container of all bridges. Users formerly calling
ast_bridge_cache() can use the new function to iterate over
bridges and retrieve the latest snapshot directly from the
bridge.
The ast_bridge_snapshot_get_latest() function was renamed to
ast_bridge_get_snapshot_by_uniqueid().
A new function "ast_bridge_get_snapshot()" was created to retrieve
the bridge snapshot directly from the bridge structure.
The ast_bridge_topic_all() function now returns a normal topic
not a cached one so you can't use stasis cache functions on it
either.
The ast_bridge_snapshot_type() stasis message now has the
ast_bridge_snapshot_update structure as it's data. It contains
the last snapshot and the new one.
Channels
------------------
* The core no longer uses the stasis cache for channels snapshots.
The following APIs are no longer available:
ast_channel_topic_cached()
ast_channel_topic_all_cached()
The ast_channel_cache_all() and ast_channel_cache_by_name() functions
now returns an ao2_container of ast_channel_snapshots rather than a
container of stasis_messages therefore you can't call stasis_cache
functions on it.
The ast_channel_topic_all() function now returns a normal topic,
not a cached one so you can't use stasis cache functions on it either.
The ast_channel_snapshot_type() stasis message now has the
ast_channel_snapshot_update structure as it's data.
ast_channel_snapshot_get_latest() still returns the latest snapshot.
chan_sip
------------------
* The chan_sip module is now deprecated, users should migrate to the
replacement module chan_pjsip. See guides at the Asterisk Wiki:
https://wiki.asterisk.org/wiki/x/tAHOAQ
https://wiki.asterisk.org/wiki/x/hYCLAQ
------------------------------------------------------------------------------
--- Functionality changes from Asterisk 16.0.0 to Asterisk 17.0.0 ------------
------------------------------------------------------------------------------
AttendedTransfer
------------------
* A new application, this will queue up attended transfer to the given extension.
BlindTransfer
------------------
* A new application, this will redirect all channels currently
bridged to the caller channel to the specified destination.
ConfBridge
------------------
* Add "average_all", "highest_all", and "lowest_all" values for
the remb_behavior option. These values operate on a bridge
level instead of a per-source level. This means that a single
REMB value is calculated and sent to every sender, instead of
a REMB value that is unique for the specific sender..
Dial
------------------
* Add RINGTIME and RINGTIME_MS variables containing respectively seconds and
milliseconds between creation of the dialing channel and receiving the first
RINGING signal
Add PROGRESSTIME and PROGRESSTIME_MS variables analogous to the above with respect to
the PROGRESS signal. Shorter of these two times should be equivalent to
the PDD (Post Dial Delay) value
Add DIALEDTIME_MS and ANSWEREDTIME_MS variables to get millisecond resolution
versions of DIALEDTIME and ANSWEREDTIME
RTP/ICE
------------------
* You can now indicate that you'd like an ice_host_candidate's local address
to be published as well as the mapped address. See the sample rtp.conf
for more information.
ReadExten
------------------
* Add 'p' option to stop reading extension if user presses '#' key.
pbx_dundi
------------------
* The DUNDi PBX module now supports IPv4/IPv6 dual binding.
res_pjsip
------------------
* 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.
res_rtp_asterisk
------------------
* DTLS packets will now be fragmented according to the MTU as set in rtp.conf. This
allows larger certificates to be used for the DTLS negotiation. By default this value
is 1200.
------------------------------------------------------------------------------
--- Functionality changes from Asterisk 16.2.0 to Asterisk 16.3.0 ----------
------------------------------------------------------------------------------

87710
ChangeLog Normal file

File diff suppressed because it is too large Load Diff

View File

@ -332,7 +332,7 @@ Data: echo hello world!
```
This manager command will attempt to execute an Asterisk application, System,
which is normally associated with the "system" class authorication. While some
which is normally associated with the "system" class authorization. While some
checks have been put into Asterisk to take this into account, certain dialplan
configurations and/or clever manipulation of the Originate manager action can
circumvent these checks. For example, take the following dialplan:
@ -365,7 +365,7 @@ set channel variables; which allows the execution of dialplan functions.
Dialplan functions within Asterisk are incredibly powerful, which is wonderful
for building applications using Asterisk. But during the read or write
execution, certain diaplan functions do much more. For example, reading the
execution, certain dialplan functions do much more. For example, reading the
SHELL() function can execute arbitrary commands on the system Asterisk is
running on. Writing to the FILE() function can change any file that Asterisk has
write access to.

View File

@ -18,6 +18,128 @@
===
===========================================================
------------------------------------------------------------------------------
--- Functionality changes from Asterisk 17.0.0 to Asterisk 17.1.0 ------------
------------------------------------------------------------------------------
AMI
------------------
* The AMI Originate action, which optionally takes a dialplan application as
an argument, no longer accepts "Originate" as the application due to
security concerns.
------------------------------------------------------------------------------
--- New functionality introduced in Asterisk 17.0.0 --------------------------
------------------------------------------------------------------------------
Applications
------------------
* The JabberStatus application, deprecated in Asterisk 12, has been removed.
Bridging
------------------
* The bridging core no longer uses the stasis cache for bridge
snapshots. The latest bridge snapshot is now stored on the
ast_bridge structure itself.
The following APIs are no longer available since the stasis cache
is no longer used:
ast_bridge_topic_cached()
ast_bridge_topic_all_cached()
A topic pool is now used for individual bridge topics.
The ast_bridge_cache() function was removed since there's no
longer a separate container of snapshots.
A new function "ast_bridges()" was created to retrieve the
container of all bridges. Users formerly calling
ast_bridge_cache() can use the new function to iterate over
bridges and retrieve the latest snapshot directly from the
bridge.
The ast_bridge_snapshot_get_latest() function was renamed to
ast_bridge_get_snapshot_by_uniqueid().
A new function "ast_bridge_get_snapshot()" was created to retrieve
the bridge snapshot directly from the bridge structure.
The ast_bridge_topic_all() function now returns a normal topic
not a cached one so you can't use stasis cache functions on it
either.
The ast_bridge_snapshot_type() stasis message now has the
ast_bridge_snapshot_update structure as it's data. It contains
the last snapshot and the new one.
Build
------------------
* Asterisk headers are no longer installed and uninstalled automatically when
performing a "make install" or a "make uninstall". To install/uninstall the
headers, use "make install-headers" and "make uninstall-headers". The headers
also continue to be uninstalled when performing a "make uninstall-all".
Channels
------------------
* The core no longer uses the stasis cache for channels snapshots.
The following APIs are no longer available:
ast_channel_topic_cached()
ast_channel_topic_all_cached()
The ast_channel_cache_all() and ast_channel_cache_by_name() functions
now returns an ao2_container of ast_channel_snapshots rather than a
container of stasis_messages therefore you can't call stasis_cache
functions on it.
The ast_channel_topic_all() function now returns a normal topic,
not a cached one so you can't use stasis cache functions on it either.
The ast_channel_snapshot_type() stasis message now has the
ast_channel_snapshot_update structure as it's data.
ast_channel_snapshot_get_latest() still returns the latest snapshot.
chan_sip
------------------
* The chan_sip module is now deprecated, users should migrate to the
replacement module chan_pjsip. See guides at the Asterisk Wiki:
https://wiki.asterisk.org/wiki/x/tAHOAQ
https://wiki.asterisk.org/wiki/x/hYCLAQ
func_callerid
------------------
* The CALLERPRES() dialplan function, deprecated in Asterisk 1.8, has been
removed.
res_parking
------------------
* The PARKINGSLOT channel variable, deprecated in Asterisk 12 in favor of the
PARKING_SPACE channel variable, will no longer be set.
res_xmpp
------------------
* The JabberStatus application, deprecated in Asterisk 12, has been removed.
------------------------------------------------------------------------------
--- Functionality changes from Asterisk 16.0.0 to Asterisk 17.0.0 ------------
------------------------------------------------------------------------------
Core
------------------
* res_pjsip_pubsub is now required so call transfer progress can be monitored
and reported in the channel variable TRANSFERSTATUS.
app_voicemail.c
------------------
* The "Voicemail Build Options" section of menuselect has been removed along with
the FILE_STORAGE, ODBC_STORAGE and IMAP_STORAGE menuselect options. All 3 variants
of the voicemail app can now be built at the same by enabling app_voicemail,
app_voicemail_imap, and app_voicemail_odbc under the "Applications" section.
By default, only app_voicemail is enabled. Also, the modules.conf sample has
been updated to "noload" app_voicemail_imap and app_voicemail_odbc should they
all be built. Packagers must update their build scripts appropriately.
chan_pjsip
------------------
* res_pjsip_pubsub is now required so call transfer progress can be monitored
and reported in the channel variable TRANSFERSTATUS.
New in 16.0.0:
app_fax:

View File

@ -173,7 +173,9 @@ static int mysql_log(struct ast_cdr *cdr)
{
struct ast_str *sql1 = ast_str_thread_get(&sql1_buf, 1024), *sql2 = ast_str_thread_get(&sql2_buf, 1024);
int retries = 5;
#if MYSQL_VERSION_ID >= 50013
#ifdef HAVE_MYSQLCLIENT_BOOL
bool my_bool_true = 1;
#elif HAVE_MYSQLCLIENT_MY_BOOL
my_bool my_bool_true = 1;
#endif
@ -382,6 +384,13 @@ static int my_unload_module(int reload)
{
struct column *entry;
if (!reload) {
if (ast_cdr_unregister(name)) {
/* If we can't unregister the backend, we can't unload the module */
return -1;
}
}
ast_cli_unregister_multiple(cdr_mysql_status_cli, sizeof(cdr_mysql_status_cli) / sizeof(struct ast_cli_entry));
if (connected) {
@ -406,7 +415,8 @@ static int my_unload_module(int reload)
if (reload) {
return ast_cdr_backend_suspend(name);
} else {
return ast_cdr_unregister(name);
/* We unregistered earlier */
return 0;
}
}
@ -460,7 +470,9 @@ static int my_connect_db(struct ast_config *cfg)
MYSQL_ROW row;
MYSQL_RES *result;
char sqldesc[128];
#if MYSQL_VERSION_ID >= 50013
#ifdef HAVE_MYSQLCLIENT_BOOL
bool my_bool_true = 1;
#elif HAVE_MYSQLCLIENT_MY_BOOL
my_bool my_bool_true = 1;
#endif

View File

@ -536,11 +536,6 @@ static struct ast_channel *ooh323_new(struct ooh323_pvt *i, int state,
ch = NULL;
}
}
if (ch) {
ast_publish_channel_state(ch);
}
} else {
ao2_cleanup(caps);
ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
@ -2225,7 +2220,7 @@ int onCallEstablished(ooCallData *call)
}
ast_queue_control(c, AST_CONTROL_ANSWER);
ast_publish_channel_state(c);
ast_channel_publish_snapshot(c);
ast_channel_unlock(p->owner);
}
ast_mutex_unlock(&p->lock);

View File

@ -1457,9 +1457,9 @@ static void send_agent_logoff(struct ast_channel *chan, const char *agent, long
ast_assert(agent != NULL);
blob = ast_json_pack("{s: s, s: i}",
blob = ast_json_pack("{s: s, s: I}",
"agent", agent,
"logintime", logintime);
"logintime", (ast_json_int_t)logintime);
if (!blob) {
return;
}

View File

@ -162,8 +162,10 @@ static int dfltMaxWaitTimeForFrame = 50;
static void isAnsweringMachine(struct ast_channel *chan, const char *data)
{
int res = 0;
int audioFrameCount = 0;
struct ast_frame *f = NULL;
struct ast_dsp *silenceDetector = NULL;
struct timeval amd_tvstart;
int dspsilence = 0, framelength = 0;
RAII_VAR(struct ast_format *, readFormat, NULL, ao2_cleanup);
int inInitialSilence = 1;
@ -275,6 +277,9 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data)
/* Set silence threshold to specified value */
ast_dsp_set_threshold(silenceDetector, silenceThreshold);
/* Set our start time so we can tie the loop to real world time and not RTP updates */
amd_tvstart = ast_tvnow();
/* Now we go into a loop waiting for frames from the channel */
while ((res = ast_waitfor(chan, 2 * maxWaitTimeForFrame)) > -1) {
int ms = 0;
@ -293,7 +298,24 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data)
break;
}
if (f->frametype == AST_FRAME_VOICE || f->frametype == AST_FRAME_NULL || f->frametype == AST_FRAME_CNG) {
/* Check to make sure we haven't gone over our real-world timeout in case frames get stalled for whatever reason */
if ( (ast_tvdiff_ms(ast_tvnow(), amd_tvstart)) > totalAnalysisTime ) {
ast_frfree(f);
strcpy(amdStatus , "NOTSURE");
if ( audioFrameCount == 0 ) {
ast_verb(3, "AMD: Channel [%s]. No audio data received in [%d] seconds.\n", ast_channel_name(chan), totalAnalysisTime);
sprintf(amdCause , "NOAUDIODATA-%d", iTotalTime);
break;
}
ast_verb(3, "AMD: Channel [%s]. Timeout...\n", ast_channel_name(chan));
sprintf(amdCause , "TOOLONG-%d", iTotalTime);
break;
}
if (f->frametype == AST_FRAME_VOICE || f->frametype == AST_FRAME_CNG) {
/* keep track of the number of audio frames we get */
audioFrameCount++;
/* Figure out how long the frame is in milliseconds */
if (f->frametype == AST_FRAME_VOICE) {
framelength = (ast_codec_samples_count(f) / DEFAULT_SAMPLES_PER_MS);

View File

@ -119,13 +119,13 @@ struct app_cdr_message_payload {
/*! The name of the channel to be manipulated */
const char *channel_name;
/*! Disable the CDR for this channel */
int disable:1;
unsigned int disable:1;
/*! Re-enable the CDR for this channel */
int reenable:1;
unsigned int reenable:1;
/*! Reset the CDR */
int reset:1;
unsigned int reset:1;
/*! If reseting the CDR, keep the variables */
int keep_variables:1;
unsigned int keep_variables:1;
};
static void appcdr_callback(void *data, struct stasis_subscription *sub, struct stasis_message *message)

View File

@ -178,6 +178,9 @@ static int chanavail_exec(struct ast_channel *chan, const char *data)
snprintf(tmp, sizeof(tmp), "%d", status);
ast_str_append(&tmp_availcause, 0, "%s%s", ast_str_strlen(tmp_availcause) ? "&" : "", tmp);
/* Disable CDR for this temporary channel. */
ast_cdr_set_property(ast_channel_name(tempchan), AST_CDR_FLAG_DISABLE_ALL);
ast_hangup(tempchan);
tempchan = NULL;

View File

@ -149,7 +149,8 @@ static int dictate_exec(struct ast_channel *chan, const char *data)
ast_mkdir(base, 0755);
len = strlen(base) + strlen(filein) + 2;
if (!path || len > maxlen) {
path = ast_alloca(len);
ast_free(path);
path = ast_malloc(len);
memset(path, 0, len);
maxlen = len;
} else {
@ -334,6 +335,7 @@ static int dictate_exec(struct ast_channel *chan, const char *data)
ast_frfree(f);
}
}
ast_free(path);
if (oldr) {
ast_set_read_format(chan, oldr);
ao2_ref(oldr, -1);

View File

@ -408,7 +408,6 @@ static int reload_followme(int reload)
char *cat = NULL, *tmp;
struct ast_variable *var;
struct number *cur, *nm;
char *numberstr;
int timeout;
int numorder;
const char* enable_callee_prompt_str;
@ -536,9 +535,12 @@ static int reload_followme(int reload)
while (var) {
if (!strcasecmp(var->name, "number")) {
int idx = 0;
char copy[strlen(var->value) + 1];
char *numberstr;
/* Add a new number */
numberstr = ast_strdupa(var->value);
strcpy(copy, var->value); /* safe */
numberstr = copy;
if ((tmp = strchr(numberstr, ','))) {
*tmp++ = '\0';
timeout = atoi(tmp);
@ -762,10 +764,6 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
}
tmpto = to;
if (to < 0) {
to = 1000;
tmpto = 1000;
}
towas = to;
winner = ast_waitfor_n(watchers, pos, &to);
tmpto -= to;

View File

@ -1165,7 +1165,7 @@ static int meetme_stasis_init(void)
STASIS_MESSAGE_TYPE_INIT(meetme_talk_request_type);
meetme_event_message_router = stasis_message_router_create(
ast_channel_topic_all_cached());
ast_channel_topic_all());
if (!meetme_event_message_router) {
meetme_stasis_cleanup();

View File

@ -2652,9 +2652,10 @@ static int create_vmaccount(char *name, struct ast_variable *var, int realtime)
ast_copy_string(vmu->fullname, var->value, sizeof(vmu->fullname));
} else if (!strcasecmp(var->name, "setvar")) {
char *varval;
char *varname = ast_strdupa(var->value);
char varname[strlen(var->value) + 1];
struct ast_variable *tmpvar;
strcpy(varname, var->value); /* safe */
if ((varval = strchr(varname, '='))) {
*varval = '\0';
varval++;

View File

@ -115,6 +115,11 @@
Like with the basic filename argument, if an absolute path isn't given, it will create
the file in the configured monitoring directory.</para>
</option>
<option name="S">
<para>When combined with the <replaceable>r</replaceable> or <replaceable>t</replaceable>
option, inserts silence when necessary to maintain synchronization between the receive
and transmit audio streams.</para>
</option>
<option name="i">
<argument name="chanvar" required="true" />
<para>Stores the MixMonitor's ID on this channel variable.</para>
@ -347,7 +352,8 @@ enum mixmonitor_flags {
MUXFLAG_VMRECIPIENTS = (1 << 10),
MUXFLAG_BEEP = (1 << 11),
MUXFLAG_BEEP_START = (1 << 12),
MUXFLAG_BEEP_STOP = (1 << 13)
MUXFLAG_BEEP_STOP = (1 << 13),
MUXFLAG_RWSYNC = (1 << 14),
};
enum mixmonitor_args {
@ -359,6 +365,7 @@ enum mixmonitor_args {
OPT_ARG_UID,
OPT_ARG_VMRECIPIENTS,
OPT_ARG_BEEP_INTERVAL,
OPT_ARG_RWSYNC,
OPT_ARG_ARRAY_SIZE, /* Always last element of the enum */
};
@ -375,6 +382,7 @@ AST_APP_OPTIONS(mixmonitor_opts, {
AST_APP_OPTION_ARG('t', MUXFLAG_WRITE, OPT_ARG_WRITENAME),
AST_APP_OPTION_ARG('i', MUXFLAG_UID, OPT_ARG_UID),
AST_APP_OPTION_ARG('m', MUXFLAG_VMRECIPIENTS, OPT_ARG_VMRECIPIENTS),
AST_APP_OPTION_ARG('S', MUXFLAG_RWSYNC, OPT_ARG_RWSYNC),
});
struct mixmonitor_ds {
@ -962,6 +970,9 @@ static int launch_monitor_thread(struct ast_channel *chan, const char *filename,
}
ast_set_flag(&mixmonitor->audiohook, AST_AUDIOHOOK_TRIGGER_SYNC);
if ((ast_test_flag(mixmonitor, MUXFLAG_RWSYNC))) {
ast_set_flag(&mixmonitor->audiohook, AST_AUDIOHOOK_SUBSTITUTE_SILENCE);
}
if (readvol)
mixmonitor->audiohook.options.read_volume = readvol;

View File

@ -173,7 +173,10 @@ static int s_streamwait3(const say_args_t *a, const char *fn)
static int do_say(say_args_t *a, const char *s, const char *options, int depth)
{
struct ast_variable *v;
char *lang, *x, *rule = NULL;
char *lang;
char *x;
char *rule = NULL;
char *rule_head = NULL;
int ret = 0;
struct varshead head = { .first = NULL, .last = NULL };
struct ast_var_t *n;
@ -195,7 +198,7 @@ static int do_say(say_args_t *a, const char *s, const char *options, int depth)
for (;;) {
for (v = ast_variable_browse(say_cfg, lang); v ; v = v->next) {
if (ast_extension_match(v->name, s)) {
rule = ast_strdupa(v->value);
rule_head = rule = ast_strdup(v->value);
break;
}
}
@ -220,6 +223,7 @@ static int do_say(say_args_t *a, const char *s, const char *options, int depth)
n = ast_var_assign("SAY", s);
if (!n) {
ast_log(LOG_ERROR, "Memory allocation error in do_say\n");
ast_free(rule_head);
return -1;
}
AST_LIST_INSERT_HEAD(&head, n, entries);
@ -281,6 +285,7 @@ static int do_say(say_args_t *a, const char *s, const char *options, int depth)
}
}
ast_var_delete(n);
ast_free(rule_head);
return ret;
}

View File

@ -4904,7 +4904,7 @@ static void rna(int rnatime, struct queue_ent *qe, struct ast_channel *peer, cha
ast_verb(3, "Auto-Pausing Queue Member %s in all queues since they failed to answer on queue %s.\n",
interface, qe->parent->name);
} else {
ast_verb(3, "Failed to pause Queue Member %s in all queues!\n", interface);
ast_verb(3, "Failed to pause Queue Member %s in all queues!\n", interface);
}
}
}
@ -5898,12 +5898,12 @@ static void send_agent_complete(const char *queuename, struct ast_channel_snapsh
break;
}
blob = ast_json_pack("{s: s, s: s, s: s, s: i, s: i, s: s}",
blob = ast_json_pack("{s: s, s: s, s: s, s: I, s: I, s: s}",
"Queue", queuename,
"Interface", member->interface,
"MemberName", member->membername,
"HoldTime", (long)(callstart - holdstart),
"TalkTime", (long)(time(NULL) - callstart),
"HoldTime", (ast_json_int_t)(callstart - holdstart),
"TalkTime", (ast_json_int_t)(time(NULL) - callstart),
"Reason", reason ?: "");
queue_publish_multi_channel_snapshot_blob(ast_queue_topic(queuename), caller, peer,
@ -6850,8 +6850,7 @@ static int try_calling(struct queue_ent *qe, struct ast_flags opts, char **opt_a
tmp->lastcall = cur->lastcall;
tmp->lastqueue = cur->lastqueue;
ast_copy_string(tmp->interface, cur->interface, sizeof(tmp->interface));
/* Special case: If we ring everyone, go ahead and ring them, otherwise
just calculate their metric for the appropriate strategy */
/* Calculate the metric for the appropriate strategy. */
if (!calc_metric(qe->parent, cur, x++, qe, tmp)) {
/* Put them in the list of outgoing thingies... We're ready now.
XXX If we're forcibly removed, these outgoing calls won't get
@ -6887,6 +6886,7 @@ static int try_calling(struct queue_ent *qe, struct ast_flags opts, char **opt_a
orig = to;
++qe->pending;
ao2_unlock(qe->parent);
/* Call the queue members with the best metric now. */
ring_one(qe, outgoing, &numbusies);
lpeer = wait_for_answer(qe, outgoing, &to, &digit, numbusies,
ast_test_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT),
@ -7174,12 +7174,12 @@ static int try_calling(struct queue_ent *qe, struct ast_flags opts, char **opt_a
ast_queue_log(queuename, ast_channel_uniqueid(qe->chan), member->membername, "CONNECT", "%ld|%s|%ld", (long) (time(NULL) - qe->start), ast_channel_uniqueid(peer),
(long)(orig - to > 0 ? (orig - to) / 1000 : 0));
blob = ast_json_pack("{s: s, s: s, s: s, s: i, s: i}",
blob = ast_json_pack("{s: s, s: s, s: s, s: I, s: I}",
"Queue", queuename,
"Interface", member->interface,
"MemberName", member->membername,
"HoldTime", (long) (time(NULL) - qe->start),
"RingTime", (long)(orig - to > 0 ? (orig - to) / 1000 : 0));
"HoldTime", (ast_json_int_t)(time(NULL) - qe->start),
"RingTime", (ast_json_int_t)(orig - to > 0 ? (orig - to) / 1000 : 0));
queue_publish_multi_channel_blob(qe->chan, peer, queue_agent_connect_type(), blob);
ast_copy_string(oldcontext, ast_channel_context(qe->chan), sizeof(oldcontext));

View File

@ -170,8 +170,7 @@ static int readexten_exec(struct ast_channel *chan, const char *data)
if (timeout <= 0)
timeout = ast_channel_pbx(chan) ? ast_channel_pbx(chan)->rtimeoutms : 10000;
if (digit_timeout <= 0)
digit_timeout = ast_channel_pbx(chan) ? ast_channel_pbx(chan)->dtimeoutms : 5000;
digit_timeout = ast_channel_pbx(chan) ? ast_channel_pbx(chan)->dtimeoutms : 5000;
if (ast_test_flag(&flags, OPT_INDICATION) && !ast_strlen_zero(arglist.filename)) {
ts = ast_get_indication_tone(ast_channel_zone(chan), arglist.filename);

View File

@ -80,6 +80,9 @@
<parameter name="Duration" required="false">
<para>The duration, in milliseconds, of the digit to be played.</para>
</parameter>
<parameter name="Receive" required="false">
<para>Emulate receiving DTMF on this channel instead of sending it out.</para>
</parameter>
</syntax>
<description>
<para>Plays a dtmf digit on the specified channel.</para>
@ -147,6 +150,7 @@ static int manager_play_dtmf(struct mansession *s, const struct message *m)
const char *channel = astman_get_header(m, "Channel");
const char *digit = astman_get_header(m, "Digit");
const char *duration = astman_get_header(m, "Duration");
const char *receive_s = astman_get_header(m, "Receive");
struct ast_channel *chan;
unsigned int duration_ms = 0;
@ -167,7 +171,14 @@ static int manager_play_dtmf(struct mansession *s, const struct message *m)
return 0;
}
ast_senddigit_external(chan, *digit, duration_ms);
if (ast_true(receive_s)) {
struct ast_frame f = { AST_FRAME_DTMF, };
f.len = duration_ms;
f.subclass.integer = *digit;
ast_queue_frame(chan, &f);
} else {
ast_senddigit_external(chan, *digit, duration_ms);
}
chan = ast_channel_unref(chan);

View File

@ -46,39 +46,6 @@
* \verbinclude voicemail.conf.sample
*/
/*** MODULEINFO
<defaultenabled>yes</defaultenabled>
<use type="module">res_adsi</use>
<use type="module">res_smdi</use>
<support_level>core</support_level>
***/
/*** MAKEOPTS
<category name="MENUSELECT_OPTS_app_voicemail" displayname="Voicemail Build Options" positive_output="yes" touch_on_change="apps/app_voicemail.c apps/app_directory.c">
<member name="FILE_STORAGE" displayname="Storage of Voicemail using filesystem">
<conflict>ODBC_STORAGE</conflict>
<conflict>IMAP_STORAGE</conflict>
<defaultenabled>yes</defaultenabled>
<support_level>core</support_level>
</member>
<member name="ODBC_STORAGE" displayname="Storage of Voicemail using ODBC">
<depend>generic_odbc</depend>
<conflict>IMAP_STORAGE</conflict>
<conflict>FILE_STORAGE</conflict>
<defaultenabled>no</defaultenabled>
<support_level>core</support_level>
</member>
<member name="IMAP_STORAGE" displayname="Storage of Voicemail using IMAP4">
<depend>imap_tk</depend>
<conflict>ODBC_STORAGE</conflict>
<conflict>FILE_STORAGE</conflict>
<use type="external">openssl</use>
<defaultenabled>no</defaultenabled>
<support_level>core</support_level>
</member>
</category>
***/
#include "asterisk.h"
#ifdef IMAP_STORAGE
@ -1830,7 +1797,7 @@ static void vm_change_password(struct ast_vm_user *vmu, const char *newpassword)
struct ast_config *cfg = NULL;
struct ast_variable *var = NULL;
struct ast_category *cat = NULL;
char *category = NULL, *value = NULL, *new = NULL;
char *category = NULL;
const char *tmp = NULL;
struct ast_flags config_flags = { CONFIG_FLAG_WITHCOMMENTS };
char secretfn[PATH_MAX] = "";
@ -1857,24 +1824,28 @@ static void vm_change_password(struct ast_vm_user *vmu, const char *newpassword)
if ((cfg = ast_config_load(VOICEMAIL_CONFIG, config_flags)) && valid_config(cfg)) {
while ((category = ast_category_browse(cfg, category))) {
if (!strcasecmp(category, vmu->context)) {
char *value = NULL;
char *new = NULL;
if (!(tmp = ast_variable_retrieve(cfg, category, vmu->mailbox))) {
ast_log(AST_LOG_WARNING, "We could not find the mailbox.\n");
break;
}
value = strstr(tmp, ",");
if (!value) {
new = ast_alloca(strlen(newpassword)+1);
new = ast_malloc(strlen(newpassword) + 1);
sprintf(new, "%s", newpassword);
} else {
new = ast_alloca((strlen(value) + strlen(newpassword) + 1));
new = ast_malloc((strlen(value) + strlen(newpassword) + 1));
sprintf(new, "%s%s", newpassword, value);
}
if (!(cat = ast_category_get(cfg, category, NULL))) {
ast_log(AST_LOG_WARNING, "Failed to get category structure.\n");
ast_free(new);
break;
}
ast_variable_update(cat, vmu->mailbox, new, NULL, 0);
found = 1;
ast_free(new);
}
}
/* save the results */
@ -1898,13 +1869,14 @@ static void vm_change_password(struct ast_vm_user *vmu, const char *newpassword)
for (category = ast_category_browse(cfg, NULL); category; category = ast_category_browse(cfg, category)) {
ast_debug(4, "users.conf: %s\n", category);
if (!strcasecmp(category, vmu->mailbox)) {
char new[strlen(newpassword) + 1];
if (!ast_variable_retrieve(cfg, category, "vmsecret")) {
ast_debug(3, "looks like we need to make vmsecret!\n");
var = ast_variable_new("vmsecret", newpassword, "");
} else {
var = NULL;
}
new = ast_alloca(strlen(newpassword) + 1);
sprintf(new, "%s", newpassword);
if (!(cat = ast_category_get(cfg, category, NULL))) {
ast_debug(4, "failed to get category!\n");
@ -2227,7 +2199,6 @@ static int imap_retrieve_greeting(const char *dir, const int msgnum, struct ast_
struct vm_state *vms_p;
char *file, *filename;
char dest[PATH_MAX];
char *attachment;
int i;
BODY *body;
int ret = 0;
@ -2280,21 +2251,26 @@ static int imap_retrieve_greeting(const char *dir, const int msgnum, struct ast_
mail_fetchstructure(vms_p->mailstream, i + 1, &body);
/* We have the body, now we extract the file name of the first attachment. */
if (body->nested.part && body->nested.part->next && body->nested.part->next->body.parameter->value) {
attachment = ast_strdupa(body->nested.part->next->body.parameter->value);
char *attachment = body->nested.part->next->body.parameter->value;
char copy[strlen(attachment) + 1];
strcpy(copy, attachment); /* safe */
attachment = copy;
filename = strsep(&attachment, ".");
if (!strcmp(filename, file)) {
ast_copy_string(vms_p->fn, dir, sizeof(vms_p->fn));
vms_p->msgArray[vms_p->curmsg] = i + 1;
create_dirpath(dest, sizeof(dest), vmu->context, vms_p->username, "");
save_body(body, vms_p, "2", attachment, 0);
ret = 0;
break;
}
} else {
ast_log(AST_LOG_ERROR, "There is no file attached to this IMAP message.\n");
ret = -1;
break;
}
filename = strsep(&attachment, ".");
if (!strcmp(filename, file)) {
ast_copy_string(vms_p->fn, dir, sizeof(vms_p->fn));
vms_p->msgArray[vms_p->curmsg] = i + 1;
create_dirpath(dest, sizeof(dest), vmu->context, vms_p->username, "");
save_body(body, vms_p, "2", attachment, 0);
ret = 0;
break;
}
}
if (curr_mbox != -1) {
@ -3778,54 +3754,6 @@ static void check_quota(struct vm_state *vms, char *mailbox) {
#endif /* IMAP_STORAGE */
static void cleanup_orphaned_lock_files(const char *base)
{
DIR *dir;
struct dirent *e;
dir = opendir(base);
if (!dir) {
/* Don't complain about this too loudly */
ast_debug(2, "Unable to open `%s': %s\n", base, strerror(errno));
return;
}
while ((e = readdir(dir))) {
char *fullpath;
struct stat s;
/* Always skip . and .. */
if (!strcmp(e->d_name, ".") || !strcmp(e->d_name, "..")) {
continue;
}
/* Build up the full path (using dynamic memory because PATH_MAX is crap) */
if (ast_asprintf(&fullpath, "%s/%s", base, e->d_name) == -1) {
break;
}
if (lstat(fullpath, &s) < 0) {
ast_free(fullpath);
continue;
}
/* This is exposing an implementation detail of ast_lock_path, but it makes
* our life a bit easier */
if (!strcmp(e->d_name, ".lock") && S_ISLNK(s.st_mode)) {
if (!ast_unlock_path(base)) {
ast_log(AST_LOG_NOTICE, "Cleaned up orphaned lock file: %s/.lock\n", base);
}
} else if (S_ISDIR(s.st_mode)) {
/* If it is a directory, let's dive down */
cleanup_orphaned_lock_files(fullpath);
}
ast_free(fullpath);
}
closedir(dir);
}
/*! \brief Lock file path
* only return failure if ast_lock_path returns 'timeout',
* not if the path does not exist or any other reason
@ -5479,12 +5407,33 @@ static int add_email_attachment(FILE *p, struct ast_vm_user *vmu, char *format,
char sox_gain_tmpdir[PATH_MAX];
char *file_to_delete = NULL, *dir_to_delete = NULL;
int res;
char altfname[PATH_MAX] = "";
int altused = 0;
char altformat[80] = "";
char *c = NULL;
/* Eww. We want formats to tell us their own MIME type */
char *mime_type = (!strcasecmp(format, "ogg")) ? "application/" : "audio/x-";
/* Users of multiple file formats need special attention. */
snprintf(fname, sizeof(fname), "%s.%s", attach, format);
if (!ast_file_is_readable(fname)) {
ast_copy_string(altformat, vmfmts, sizeof(altformat));
c = strchr(altformat, '|');
if (c) {
*c = '\0';
}
ast_log(AST_LOG_WARNING, "Failed to open file: %s: %s - trying first/alternate format %s\n", fname, strerror(errno), altformat);
snprintf(altfname, sizeof(altfname), "%s.%s", attach, altformat);
if (!ast_file_is_readable(altfname)) {
ast_log(AST_LOG_WARNING, "Failed to open file: %s: %s - alternate format %s failure\n", altfname, strerror(errno), altformat);
} else {
altused = 1;
}
}
/* This 'while' loop will only execute once. We use it so that we can 'break' */
while (vmu->volgain < -.001 || vmu->volgain > .001) {
while (vmu->volgain < -.001 || vmu->volgain > .001 || altused) {
char tmpdir[PATH_MAX];
create_dirpath(tmpdir, sizeof(tmpdir), vmu->context, vmu->mailbox, "tmp");
@ -5510,8 +5459,29 @@ static int add_email_attachment(FILE *p, struct ast_vm_user *vmu, char *format,
break;
}
res = snprintf(sox_gain_cmd, sizeof(sox_gain_cmd), "sox -v %.4f %s.%s %s",
vmu->volgain, attach, format, fname);
if (!altused) {
res = snprintf(sox_gain_cmd, sizeof(sox_gain_cmd), "sox -v %.4f %s.%s %s",
vmu->volgain, attach, format, fname);
} else {
if (!strcasecmp(format, "wav")) {
if (vmu->volgain < -.001 || vmu->volgain > .001) {
res = snprintf(sox_gain_cmd, sizeof(sox_gain_cmd), "sox -v %.4f %s.%s -e signed-integer -b 16 %s",
vmu->volgain, attach, altformat, fname);
} else {
res = snprintf(sox_gain_cmd, sizeof(sox_gain_cmd), "sox %s.%s -e signed-integer -b 16 %s",
attach, altformat, fname);
}
} else {
if (vmu->volgain < -.001 || vmu->volgain > .001) {
res = snprintf(sox_gain_cmd, sizeof(sox_gain_cmd), "sox -v %.4f %s.%s %s",
vmu->volgain, attach, altformat, fname);
} else {
res = snprintf(sox_gain_cmd, sizeof(sox_gain_cmd), "sox %s.%s %s",
attach, altformat, fname);
}
}
}
if (res >= sizeof(sox_gain_cmd)) {
ast_log(LOG_ERROR, "Failed to generate sox command, out of buffer space\n");
break;
@ -7212,7 +7182,7 @@ leave_vm_out:
#ifdef IMAP_STORAGE
/* expunge message - use UID Expunge if supported on IMAP server*/
ast_debug(3, "*** Checking if we can expunge, expungeonhangup set to %d\n", expungeonhangup);
if (expungeonhangup == 1) {
if (expungeonhangup == 1 && vms->mailstream != NULL) {
ast_mutex_lock(&vms->lock);
#ifdef HAVE_IMAP_TK2006
if (LEVELUIDPLUS (vms->mailstream)) {
@ -8180,10 +8150,12 @@ static void queue_mwi_event(const char *channel_id, const char *box, int urgent,
aliases = ao2_find(mailbox_alias_mappings, box, OBJ_SEARCH_KEY | OBJ_MULTIPLE);
while ((mapping = ao2_iterator_next(aliases))) {
char alias[strlen(mapping->alias) + 1];
strcpy(alias, mapping->alias); /* safe */
mailbox = NULL;
context = NULL;
ast_debug(3, "Found alias mapping: %s -> %s\n", mapping->alias, box);
separate_mailbox(ast_strdupa(mapping->alias), &mailbox, &context);
separate_mailbox(alias, &mailbox, &context);
ast_publish_mwi_state_channel(mailbox, context, new + urgent, old, channel_id);
ao2_ref(mapping, -1);
}
@ -8403,12 +8375,12 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
directory_app = pbx_findapp("Directory");
if (directory_app) {
char vmcontext[256];
char *old_context;
char *old_exten;
char old_context[strlen(ast_channel_context(chan)) + 1];
char old_exten[strlen(ast_channel_exten(chan)) + 1];
int old_priority;
/* make backup copies */
old_context = ast_strdupa(ast_channel_context(chan));
old_exten = ast_strdupa(ast_channel_exten(chan));
strcpy(old_context, ast_channel_context(chan)); /* safe */
strcpy(old_exten, ast_channel_exten(chan)); /* safe */
old_priority = ast_channel_priority(chan);
/* call the Directory, changes the channel */
@ -9089,7 +9061,6 @@ static int imap_remove_file(char *dir, int msgnum)
static int imap_delete_old_greeting (char *dir, struct vm_state *vms)
{
char *file, *filename;
char *attachment;
char arg[11];
int i;
BODY* body;
@ -9118,17 +9089,22 @@ static int imap_delete_old_greeting (char *dir, struct vm_state *vms)
mail_fetchstructure(vms->mailstream, i + 1, &body);
/* We have the body, now we extract the file name of the first attachment. */
if (body->nested.part->next && body->nested.part->next->body.parameter->value) {
attachment = ast_strdupa(body->nested.part->next->body.parameter->value);
char *attachment = body->nested.part->next->body.parameter->value;
char copy[strlen(attachment) + 1];
strcpy(copy, attachment); /* safe */
attachment = copy;
filename = strsep(&attachment, ".");
if (!strcmp(filename, file)) {
snprintf(arg, sizeof(arg), "%d", i + 1);
mail_setflag(vms->mailstream, arg, "\\DELETED");
}
} else {
ast_log(AST_LOG_ERROR, "There is no file attached to this IMAP message.\n");
ast_mutex_unlock(&vms->lock);
return -1;
}
filename = strsep(&attachment, ".");
if (!strcmp(filename, file)) {
snprintf(arg, sizeof(arg), "%d", i + 1);
mail_setflag(vms->mailstream, arg, "\\DELETED");
}
}
mail_expunge(vms->mailstream);
@ -13744,26 +13720,30 @@ static void load_zonemessages(struct ast_config *cfg)
var = ast_variable_browse(cfg, "zonemessages");
while (var) {
struct vm_zone *z;
char *msg_format, *tzone;
if (var->value) {
struct vm_zone *z;
char *msg_format, *tzone;
char storage[strlen(var->value) + 1];
z = ast_malloc(sizeof(*z));
if (!z) {
return;
}
z = ast_malloc(sizeof(*z));
if (!z) {
return;
}
msg_format = ast_strdupa(var->value);
tzone = strsep(&msg_format, "|,");
if (msg_format) {
ast_copy_string(z->name, var->name, sizeof(z->name));
ast_copy_string(z->timezone, tzone, sizeof(z->timezone));
ast_copy_string(z->msg_format, msg_format, sizeof(z->msg_format));
AST_LIST_LOCK(&zones);
AST_LIST_INSERT_HEAD(&zones, z, list);
AST_LIST_UNLOCK(&zones);
} else {
ast_log(AST_LOG_WARNING, "Invalid timezone definition at line %d\n", var->lineno);
ast_free(z);
strcpy(storage, var->value); /* safe */
msg_format = storage;
tzone = strsep(&msg_format, "|,");
if (msg_format) {
ast_copy_string(z->name, var->name, sizeof(z->name));
ast_copy_string(z->timezone, tzone, sizeof(z->timezone));
ast_copy_string(z->msg_format, msg_format, sizeof(z->msg_format));
AST_LIST_LOCK(&zones);
AST_LIST_INSERT_HEAD(&zones, z, list);
AST_LIST_UNLOCK(&zones);
} else {
ast_log(AST_LOG_WARNING, "Invalid timezone definition at line %d\n", var->lineno);
ast_free(z);
}
}
var = var->next;
}
@ -15187,6 +15167,11 @@ static int unload_module(void)
#endif
ao2_ref(inprocess_container, -1);
ao2_container_unregister("voicemail_alias_mailbox_mappings");
ao2_cleanup(alias_mailbox_mappings);
ao2_container_unregister("voicemail_mailbox_alias_mappings");
ao2_cleanup(mailbox_alias_mappings);
if (poll_thread != AST_PTHREADT_NULL)
stop_poll_thread();
@ -15258,6 +15243,7 @@ static int load_module(void)
if (!mailbox_alias_mappings) {
ast_log(LOG_ERROR, "Unable to create mailbox_alias_mappings container\n");
ao2_cleanup(inprocess_container);
ao2_container_unregister("voicemail_alias_mailbox_mappings");
ao2_cleanup(alias_mailbox_mappings);
return AST_MODULE_LOAD_DECLINE;
}
@ -15265,6 +15251,7 @@ static int load_module(void)
if (res) {
ast_log(LOG_ERROR, "Unable to register mailbox_alias_mappings container\n");
ao2_cleanup(inprocess_container);
ao2_container_unregister("voicemail_alias_mailbox_mappings");
ao2_cleanup(alias_mailbox_mappings);
ao2_cleanup(mailbox_alias_mappings);
return AST_MODULE_LOAD_DECLINE;
@ -15273,9 +15260,6 @@ static int load_module(void)
/* compute the location of the voicemail spool directory */
snprintf(VM_SPOOL_DIR, sizeof(VM_SPOOL_DIR), "%s/voicemail/", ast_config_AST_SPOOL_DIR);
/* Now that we have a spool directory, clean up old lock files */
cleanup_orphaned_lock_files(VM_SPOOL_DIR);
if (!(mwi_subscription_tps = ast_taskprocessor_get("app_voicemail", 0))) {
ast_log(AST_LOG_WARNING, "failed to reference mwi subscription taskprocessor. MWI will not work\n");
}

View File

@ -0,0 +1,372 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><title>Release Summary - asterisk-17.1.0</title><h1 align="center"><a name="top">Release Summary</a></h1><h3 align="center">asterisk-17.1.0</h3><h3 align="center">Date: 2019-12-23</h3><h3 align="center">&lt;asteriskteam@digium.com&gt;</h3><hr><h2 align="center">Table of Contents</h2><ol>
<li><a href="#summary">Summary</a></li>
<li><a href="#contributors">Contributors</a></li>
<li><a href="#closed_issues">Closed Issues</a></li>
<li><a href="#commits">Other Changes</a></li>
<li><a href="#diffstat">Diffstat</a></li>
</ol><hr><a name="summary"><h2 align="center">Summary</h2></a><center><a href="#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-17.0.0.</p><hr><a name="contributors"><h2 align="center">Contributors</h2></a><center><a href="#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><table width="100%" border="0">
<tr><th width="33%">Coders</th><th width="33%">Testers</th><th width="33%">Reporters</th></tr>
<tr valign="top"><td width="33%">23 George Joseph <gjoseph@digium.com><br/>23 Sean Bright <sean.bright@gmail.com><br/>16 Joshua Colp <jcolp@digium.com><br/>13 Kevin Harwell <kharwell@digium.com><br/>6 Corey Farrell <git@cfware.com><br/>5 Asterisk Development Team <asteriskteam@digium.com><br/>5 Alexei Gradinari <alex2grad@gmail.com><br/>5 Ben Ford <bford@digium.com><br/>4 Frederic LE FOLL <frederic.lefoll@c-s.fr><br/>3 Igor Goncharovsky <igor.goncharovsky@gmail.com><br/>2 Salah Ahmed <txrubel@gmail.com><br/>2 Joshua C. Colp <jcolp@sangoma.com><br/>2 Torrey Searle <torrey@voxbone.com><br/>2 lvl <digium@lvlconsultancy.nl><br/>1 Thomas Arimont (license 5525)<br/>1 Pascal Cadotte Michaud <pcm@wazo.io><br/>1 Martin Tomec <tomec.martin@gmail.com><br/>1 Walter Doekes <walter+asterisk@wjd.nu><br/>1 Stas Kobzar <stas@modulis.ca><br/>1 Jonathan Rose <jrose@digium.com><br/>1 Michael Goryainov<br/>1 Chris-Savinovich <csavinovich@digium.com><br/>1 Michael Cargile <mikec@vicidial.com><br/>1 Chris Savinovich <csavinovich@digium.com><br/>1 sungtae kim <pchero21@gmail.com><br/>1 Florian Floimair <f.floimair@commend.com><br/>1 cmaj <chris@penguinpbx.com><br/>1 Christoph Moench-Tegeder <cmt@burggraben.net><br/>1 Dan Cropp <dan@amtelco.com><br/>1 Guido Falsi <madpilot@FreeBSD.org><br/></td><td width="33%">1 tests/test_utils.c.<br/></td><td width="33%">5 Kevin Harwell <kharwell@digium.com><br/>5 Joshua C. Colp <jcolp@digium.com><br/>4 Frederic LE FOLL <frederic.lefoll@c-s.fr><br/>3 Salah Ahmed <txrubel@gmail.com><br/>3 Ross Beer <ross.beer@voicehost.co.uk><br/>2 Alexei Gradinari <alex2grad@gmail.com><br/>2 Torrey Searle <tsearle@gmail.com><br/>2 Ross Beer<br/>2 Joshua Elson <joshelson@gmail.com><br/>2 George Joseph <gjoseph@digium.com><br/>2 Ruddy G <plugworld@micnes.com><br/>1 Michael Cargile <mikec@vicidial.com><br/>1 Walter Doekes <walter+asterisk@wjd.nu><br/>1 Ted G<br/>1 Martin Tomec <tomec.martin@gmail.com><br/>1 Chris Savinovich <csavinovich@digium.com><br/>1 Byron Clark <bclark@getjive.com><br/>1 Niklas Larsson <niklas@tese.se><br/>1 Jonas Swiatek <jonas@telzio.com><br/>1 Yoooooo Ha <n1906374c@e.ntu.edu.sg><br/>1 Michael <ringo@vianet.ca><br/>1 Eliel Sardañons <eliels@gmail.com><br/>1 Guido Falsi <madpilot@freebsd.org><br/>1 Gregory Massel <greg@csurf.co.za><br/>1 Dan Cropp<br/>1 Jeremiah Gadd <jeremygadd@gmail.com><br/>1 Bernhard Schmidt<br/>1 Stas Kobzar <stas@modulis.ca><br/>1 nappsoft <infos@nappsoft.ch><br/>1 Pascal Cadotte Michaud <pascal.cadotte@gmail.com><br/>1 Kilburn <kilburna@gmail.com><br/>1 Ian Jones <tech@iljones.net><br/>1 Michael Goryainov <gms4nlt@gmail.com><br/>1 Bernhard Schmidt <berni@birkenwald.de><br/>1 Ted G <tgwaste@gmail.com><br/>1 Marian Piater <marian.piater@voipsun.cz><br/>1 Aheliotech <phones@aheliotech.com><br/>1 Dan Cropp <dan@amtelco.com><br/>1 Mark <mark@wrapped.cx><br/>1 Alexander Traud <pabstraud@compuserve.com><br/>1 Speed Dial Dave <speed_dial_dave@gmx.com><br/>1 Timothy Vanderaerden <timothy.vanderaerden@optimise-group.be><br/>1 Niklas Larsson<br/>1 Andrey V. T. <avt1203@gmail.com><br/>1 Christoph Moench-Tegeder <cmt@burggraben.net><br/>1 Florian Floimair <f.floimair@commend.com><br/>1 Jonathan Harris <lardconcepts@gmail.com><br/>1 Daniel <depeee@gmail.com><br/>1 Sam Banks <sam.banks.nz@gmail.com><br/>1 Eliel Sardañons<br/>1 Alexander Traud<br/>1 Cyril Ramière <cyril.ramiere@ino.global><br/>1 Jørgen H <asterisk.org@hovland.cx><br/>1 cmaj <chris@penguinpbx.com><br/>1 Juan Martin <jmartin79@yandex.com><br/>1 lvl <digium@lvlconsultancy.nl><br/></td></tr>
</table><hr><a name="closed_issues"><h2 align="center">Closed Issues</h2></a><center><a href="#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>Security</h3><h4>Category: Channels/chan_sip/General</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28589">ASTERISK-28589</a>: chan_sip: Depending on configuration an INVITE can alter Addr of a peer<br/>Reported by: Andrey V. T.<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=665a94cb7622dd5f9591df5d68962e41266ee47b">[665a94cb76]</a> Ben Ford -- chan_sip.c: Prevent address change on unauthenticated SIP request.</li>
</ul><br><h4>Category: Core/ManagerInterface</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28580">ASTERISK-28580</a>: Bypass SYSTEM write permission in manager action allows system commands execution<br/>Reported by: Eliel Sardañons<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=6b1ba589671a0e6e9a52b89af6e5398f040ef99f">[6b1ba58967]</a> George Joseph -- manager.c: Prevent the Originate action from running the Originate app</li>
</ul><br><h4>Category: Resources/res_pjsip_t38</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28495">ASTERISK-28495</a>: res_pjsip_t38: 200 OK with SDP answer with declined stream causes crash<br/>Reported by: Alexei Gradinari<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=9d4f1e8ebe5dc1152c59aee60955fc29ae3b3191">[9d4f1e8ebe]</a> Alexei Gradinari -- AST-2019-004 - res_pjsip_t38.c: Add NULL checks before using session media</li>
</ul><br><h3>Improvement</h3><h4>Category: Applications/app_voicemail</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28567">ASTERISK-28567</a>: Problem with ASTERISK-20207: Asterisk should clear out any .lock files in the voice mail directory on startup.<br/>Reported by: Michael<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=b90399498787b898da89d21564251e6aa84dda98">[b903994987]</a> Sean Bright -- Revert "app_voicemail: Cleanup stale lock files on module load"</li>
</ul><br><h4>Category: Applications/app_voicemail/ODBC</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-22192">ASTERISK-22192</a>: [patch] Allow voicemail forwards with ODBC backend when format differs from attachfmt column<br/>Reported by: cmaj<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=aa0973f868ac463bc31b760f364afb2ab691b030">[aa0973f868]</a> cmaj -- app_voicemail.c: Support multiple file formats for forwarded messages.</li>
</ul><br><h4>Category: Core/CodecInterface</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28512">ASTERISK-28512</a>: Add pass-through support for H.265 (HEVC) codec<br/>Reported by: Florian Floimair<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=d7a3e4f5cf6dadc0c8fa9b0cdc0c2d13b45d33ab">[d7a3e4f5cf]</a> Florian Floimair -- core: Add H.265/HEVC passthrough support</li>
</ul><br><h4>Category: Documentation</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28586">ASTERISK-28586</a>: Typo in README-SERIOUSLY.bestpractices.md<br/>Reported by: Sam Banks<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=4bc1c170cd09ef890133e438e7030ac9b6eeba85">[4bc1c170cd]</a> Sean Bright -- README-SERIOUSLY.bestpractices.md: Speling correetions.</li>
</ul><br><h4>Category: Resources/res_pjsip</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28542">ASTERISK-28542</a>: [patch] add the ability for asterisk to generate on-hold re-invites<br/>Reported by: Torrey Searle<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=55b760d7625f3c78c8f4de5587a2051b7a16dfa4">[55b760d762]</a> Torrey Searle -- channel/chan_pjsip: add dialplan function for music on hold</li>
</ul><br><h4>Category: Resources/res_pjsip_outbound_registration</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28602">ASTERISK-28602</a>: res_pjsip_outbound_registration: Maximum retries reached<br/>Reported by: Daniel<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=eea2d499f4cc0982ff8817640c803dbd57a008ed">[eea2d499f4]</a> Joshua Colp -- res_pjsip_outbound_registration: Extend documentation for "max_retries".</li>
</ul><br><h3>Bug</h3><h4>Category: .Release/Targets</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28488">ASTERISK-28488</a>: pjsip mwi: n+1 sip notify's sent on re-register<br/>Reported by: Chris Savinovich<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=a36fb473fe3cda2fd56a44f4e09234a167ef44d2">[a36fb473fe]</a> Kevin Harwell -- res_pjsip_mwi: add better handling of solicited vs unsolicited subscriptions</li>
</ul><br><h4>Category: Applications/app_amd</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28608">ASTERISK-28608</a>: app_amd: Use time calculation to calculate timeout<br/>Reported by: Michael Cargile<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=e23b2856d09a7843e3d8dda6f1f3b72de89a48e6">[e23b2856d0]</a> Michael Cargile -- app_amd: Fixed timeout issue</li>
</ul><br><h4>Category: Applications/app_chanisavail</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28527">ASTERISK-28527</a>: ChanIsAvail() creates a CDR if unanswered=yes is set in cdr.conf<br/>Reported by: Frederic LE FOLL<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=50997de8878f0ad08147540395dab3bc4ffb0d2a">[50997de887]</a> Frederic LE FOLL -- ChanIsAvail() generates a CDR when unanswered=yes in cdr.conf.</li>
</ul><br><h4>Category: Applications/app_meetme</h4><a href="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><a href="https://code.asterisk.org/code/changelog/asterisk?cs=3d29b06e37de0480ba4c0e3fb61ff690d67572aa">[3d29b06e37]</a> Joshua C. Colp -- configure: Add check for MySQL client bool and my_bool type usage.</li>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=36b28c98dd8fd8906b9b6eefee2489820f1a1295">[36b28c98dd]</a> George Joseph -- Build: Fix compile issues with seldom used modules</li>
</ul><br><h4>Category: Applications/app_queue</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28644">ASTERISK-28644</a>: Stale comment in app_queue about ring_entry exception<br/>Reported by: Walter Doekes<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=e1eb5e8dc269ca90c4503d8c8da058b3f3822eb9">[e1eb5e8dc2]</a> Walter Doekes -- app_queue: Fix old confusing comment about when the members are called</li>
</ul><br><h4>Category: Applications/app_voicemail/IMAP</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28505">ASTERISK-28505</a>: app_voicemail/IMAP: segfault in leave_voicemail because not checking mailstream<br/>Reported by: Alexei Gradinari<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=052ab9d96604ba5f4e6666788bf93d357607fb95">[052ab9d966]</a> Alexei Gradinari -- app_voicemail/IMAP: check mailstream not NULL in leave_voicemail</li>
</ul><br><h4>Category: Bridges/bridge_native_rtp</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28637">ASTERISK-28637</a>: chan_sip+native_bridge_rtp: directmedia compatibility check failure when negociated ptime is not default ptime.<br/>Reported by: Frederic LE FOLL<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=3e73893e53dddfc43f47dc6a451bc9e2a5387345">[3e73893e53]</a> Frederic LE FOLL -- chan_sip+native_bridge_rtp: no directmedia for ptime other than default ptime.</li>
</ul><br><h4>Category: Bridges/bridge_softmix</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28618">ASTERISK-28618</a>: bridge_softmix: hold not cleared when joining a softmix bridge<br/>Reported by: Kevin Harwell<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=8b4610acfe476f111a52234e1fd2cab03b7d58f9">[8b4610acfe]</a> Kevin Harwell -- bridge_softmix: clear hold when joining a softmix bridge</li>
</ul><br><h4>Category: CDR/General</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28566">ASTERISK-28566</a>: CDR backend unload problem during active call(s)<br/>Reported by: Marian Piater<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=1dc3451a3464bdc52d03344535dd7ac7751777a2">[1dc3451a34]</a> Sean Bright -- cdr_mysql: Don't clean up on unload unless we can unregister from CDRs</li>
</ul><br><h4>Category: CDR/cdr_pgsql</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28571">ASTERISK-28571</a>: cdr_pgsql: accesses obsolete (and finally removed) column<br/>Reported by: Christoph Moench-Tegeder<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=79cc8ae3b809629df8f4739dfd537aa98d0c43ec">[79cc8ae3b8]</a> Christoph Moench-Tegeder -- cdr_pgsql cel_pgsql res_config_pgsql: compatibility with PostgreSQL 12</li>
</ul><br><h4>Category: Channels/chan_dahdi</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28615">ASTERISK-28615</a>: chan_dahdi: PRI span status may stay "Down, Active" after a short alarm<br/>Reported by: Frederic LE FOLL<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=d3dd4c5459846b0bff4864f8089418a475c603db">[d3dd4c5459]</a> Frederic LE FOLL -- chan_dahdi: PRI span status may stay "Down, Active" after a short alarm</li>
</ul><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28536">ASTERISK-28536</a>: Asterisk release candidates fail to build on FreeBSD<br/>Reported by: Guido Falsi<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=5ff2f7a0169d30952f1ba9c5ff48027e6c950f03">[5ff2f7a016]</a> Guido Falsi -- chan_dahdi: Fix build with clang/llvm</li>
</ul><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28525">ASTERISK-28525</a>: chan_dahdi: set CHANNEL(hangupsource) when a PRI channel hangs up<br/>Reported by: Frederic LE FOLL<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=9e67c925027ec59154406f82cea4cb3934bdf2a7">[9e67c92502]</a> Frederic LE FOLL -- chan_dahdi: set CHANNEL(hangupsource) when a PRI channel hangs up</li>
</ul><br><h4>Category: Channels/chan_pjsip</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28578">ASTERISK-28578</a>: race condition on pjsip channelstats command<br/>Reported by: Salah Ahmed<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=40acd7d1987e38d010430e013dd3dc0d54f8d4b9">[40acd7d198]</a> Salah Ahmed -- Crash during "pjsip show channelstats" execution</li>
</ul><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28561">ASTERISK-28561</a>: Asterisk Deadlocks<br/>Reported by: Aheliotech<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=ae761c74738c04c11b72b539cc7e852bef6da260">[ae761c7473]</a> Joshua Colp -- pbx: deadlock when outgoing dialed channel hangs up too quickly</li>
</ul><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28086">ASTERISK-28086</a>: chan_pjsip: Crash when initiating PlayDTMF over AMI<br/>Reported by: Jeremiah Gadd<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=71f86e78b6e5694ef90baab9683f4f519d9540c1">[71f86e78b6]</a> lvl -- chan_pjsip: Prevent segfault when running PlayDTMF on hungup channel</li>
</ul><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28538">ASTERISK-28538</a>: chan_pjsip: Deadlock on fax detection<br/>Reported by: Joshua C. Colp<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=4d1baa3ae86b7adb6988ea73aa93f9966b714a4a">[4d1baa3ae8]</a> Joshua Colp -- chan_pjsip: Relock correct channel during "fax" redirect.</li>
</ul><br><h4>Category: Channels/chan_sip/General</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28637">ASTERISK-28637</a>: chan_sip+native_bridge_rtp: directmedia compatibility check failure when negociated ptime is not default ptime.<br/>Reported by: Frederic LE FOLL<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=3e73893e53dddfc43f47dc6a451bc9e2a5387345">[3e73893e53]</a> Frederic LE FOLL -- chan_sip+native_bridge_rtp: no directmedia for ptime other than default ptime.</li>
</ul><br><h4>Category: Channels/chan_unistim</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-25592">ASTERISK-25592</a>: chan_unistim: Clang Warning: variable sized type not at end of a struct<br/>Reported by: Alexander Traud<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=056ddf76cee4f11dbb6529f9581c93301ebc3507">[056ddf76ce]</a> Igor Goncharovsky -- chan_unistim: Fix clang warning: variable sized type not at end of a struct</li>
</ul><br><h4>Category: Codecs/codec_resample</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28511">ASTERISK-28511</a>: codec_resample: Bad sound quality when up sampling from SLIN16 to SLIN32<br/>Reported by: Ruddy G<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=75d6418d8eada0e59c55f7fcc5b680b31caf4303">[75d6418d8e]</a> Sean Bright -- codec_resample: Ensure OUTSIDE_SPEEX is defined when necessary</li>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=34ab9964f57721fc4d9d54bc8cd7bab96bd52602">[34ab9964f5]</a> Sean Bright -- codec_resample: Upgrade speex_resample to fix up-sampling bug</li>
</ul><br><h4>Category: Core/BuildSystem</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28487">ASTERISK-28487</a>: compile menuselect on gentoo<br/>Reported by: Kilburn<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=a5f05eed70694e16f332e5433756ec27abd34e5c">[a5f05eed70]</a> Sean Bright -- menuselect: Fix curses build on Gentoo Linux</li>
</ul><br><h4>Category: Core/Channels</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28499">ASTERISK-28499</a>: translate: Crash when frame does not have a "src" field set<br/>Reported by: Gregory Massel<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=61c01df560f4cd193dd9bf2b0aaf7cc30b873a6a">[61c01df560]</a> Joshua Colp -- AST-2019-005 - translate: Don't assume all frames will have a src.</li>
</ul><br><h4>Category: Core/Configuration</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-23756">ASTERISK-23756</a>: setvar directive when used in template and a child of said template, results in duplicate variable names<br/>Reported by: Michael Goryainov<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=2fa296e7d41526f000841c083fcbd4d38a7fd776">[2fa296e7d4]</a> Michael Goryainov -- channels: Allow updating variable value</li>
</ul><br><h4>Category: Core/General</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28498">ASTERISK-28498</a>: cel / cdr: Event times may be incorrect<br/>Reported by: Joshua C. Colp<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=108b1abbd9d2ee0148b4833f581d9612ab46256c">[108b1abbd9]</a> Joshua Colp -- cdr / cel: Use event time at event creation instead of processing.</li>
</ul><br><h4>Category: Core/RTP</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28480">ASTERISK-28480</a>: json integer overflow in ssrc and timestamp<br/>Reported by: Salah Ahmed<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=a305f2fdcb6c665c7bdfe779a370f09e1be35794">[a305f2fdcb]</a> Kevin Harwell -- various modules: json integer overflow</li>
</ul><br><h4>Category: Core/Stasis</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28553">ASTERISK-28553</a>: stasis.c: Crash during unload<br/>Reported by: Kevin Harwell<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=57fa6045711d2533de5ea08ec4d30b4ccfc885c2">[57fa604571]</a> Joshua Colp -- stasis: Pass bumped topic_all reference to proxy_dtor.</li>
</ul><br><h4>Category: Core/UDPTL</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28483">ASTERISK-28483</a>: packet lost on UDPTL wrap around<br/>Reported by: Torrey Searle<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=44af3e9018108b01f219fc40a7fdb400a0d477d1">[44af3e9018]</a> Torrey Searle -- main/udptl.c: correctly handle udptl sequence wrap around</li>
</ul><br><h4>Category: Functions/General</h4><a href="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>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=450173a0ae3aace0bbdcbfbcd336c5069747b0d1">[450173a0ae]</a> Pascal Cadotte Michaud -- PJSIP_CONTACT: add missing argument documentation</li>
</ul><a href="https://issues.asterisk.org/jira/browse/ASTERISK-26481">ASTERISK-26481</a>: FILE function grabs garbage along with read data when target line has no newline<br/>Reported by: Jonathan Harris<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=92bb381d5d1878b9268e5da23a2e85cba3cdb715">[92bb381d5d]</a> Sean Bright -- func_env: Prevent FILE() from reading garbage at end-of-file</li>
</ul><br><h4>Category: General</h4><a href="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><a href="https://code.asterisk.org/code/changelog/asterisk?cs=27a4a3c761613904a6105aec6ff211e206cbbf67">[27a4a3c761]</a> George Joseph -- res_rtp_asterisk: Add frame list cleanups to ast_rtp_read</li>
</ul><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28590">ASTERISK-28590</a>: utils.c throws repeated warnings; "pthread_attr_setstacksize: Invalid argument"<br/>Reported by: Speed Dial Dave<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=b3c56c7fa516944852ad2792b00410fc10448beb">[b3c56c7fa5]</a> Sean Bright -- utils.h: Set lower bound for thread stack size to PTHREAD_STACK_MIN</li>
</ul><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28523">ASTERISK-28523</a>: Asterisk 16.5.0 Memory leak<br/>Reported by: Cyril Ramière<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=f821e8107180e7c49c00c16ae8f998e12b51e79a">[f821e81071]</a> Kevin Harwell -- res_sorcery_memory_cache: stale item update leak</li>
</ul><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28472">ASTERISK-28472</a>: Asterisk occasionally passes a NULL as srtp->session to srtp_protect/unprotect causing SEGV<br/>Reported by: Jonas Swiatek<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=5daa9bbaee476fcf11223d174d90a987d96fb1a5">[5daa9bbaee]</a> Kevin Harwell -- srtp: Fix possible race condition, and add NULL checks</li>
</ul><br><h4>Category: PBX/pbx_config</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28534">ASTERISK-28534</a>: Segmentation fault when there is no priority for an extension<br/>Reported by: Timothy Vanderaerden<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=8d0edf2b3714bd1096902d15d240c2a43c270bd5">[8d0edf2b37]</a> Sean Bright -- pbx: Prevent Realtime switch crash on invalid priority</li>
</ul><br><h4>Category: Resources/res_ari</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28585">ASTERISK-28585</a>: ari/resource_events: Crash in event session cleanup<br/>Reported by: Kevin Harwell<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=e37d5461095e93ad274dd9893d21750b8d2cacc1">[e37d546109]</a> Joshua Colp -- res_ari_events: Add module reference when a WebSocket is open.</li>
</ul><br><h4>Category: Resources/res_calendar_exchange</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28572">ASTERISK-28572</a>: Memory leaks in res_calendar_exchange and res_calendar_icalendar<br/>Reported by: Yoooooo Ha<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=b3792e1288d481718875fde9da35b9332301d766">[b3792e1288]</a> Sean Bright -- res_calendar: Resolve memory leak on calendar destruction</li>
</ul><br><h4>Category: Resources/res_calendar_icalendar</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28572">ASTERISK-28572</a>: Memory leaks in res_calendar_exchange and res_calendar_icalendar<br/>Reported by: Yoooooo Ha<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=b3792e1288d481718875fde9da35b9332301d766">[b3792e1288]</a> Sean Bright -- res_calendar: Resolve memory leak on calendar destruction</li>
</ul><br><h4>Category: Resources/res_parking</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28631">ASTERISK-28631</a>: res_parking: Doesn't park when parkee and parker are the same<br/>Reported by: Ross Beer<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=41d58a4ce2ea34345c6c9645238eb80ae39e15ac">[41d58a4ce2]</a> Joshua Colp -- parking: Fall back to parker channel name even if it matches parkee.</li>
</ul><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28616">ASTERISK-28616</a>: parking: Deadlock when multi call parking<br/>Reported by: Joshua C. Colp<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=de433cdcaf64070164300a51ab8ab0d0c596c71e">[de433cdcaf]</a> Joshua Colp -- parking: Fix case where we can't get the parker.</li>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=d638d9c6c6b9ffe8feb0ee35466a6d884a5d04e4">[d638d9c6c6]</a> Joshua Colp -- parking: Use channel snapshot instead of channel.</li>
</ul><br><h4>Category: Resources/res_pjsip</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28641">ASTERISK-28641</a>: res_pjsip Segfaults when realtime configuration to an AOR points to a not existent AOR<br/>Reported by: Ross Beer<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=4e057eb9d2c3572373c95f5b272ac8950efcbfec">[4e057eb9d2]</a> Sean Bright -- res_pjsip_registrar.c: Prevent potential double free if AOR is not found</li>
</ul><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28544">ASTERISK-28544</a>: Wrong contact representation in ipv6 mode<br/>Reported by: Jørgen H<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=6527eb8213e185e3b5e3a194764d688f4d73a088">[6527eb8213]</a> Sean Bright -- res_pjsip_transport_websocket: Don't put brackets around local_name if IPv6</li>
</ul><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28521">ASTERISK-28521</a>: pjsip: Memory Leak<br/>Reported by: Mark<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=7c0435f854d34f2723fa744ee599845b25bcc5f8">[7c0435f854]</a> George Joseph -- pjproject_bundled: Revert pjproject 2.9 commits causing leaks</li>
</ul><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28228">ASTERISK-28228</a>: res_pjsip: pjsip show contacts prints double entries<br/>Reported by: Ian Jones<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=20459d4cacc94335b7e39ed696f336c521f872ba">[20459d4cac]</a> Joshua Colp -- res_pjsip: Fix multiple of the same contact in "pjsip show contacts".</li>
</ul><br><h4>Category: Resources/res_pjsip_mwi</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28575">ASTERISK-28575</a>: MWI Send Notify Crash on 16.6<br/>Reported by: Joshua Elson<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=45c0d991857ec1ee61d12bc26a106cc8d5cc84a3">[45c0d99185]</a> Kevin Harwell -- res_pjsip_mwi: potential double unref, and potential unwanted double link</li>
</ul><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28552">ASTERISK-28552</a>: res_pjsip_mwi: Frack during unload on unsolicited_mwi container<br/>Reported by: Kevin Harwell<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=996fc40e2b489c7df13567d2255d8238c0cad1bd">[996fc40e2b]</a> Kevin Harwell -- res_pjsip_mwi: use an ao2_global object for mwi containers</li>
</ul><br><h4>Category: Resources/res_pjsip_outbound_registration</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28624">ASTERISK-28624</a>: res_pjsip_outbound_registration: add SRV failover<br/>Reported by: Kevin Harwell<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=8c99930375bb73072a20e30893fecd1c382f5671">[8c99930375]</a> Kevin Harwell -- res_pjsip_outbound_registration: add support for SRV failover</li>
</ul><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28521">ASTERISK-28521</a>: pjsip: Memory Leak<br/>Reported by: Mark<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=7c0435f854d34f2723fa744ee599845b25bcc5f8">[7c0435f854]</a> George Joseph -- pjproject_bundled: Revert pjproject 2.9 commits causing leaks</li>
</ul><br><h4>Category: Resources/res_pjsip_path</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28463">ASTERISK-28463</a>: res_pjsip_path: Crash when invalid contact is configured<br/>Reported by: Juan Martin<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=51cf060c6ccca4d545ab4723f412318388b185f1">[51cf060c6c]</a> Sean Bright -- res_pjsip_registrar: Validate Contact URI before adding to responses</li>
</ul><br><h4>Category: Resources/res_pjsip_sdp_rtp</h4><a href="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><a href="https://code.asterisk.org/code/changelog/asterisk?cs=5949f9a86a14892ca66d34207f780ed59bff59e5">[5949f9a86a]</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><a href="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><a href="https://code.asterisk.org/code/changelog/asterisk?cs=5949f9a86a14892ca66d34207f780ed59bff59e5">[5949f9a86a]</a> Joshua C. Colp -- res_pjsip_session: Set stream state on created streams for incoming SDP.</li>
</ul><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28445">ASTERISK-28445</a>: res_pjsip_session: ast_json_vpack: Invalid UTF-8 string on hangup when TEST_FRAMEWORK enabled<br/>Reported by: Bernhard Schmidt<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=4d56adf8fbbbaa6c05c547eb482f1d154ec006d4">[4d56adf8fb]</a> Sean Bright -- res_pjsip_session.c: Prevent use-after-free with TEST_FRAMEWORK enabled</li>
</ul><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28086">ASTERISK-28086</a>: chan_pjsip: Crash when initiating PlayDTMF over AMI<br/>Reported by: Jeremiah Gadd<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=71f86e78b6e5694ef90baab9683f4f519d9540c1">[71f86e78b6]</a> lvl -- chan_pjsip: Prevent segfault when running PlayDTMF on hungup channel</li>
</ul><br><h4>Category: Resources/res_pjsip_t38</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28621">ASTERISK-28621</a>: Enforce T.38 error correction mode at 200 ok received <br/>Reported by: Salah Ahmed<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=4ac0299bfbdfc851040ab2e8136e0078378ea19a">[4ac0299bfb]</a> Salah Ahmed -- res_pjsip_t38: T.38 error correction mode selection at 200 ok received</li>
</ul><br><h4>Category: Resources/res_rtp_asterisk</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28576">ASTERISK-28576</a>: res_rtp_asterisk: ICE Completion Crash when sent packet length doesn't match<br/>Reported by: Joshua Elson<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=0c486e7edf9afae2e649aba47be2464e9a25db38">[0c486e7edf]</a> Joshua Colp -- res_rtp_asterisk: Always return provided DTLS packet length.</li>
</ul><br><h4>Category: Resources/res_stasis</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28423">ASTERISK-28423</a>: ARI causes STASIS Deadlock<br/>Reported by: Ross Beer<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=7202624b3b46bf013a08f26480a60fa2c515a80f">[7202624b3b]</a> George Joseph -- stasis: Don't hold app_registry and session locks unnecessarily</li>
</ul><br><h4>Category: pjproject/pjsip</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28574">ASTERISK-28574</a>: pjproject fails to build on 16.6.0, works on 16.5<br/>Reported by: Niklas Larsson<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=2652bda3a0bb0dd2b444a4e224ff3dcea2eb6e93">[2652bda3a0]</a> George Joseph -- pjproject_bundled: Replace earlier reverts with official fixes.</li>
</ul><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28509">ASTERISK-28509</a>: PJSIP cnonce generated on Linux contains 36 characters, NEC only supports up to 32 characters<br/>Reported by: Dan Cropp<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=a1d38e19a267e06042c5c98d6204bd14a0a0c4e4">[a1d38e19a2]</a> Dan Cropp -- pjproject: Configurable setting for cnonce to include hyphens or not</li>
</ul><br><h3>New Feature</h3><h4>Category: Applications/app_senddtmf</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28614">ASTERISK-28614</a>: app_senddtmf: Allow "receiving" DTMF with PlayDTMF instead of only "sending"<br/>Reported by: lvl<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=6345a002284e68ae5637088678a4491963d28845">[6345a00228]</a> lvl -- app_senddtmf: Add receive mode to AMI Action PlayDTMF</li>
</ul><br><h4>Category: Core/Jitterbuffer</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28533">ASTERISK-28533</a>: func_jitterbuffer: Add support for video synchronization<br/>Reported by: Joshua C. Colp<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=926053d7bdf6245d9081550eadd5c61ed2aeb784">[926053d7bd]</a> Joshua Colp -- func_jitterbuffer: Add audio/video sync support.</li>
</ul><br><h4>Category: Functions/func_curl</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28613">ASTERISK-28613</a>: func_curl: CURLOPT cannot set Content-Type header<br/>Reported by: Martin Tomec<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=d579ec9cdf85ab31c1b7d9c8391d41b4ec513fc9">[d579ec9cdf]</a> Martin Tomec -- func_curl.c: Support custom http headers</li>
</ul><br><h4>Category: Resources/res_musiconhold</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-17808">ASTERISK-17808</a>: [patch] Unregister a realtime moh class<br/>Reported by: Byron Clark<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=9e26136ee6a2d09dfe26528d109eedd12a7948ef">[9e26136ee6]</a> sungtae kim -- res_musiconhold: Added unregister realtime moh class</li>
</ul><br><h4>Category: pjproject/pjsip</h4><a href="https://issues.asterisk.org/jira/browse/ASTERISK-28489">ASTERISK-28489</a>: Channel variable SIPFROMDOMAIN for chan_pjsip to setup From header URI domain<br/>Reported by: Stas Kobzar<ul>
<li><a href="https://code.asterisk.org/code/changelog/asterisk?cs=3a246c2a69cd7f160d80c31058e99e9f99de6746">[3a246c2a69]</a> Stas Kobzar -- res_pjsip: Channel variable SIPFROMDOMAIN</li>
</ul><br><hr><a name="commits"><h2 align="center">Commits Not Associated with an Issue</h2></a><center><a href="#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><table width="100%" border="1">
<tr><th>Revision</th><th>Author</th><th>Summary</th></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=de2b8ef23aa78a0b2c8e733e70edd8f733d25bed">de2b8ef23a</a></td><td>Asterisk Development Team</td><td>Update for 17.1.0-rc2</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=a76d3103fb4aa420d9cb7af8cfc5b384d30d6658">a76d3103fb</a></td><td>George Joseph</td><td>Revert "chan_dahdi: set CHANNEL(hangupsource) when a PRI channel hangs up"</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=c8563727d5343e18213fb499579a1f45d0566d4e">c8563727d5</a></td><td>Asterisk Development Team</td><td>Update for 17.1.0-rc1</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=08a6e8c55315deedeae5e7c1d0528286f1c8a153">08a6e8c553</a></td><td>Asterisk Development Team</td><td>Update CHANGES and UPGRADE.txt for 17.1.0</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=6a89784b7820c301e8b438d140c836db84d3f2b9">6a89784b78</a></td><td>Joshua Colp</td><td>Revert "PJSIP_CONTACT: add missing argument documentation"</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=f26e5bacc008fc5335cb260f75ae73ee3fcbb67a">f26e5bacc0</a></td><td>Sean Bright</td><td>res_pjsip_registrar.c: Prevent possible buffer overflow with domain aliases</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=88150323a235efeb051dc0cae9ef615dd34e86d1">88150323a2</a></td><td>Thomas Arimont</td><td>channel.c: Resolve issue with receiving SIP INFO packets for DTMF</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=5b15a1c6393b380ad86daa40a08491d880f94e68">5b15a1c639</a></td><td>George Joseph</td><td>CI: Turn off shallow cloning altogether</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=cc59e21409b22c109560b92a6073bffc30006f7c">cc59e21409</a></td><td>Sean Bright</td><td>media_cache.c: Various CLI improvements</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=2a92e6b576334ac926d7d498cfab6081d16e702e">2a92e6b576</a></td><td>George Joseph</td><td>CI: Fix missing script block in jenkinsfiles</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=f0d1ce50afd25a1269e680b90c8bb612bd543565">f0d1ce50af</a></td><td>George Joseph</td><td>CI: Fix missing script block in jenkinsfiles</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=46dceab33f5b54ee0f222646bb92654c07efe01f">46dceab33f</a></td><td>George Joseph</td><td>CI: Increase clone depth and do better cleanup</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=76ef36fafcb9a0250e036eb8172681b506a81ee0">76ef36fafc</a></td><td>Sean Bright</td><td>res_pjsip_registrar: Fix uninitlized variable warning</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=649733612d84fbc8566822513dfe9b6fc88c778c">649733612d</a></td><td>Alexei Gradinari</td><td>serializer: set high/low alert levels on whole pool</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=8bc6fa0fbd82f4a57e492f0f92b2acd6454a47b7">8bc6fa0fbd</a></td><td>Kevin Harwell</td><td>various files - fix some alerts raised by lgtm code analysis</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=ea3daa94c8c04e2037c5fd801bcd703a8209ac94">ea3daa94c8</a></td><td>Kevin Harwell</td><td>res_pjsip_session: initialize pending's topology to endpoint's</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=2d665091a36882070dae8ac733aa551f260488ad">2d665091a3</a></td><td>George Joseph</td><td>ExternalMedia: Change return object from ExternalMedia to Channel</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=b8ae799ca9da487e87406edc932a575a600ac735">b8ae799ca9</a></td><td>Joshua Colp</td><td>res_rtp_asterisk: Remove a log message that slipped in.</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=ba688e6891e069761ee996baab507e00e4da8278">ba688e6891</a></td><td>Joshua Colp</td><td>test_res_rtp: Enable FIR and REMB nominal tests.</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=c84135d2a3527b383280a6732dcee5d30a5a5486">c84135d2a3</a></td><td>Chris Savinovich</td><td>test_taskprocessor.c: Fix test failure on Ubuntu</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=37ec88c4c8bd71d9a50209966274bbf8559562fa">37ec88c4c8</a></td><td>Kevin Harwell</td><td>serializer: move/add asterisk serializer pool functionality</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=299ba78b0955f17bfac5703b891d0d19466f99c1">299ba78b09</a></td><td>Kevin Harwell</td><td>res_pjsip/res_pjsip_mwi: use centralized serializer pools</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=25fbe7979396d83da3bef91353894e0862bb7897">25fbe79793</a></td><td>Corey Farrell</td><td>stasis_state: Create internal stasis_state_proxy object.</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=4b47d4774dd75fda72cb2a8ebc39624b2e575a3c">4b47d4774d</a></td><td>Alexei Gradinari</td><td>res_pjsip_pubsub: add endpoint to some warning</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=d223419bcddaf0a695ee90fdb70d4f8fd721090e">d223419bcd</a></td><td>Jonathan Rose</td><td>basic-pbx: Bring forward queue configuration from 13</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=8269fcbf0343b7515df2073cd8b847ce4b24aa6b">8269fcbf03</a></td><td>Ben Ford</td><td>taskprocessor.c: Added "like" support to 'core show taskprocessors'</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=37139e16a554e99b5cc8457681cf04e20c585fb4">37139e16a5</a></td><td>Asterisk Development Team</td><td>Update CHANGES and UPGRADE.txt for 17.0.0-rc2</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=7550a82fe0cfbcf1309bb410293c8086a13a8bd2">7550a82fe0</a></td><td>Sean Bright</td><td>res_musiconhold: Add new 'playlist' mode</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=175a7ccac76529b8f238f2ad61b8cd4cba0c0d10">175a7ccac7</a></td><td>Kevin Harwell</td><td>res_pjsip_pubsub: change warning to debug</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=5bedd4a9b45bb2d7ded09ad6d0b3561e2d091711">5bedd4a9b4</a></td><td>Corey Farrell</td><td>core: Fix ABI mismatch of ao2_global_obj.</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=f181dfc0657cfe8e2558eed68665a9ce8f0d4a54">f181dfc065</a></td><td>Ben Ford</td><td>taskprocessor.c: Add CLI commands to reset taskprocessor stats.</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=ec712cfab24552406a7e104bd8ab02201f78c233">ec712cfab2</a></td><td>Corey Farrell</td><td>core: Add AO2_ALLOC_OPT_NO_REF_DEBUG option.</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=b1c5753b78344d2fc6b4d209116dea1f50d76bcd">b1c5753b78</a></td><td>George Joseph</td><td>astmm.c: Display backtrace with memory show allocations</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=af0ccbc45e62efc92bccabcd7e19593ae7b4955b">af0ccbc45e</a></td><td>Corey Farrell</td><td>stasis: refcounter.py can incorrectly report skewed objects.</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=fd7fc3d7a5fcabb9dbf925fdcdf51b4fe50ece82">fd7fc3d7a5</a></td><td>Corey Farrell</td><td>stasis: Fix leaks</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=78f329dad9a84312909cf517945ae1fe71b801d9">78f329dad9</a></td><td>Corey Farrell</td><td>app_voicemail: Fix module unload leak.</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=1d960195c2b28d6c78794f699b07dc6f54460d2f">1d960195c2</a></td><td>Ben Ford</td><td>res_rtp_asterisk.c: Send RTCP as compound packets.</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=5dad4f4ea1bce2e823ed72e075b51d637673670f">5dad4f4ea1</a></td><td>Ben Ford</td><td>res_rtp: Add unit tests for RTCP stats.</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=44068cc6bf802742ce8a0283351781bbcd9d7690">44068cc6bf</a></td><td>George Joseph</td><td>ARI: External Media</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=c060ef7dee4bdd56504478f3ab74ae56646e2b6f">c060ef7dee</a></td><td>George Joseph</td><td>chan_sip: Update links referenced in deprecation notice</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=7d99710fa683fbceec1ff12f7d52ecd5549f08e0">7d99710fa6</a></td><td>Chris-Savinovich</td><td>test_utils.c: Skip test adsi_loaded_test if module not loaded.</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=95b3c9839da7a4cc01feeeab2b65350bc8e0ce40">95b3c9839d</a></td><td>Igor Goncharovsky</td><td>chan_unistim: Fix code, causing all incoming DTMF sent back to asterisk</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=e7f1f7eefd13c535ed90b30fa6122dbe43f076a4">e7f1f7eefd</a></td><td>Igor Goncharovsky</td><td>chan_unistim: Fix RTP port byte order for big-endian arch</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=a0b0c7540c2d9623ccbe73390f95fd3f2573eb3e">a0b0c7540c</a></td><td>Alexei Gradinari</td><td>Fix misname 'res_external_mwi' to 'res_mwi_external' in comments.</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=581ffdf6a98c53ec41d640161420bdb07f4d3d9b">581ffdf6a9</a></td><td>George Joseph</td><td>chan_rtp: Accept hostname as well as ip address as destination</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=b3d9f6ef6cf7541676631909f3852c6b1b5030fb">b3d9f6ef6c</a></td><td>George Joseph</td><td>dns_core: Create new API ast_dns_resolve_ipv6_and_ipv4</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=f6ab42df2641ad8e32849d7bb608bd35f4fa313e">f6ab42df26</a></td><td>George Joseph</td><td>res_ari.c: Prefer exact handler match over wildcard</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=e123d1ccc581d319d5efbe647920b738f1af6505">e123d1ccc5</a></td><td>Sean Bright</td><td>audiohook.c: Substitute silence for unavailable audio frames</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=5489ad5574331c909075539dc9ccaef4acebb477">5489ad5574</a></td><td>George Joseph</td><td>CI: Escape backslashes in printenv/sort/tr</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=aa44e723c56f65b363955f5c945b9be97ed545cc">aa44e723c5</a></td><td>George Joseph</td><td>CI: Add "throttle" label and "skip_gate" capability</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=865214079447f987e3a3d1b1a31cea2524547614">8652140794</a></td><td>George Joseph</td><td>CI: Make node labels job-specific</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=87f8ca2812b45e2c1eb8f5897b35575d2ded4e23">87f8ca2812</a></td><td>Sean Bright</td><td>app_voicemail: Remove extra menuselect build options</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=1976db6ffd912dfb9ac0bc42748ae9c687171c7a">1976db6ffd</a></td><td>Sean Bright</td><td>res_musiconhold: Use a vector instead of custom array allocation</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=c748187bbfc693cce2ffbdb80cdf8f0310d0ad76">c748187bbf</a></td><td>Sean Bright</td><td>manager: Send fewer packets</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=f1e0c9d1b819ccda353412e6cf8e29ff273f0145">f1e0c9d1b8</a></td><td>Asterisk Development Team</td><td>Update CHANGES and UPGRADE.txt for 17.0.0</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=4f2ad5a55d5d44550e21a817c35c46a6baa7f916">4f2ad5a55d</a></td><td>George Joseph</td><td>doc: Add "master-only" flag back to the CHANGES and UPGRADE files</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=a66ccb90ac7175b33dea0590aa9482e8afb6078b">a66ccb90ac</a></td><td>Sean Bright</td><td>res_musiconhold: Use ast_pipe_nonblock() wrapper</td></tr>
<tr><td><a href="https://code.asterisk.org/code/changelog/asterisk?cs=e821a637a84c7ee2e6549c44c2f1ca6637daae18">e821a637a8</a></td><td>George Joseph</td><td>loader.c: Fix possible SEGV when a module fails to register</td></tr>
</table><hr><a name="diffstat"><h2 align="center">Diffstat Results</h2></a><center><a href="#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-17.0.0-summary.html | 1265 ----
asterisk-17.0.0-summary.txt | 2973 ----------
b/.version | 2
b/CHANGES | 94
b/ChangeLog | 1876 +++++-
b/README-SERIOUSLY.bestpractices.md | 4
b/UPGRADE.txt | 10
b/addons/cdr_mysql.c | 18
b/addons/chan_ooh323.c | 7
b/apps/app_amd.c | 24
b/apps/app_cdr.c | 8
b/apps/app_chanisavail.c | 3
b/apps/app_dictate.c | 4
b/apps/app_followme.c | 10
b/apps/app_meetme.c | 2
b/apps/app_minivm.c | 3
b/apps/app_mixmonitor.c | 13
b/apps/app_playback.c | 9
b/apps/app_queue.c | 6
b/apps/app_readexten.c | 3
b/apps/app_senddtmf.c | 13
b/apps/app_voicemail.c | 217
b/asterisk-17.1.0-rc2-summary.html | 28
b/asterisk-17.1.0-rc2-summary.txt | 133
b/bridges/bridge_native_rtp.c | 5
b/bridges/bridge_softmix.c | 7
b/cdr/cdr_pgsql.c | 2
b/cel/cel_pgsql.c | 2
b/channels/chan_dahdi.c | 35
b/channels/chan_dahdi.h | 18
b/channels/chan_iax2.c | 16
b/channels/chan_motif.c | 9
b/channels/chan_pjsip.c | 24
b/channels/chan_rtp.c | 19
b/channels/chan_sip.c | 39
b/channels/chan_unistim.c | 174
b/channels/pjsip/cli_commands.c | 13
b/channels/pjsip/dialplan_functions.c | 65
b/channels/pjsip/include/dialplan_functions.h | 25
b/channels/sig_pri.c | 2
b/codecs/Makefile | 3
b/codecs/ex_alaw.h | 5
b/codecs/ex_g722.h | 5
b/codecs/ex_ulaw.h | 5
b/codecs/speex/arch.h | 13
b/codecs/speex/fixed_generic.h | 4
b/codecs/speex/resample.c | 332 -
b/codecs/speex/speex_resampler.h | 4
b/configs/basic-pbx/extensions.conf | 14
b/configs/basic-pbx/modules.conf | 1
b/configs/basic-pbx/queues.conf | 19
b/configs/samples/extconfig.conf.sample | 1
b/configs/samples/musiconhold.conf.sample | 23
b/configure | 82
b/configure.ac | 20
b/contrib/ast-db-manage/config/versions/fbb7766f17bc_add_playlist_to_moh.py | 54
b/contrib/realtime/mysql/mysql_config.sql | 15
b/contrib/realtime/postgresql/postgresql_config.sql | 21
b/formats/format_g726.c | 16
b/formats/msgsm.h | 4
b/funcs/func_curl.c | 37
b/funcs/func_env.c | 5
b/funcs/func_jitterbuffer.c | 19
b/include/asterisk/abstract_jb.h | 4
b/include/asterisk/ari.h | 2
b/include/asterisk/astobj2.h | 5
b/include/asterisk/audiohook.h | 2
b/include/asterisk/autoconfig.h.in | 6
b/include/asterisk/calendar.h | 4
b/include/asterisk/channel_internal.h | 5
b/include/asterisk/config.h | 18
b/include/asterisk/config_options.h | 2
b/include/asterisk/dns_core.h | 22
b/include/asterisk/dns_internal.h | 5
b/include/asterisk/format_cache.h | 5
b/include/asterisk/max_forwards.h | 1
b/include/asterisk/mixmonitor.h | 5
b/include/asterisk/parking.h | 5
b/include/asterisk/res_pjsip.h | 5
b/include/asterisk/res_pjsip_presence_xml.h | 5
b/include/asterisk/res_pjsip_session.h | 2
b/include/asterisk/rtp_engine.h | 111
b/include/asterisk/serializer.h | 85
b/include/asterisk/slin.h | 5
b/include/asterisk/taskprocessor.h | 9
b/include/asterisk/utils.h | 9
b/main/abstract_jb.c | 178
b/main/app.c | 9
b/main/asterisk.c | 15
b/main/astmm.c | 23
b/main/astobj2.c | 88
b/main/astobj2_container.c | 24
b/main/astobj2_global.c | 97
b/main/astobj2_hash.c | 21
b/main/astobj2_rbtree.c | 13
b/main/audiohook.c | 11
b/main/channel.c | 105
b/main/codec_builtin.c | 8
b/main/config.c | 16
b/main/dns_core.c | 72
b/main/event.c | 17
b/main/file.c | 37
b/main/format_cache.c | 8
b/main/indications.c | 6
b/main/manager.c | 92
b/main/media_cache.c | 47
b/main/pbx.c | 5
b/main/pbx_variables.c | 23
b/main/rtp_engine.c | 137
b/main/serializer.c | 189
b/main/stasis.c | 22
b/main/stasis_cache.c | 10
b/main/stasis_state.c | 298 -
b/main/taskprocessor.c | 219
b/res/ari/config.c | 10
b/res/ari/resource_channels.c | 158
b/res/ari/resource_channels.h | 42
b/res/ari/resource_events.c | 10
b/res/parking/parking_bridge.c | 36
b/res/parking/parking_bridge_features.c | 2
b/res/parking/res_parking.h | 5
b/res/res_ari_channels.c | 135
b/res/res_ari_events.c | 2
b/res/res_calendar_ews.c | 1
b/res/res_calendar_exchange.c | 1
b/res/res_calendar_icalendar.c | 1
b/res/res_config_curl.c | 5
b/res/res_config_pgsql.c | 2
b/res/res_musiconhold.c | 294
b/res/res_phoneprov.c | 6
b/res/res_pjsip.c | 83
b/res/res_pjsip/config_system.c | 2
b/res/res_pjsip/config_transport.c | 17
b/res/res_pjsip/pjsip_configuration.c | 4
b/res/res_pjsip/pjsip_resolver.c | 4
b/res/res_pjsip_endpoint_identifier_ip.c | 18
b/res/res_pjsip_mwi.c | 339 -
b/res/res_pjsip_outbound_registration.c | 17
b/res/res_pjsip_pubsub.c | 20
b/res/res_pjsip_registrar.c | 55
b/res/res_pjsip_session.c | 35
b/res/res_pjsip_t38.c | 40
b/res/res_pjsip_transport_websocket.c | 2
b/res/res_resolver_unbound.c | 6
b/res/res_rtp_asterisk.c | 297
b/res/res_stasis.c | 43
b/res/stasis/command.c | 2
b/res/stasis/control.c | 2
b/rest-api-templates/res_ari_resource.c.mustache | 2
b/rest-api/api-docs/channels.json | 125
b/tests/CI/gates.jenkinsfile | 12
b/tests/CI/periodics-daily.jenkinsfile | 11
b/tests/CI/ref_debug.jenkinsfile | 9
b/tests/CI/unittests.jenkinsfile | 9
b/tests/test_data_buffer.c | 2
b/tests/test_res_rtp.c | 516 +
b/tests/test_taskprocessor.c | 2
157 files changed, 6536 insertions(+), 5842 deletions(-)</pre><br></html>

962
asterisk-17.1.0-summary.txt Normal file
View File

@ -0,0 +1,962 @@
Release Summary
asterisk-17.1.0
Date: 2019-12-23
<asteriskteam@digium.com>
----------------------------------------------------------------------
Table of Contents
1. Summary
2. Contributors
3. Closed Issues
4. Other Changes
5. Diffstat
----------------------------------------------------------------------
Summary
[Back to Top]
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.
The data in this summary reflects changes that have been made since the
previous release, asterisk-17.0.0.
----------------------------------------------------------------------
Contributors
[Back to Top]
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.
Coders Testers Reporters
23 George Joseph 1 tests/test_utils.c. 5 Kevin Harwell
23 Sean Bright 5 Joshua C. Colp
16 Joshua Colp 4 Frederic LE FOLL
13 Kevin Harwell 3 Salah Ahmed
6 Corey Farrell 3 Ross Beer
5 Asterisk Development 2 Alexei Gradinari
Team 2 Torrey Searle
5 Alexei Gradinari 2 Ross Beer
5 Ben Ford 2 Joshua Elson
4 Frederic LE FOLL 2 George Joseph
3 Igor Goncharovsky 2 Ruddy G
2 Salah Ahmed 1 Michael Cargile
2 Joshua C. Colp 1 Walter Doekes
2 Torrey Searle 1 Ted G
2 lvl 1 Martin Tomec
1 Thomas Arimont (license 1 Chris Savinovich
5525) 1 Byron Clark
1 Pascal Cadotte Michaud 1 Niklas Larsson
1 Martin Tomec 1 Jonas Swiatek
1 Walter Doekes 1 Yoooooo Ha
1 Stas Kobzar 1 Michael
1 Jonathan Rose 1 Eliel Sardañons
1 Michael Goryainov 1 Guido Falsi
1 Chris-Savinovich 1 Gregory Massel
1 Michael Cargile 1 Dan Cropp
1 Chris Savinovich 1 Jeremiah Gadd
1 sungtae kim 1 Bernhard Schmidt
1 Florian Floimair 1 Stas Kobzar
1 cmaj 1 nappsoft
1 Christoph Moench-Tegeder 1 Pascal Cadotte Michaud
1 Dan Cropp 1 Kilburn
1 Guido Falsi 1 Ian Jones
1 Michael Goryainov
1 Bernhard Schmidt
1 Ted G
1 Marian Piater
1 Aheliotech
1 Dan Cropp
1 Mark
1 Alexander Traud
1 Speed Dial Dave
1 Timothy Vanderaerden
1 Niklas Larsson
1 Andrey V. T.
1 Christoph
Moench-Tegeder
1 Florian Floimair
1 Jonathan Harris
1 Daniel
1 Sam Banks
1 Eliel Sardañons
1 Alexander Traud
1 Cyril Ramière
1 Jørgen H
1 cmaj
1 Juan Martin
1 lvl
----------------------------------------------------------------------
Closed Issues
[Back to Top]
This is a list of all issues from the issue tracker that were closed by
changes that went into this release.
Security
Category: Channels/chan_sip/General
ASTERISK-28589: chan_sip: Depending on configuration an INVITE can alter
Addr of a peer
Reported by: Andrey V. T.
* [665a94cb76] Ben Ford -- chan_sip.c: Prevent address change on
unauthenticated SIP request.
Category: Core/ManagerInterface
ASTERISK-28580: Bypass SYSTEM write permission in manager action allows
system commands execution
Reported by: Eliel Sardañons
* [6b1ba58967] George Joseph -- manager.c: Prevent the Originate action
from running the Originate app
Category: Resources/res_pjsip_t38
ASTERISK-28495: res_pjsip_t38: 200 OK with SDP answer with declined stream
causes crash
Reported by: Alexei Gradinari
* [9d4f1e8ebe] Alexei Gradinari -- AST-2019-004 - res_pjsip_t38.c: Add
NULL checks before using session media
Improvement
Category: Applications/app_voicemail
ASTERISK-28567: Problem with ASTERISK-20207: Asterisk should clear out any
.lock files in the voice mail directory on startup.
Reported by: Michael
* [b903994987] Sean Bright -- Revert "app_voicemail: Cleanup stale lock
files on module load"
Category: Applications/app_voicemail/ODBC
ASTERISK-22192: [patch] Allow voicemail forwards with ODBC backend when
format differs from attachfmt column
Reported by: cmaj
* [aa0973f868] cmaj -- app_voicemail.c: Support multiple file formats
for forwarded messages.
Category: Core/CodecInterface
ASTERISK-28512: Add pass-through support for H.265 (HEVC) codec
Reported by: Florian Floimair
* [d7a3e4f5cf] Florian Floimair -- core: Add H.265/HEVC passthrough
support
Category: Documentation
ASTERISK-28586: Typo in README-SERIOUSLY.bestpractices.md
Reported by: Sam Banks
* [4bc1c170cd] Sean Bright -- README-SERIOUSLY.bestpractices.md: Speling
correetions.
Category: Resources/res_pjsip
ASTERISK-28542: [patch] add the ability for asterisk to generate on-hold
re-invites
Reported by: Torrey Searle
* [55b760d762] Torrey Searle -- channel/chan_pjsip: add dialplan
function for music on hold
Category: Resources/res_pjsip_outbound_registration
ASTERISK-28602: res_pjsip_outbound_registration: Maximum retries reached
Reported by: Daniel
* [eea2d499f4] Joshua Colp -- res_pjsip_outbound_registration: Extend
documentation for "max_retries".
Bug
Category: .Release/Targets
ASTERISK-28488: pjsip mwi: n+1 sip notify's sent on re-register
Reported by: Chris Savinovich
* [a36fb473fe] Kevin Harwell -- res_pjsip_mwi: add better handling of
solicited vs unsolicited subscriptions
Category: Applications/app_amd
ASTERISK-28608: app_amd: Use time calculation to calculate timeout
Reported by: Michael Cargile
* [e23b2856d0] Michael Cargile -- app_amd: Fixed timeout issue
Category: Applications/app_chanisavail
ASTERISK-28527: ChanIsAvail() creates a CDR if unanswered=yes is set in
cdr.conf
Reported by: Frederic LE FOLL
* [50997de887] Frederic LE FOLL -- ChanIsAvail() generates a CDR when
unanswered=yes in cdr.conf.
Category: Applications/app_meetme
ASTERISK-28604: app_meetme, chan_ooh323 and cdr_mysql don't build on
17.0.0
Reported by: George Joseph
* [3d29b06e37] Joshua C. Colp -- configure: Add check for MySQL client
bool and my_bool type usage.
* [36b28c98dd] George Joseph -- Build: Fix compile issues with seldom
used modules
Category: Applications/app_queue
ASTERISK-28644: Stale comment in app_queue about ring_entry exception
Reported by: Walter Doekes
* [e1eb5e8dc2] Walter Doekes -- app_queue: Fix old confusing comment
about when the members are called
Category: Applications/app_voicemail/IMAP
ASTERISK-28505: app_voicemail/IMAP: segfault in leave_voicemail because
not checking mailstream
Reported by: Alexei Gradinari
* [052ab9d966] Alexei Gradinari -- app_voicemail/IMAP: check mailstream
not NULL in leave_voicemail
Category: Bridges/bridge_native_rtp
ASTERISK-28637: chan_sip+native_bridge_rtp: directmedia compatibility
check failure when negociated ptime is not default ptime.
Reported by: Frederic LE FOLL
* [3e73893e53] Frederic LE FOLL -- chan_sip+native_bridge_rtp: no
directmedia for ptime other than default ptime.
Category: Bridges/bridge_softmix
ASTERISK-28618: bridge_softmix: hold not cleared when joining a softmix
bridge
Reported by: Kevin Harwell
* [8b4610acfe] Kevin Harwell -- bridge_softmix: clear hold when joining
a softmix bridge
Category: CDR/General
ASTERISK-28566: CDR backend unload problem during active call(s)
Reported by: Marian Piater
* [1dc3451a34] Sean Bright -- cdr_mysql: Don't clean up on unload unless
we can unregister from CDRs
Category: CDR/cdr_pgsql
ASTERISK-28571: cdr_pgsql: accesses obsolete (and finally removed) column
Reported by: Christoph Moench-Tegeder
* [79cc8ae3b8] Christoph Moench-Tegeder -- cdr_pgsql cel_pgsql
res_config_pgsql: compatibility with PostgreSQL 12
Category: Channels/chan_dahdi
ASTERISK-28615: chan_dahdi: PRI span status may stay "Down, Active" after
a short alarm
Reported by: Frederic LE FOLL
* [d3dd4c5459] Frederic LE FOLL -- chan_dahdi: PRI span status may stay
"Down, Active" after a short alarm
ASTERISK-28536: Asterisk release candidates fail to build on FreeBSD
Reported by: Guido Falsi
* [5ff2f7a016] Guido Falsi -- chan_dahdi: Fix build with clang/llvm
ASTERISK-28525: chan_dahdi: set CHANNEL(hangupsource) when a PRI channel
hangs up
Reported by: Frederic LE FOLL
* [9e67c92502] Frederic LE FOLL -- chan_dahdi: set CHANNEL(hangupsource)
when a PRI channel hangs up
Category: Channels/chan_pjsip
ASTERISK-28578: race condition on pjsip channelstats command
Reported by: Salah Ahmed
* [40acd7d198] Salah Ahmed -- Crash during "pjsip show channelstats"
execution
ASTERISK-28561: Asterisk Deadlocks
Reported by: Aheliotech
* [ae761c7473] Joshua Colp -- pbx: deadlock when outgoing dialed channel
hangs up too quickly
ASTERISK-28086: chan_pjsip: Crash when initiating PlayDTMF over AMI
Reported by: Jeremiah Gadd
* [71f86e78b6] lvl -- chan_pjsip: Prevent segfault when running PlayDTMF
on hungup channel
ASTERISK-28538: chan_pjsip: Deadlock on fax detection
Reported by: Joshua C. Colp
* [4d1baa3ae8] Joshua Colp -- chan_pjsip: Relock correct channel during
"fax" redirect.
Category: Channels/chan_sip/General
ASTERISK-28637: chan_sip+native_bridge_rtp: directmedia compatibility
check failure when negociated ptime is not default ptime.
Reported by: Frederic LE FOLL
* [3e73893e53] Frederic LE FOLL -- chan_sip+native_bridge_rtp: no
directmedia for ptime other than default ptime.
Category: Channels/chan_unistim
ASTERISK-25592: chan_unistim: Clang Warning: variable sized type not at
end of a struct
Reported by: Alexander Traud
* [056ddf76ce] Igor Goncharovsky -- chan_unistim: Fix clang warning:
variable sized type not at end of a struct
Category: Codecs/codec_resample
ASTERISK-28511: codec_resample: Bad sound quality when up sampling from
SLIN16 to SLIN32
Reported by: Ruddy G
* [75d6418d8e] Sean Bright -- codec_resample: Ensure OUTSIDE_SPEEX is
defined when necessary
* [34ab9964f5] Sean Bright -- codec_resample: Upgrade speex_resample to
fix up-sampling bug
Category: Core/BuildSystem
ASTERISK-28487: compile menuselect on gentoo
Reported by: Kilburn
* [a5f05eed70] Sean Bright -- menuselect: Fix curses build on Gentoo
Linux
Category: Core/Channels
ASTERISK-28499: translate: Crash when frame does not have a "src" field
set
Reported by: Gregory Massel
* [61c01df560] Joshua Colp -- AST-2019-005 - translate: Don't assume all
frames will have a src.
Category: Core/Configuration
ASTERISK-23756: setvar directive when used in template and a child of said
template, results in duplicate variable names
Reported by: Michael Goryainov
* [2fa296e7d4] Michael Goryainov -- channels: Allow updating variable
value
Category: Core/General
ASTERISK-28498: cel / cdr: Event times may be incorrect
Reported by: Joshua C. Colp
* [108b1abbd9] Joshua Colp -- cdr / cel: Use event time at event
creation instead of processing.
Category: Core/RTP
ASTERISK-28480: json integer overflow in ssrc and timestamp
Reported by: Salah Ahmed
* [a305f2fdcb] Kevin Harwell -- various modules: json integer overflow
Category: Core/Stasis
ASTERISK-28553: stasis.c: Crash during unload
Reported by: Kevin Harwell
* [57fa604571] Joshua Colp -- stasis: Pass bumped topic_all reference to
proxy_dtor.
Category: Core/UDPTL
ASTERISK-28483: packet lost on UDPTL wrap around
Reported by: Torrey Searle
* [44af3e9018] Torrey Searle -- main/udptl.c: correctly handle udptl
sequence wrap around
Category: Functions/General
ASTERISK-28626: Missing arguments in PJSIP_CONTACT function documentation
Reported by: Pascal Cadotte Michaud
* [450173a0ae] Pascal Cadotte Michaud -- PJSIP_CONTACT: add missing
argument documentation
ASTERISK-26481: FILE function grabs garbage along with read data when
target line has no newline
Reported by: Jonathan Harris
* [92bb381d5d] Sean Bright -- func_env: Prevent FILE() from reading
garbage at end-of-file
Category: General
ASTERISK-28609: Memory Leak in res_rtp_asterisk.c
Reported by: Ted G
* [27a4a3c761] George Joseph -- res_rtp_asterisk: Add frame list
cleanups to ast_rtp_read
ASTERISK-28590: utils.c throws repeated warnings;
"pthread_attr_setstacksize: Invalid argument"
Reported by: Speed Dial Dave
* [b3c56c7fa5] Sean Bright -- utils.h: Set lower bound for thread stack
size to PTHREAD_STACK_MIN
ASTERISK-28523: Asterisk 16.5.0 Memory leak
Reported by: Cyril Ramière
* [f821e81071] Kevin Harwell -- res_sorcery_memory_cache: stale item
update leak
ASTERISK-28472: Asterisk occasionally passes a NULL as srtp->session to
srtp_protect/unprotect causing SEGV
Reported by: Jonas Swiatek
* [5daa9bbaee] Kevin Harwell -- srtp: Fix possible race condition, and
add NULL checks
Category: PBX/pbx_config
ASTERISK-28534: Segmentation fault when there is no priority for an
extension
Reported by: Timothy Vanderaerden
* [8d0edf2b37] Sean Bright -- pbx: Prevent Realtime switch crash on
invalid priority
Category: Resources/res_ari
ASTERISK-28585: ari/resource_events: Crash in event session cleanup
Reported by: Kevin Harwell
* [e37d546109] Joshua Colp -- res_ari_events: Add module reference when
a WebSocket is open.
Category: Resources/res_calendar_exchange
ASTERISK-28572: Memory leaks in res_calendar_exchange and
res_calendar_icalendar
Reported by: Yoooooo Ha
* [b3792e1288] Sean Bright -- res_calendar: Resolve memory leak on
calendar destruction
Category: Resources/res_calendar_icalendar
ASTERISK-28572: Memory leaks in res_calendar_exchange and
res_calendar_icalendar
Reported by: Yoooooo Ha
* [b3792e1288] Sean Bright -- res_calendar: Resolve memory leak on
calendar destruction
Category: Resources/res_parking
ASTERISK-28631: res_parking: Doesn't park when parkee and parker are the
same
Reported by: Ross Beer
* [41d58a4ce2] Joshua Colp -- parking: Fall back to parker channel name
even if it matches parkee.
ASTERISK-28616: parking: Deadlock when multi call parking
Reported by: Joshua C. Colp
* [de433cdcaf] Joshua Colp -- parking: Fix case where we can't get the
parker.
* [d638d9c6c6] Joshua Colp -- parking: Use channel snapshot instead of
channel.
Category: Resources/res_pjsip
ASTERISK-28641: res_pjsip Segfaults when realtime configuration to an AOR
points to a not existent AOR
Reported by: Ross Beer
* [4e057eb9d2] Sean Bright -- res_pjsip_registrar.c: Prevent potential
double free if AOR is not found
ASTERISK-28544: Wrong contact representation in ipv6 mode
Reported by: Jørgen H
* [6527eb8213] Sean Bright -- res_pjsip_transport_websocket: Don't put
brackets around local_name if IPv6
ASTERISK-28521: pjsip: Memory Leak
Reported by: Mark
* [7c0435f854] George Joseph -- pjproject_bundled: Revert pjproject 2.9
commits causing leaks
ASTERISK-28228: res_pjsip: pjsip show contacts prints double entries
Reported by: Ian Jones
* [20459d4cac] Joshua Colp -- res_pjsip: Fix multiple of the same
contact in "pjsip show contacts".
Category: Resources/res_pjsip_mwi
ASTERISK-28575: MWI Send Notify Crash on 16.6
Reported by: Joshua Elson
* [45c0d99185] Kevin Harwell -- res_pjsip_mwi: potential double unref,
and potential unwanted double link
ASTERISK-28552: res_pjsip_mwi: Frack during unload on unsolicited_mwi
container
Reported by: Kevin Harwell
* [996fc40e2b] Kevin Harwell -- res_pjsip_mwi: use an ao2_global object
for mwi containers
Category: Resources/res_pjsip_outbound_registration
ASTERISK-28624: res_pjsip_outbound_registration: add SRV failover
Reported by: Kevin Harwell
* [8c99930375] Kevin Harwell -- res_pjsip_outbound_registration: add
support for SRV failover
ASTERISK-28521: pjsip: Memory Leak
Reported by: Mark
* [7c0435f854] George Joseph -- pjproject_bundled: Revert pjproject 2.9
commits causing leaks
Category: Resources/res_pjsip_path
ASTERISK-28463: res_pjsip_path: Crash when invalid contact is configured
Reported by: Juan Martin
* [51cf060c6c] Sean Bright -- res_pjsip_registrar: Validate Contact URI
before adding to responses
Category: Resources/res_pjsip_sdp_rtp
ASTERISK-28659: res_pjsip_sdp_rtp: Bundle includes non-existent media
stream if codecs create additional streams and offer does not have them
Reported by: nappsoft
* [5949f9a86a] Joshua C. Colp -- res_pjsip_session: Set stream state on
created streams for incoming SDP.
Category: Resources/res_pjsip_session
ASTERISK-28659: res_pjsip_sdp_rtp: Bundle includes non-existent media
stream if codecs create additional streams and offer does not have them
Reported by: nappsoft
* [5949f9a86a] Joshua C. Colp -- res_pjsip_session: Set stream state on
created streams for incoming SDP.
ASTERISK-28445: res_pjsip_session: ast_json_vpack: Invalid UTF-8 string on
hangup when TEST_FRAMEWORK enabled
Reported by: Bernhard Schmidt
* [4d56adf8fb] Sean Bright -- res_pjsip_session.c: Prevent
use-after-free with TEST_FRAMEWORK enabled
ASTERISK-28086: chan_pjsip: Crash when initiating PlayDTMF over AMI
Reported by: Jeremiah Gadd
* [71f86e78b6] lvl -- chan_pjsip: Prevent segfault when running PlayDTMF
on hungup channel
Category: Resources/res_pjsip_t38
ASTERISK-28621: Enforce T.38 error correction mode at 200 ok received
Reported by: Salah Ahmed
* [4ac0299bfb] Salah Ahmed -- res_pjsip_t38: T.38 error correction mode
selection at 200 ok received
Category: Resources/res_rtp_asterisk
ASTERISK-28576: res_rtp_asterisk: ICE Completion Crash when sent packet
length doesn't match
Reported by: Joshua Elson
* [0c486e7edf] Joshua Colp -- res_rtp_asterisk: Always return provided
DTLS packet length.
Category: Resources/res_stasis
ASTERISK-28423: ARI causes STASIS Deadlock
Reported by: Ross Beer
* [7202624b3b] George Joseph -- stasis: Don't hold app_registry and
session locks unnecessarily
Category: pjproject/pjsip
ASTERISK-28574: pjproject fails to build on 16.6.0, works on 16.5
Reported by: Niklas Larsson
* [2652bda3a0] George Joseph -- pjproject_bundled: Replace earlier
reverts with official fixes.
ASTERISK-28509: PJSIP cnonce generated on Linux contains 36 characters,
NEC only supports up to 32 characters
Reported by: Dan Cropp
* [a1d38e19a2] Dan Cropp -- pjproject: Configurable setting for cnonce
to include hyphens or not
New Feature
Category: Applications/app_senddtmf
ASTERISK-28614: app_senddtmf: Allow "receiving" DTMF with PlayDTMF instead
of only "sending"
Reported by: lvl
* [6345a00228] lvl -- app_senddtmf: Add receive mode to AMI Action
PlayDTMF
Category: Core/Jitterbuffer
ASTERISK-28533: func_jitterbuffer: Add support for video synchronization
Reported by: Joshua C. Colp
* [926053d7bd] Joshua Colp -- func_jitterbuffer: Add audio/video sync
support.
Category: Functions/func_curl
ASTERISK-28613: func_curl: CURLOPT cannot set Content-Type header
Reported by: Martin Tomec
* [d579ec9cdf] Martin Tomec -- func_curl.c: Support custom http headers
Category: Resources/res_musiconhold
ASTERISK-17808: [patch] Unregister a realtime moh class
Reported by: Byron Clark
* [9e26136ee6] sungtae kim -- res_musiconhold: Added unregister realtime
moh class
Category: pjproject/pjsip
ASTERISK-28489: Channel variable SIPFROMDOMAIN for chan_pjsip to setup
From header URI domain
Reported by: Stas Kobzar
* [3a246c2a69] Stas Kobzar -- res_pjsip: Channel variable SIPFROMDOMAIN
----------------------------------------------------------------------
Commits Not Associated with an Issue
[Back to Top]
This is a list of all changes that went into this release that did not
reference a JIRA issue.
+------------------------------------------------------------------------+
| Revision | Author | Summary |
|------------+----------------------+------------------------------------|
| de2b8ef23a | Asterisk Development | Update for 17.1.0-rc2 |
| | Team | |
|------------+----------------------+------------------------------------|
| | | Revert "chan_dahdi: set |
| a76d3103fb | George Joseph | CHANNEL(hangupsource) when a PRI |
| | | channel hangs up" |
|------------+----------------------+------------------------------------|
| c8563727d5 | Asterisk Development | Update for 17.1.0-rc1 |
| | Team | |
|------------+----------------------+------------------------------------|
| 08a6e8c553 | Asterisk Development | Update CHANGES and UPGRADE.txt for |
| | Team | 17.1.0 |
|------------+----------------------+------------------------------------|
| 6a89784b78 | Joshua Colp | Revert "PJSIP_CONTACT: add missing |
| | | argument documentation" |
|------------+----------------------+------------------------------------|
| | | res_pjsip_registrar.c: Prevent |
| f26e5bacc0 | Sean Bright | possible buffer overflow with |
| | | domain aliases |
|------------+----------------------+------------------------------------|
| | | channel.c: Resolve issue with |
| 88150323a2 | Thomas Arimont | receiving SIP INFO packets for |
| | | DTMF |
|------------+----------------------+------------------------------------|
| 5b15a1c639 | George Joseph | CI: Turn off shallow cloning |
| | | altogether |
|------------+----------------------+------------------------------------|
| cc59e21409 | Sean Bright | media_cache.c: Various CLI |
| | | improvements |
|------------+----------------------+------------------------------------|
| 2a92e6b576 | George Joseph | CI: Fix missing script block in |
| | | jenkinsfiles |
|------------+----------------------+------------------------------------|
| f0d1ce50af | George Joseph | CI: Fix missing script block in |
| | | jenkinsfiles |
|------------+----------------------+------------------------------------|
| 46dceab33f | George Joseph | CI: Increase clone depth and do |
| | | better cleanup |
|------------+----------------------+------------------------------------|
| 76ef36fafc | Sean Bright | res_pjsip_registrar: Fix |
| | | uninitlized variable warning |
|------------+----------------------+------------------------------------|
| 649733612d | Alexei Gradinari | serializer: set high/low alert |
| | | levels on whole pool |
|------------+----------------------+------------------------------------|
| 8bc6fa0fbd | Kevin Harwell | various files - fix some alerts |
| | | raised by lgtm code analysis |
|------------+----------------------+------------------------------------|
| ea3daa94c8 | Kevin Harwell | res_pjsip_session: initialize |
| | | pending's topology to endpoint's |
|------------+----------------------+------------------------------------|
| | | ExternalMedia: Change return |
| 2d665091a3 | George Joseph | object from ExternalMedia to |
| | | Channel |
|------------+----------------------+------------------------------------|
| b8ae799ca9 | Joshua Colp | res_rtp_asterisk: Remove a log |
| | | message that slipped in. |
|------------+----------------------+------------------------------------|
| ba688e6891 | Joshua Colp | test_res_rtp: Enable FIR and REMB |
| | | nominal tests. |
|------------+----------------------+------------------------------------|
| c84135d2a3 | Chris Savinovich | test_taskprocessor.c: Fix test |
| | | failure on Ubuntu |
|------------+----------------------+------------------------------------|
| 37ec88c4c8 | Kevin Harwell | serializer: move/add asterisk |
| | | serializer pool functionality |
|------------+----------------------+------------------------------------|
| 299ba78b09 | Kevin Harwell | res_pjsip/res_pjsip_mwi: use |
| | | centralized serializer pools |
|------------+----------------------+------------------------------------|
| 25fbe79793 | Corey Farrell | stasis_state: Create internal |
| | | stasis_state_proxy object. |
|------------+----------------------+------------------------------------|
| 4b47d4774d | Alexei Gradinari | res_pjsip_pubsub: add endpoint to |
| | | some warning |
|------------+----------------------+------------------------------------|
| d223419bcd | Jonathan Rose | basic-pbx: Bring forward queue |
| | | configuration from 13 |
|------------+----------------------+------------------------------------|
| | | taskprocessor.c: Added "like" |
| 8269fcbf03 | Ben Ford | support to 'core show |
| | | taskprocessors' |
|------------+----------------------+------------------------------------|
| 37139e16a5 | Asterisk Development | Update CHANGES and UPGRADE.txt for |
| | Team | 17.0.0-rc2 |
|------------+----------------------+------------------------------------|
| 7550a82fe0 | Sean Bright | res_musiconhold: Add new |
| | | 'playlist' mode |
|------------+----------------------+------------------------------------|
| 175a7ccac7 | Kevin Harwell | res_pjsip_pubsub: change warning |
| | | to debug |
|------------+----------------------+------------------------------------|
| 5bedd4a9b4 | Corey Farrell | core: Fix ABI mismatch of |
| | | ao2_global_obj. |
|------------+----------------------+------------------------------------|
| f181dfc065 | Ben Ford | taskprocessor.c: Add CLI commands |
| | | to reset taskprocessor stats. |
|------------+----------------------+------------------------------------|
| ec712cfab2 | Corey Farrell | core: Add |
| | | AO2_ALLOC_OPT_NO_REF_DEBUG option. |
|------------+----------------------+------------------------------------|
| b1c5753b78 | George Joseph | astmm.c: Display backtrace with |
| | | memory show allocations |
|------------+----------------------+------------------------------------|
| af0ccbc45e | Corey Farrell | stasis: refcounter.py can |
| | | incorrectly report skewed objects. |
|------------+----------------------+------------------------------------|
| fd7fc3d7a5 | Corey Farrell | stasis: Fix leaks |
|------------+----------------------+------------------------------------|
| 78f329dad9 | Corey Farrell | app_voicemail: Fix module unload |
| | | leak. |
|------------+----------------------+------------------------------------|
| 1d960195c2 | Ben Ford | res_rtp_asterisk.c: Send RTCP as |
| | | compound packets. |
|------------+----------------------+------------------------------------|
| 5dad4f4ea1 | Ben Ford | res_rtp: Add unit tests for RTCP |
| | | stats. |
|------------+----------------------+------------------------------------|
| 44068cc6bf | George Joseph | ARI: External Media |
|------------+----------------------+------------------------------------|
| c060ef7dee | George Joseph | chan_sip: Update links referenced |
| | | in deprecation notice |
|------------+----------------------+------------------------------------|
| | | test_utils.c: Skip test |
| 7d99710fa6 | Chris-Savinovich | adsi_loaded_test if module not |
| | | loaded. |
|------------+----------------------+------------------------------------|
| | | chan_unistim: Fix code, causing |
| 95b3c9839d | Igor Goncharovsky | all incoming DTMF sent back to |
| | | asterisk |
|------------+----------------------+------------------------------------|
| e7f1f7eefd | Igor Goncharovsky | chan_unistim: Fix RTP port byte |
| | | order for big-endian arch |
|------------+----------------------+------------------------------------|
| a0b0c7540c | Alexei Gradinari | Fix misname 'res_external_mwi' to |
| | | 'res_mwi_external' in comments. |
|------------+----------------------+------------------------------------|
| 581ffdf6a9 | George Joseph | chan_rtp: Accept hostname as well |
| | | as ip address as destination |
|------------+----------------------+------------------------------------|
| b3d9f6ef6c | George Joseph | dns_core: Create new API |
| | | ast_dns_resolve_ipv6_and_ipv4 |
|------------+----------------------+------------------------------------|
| f6ab42df26 | George Joseph | res_ari.c: Prefer exact handler |
| | | match over wildcard |
|------------+----------------------+------------------------------------|
| e123d1ccc5 | Sean Bright | audiohook.c: Substitute silence |
| | | for unavailable audio frames |
|------------+----------------------+------------------------------------|
| 5489ad5574 | George Joseph | CI: Escape backslashes in |
| | | printenv/sort/tr |
|------------+----------------------+------------------------------------|
| aa44e723c5 | George Joseph | CI: Add "throttle" label and |
| | | "skip_gate" capability |
|------------+----------------------+------------------------------------|
| 8652140794 | George Joseph | CI: Make node labels job-specific |
|------------+----------------------+------------------------------------|
| 87f8ca2812 | Sean Bright | app_voicemail: Remove extra |
| | | menuselect build options |
|------------+----------------------+------------------------------------|
| 1976db6ffd | Sean Bright | res_musiconhold: Use a vector |
| | | instead of custom array allocation |
|------------+----------------------+------------------------------------|
| c748187bbf | Sean Bright | manager: Send fewer packets |
|------------+----------------------+------------------------------------|
| f1e0c9d1b8 | Asterisk Development | Update CHANGES and UPGRADE.txt for |
| | Team | 17.0.0 |
|------------+----------------------+------------------------------------|
| 4f2ad5a55d | George Joseph | doc: Add "master-only" flag back |
| | | to the CHANGES and UPGRADE files |
|------------+----------------------+------------------------------------|
| a66ccb90ac | Sean Bright | res_musiconhold: Use |
| | | ast_pipe_nonblock() wrapper |
|------------+----------------------+------------------------------------|
| e821a637a8 | George Joseph | loader.c: Fix possible SEGV when a |
| | | module fails to register |
+------------------------------------------------------------------------+
----------------------------------------------------------------------
Diffstat Results
[Back to Top]
This is a summary of the changes to the source code that went into this
release that was generated using the diffstat utility.
asterisk-17.0.0-summary.html | 1265 ----
asterisk-17.0.0-summary.txt | 2973 ----------
b/.version | 2
b/CHANGES | 94
b/ChangeLog | 1876 +++++-
b/README-SERIOUSLY.bestpractices.md | 4
b/UPGRADE.txt | 10
b/addons/cdr_mysql.c | 18
b/addons/chan_ooh323.c | 7
b/apps/app_amd.c | 24
b/apps/app_cdr.c | 8
b/apps/app_chanisavail.c | 3
b/apps/app_dictate.c | 4
b/apps/app_followme.c | 10
b/apps/app_meetme.c | 2
b/apps/app_minivm.c | 3
b/apps/app_mixmonitor.c | 13
b/apps/app_playback.c | 9
b/apps/app_queue.c | 6
b/apps/app_readexten.c | 3
b/apps/app_senddtmf.c | 13
b/apps/app_voicemail.c | 217
b/asterisk-17.1.0-rc2-summary.html | 28
b/asterisk-17.1.0-rc2-summary.txt | 133
b/bridges/bridge_native_rtp.c | 5
b/bridges/bridge_softmix.c | 7
b/cdr/cdr_pgsql.c | 2
b/cel/cel_pgsql.c | 2
b/channels/chan_dahdi.c | 35
b/channels/chan_dahdi.h | 18
b/channels/chan_iax2.c | 16
b/channels/chan_motif.c | 9
b/channels/chan_pjsip.c | 24
b/channels/chan_rtp.c | 19
b/channels/chan_sip.c | 39
b/channels/chan_unistim.c | 174
b/channels/pjsip/cli_commands.c | 13
b/channels/pjsip/dialplan_functions.c | 65
b/channels/pjsip/include/dialplan_functions.h | 25
b/channels/sig_pri.c | 2
b/codecs/Makefile | 3
b/codecs/ex_alaw.h | 5
b/codecs/ex_g722.h | 5
b/codecs/ex_ulaw.h | 5
b/codecs/speex/arch.h | 13
b/codecs/speex/fixed_generic.h | 4
b/codecs/speex/resample.c | 332 -
b/codecs/speex/speex_resampler.h | 4
b/configs/basic-pbx/extensions.conf | 14
b/configs/basic-pbx/modules.conf | 1
b/configs/basic-pbx/queues.conf | 19
b/configs/samples/extconfig.conf.sample | 1
b/configs/samples/musiconhold.conf.sample | 23
b/configure | 82
b/configure.ac | 20
b/contrib/ast-db-manage/config/versions/fbb7766f17bc_add_playlist_to_moh.py | 54
b/contrib/realtime/mysql/mysql_config.sql | 15
b/contrib/realtime/postgresql/postgresql_config.sql | 21
b/formats/format_g726.c | 16
b/formats/msgsm.h | 4
b/funcs/func_curl.c | 37
b/funcs/func_env.c | 5
b/funcs/func_jitterbuffer.c | 19
b/include/asterisk/abstract_jb.h | 4
b/include/asterisk/ari.h | 2
b/include/asterisk/astobj2.h | 5
b/include/asterisk/audiohook.h | 2
b/include/asterisk/autoconfig.h.in | 6
b/include/asterisk/calendar.h | 4
b/include/asterisk/channel_internal.h | 5
b/include/asterisk/config.h | 18
b/include/asterisk/config_options.h | 2
b/include/asterisk/dns_core.h | 22
b/include/asterisk/dns_internal.h | 5
b/include/asterisk/format_cache.h | 5
b/include/asterisk/max_forwards.h | 1
b/include/asterisk/mixmonitor.h | 5
b/include/asterisk/parking.h | 5
b/include/asterisk/res_pjsip.h | 5
b/include/asterisk/res_pjsip_presence_xml.h | 5
b/include/asterisk/res_pjsip_session.h | 2
b/include/asterisk/rtp_engine.h | 111
b/include/asterisk/serializer.h | 85
b/include/asterisk/slin.h | 5
b/include/asterisk/taskprocessor.h | 9
b/include/asterisk/utils.h | 9
b/main/abstract_jb.c | 178
b/main/app.c | 9
b/main/asterisk.c | 15
b/main/astmm.c | 23
b/main/astobj2.c | 88
b/main/astobj2_container.c | 24
b/main/astobj2_global.c | 97
b/main/astobj2_hash.c | 21
b/main/astobj2_rbtree.c | 13
b/main/audiohook.c | 11
b/main/channel.c | 105
b/main/codec_builtin.c | 8
b/main/config.c | 16
b/main/dns_core.c | 72
b/main/event.c | 17
b/main/file.c | 37
b/main/format_cache.c | 8
b/main/indications.c | 6
b/main/manager.c | 92
b/main/media_cache.c | 47
b/main/pbx.c | 5
b/main/pbx_variables.c | 23
b/main/rtp_engine.c | 137
b/main/serializer.c | 189
b/main/stasis.c | 22
b/main/stasis_cache.c | 10
b/main/stasis_state.c | 298 -
b/main/taskprocessor.c | 219
b/res/ari/config.c | 10
b/res/ari/resource_channels.c | 158
b/res/ari/resource_channels.h | 42
b/res/ari/resource_events.c | 10
b/res/parking/parking_bridge.c | 36
b/res/parking/parking_bridge_features.c | 2
b/res/parking/res_parking.h | 5
b/res/res_ari_channels.c | 135
b/res/res_ari_events.c | 2
b/res/res_calendar_ews.c | 1
b/res/res_calendar_exchange.c | 1
b/res/res_calendar_icalendar.c | 1
b/res/res_config_curl.c | 5
b/res/res_config_pgsql.c | 2
b/res/res_musiconhold.c | 294
b/res/res_phoneprov.c | 6
b/res/res_pjsip.c | 83
b/res/res_pjsip/config_system.c | 2
b/res/res_pjsip/config_transport.c | 17
b/res/res_pjsip/pjsip_configuration.c | 4
b/res/res_pjsip/pjsip_resolver.c | 4
b/res/res_pjsip_endpoint_identifier_ip.c | 18
b/res/res_pjsip_mwi.c | 339 -
b/res/res_pjsip_outbound_registration.c | 17
b/res/res_pjsip_pubsub.c | 20
b/res/res_pjsip_registrar.c | 55
b/res/res_pjsip_session.c | 35
b/res/res_pjsip_t38.c | 40
b/res/res_pjsip_transport_websocket.c | 2
b/res/res_resolver_unbound.c | 6
b/res/res_rtp_asterisk.c | 297
b/res/res_stasis.c | 43
b/res/stasis/command.c | 2
b/res/stasis/control.c | 2
b/rest-api-templates/res_ari_resource.c.mustache | 2
b/rest-api/api-docs/channels.json | 125
b/tests/CI/gates.jenkinsfile | 12
b/tests/CI/periodics-daily.jenkinsfile | 11
b/tests/CI/ref_debug.jenkinsfile | 9
b/tests/CI/unittests.jenkinsfile | 9
b/tests/test_data_buffer.c | 2
b/tests/test_res_rtp.c | 516 +
b/tests/test_taskprocessor.c | 2
157 files changed, 6536 insertions(+), 5842 deletions(-)

View File

@ -713,6 +713,8 @@ static int native_rtp_bridge_compatible_check(struct ast_bridge *bridge, struct
framing_inst0, framing_inst1);
return 0;
}
ast_debug(3, "Symmetric ptimes on the two call legs (%u). May be able to native bridge in RTP\n",
framing_inst0);
}
read_ptime0 = ast_format_cap_get_format_framing(cap0, ast_channel_rawreadformat(bc0->chan));
@ -726,6 +728,9 @@ static int native_rtp_bridge_compatible_check(struct ast_bridge *bridge, struct
read_ptime0, write_ptime1, read_ptime1, write_ptime0);
return 0;
}
ast_debug(3, "Bridge '%s': Packetization comparison success between RTP streams (read_ptime0:%d == write_ptime1:%d and read_ptime1:%d == write_ptime0:%d).\n",
bridge->uniqueid,
read_ptime0, write_ptime1, read_ptime1, write_ptime0);
return 1;
}

View File

@ -726,6 +726,13 @@ static int softmix_bridge_join(struct ast_bridge *bridge, struct ast_bridge_chan
sfu_topologies_on_join(bridge, bridge_channel);
}
/* Complete any active hold before entering, or transitioning to softmix. */
if (ast_channel_hold_state(bridge_channel->chan) == AST_CONTROL_HOLD) {
ast_debug(1, "Channel %s simulating UNHOLD for bridge softmix join.\n",
ast_channel_name(bridge_channel->chan));
ast_indicate(bridge_channel->chan, AST_CONTROL_UNHOLD);
}
softmix_poke_thread(softmix_data);
return 0;
}

View File

@ -707,7 +707,7 @@ static int config_module(int reload)
schemaname = ast_alloca(strlen(tmp_schemaname) * 2 + 1);
PQescapeStringConn(conn, schemaname, tmp_schemaname, strlen(tmp_schemaname), NULL);
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",
tablename,
ast_strlen_zero(schemaname) ? "" : "'", ast_strlen_zero(schemaname) ? "current_schema()" : schemaname, ast_strlen_zero(schemaname) ? "" : "'");
} else {

View File

@ -597,7 +597,7 @@ static int process_my_load_module(struct ast_config *cfg)
PQescapeStringConn(conn, schemaname, schema, lenschema, NULL);
snprintf(sqlcmd, sizeof(sqlcmd),
"SELECT a.attname, t.typname, a.attlen, a.attnotnull, d.adsrc, a.atttypmod "
"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 ("

View File

@ -4382,7 +4382,7 @@ static char *alarm2str(int alm)
static const char *event2str(int event)
{
static char buf[256];
if ((event < (ARRAY_LEN(events))) && (event > -1))
if ((event > -1) && (event < (ARRAY_LEN(events))) )
return events[event];
sprintf(buf, "Event %d", event); /* safe */
return buf;
@ -12770,8 +12770,10 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf,
struct ast_variable *v, *tmpvar;
for (v = conf->chan.vars ; v ; v = v->next) {
if ((tmpvar = ast_variable_new(v->name, v->value, v->file))) {
tmpvar->next = tmp->vars;
tmp->vars = tmpvar;
if (ast_variable_list_replace(&tmp->vars, tmpvar)) {
tmpvar->next = tmp->vars;
tmp->vars = tmpvar;
}
}
}
}
@ -15158,10 +15160,12 @@ static void mfcr2_show_links_of(struct ast_cli_args *a, struct r2links *list_hea
int channo;
int prev_channo;
x++;
switch (mfcr2->r2master) {
case 0L: thread_status = "zero"; break;
case AST_PTHREADT_NULL: thread_status = "none"; break;
default: thread_status = "created"; break;
if (mfcr2->r2master == 0L) {
thread_status = "zero";
} else if (mfcr2->r2master == AST_PTHREADT_NULL) {
thread_status = "none";
} else {
thread_status = "created";
}
snprintf(index, sizeof(index), "%d", mfcr2->index);
snprintf(live_chans_str, sizeof(live_chans_str), "%d", mfcr2->live_chans);
@ -15170,7 +15174,7 @@ static void mfcr2_show_links_of(struct ast_cli_args *a, struct r2links *list_hea
inside_range = 0;
len = 0;
/* Prepare nice string in channel_list[] */
for (i = 0; i < mfcr2->numchans; i++) {
for (i = 0; i < mfcr2->numchans && len < sizeof(channel_list) - 1; i++) {
struct dahdi_pvt *p = mfcr2->pvts[i];
if (!p) {
continue;
@ -18128,13 +18132,17 @@ static int process_dahdi(struct dahdi_chan_conf *confp, const char *cat, struct
} else if (!strcasecmp(v->name, "namedpickupgroup")) {
confp->chan.named_pickupgroups = ast_get_namedgroups(v->value);
} else if (!strcasecmp(v->name, "setvar")) {
char *varname = ast_strdupa(v->value), *varval = NULL;
struct ast_variable *tmpvar;
if (varname && (varval = strchr(varname, '='))) {
*varval++ = '\0';
if ((tmpvar = ast_variable_new(varname, varval, ""))) {
tmpvar->next = confp->chan.vars;
confp->chan.vars = tmpvar;
if (v->value) {
char *varval = NULL;
struct ast_variable *tmpvar;
char varname[strlen(v->value) + 1];
strcpy(varname, v->value); /* safe */
if ((varval = strchr(varname, '='))) {
*varval++ = '\0';
if ((tmpvar = ast_variable_new(varname, varval, ""))) {
tmpvar->next = confp->chan.vars;
confp->chan.vars = tmpvar;
}
}
}
} else if (!strcasecmp(v->name, "immediate")) {
@ -19078,9 +19086,12 @@ static int process_dahdi(struct dahdi_chan_conf *confp, const char *cat, struct
} else if (!strcasecmp(v->name, "mfcr2_logging")) {
openr2_log_level_t tmplevel;
char *clevel;
char *logval = ast_strdupa(v->value);
char *logval;
char copy[strlen(v->value) + 1];
strcpy(copy, v->value); /* safe */
logval = copy;
while (logval) {
clevel = strsep(&logval,",");
clevel = strsep(&logval,",");
if (-1 == (tmplevel = openr2_log_get_level(clevel))) {
ast_log(LOG_WARNING, "Ignoring invalid logging level: '%s' at line %d.\n", clevel, v->lineno);
continue;

View File

@ -692,15 +692,15 @@ struct dahdi_pvt {
openr2_calling_party_category_t mfcr2_category;
int mfcr2_dnis_index;
int mfcr2_ani_index;
int mfcr2call:1;
int mfcr2_answer_pending:1;
int mfcr2_charge_calls:1;
int mfcr2_allow_collect_calls:1;
int mfcr2_forced_release:1;
int mfcr2_dnis_matched:1;
int mfcr2_call_accepted:1;
int mfcr2_accept_on_offer:1;
int mfcr2_progress_sent:1;
unsigned int mfcr2call:1;
unsigned int mfcr2_answer_pending:1;
unsigned int mfcr2_charge_calls:1;
unsigned int mfcr2_allow_collect_calls:1;
unsigned int mfcr2_forced_release:1;
unsigned int mfcr2_dnis_matched:1;
unsigned int mfcr2_call_accepted:1;
unsigned int mfcr2_accept_on_offer:1;
unsigned int mfcr2_progress_sent:1;
#endif /* defined(HAVE_OPENR2) */
/*! \brief DTMF digit in progress. 0 when no digit in progress. */
char begindigit;

View File

@ -7916,9 +7916,11 @@ static int check_access(int callno, struct ast_sockaddr *addr, struct iax_ies *i
/* We found our match (use the first) */
/* copy vars */
for (v = user->vars ; v ; v = v->next) {
if((tmpvar = ast_variable_new(v->name, v->value, v->file))) {
tmpvar->next = iaxs[callno]->vars;
iaxs[callno]->vars = tmpvar;
if ((tmpvar = ast_variable_new(v->name, v->value, v->file))) {
if (ast_variable_list_replace(&iaxs[callno]->vars, tmpvar)) {
tmpvar->next = iaxs[callno]->vars;
iaxs[callno]->vars = tmpvar;
}
}
}
/* If a max AUTHREQ restriction is in place, activate it */
@ -11111,18 +11113,18 @@ static int socket_process_helper(struct iax2_thread *thread)
if (iaxs[fr->callno]->pingtime <= peer->maxms) {
ast_log(LOG_NOTICE, "Peer '%s' is now REACHABLE! Time: %u\n", peer->name, iaxs[fr->callno]->pingtime);
ast_endpoint_set_state(peer->endpoint, AST_ENDPOINT_ONLINE);
blob = ast_json_pack("{s: s, s: i}",
blob = ast_json_pack("{s: s, s: I}",
"peer_status", "Reachable",
"time", iaxs[fr->callno]->pingtime);
"time", (ast_json_int_t)iaxs[fr->callno]->pingtime);
ast_devstate_changed(AST_DEVICE_NOT_INUSE, AST_DEVSTATE_CACHABLE, "IAX2/%s", peer->name); /* Activate notification */
}
} else if ((peer->historicms > 0) && (peer->historicms <= peer->maxms)) {
if (iaxs[fr->callno]->pingtime > peer->maxms) {
ast_log(LOG_NOTICE, "Peer '%s' is now TOO LAGGED (%u ms)!\n", peer->name, iaxs[fr->callno]->pingtime);
ast_endpoint_set_state(peer->endpoint, AST_ENDPOINT_ONLINE);
blob = ast_json_pack("{s: s, s: i}",
blob = ast_json_pack("{s: s, s: I}",
"peer_status", "Lagged",
"time", iaxs[fr->callno]->pingtime);
"time", (ast_json_int_t)iaxs[fr->callno]->pingtime);
ast_devstate_changed(AST_DEVICE_UNAVAILABLE, AST_DEVSTATE_CACHABLE, "IAX2/%s", peer->name); /* Activate notification */
}
}
@ -13179,9 +13181,11 @@ static struct iax2_user *build_user(const char *name, struct ast_variable *v, st
if ((varval = strchr(varname, '='))) {
*varval = '\0';
varval++;
if((tmpvar = ast_variable_new(varname, varval, ""))) {
tmpvar->next = user->vars;
user->vars = tmpvar;
if ((tmpvar = ast_variable_new(varname, varval, ""))) {
if (ast_variable_list_replace(&user->vars, tmpvar)) {
tmpvar->next = user->vars;
user->vars = tmpvar;
}
}
}
} else if (!strcasecmp(v->name, "allow")) {

View File

@ -2086,15 +2086,16 @@ static int jingle_interpret_description(struct jingle_session *session, iks *des
/* Iterate the codecs updating the relevant RTP instance as we go */
for (codec = iks_child(description); codec; codec = iks_next(codec)) {
char *id = iks_find_attrib(codec, "id"), *name = iks_find_attrib(codec, "name");
char *id = iks_find_attrib(codec, "id");
char *attr_name = iks_find_attrib(codec, "name");
char *clockrate = iks_find_attrib(codec, "clockrate");
int rtp_id, rtp_clockrate;
if (!ast_strlen_zero(id) && !ast_strlen_zero(name) && (sscanf(id, "%30d", &rtp_id) == 1)) {
if (!ast_strlen_zero(id) && !ast_strlen_zero(attr_name) && (sscanf(id, "%30d", &rtp_id) == 1)) {
if (!ast_strlen_zero(clockrate) && (sscanf(clockrate, "%30d", &rtp_clockrate) == 1)) {
ast_rtp_codecs_payloads_set_rtpmap_type_rate(&codecs, NULL, rtp_id, media, name, 0, rtp_clockrate);
ast_rtp_codecs_payloads_set_rtpmap_type_rate(&codecs, NULL, rtp_id, media, attr_name, 0, rtp_clockrate);
} else {
ast_rtp_codecs_payloads_set_rtpmap_type(&codecs, NULL, rtp_id, media, name, 0);
ast_rtp_codecs_payloads_set_rtpmap_type(&codecs, NULL, rtp_id, media, attr_name, 0);
}
}
}

View File

@ -749,7 +749,8 @@ static int chan_pjsip_answer(struct ast_channel *ast)
}
/*! \brief Internal helper function called when CNG tone is detected */
static struct ast_frame *chan_pjsip_cng_tone_detected(struct ast_sip_session *session, struct ast_frame *f)
static struct ast_frame *chan_pjsip_cng_tone_detected(struct ast_channel *ast, struct ast_sip_session *session,
struct ast_frame *f)
{
const char *target_context;
int exists;
@ -765,11 +766,11 @@ static struct ast_frame *chan_pjsip_cng_tone_detected(struct ast_sip_session *se
}
/* If already executing in the fax extension don't do anything */
if (!strcmp(ast_channel_exten(session->channel), "fax")) {
if (!strcmp(ast_channel_exten(ast), "fax")) {
return f;
}
target_context = S_OR(ast_channel_macrocontext(session->channel), ast_channel_context(session->channel));
target_context = S_OR(ast_channel_macrocontext(ast), ast_channel_context(ast));
/*
* We need to unlock the channel here because ast_exists_extension has the
@ -778,25 +779,30 @@ static struct ast_frame *chan_pjsip_cng_tone_detected(struct ast_sip_session *se
*
* ast_async_goto() has its own restriction on not holding the channel lock.
*/
ast_channel_unlock(session->channel);
ast_channel_unlock(ast);
ast_frfree(f);
f = &ast_null_frame;
exists = ast_exists_extension(session->channel, target_context, "fax", 1,
S_COR(ast_channel_caller(session->channel)->id.number.valid,
ast_channel_caller(session->channel)->id.number.str, NULL));
exists = ast_exists_extension(ast, target_context, "fax", 1,
S_COR(ast_channel_caller(ast)->id.number.valid,
ast_channel_caller(ast)->id.number.str, NULL));
if (exists) {
ast_verb(2, "Redirecting '%s' to fax extension due to CNG detection\n",
ast_channel_name(session->channel));
pbx_builtin_setvar_helper(session->channel, "FAXEXTEN", ast_channel_exten(session->channel));
if (ast_async_goto(session->channel, target_context, "fax", 1)) {
ast_channel_name(ast));
pbx_builtin_setvar_helper(ast, "FAXEXTEN", ast_channel_exten(ast));
if (ast_async_goto(ast, target_context, "fax", 1)) {
ast_log(LOG_ERROR, "Failed to async goto '%s' into fax extension in '%s'\n",
ast_channel_name(session->channel), target_context);
ast_channel_name(ast), target_context);
}
} else {
ast_log(LOG_NOTICE, "FAX CNG detected on '%s' but no fax extension in '%s'\n",
ast_channel_name(session->channel), target_context);
ast_channel_name(ast), target_context);
}
ast_channel_lock(session->channel);
/* It's possible for a masquerade to have occurred when doing the ast_async_goto resulting in
* the channel on the session having changed. Since we need to return with the original channel
* locked we lock the channel that was passed in and not session->channel.
*/
ast_channel_lock(ast);
return f;
}
@ -895,7 +901,11 @@ static struct ast_frame *chan_pjsip_read_stream(struct ast_channel *ast)
if (f->subclass.integer == 'f') {
ast_debug(3, "Channel driver fax CNG detected on %s\n",
ast_channel_name(ast));
f = chan_pjsip_cng_tone_detected(session, f);
f = chan_pjsip_cng_tone_detected(ast, session, f);
/* When chan_pjsip_cng_tone_detected returns it is possible for the
* channel pointed to by ast and by session->channel to differ due to a
* masquerade. It's best not to touch things after this.
*/
} else {
ast_debug(3, "* Detected inband DTMF '%c' on '%s'\n", f->subclass.integer,
ast_channel_name(ast));
@ -1648,6 +1658,7 @@ static int chan_pjsip_indicate(struct ast_channel *ast, int condition, const voi
if (ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), ast_format_vp8) != AST_FORMAT_CMP_NOT_EQUAL ||
ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), ast_format_vp9) != AST_FORMAT_CMP_NOT_EQUAL ||
ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), ast_format_h265) != AST_FORMAT_CMP_NOT_EQUAL ||
(channel->session->endpoint->media.webrtc &&
ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), ast_format_h264) != AST_FORMAT_CMP_NOT_EQUAL)) {
/* FIXME Fake RTP write, this will be sent as an RTCP packet. Ideally the
@ -1727,7 +1738,7 @@ static int chan_pjsip_indicate(struct ast_channel *ast, int condition, const voi
device_buf = alloca(device_buf_size);
ast_channel_get_device_name(ast, device_buf, device_buf_size);
ast_devstate_changed_literal(AST_DEVICE_ONHOLD, 1, device_buf);
if (!channel->session->endpoint->moh_passthrough) {
if (!channel->session->moh_passthrough) {
ast_moh_start(ast, data, NULL);
} else {
if (ast_sip_push_task(channel->session->serializer, remote_send_hold, ao2_bump(channel->session))) {
@ -1743,7 +1754,7 @@ static int chan_pjsip_indicate(struct ast_channel *ast, int condition, const voi
device_buf = alloca(device_buf_size);
ast_channel_get_device_name(ast, device_buf, device_buf_size);
ast_devstate_changed_literal(AST_DEVICE_UNKNOWN, 1, device_buf);
if (!channel->session->endpoint->moh_passthrough) {
if (!channel->session->moh_passthrough) {
ast_moh_stop(ast);
} else {
if (ast_sip_push_task(channel->session->serializer, remote_send_unhold, ao2_bump(channel->session))) {
@ -2250,6 +2261,12 @@ static int chan_pjsip_digit_end(struct ast_channel *ast, char digit, unsigned in
struct ast_sip_session_media *media;
int res = 0;
if (!channel || !channel->session) {
/* This happens when the channel is hungup while a DTMF digit is playing. See ASTERISK-28086 */
ast_debug(3, "Channel %s disappeared while calling digit_end\n", ast_channel_name(ast));
return -1;
}
media = channel->session->active_media_state->default_session[AST_MEDIA_TYPE_AUDIO];
switch (channel->session->dtmf) {
@ -3211,6 +3228,12 @@ static struct ast_custom_function dtmf_mode_function = {
.write = pjsip_acf_dtmf_mode_write
};
static struct ast_custom_function moh_passthrough_function = {
.name = "PJSIP_MOH_PASSTHROUGH",
.read = pjsip_acf_moh_passthrough_read,
.write = pjsip_acf_moh_passthrough_write
};
static struct ast_custom_function session_refresh_function = {
.name = "PJSIP_SEND_SESSION_REFRESH",
.write = pjsip_acf_session_refresh_write,
@ -3263,6 +3286,11 @@ static int load_module(void)
goto end;
}
if (ast_custom_function_register(&moh_passthrough_function)) {
ast_log(LOG_WARNING, "Unable to register PJSIP_MOH_PASSTHROUGH dialplan function\n");
goto end;
}
if (ast_custom_function_register(&session_refresh_function)) {
ast_log(LOG_WARNING, "Unable to register PJSIP_SEND_SESSION_REFRESH dialplan function\n");
goto end;
@ -3308,6 +3336,7 @@ end:
ast_sip_session_unregister_supplement(&call_pickup_supplement);
ast_sip_unregister_service(&refer_callback_module);
ast_custom_function_unregister(&dtmf_mode_function);
ast_custom_function_unregister(&moh_passthrough_function);
ast_custom_function_unregister(&media_offer_function);
ast_custom_function_unregister(&chan_pjsip_dial_contacts_function);
ast_custom_function_unregister(&chan_pjsip_parse_uri_function);
@ -3335,6 +3364,7 @@ static int unload_module(void)
ast_sip_unregister_service(&refer_callback_module);
ast_custom_function_unregister(&dtmf_mode_function);
ast_custom_function_unregister(&moh_passthrough_function);
ast_custom_function_unregister(&media_offer_function);
ast_custom_function_unregister(&chan_pjsip_dial_contacts_function);
ast_custom_function_unregister(&chan_pjsip_parse_uri_function);

View File

@ -43,6 +43,7 @@
#include "asterisk/causes.h"
#include "asterisk/format_cache.h"
#include "asterisk/multicast_rtp.h"
#include "asterisk/dns_core.h"
/* Forward declarations */
static struct ast_channel *multicast_rtp_request(const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause);
@ -293,9 +294,23 @@ static struct ast_channel *unicast_rtp_request(const char *type, struct ast_form
ast_log(LOG_ERROR, "Destination is required for the 'UnicastRTP' channel\n");
goto failure;
}
if (!ast_sockaddr_parse(&address, args.destination, PARSE_PORT_REQUIRE)) {
ast_log(LOG_ERROR, "Destination '%s' could not be parsed\n", args.destination);
goto failure;
int rc;
char *host;
char *port;
rc = ast_sockaddr_split_hostport(args.destination, &host, &port, PARSE_PORT_REQUIRE);
if (!rc) {
ast_log(LOG_ERROR, "Unable to parse destination '%s' into host and port\n", args.destination);
goto failure;
}
rc = ast_dns_resolve_ipv6_and_ipv4(&address, host, port);
if (rc != 0) {
ast_log(LOG_ERROR, "Unable to resolve host '%s'\n", host);
goto failure;
}
}
if (!ast_strlen_zero(args.options)

View File

@ -8193,8 +8193,11 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
/* Use only the preferred audio format, which is stored at the '0' index */
fmt = ast_format_cap_get_best_by_type(what, AST_MEDIA_TYPE_AUDIO); /* get the best audio format */
if (fmt) {
int framing;
ast_format_cap_remove_by_type(caps, AST_MEDIA_TYPE_AUDIO); /* remove only the other audio formats */
ast_format_cap_append(caps, fmt, 0); /* add our best choice back */
framing = ast_format_cap_get_format_framing(what, fmt);
ast_format_cap_append(caps, fmt, framing); /* add our best choice back */
} else {
/* If we don't have an audio format, try to get something */
fmt = ast_format_cap_get_format(caps, 0);
@ -19245,18 +19248,6 @@ static enum check_auth_result check_peer_ok(struct sip_pvt *p, char *of,
bogus_peer = NULL;
}
/* build_peer, called through sip_find_peer, is not able to check the
* sip_pvt->natdetected flag in order to determine if the peer is behind
* NAT or not when SIP_PAGE3_NAT_AUTO_RPORT or SIP_PAGE3_NAT_AUTO_COMEDIA
* are set on the peer. So we check for that here and set the peer's
* address accordingly.
*/
set_peer_nat(p, peer);
if (p->natdetected && ast_test_flag(&peer->flags[2], SIP_PAGE3_NAT_AUTO_RPORT)) {
ast_sockaddr_copy(&peer->addr, &p->recv);
}
if (!ast_apply_acl(peer->acl, addr, "SIP Peer ACL: ")) {
ast_debug(2, "Found peer '%s' for '%s', but fails host access\n", peer->name, of);
sip_unref_peer(peer, "sip_unref_peer: check_peer_ok: from sip_find_peer call, early return of AUTH_ACL_FAILED");
@ -19325,6 +19316,21 @@ static enum check_auth_result check_peer_ok(struct sip_pvt *p, char *of,
ast_string_field_set(p, peermd5secret, NULL);
}
if (!(res = check_auth(p, req, peer->name, p->peersecret, p->peermd5secret, sipmethod, uri2, reliable))) {
/* build_peer, called through sip_find_peer, is not able to check the
* sip_pvt->natdetected flag in order to determine if the peer is behind
* NAT or not when SIP_PAGE3_NAT_AUTO_RPORT or SIP_PAGE3_NAT_AUTO_COMEDIA
* are set on the peer. So we check for that here and set the peer's
* address accordingly. The address should ONLY be set once we are sure
* authentication was a success. If, for example, an INVITE was sent that
* matched the peer name but failed the authentication check, the address
* would be updated, which is bad.
*/
set_peer_nat(p, peer);
if (p->natdetected && ast_test_flag(&peer->flags[2], SIP_PAGE3_NAT_AUTO_RPORT)) {
ast_sockaddr_copy(&peer->addr, &p->recv);
}
/* If we have a call limit, set flag */
if (peer->call_limit)
ast_set_flag(&p->flags[0], SIP_CALL_LIMIT);
@ -19424,6 +19430,7 @@ static enum check_auth_result check_peer_ok(struct sip_pvt *p, char *of,
}
}
sip_unref_peer(peer, "check_peer_ok: sip_unref_peer: tossing temp ptr to peer from sip_find_peer");
return res;
}
@ -31366,8 +31373,10 @@ static struct ast_variable *add_var(const char *buf, struct ast_variable *list)
if ((varval = strchr(varname, '='))) {
*varval++ = '\0';
if ((tmpvar = ast_variable_new(varname, varval, ""))) {
tmpvar->next = list;
list = tmpvar;
if (ast_variable_list_replace(&list, tmpvar)) {
tmpvar->next = list;
list = tmpvar;
}
}
}
return list;
@ -35349,8 +35358,8 @@ static void deprecation_notice(void)
{
ast_log(LOG_WARNING, "chan_sip has no official maintainer and is deprecated. Migration to\n");
ast_log(LOG_WARNING, "chan_pjsip is recommended. See guides at the Asterisk Wiki:\n");
ast_log(LOG_WARNING, "https://wiki.asterisk.org/wiki/x/tAHOAQ\n");
ast_log(LOG_WARNING, "https://wiki.asterisk.org/wiki/x/hYCLAQ\n");
ast_log(LOG_WARNING, "https://wiki.asterisk.org/wiki/display/AST/Migrating+from+chan_sip+to+res_pjsip\n");
ast_log(LOG_WARNING, "https://wiki.asterisk.org/wiki/display/AST/Configuring+res_pjsip\n");
}
/*! \brief Event callback which indicates we're fully booted */

View File

@ -62,6 +62,7 @@
#include "asterisk/module.h"
#include "asterisk/pbx.h"
#include "asterisk/rtp_engine.h"
#include "asterisk/unaligned.h"
#include "asterisk/netsock2.h"
#include "asterisk/acl.h"
#include "asterisk/callerid.h"
@ -575,7 +576,7 @@ static const unsigned char packet_send_stream_based_tone_on[] =
{ 0x16, 0x06, 0x1b, 0x00, 0x00, 0x05 };
static const unsigned char packet_send_stream_based_tone_single_freq[] =
{ 0x16, 0x06, 0x1d, 0x00, 0x01, 0xb8 };
static const unsigned char packet_send_stream_based_tone_dial_freq[] =
static const unsigned char packet_send_stream_based_tone_dual_freq[] =
{ 0x16, 0x08, 0x1d, 0x00, 0x01, 0xb8, 0x01, 0x5e };
static const unsigned char packet_send_select_output[] =
{ 0x16, 0x06, 0x32, 0xc0, 0x01, 0x00 };
@ -1002,27 +1003,36 @@ static int get_to_address(int fd, struct sockaddr_in *toAddr)
{
#ifdef HAVE_PKTINFO
int err;
struct msghdr msg;
struct {
struct cmsghdr cm;
int len;
struct in_addr address;
} ip_msg;
/* Zero out the structures before we use them */
/* This sets several key values to NULL */
memset(&msg, 0, sizeof(msg));
memset(&ip_msg, 0, sizeof(ip_msg));
/* Initialize the message structure */
msg.msg_control = &ip_msg;
msg.msg_controllen = sizeof(ip_msg);
char cmbuf[0x100];
struct cmsghdr *cmsg;
struct sockaddr_in peeraddr;
struct in_addr addr;
struct msghdr mh = {
.msg_name = &peeraddr,
.msg_namelen = sizeof(peeraddr),
.msg_control = cmbuf,
.msg_controllen = sizeof(cmbuf),
};
memset(&addr, 0, sizeof(addr));
/* Get info about the incoming packet */
err = recvmsg(fd, &msg, MSG_PEEK);
err = recvmsg(fd, &mh, MSG_PEEK);
if (err == -1) {
ast_log(LOG_WARNING, "recvmsg returned an error: %s\n", strerror(errno));
return err;
}
memcpy(&toAddr->sin_addr, &ip_msg.address, sizeof(struct in_addr));
for(cmsg = CMSG_FIRSTHDR(&mh);
cmsg != NULL;
cmsg = CMSG_NXTHDR(&mh, cmsg))
{
if (cmsg->cmsg_level == IPPROTO_IP && cmsg->cmsg_type == IP_PKTINFO) {
struct in_pktinfo *pkt = (struct in_pktinfo*)CMSG_DATA(cmsg);
addr = pkt->ipi_addr;
if (unistimdebug) {
ast_verb(0, "message received on address %s\n", ast_inet_ntoa(addr));
}
}
}
memcpy(&toAddr->sin_addr, &addr, sizeof(struct in_addr));
return err;
#else
memcpy(toAddr, &public_ip, sizeof(*toAddr));
@ -1030,6 +1040,7 @@ static int get_to_address(int fd, struct sockaddr_in *toAddr)
#endif
}
/* Allocate memory & initialize structures for a new phone */
/* addr_from : ip address of the phone */
static struct unistimsession *create_client(const struct sockaddr_in *addr_from)
@ -1041,7 +1052,10 @@ static struct unistimsession *create_client(const struct sockaddr_in *addr_from)
return NULL;
memcpy(&s->sin, addr_from, sizeof(struct sockaddr_in));
get_to_address(unistimsock, &s->sout);
if (get_to_address(unistimsock, &s->sout) < 0) {
ast_free(s);
return NULL;
}
s->sout.sin_family = AF_INET;
if (unistimdebug) {
ast_verb(0, "Creating a new entry for the phone from %s received via server ip %s\n",
@ -1208,19 +1222,16 @@ static void send_tone(struct unistimsession *pte, uint16_t tone1, uint16_t tone2
if (!tone2) {
memcpy(buffsend + SIZE_HEADER, packet_send_stream_based_tone_single_freq,
sizeof(packet_send_stream_based_tone_single_freq));
buffsend[10] = (tone1 & 0xff00) >> 8;
buffsend[11] = (tone1 & 0x00ff);
put_unaligned_uint16(&buffsend[10], htons(tone1));
send_client(SIZE_HEADER + sizeof(packet_send_stream_based_tone_single_freq), buffsend,
pte);
} else {
tone2 *= 8;
memcpy(buffsend + SIZE_HEADER, packet_send_stream_based_tone_dial_freq,
sizeof(packet_send_stream_based_tone_dial_freq));
buffsend[10] = (tone1 & 0xff00) >> 8;
buffsend[11] = (tone1 & 0x00ff);
buffsend[12] = (tone2 & 0xff00) >> 8;
buffsend[13] = (tone2 & 0x00ff);
send_client(SIZE_HEADER + sizeof(packet_send_stream_based_tone_dial_freq), buffsend,
memcpy(buffsend + SIZE_HEADER, packet_send_stream_based_tone_dual_freq,
sizeof(packet_send_stream_based_tone_dual_freq));
put_unaligned_uint16(&buffsend[10], htons(tone1));
put_unaligned_uint16(&buffsend[12], htons(tone2));
send_client(SIZE_HEADER + sizeof(packet_send_stream_based_tone_dual_freq), buffsend,
pte);
}
@ -2747,7 +2758,7 @@ static void send_start_rtp(struct unistim_subchannel *sub)
sizeof(packet_send_jitter_buffer_conf));
send_client(SIZE_HEADER + sizeof(packet_send_jitter_buffer_conf), buffsend, pte);
if (pte->device->rtp_method != 0) {
uint16_t rtcpsin_port = htons(us.sin_port) + 1; /* RTCP port is RTP + 1 */
uint16_t rtcpsin_port = ntohs(us.sin_port) + 1; /* RTCP port is RTP + 1 */
if (unistimdebug) {
ast_verb(0, "Sending OpenAudioStreamTX using method #%d\n", pte->device->rtp_method);
@ -2761,20 +2772,14 @@ static void send_start_rtp(struct unistim_subchannel *sub)
}
if (pte->device->rtp_method != 2) {
memcpy(buffsend + 28, &public.sin_addr, sizeof(public.sin_addr));
buffsend[20] = (htons(sin.sin_port) & 0xff00) >> 8;
buffsend[21] = (htons(sin.sin_port) & 0x00ff);
buffsend[23] = (rtcpsin_port & 0x00ff);
buffsend[22] = (rtcpsin_port & 0xff00) >> 8;
buffsend[25] = (us.sin_port & 0xff00) >> 8;
buffsend[24] = (us.sin_port & 0x00ff);
buffsend[27] = (rtcpsin_port & 0x00ff);
buffsend[26] = (rtcpsin_port & 0xff00) >> 8;
put_unaligned_uint16(&buffsend[20], sin.sin_port);
put_unaligned_uint16(&buffsend[22], htons(rtcpsin_port));
put_unaligned_uint16(&buffsend[24], us.sin_port);
put_unaligned_uint16(&buffsend[26], htons(rtcpsin_port));
} else {
memcpy(buffsend + 23, &public.sin_addr, sizeof(public.sin_addr));
buffsend[15] = (htons(sin.sin_port) & 0xff00) >> 8;
buffsend[16] = (htons(sin.sin_port) & 0x00ff);
buffsend[20] = (us.sin_port & 0xff00) >> 8;
buffsend[19] = (us.sin_port & 0x00ff);
put_unaligned_uint16(&buffsend[15], sin.sin_port);
put_unaligned_uint16(&buffsend[19], us.sin_port);
}
buffsend[11] = codec; /* rx */
buffsend[12] = codec; /* tx */
@ -2792,20 +2797,14 @@ static void send_start_rtp(struct unistim_subchannel *sub)
}
if (pte->device->rtp_method != 2) {
memcpy(buffsend + 28, &public.sin_addr, sizeof(public.sin_addr));
buffsend[20] = (htons(sin.sin_port) & 0xff00) >> 8;
buffsend[21] = (htons(sin.sin_port) & 0x00ff);
buffsend[23] = (rtcpsin_port & 0x00ff);
buffsend[22] = (rtcpsin_port & 0xff00) >> 8;
buffsend[25] = (us.sin_port & 0xff00) >> 8;
buffsend[24] = (us.sin_port & 0x00ff);
buffsend[27] = (rtcpsin_port & 0x00ff);
buffsend[26] = (rtcpsin_port & 0xff00) >> 8;
put_unaligned_uint16(&buffsend[20], sin.sin_port);
put_unaligned_uint16(&buffsend[22], htons(rtcpsin_port));
put_unaligned_uint16(&buffsend[24], us.sin_port);
put_unaligned_uint16(&buffsend[26], htons(rtcpsin_port));
} else {
memcpy(buffsend + 23, &public.sin_addr, sizeof(public.sin_addr));
buffsend[15] = (htons(sin.sin_port) & 0xff00) >> 8;
buffsend[16] = (htons(sin.sin_port) & 0x00ff);
buffsend[20] = (us.sin_port & 0xff00) >> 8;
buffsend[19] = (us.sin_port & 0x00ff);
put_unaligned_uint16(&buffsend[15], sin.sin_port);
put_unaligned_uint16(&buffsend[19], us.sin_port);
}
buffsend[11] = codec; /* rx */
buffsend[12] = codec; /* tx */
@ -2820,11 +2819,9 @@ static void send_start_rtp(struct unistim_subchannel *sub)
memcpy(buffsend + SIZE_HEADER, packet_send_call, sizeof(packet_send_call));
memcpy(buffsend + 53, &public.sin_addr, sizeof(public.sin_addr));
/* Destination port when sending RTP */
buffsend[49] = (us.sin_port & 0x00ff);
buffsend[50] = (us.sin_port & 0xff00) >> 8;
put_unaligned_uint16(&buffsend[49], us.sin_port);
/* Destination port when sending RTCP */
buffsend[52] = (rtcpsin_port & 0x00ff);
buffsend[51] = (rtcpsin_port & 0xff00) >> 8;
put_unaligned_uint16(&buffsend[51], htons(rtcpsin_port));
/* Codec */
buffsend[40] = codec;
buffsend[41] = codec;
@ -2841,10 +2838,8 @@ static void send_start_rtp(struct unistim_subchannel *sub)
ast_format_get_name(ast_channel_readformat(sub->owner)));
}
/* Source port for transmit RTP and Destination port for receiving RTP */
buffsend[45] = (htons(sin.sin_port) & 0xff00) >> 8;
buffsend[46] = (htons(sin.sin_port) & 0x00ff);
buffsend[47] = (rtcpsin_port & 0xff00) >> 8;
buffsend[48] = (rtcpsin_port & 0x00ff);
put_unaligned_uint16(&buffsend[45], sin.sin_port);
put_unaligned_uint16(&buffsend[47], htons(rtcpsin_port));
send_client(SIZE_HEADER + sizeof(packet_send_call), buffsend, pte);
}
}
@ -3331,22 +3326,12 @@ static void handle_call_incoming(struct unistimsession *s)
return;
}
static int unistim_do_senddigit(struct unistimsession *pte, char digit)
static int send_dtmf_tone(struct unistimsession *pte, char digit)
{
struct ast_frame f = { .frametype = AST_FRAME_DTMF, .subclass.integer = digit, .src = "unistim" };
struct unistim_subchannel *sub;
int row, col;
int row, col;
sub = get_sub(pte->device, SUB_REAL);
if (!sub || !sub->owner || sub->alreadygone) {
ast_log(LOG_WARNING, "Unable to find subchannel in dtmf senddigit\n");
return -1;
}
/* Send DTMF indication _before_ playing sounds */
ast_queue_frame(sub->owner, &f);
if (unistimdebug) {
ast_verb(0, "Send Digit %c (%i ms)\n", digit, pte->device->dtmfduration);
ast_verb(0, "Phone Play Digit %c\n", digit);
}
if (pte->device->dtmfduration > 0) {
row = (digit - '1') % 3;
@ -3364,6 +3349,28 @@ static int unistim_do_senddigit(struct unistimsession *pte, char digit)
} else {
send_tone(pte, 500, 2000);
}
}
return 0;
}
static int unistim_do_senddigit(struct unistimsession *pte, char digit)
{
struct ast_frame f = { .frametype = AST_FRAME_DTMF, .subclass.integer = digit, .src = "unistim" };
struct unistim_subchannel *sub;
sub = get_sub(pte->device, SUB_REAL);
if (!sub || !sub->owner || sub->alreadygone) {
ast_log(LOG_WARNING, "Unable to find subchannel in dtmf senddigit\n");
return -1;
}
/* Send DTMF indication _before_ playing sounds */
ast_queue_frame(sub->owner, &f);
if (pte->device->dtmfduration > 0) {
if (unistimdebug) {
ast_verb(0, "Send Digit %c (%i ms)\n", digit, pte->device->dtmfduration);
}
send_dtmf_tone(pte, digit);
usleep(pte->device->dtmfduration * 1000); /* XXX Less than perfect, blocking an important thread is not a good idea */
send_tone(pte, 0, 0);
}
@ -5506,34 +5513,21 @@ static int unistim_senddigit_begin(struct ast_channel *ast, char digit)
if (!pte) {
return -1;
}
return unistim_do_senddigit(pte, digit);
return send_dtmf_tone(pte, digit);
}
static int unistim_senddigit_end(struct ast_channel *ast, char digit, unsigned int duration)
{
struct unistimsession *pte = channel_to_session(ast);
struct ast_frame f = { 0, };
struct unistim_subchannel *sub;
sub = get_sub(pte->device, SUB_REAL);
if (!sub || !sub->owner || sub->alreadygone) {
ast_log(LOG_WARNING, "Unable to find subchannel in dtmf senddigit_end\n");
if (!pte) {
return -1;
}
if (unistimdebug) {
ast_verb(0, "Send Digit off %c\n", digit);
}
if (!pte) {
return -1;
ast_verb(0, "Send Digit off %c (duration %d)\n", digit, duration);
}
send_tone(pte, 0, 0);
f.frametype = AST_FRAME_DTMF;
f.subclass.integer = digit;
f.src = "unistim";
ast_queue_frame(sub->owner, &f);
return 0;
}

View File

@ -339,14 +339,14 @@ static int cli_channelstats_print_body(void *obj, void *arg, int flags)
struct ast_sip_cli_context *context = arg;
const struct ast_channel_snapshot *snapshot = obj;
struct ast_channel *channel = ast_channel_get_by_name(snapshot->base->name);
struct ast_sip_channel_pvt *cpvt = channel ? ast_channel_tech_pvt(channel) : NULL;
struct ast_sip_channel_pvt *cpvt = NULL;
struct ast_sip_session *session;
struct ast_sip_session_media *media;
struct ast_rtp_instance *rtp;
struct ast_rtp_instance_stats stats;
char *print_name = NULL;
char *print_time = alloca(32);
char codec_in_use[7];
int stats_res = -1;
ast_assert(context->output_buffer != NULL);
@ -357,7 +357,8 @@ static int cli_channelstats_print_body(void *obj, void *arg, int flags)
ast_channel_lock(channel);
session = cpvt->session;
cpvt = ast_channel_tech_pvt(channel);
session = cpvt ? cpvt->session : NULL;
if (!session) {
ast_str_append(&context->output_buffer, 0, " %s not valid\n", snapshot->base->name);
ast_channel_unlock(channel);
@ -373,14 +374,13 @@ static int cli_channelstats_print_body(void *obj, void *arg, int flags)
return 0;
}
rtp = ao2_bump(media->rtp);
codec_in_use[0] = '\0';
if (ast_channel_rawreadformat(channel)) {
ast_copy_string(codec_in_use, ast_format_get_name(ast_channel_rawreadformat(channel)), sizeof(codec_in_use));
}
stats_res = ast_rtp_instance_get_stats(media->rtp, &stats, AST_RTP_INSTANCE_STAT_ALL);
ast_channel_unlock(channel);
print_name = ast_strdupa(snapshot->base->name);
@ -389,7 +389,7 @@ static int cli_channelstats_print_body(void *obj, void *arg, int flags)
ast_format_duration_hh_mm_ss(ast_tvnow().tv_sec - snapshot->base->creationtime.tv_sec, print_time, 32);
if (ast_rtp_instance_get_stats(rtp, &stats, AST_RTP_INSTANCE_STAT_ALL)) {
if (stats_res == -1) {
ast_str_append(&context->output_buffer, 0, "%s direct media\n", snapshot->base->name);
} else {
ast_str_append(&context->output_buffer, 0,
@ -414,7 +414,6 @@ static int cli_channelstats_print_body(void *obj, void *arg, int flags)
);
}
ao2_cleanup(rtp);
ao2_cleanup(channel);
return 0;

View File

@ -80,6 +80,19 @@
<para>This function uses the same DTMF mode naming as the dtmf_mode configuration option</para>
</description>
</function>
<function name="PJSIP_MOH_PASSTHROUGH" language="en_US">
<synopsis>
Get or change the on-hold behavior for a SIP call.
</synopsis>
<syntax>
</syntax>
<description>
<para>When read, returns the current moh passthrough mode</para>
<para>When written, sets the current moh passthrough mode</para>
<para>If <replaceable>yes</replaceable>, on-hold re-INVITEs are sent. If <replaceable>no</replaceable>, music on hold is generated.</para>
<para>This function can be used to override the moh_passthrough configuration option</para>
</description>
</function>
<function name="PJSIP_SEND_SESSION_REFRESH" language="en_US">
<synopsis>
W/O: Initiate a session refresh via an UPDATE or re-INVITE on an established media session
@ -1431,6 +1444,34 @@ int pjsip_acf_dtmf_mode_read(struct ast_channel *chan, const char *cmd, char *da
return 0;
}
int pjsip_acf_moh_passthrough_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
struct ast_sip_channel_pvt *channel;
if (!chan) {
ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
return -1;
}
if (len < 3) {
ast_log(LOG_WARNING, "%s: buffer too small\n", cmd);
return -1;
}
ast_channel_lock(chan);
if (strcmp(ast_channel_tech(chan)->type, "PJSIP")) {
ast_log(LOG_WARNING, "Cannot call %s on a non-PJSIP channel\n", cmd);
ast_channel_unlock(chan);
return -1;
}
channel = ast_channel_tech_pvt(chan);
strncpy(buf, AST_YESNO(channel->session->moh_passthrough), len);
ast_channel_unlock(chan);
return 0;
}
struct refresh_data {
struct ast_sip_session *session;
enum ast_sip_session_refresh_method method;
@ -1574,6 +1615,30 @@ int pjsip_acf_dtmf_mode_write(struct ast_channel *chan, const char *cmd, char *d
return ast_sip_push_task_wait_serializer(channel->session->serializer, dtmf_mode_refresh_cb, &rdata);
}
int pjsip_acf_moh_passthrough_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
{
struct ast_sip_channel_pvt *channel;
if (!chan) {
ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
return -1;
}
ast_channel_lock(chan);
if (strcmp(ast_channel_tech(chan)->type, "PJSIP")) {
ast_log(LOG_WARNING, "Cannot call %s on a non-PJSIP channel\n", cmd);
ast_channel_unlock(chan);
return -1;
}
channel = ast_channel_tech_pvt(chan);
channel->session->moh_passthrough = ast_true(value);
ast_channel_unlock(chan);
return 0;
}
static int refresh_write_cb(void *obj)
{
struct refresh_data *data = obj;

View File

@ -72,6 +72,31 @@ int pjsip_acf_dtmf_mode_read(struct ast_channel *chan, const char *cmd, char *da
*/
int pjsip_acf_dtmf_mode_write(struct ast_channel *chan, const char *cmd, char *data, const char *value);
/*!
* \brief PJSIP_MOH_PASSTHROUGH function read callback
* \param chan The channel the function is called on
* \param cmd The name of the function
* \param data Arguments passed to the function
* \param buf Out buffer that should be populated with the data
* \param len Size of the buffer
*
* \retval 0 on success
* \retval -1 on failure
*/
int pjsip_acf_moh_passthrough_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len);
/*!
* \brief PJSIP_MOH_PASSTHROUGH function write callback
* \param chan The channel the function is called on
* \param cmd The name of the function
* \param data Arguments passed to the function
* \param value Value to be set by the function
*
* \retval 0 on success
* \retval -1 on failure
*/
int pjsip_acf_moh_passthrough_write(struct ast_channel *chan, const char *cmd, char *data, const char *value);
/*!
* \brief PJSIP_MEDIA_OFFER function read callback
* \param chan The channel the function is called on

View File

@ -2230,7 +2230,7 @@ static void *pri_ss_thread(void *data)
void pri_event_alarm(struct sig_pri_span *pri, int index, int before_start_pri)
{
pri->dchanavail[index] &= ~(DCHAN_NOTINALARM | DCHAN_UP);
pri->dchanavail[index] &= ~DCHAN_NOTINALARM;
if (!before_start_pri) {
pri_find_dchan(pri);
}

View File

@ -90,4 +90,5 @@ SPEEX_RESAMPLE_CFLAGS:=
endif
$(call MOD_ADD_C,codec_resample,speex/resample.c)
speex/resample.o: _ASTCFLAGS+=$(SPEEX_RESAMPLE_CFLAGS)
codec_resample.o: _ASTCFLAGS+=-DOUTSIDE_SPEEX
speex/resample.o: _ASTCFLAGS+=$(SPEEX_RESAMPLE_CFLAGS) -DOUTSIDE_SPEEX -DEXPORT=

View File

@ -7,6 +7,9 @@
*
*/
#ifndef ASTERISK_EX_ALAW_H
#define ASTERISK_EX_ALAW_H
static uint8_t ex_alaw[] = {
0x00, 0x03, 0x06, 0x09, 0x0c, 0x0f, 0x12, 0x15,
0x10, 0x18, 0x1b, 0x1e, 0x21, 0x24, 0x27, 0x2a,
@ -34,3 +37,5 @@ static struct ast_frame *alaw_sample(void)
f.subclass.format = ast_format_alaw;
return &f;
}
#endif /* ASTERISK_EX_ALAW_H */

View File

@ -7,6 +7,9 @@
*
*/
#ifndef ASTERISK_EX_G722_H
#define ASTERISK_EX_G722_H
static uint8_t ex_g722[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@ -46,3 +49,5 @@ static struct ast_frame *g722_sample(void)
return &f;
}
#endif /* ASTERISK_EX_G722_H */

View File

@ -7,6 +7,9 @@
*
*/
#ifndef ASTERISK_EX_ULAW_H
#define ASTERISK_EX_ULAW_H
static uint8_t ex_ulaw[] = {
0x00, 0x03, 0x06, 0x09, 0x0c, 0x0f, 0x12, 0x15,
0x10, 0x18, 0x1b, 0x1e, 0x21, 0x24, 0x27, 0x2a,
@ -36,3 +39,5 @@ static struct ast_frame *ulaw_sample(void)
return &f;
}
#endif /* ASTERISK_EX_ULAW_H */

View File

@ -35,14 +35,6 @@
#ifndef ARCH_H
#define ARCH_H
#ifndef SPEEX_VERSION
#define SPEEX_MAJOR_VERSION 1 /**< Major Speex version. */
#define SPEEX_MINOR_VERSION 1 /**< Minor Speex version. */
#define SPEEX_MICRO_VERSION 15 /**< Micro Speex version. */
#define SPEEX_EXTRA_VERSION "" /**< Extra Speex version. */
#define SPEEX_VERSION "speex-1.2beta3" /**< Speex version string. */
#endif
#define FIXED_POINT
/* A couple test to catch stupid option combinations */
@ -77,7 +69,7 @@
#endif
#ifndef OUTSIDE_SPEEX
#include "speex/speex_types.h"
#include "speex/speexdsp_types.h"
#endif
#define ABS(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute integer value. */
@ -91,7 +83,7 @@
#ifdef FIXED_POINT
typedef spx_int16_t spx_word16_t;
typedef spx_int32_t spx_word32_t;
typedef spx_int32_t spx_word32_t;
typedef spx_word32_t spx_mem_t;
typedef spx_word16_t spx_coef_t;
typedef spx_word16_t spx_lsp_t;
@ -173,6 +165,7 @@ typedef float spx_word32_t;
#define VSHR32(a,shift) (a)
#define SATURATE16(x,a) (x)
#define SATURATE32(x,a) (x)
#define SATURATE32PSHR(x,shift,a) (x)
#define PSHR(a,shift) (a)
#define SHR(a,shift) (a)

View File

@ -52,6 +52,10 @@
#define SATURATE16(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x)))
#define SATURATE32(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x)))
#define SATURATE32PSHR(x,shift,a) (((x)>=(SHL32(a,shift))) ? (a) : \
(x)<=-(SHL32(a,shift)) ? -(a) : \
(PSHR32(x, shift)))
#define SHR(a,shift) ((a) >> (shift))
#define SHL(a,shift) ((spx_word32_t)(a) << (shift))
#define PSHR(a,shift) (SHR((a)+((EXTEND32(1)<<((shift))>>1)),shift))

View File

@ -61,18 +61,26 @@
#include "config.h"
#endif
#ifdef OUTSIDE_SPEEX
#include <stdlib.h>
static void *speex_alloc (int size) {return calloc(size,1);}
static void *speex_realloc (void *ptr, int size) {return realloc(ptr, size);}
static void speex_free (void *ptr) {free(ptr);}
#include "speex_resampler.h"
#include "arch.h"
#else /* OUTSIDE_SPEEX */
#include "speex/speex_resampler.h"
#include "arch.h"
#include "os_support.h"
#endif /* OUTSIDE_SPEEX */
#include "stack_alloc.h"
#include <math.h>
#include <limits.h>
#ifndef M_PI
#define M_PI 3.14159263
#define M_PI 3.14159265358979323846
#endif
#ifdef FIXED_POINT
@ -92,6 +100,10 @@ static void speex_free (void *ptr) {free(ptr);}
#include "resample_sse.h"
#endif
#ifdef _USE_NEON
#include "resample_neon.h"
#endif
/* Numer of elements to allocate on the stack */
#ifdef VAR_ARRAYS
#define FIXED_STACK_ALLOC 8192
@ -133,7 +145,7 @@ struct SpeexResamplerState_ {
int out_stride;
} ;
static double kaiser12_table[68] = {
static const double kaiser12_table[68] = {
0.99859849, 1.00000000, 0.99859849, 0.99440475, 0.98745105, 0.97779076,
0.96549770, 0.95066529, 0.93340547, 0.91384741, 0.89213598, 0.86843014,
0.84290116, 0.81573067, 0.78710866, 0.75723148, 0.72629970, 0.69451601,
@ -147,7 +159,7 @@ static double kaiser12_table[68] = {
0.00105297, 0.00069463, 0.00043489, 0.00025272, 0.00013031, 0.0000527734,
0.00001000, 0.00000000};
/*
static double kaiser12_table[36] = {
static const double kaiser12_table[36] = {
0.99440475, 1.00000000, 0.99440475, 0.97779076, 0.95066529, 0.91384741,
0.86843014, 0.81573067, 0.75723148, 0.69451601, 0.62920216, 0.56287762,
0.49704014, 0.43304576, 0.37206735, 0.31506490, 0.26276832, 0.21567274,
@ -155,7 +167,7 @@ static double kaiser12_table[36] = {
0.03111947, 0.02127838, 0.01402878, 0.00886058, 0.00531256, 0.00298291,
0.00153438, 0.00069463, 0.00025272, 0.0000527734, 0.00000500, 0.00000000};
*/
static double kaiser10_table[36] = {
static const double kaiser10_table[36] = {
0.99537781, 1.00000000, 0.99537781, 0.98162644, 0.95908712, 0.92831446,
0.89005583, 0.84522401, 0.79486424, 0.74011713, 0.68217934, 0.62226347,
0.56155915, 0.50119680, 0.44221549, 0.38553619, 0.33194107, 0.28205962,
@ -163,7 +175,7 @@ static double kaiser10_table[36] = {
0.05731132, 0.04193980, 0.02979584, 0.02044510, 0.01345224, 0.00839739,
0.00488951, 0.00257636, 0.00115101, 0.00035515, 0.00000000, 0.00000000};
static double kaiser8_table[36] = {
static const double kaiser8_table[36] = {
0.99635258, 1.00000000, 0.99635258, 0.98548012, 0.96759014, 0.94302200,
0.91223751, 0.87580811, 0.83439927, 0.78875245, 0.73966538, 0.68797126,
0.63451750, 0.58014482, 0.52566725, 0.47185369, 0.41941150, 0.36897272,
@ -171,7 +183,7 @@ static double kaiser8_table[36] = {
0.10562887, 0.08273982, 0.06335451, 0.04724088, 0.03412321, 0.02369490,
0.01563093, 0.00959968, 0.00527363, 0.00233883, 0.00050000, 0.00000000};
static double kaiser6_table[36] = {
static const double kaiser6_table[36] = {
0.99733006, 1.00000000, 0.99733006, 0.98935595, 0.97618418, 0.95799003,
0.93501423, 0.90755855, 0.87598009, 0.84068475, 0.80211977, 0.76076565,
0.71712752, 0.67172623, 0.62508937, 0.57774224, 0.53019925, 0.48295561,
@ -180,19 +192,19 @@ static double kaiser6_table[36] = {
0.05031820, 0.03607231, 0.02432151, 0.01487334, 0.00752000, 0.00000000};
struct FuncDef {
double *table;
const double *table;
int oversample;
};
static struct FuncDef _KAISER12 = {kaiser12_table, 64};
static const struct FuncDef _KAISER12 = {kaiser12_table, 64};
#define KAISER12 (&_KAISER12)
/*static struct FuncDef _KAISER12 = {kaiser12_table, 32};
#define KAISER12 (&_KAISER12)*/
static struct FuncDef _KAISER10 = {kaiser10_table, 32};
static const struct FuncDef _KAISER10 = {kaiser10_table, 32};
#define KAISER10 (&_KAISER10)
static struct FuncDef _KAISER8 = {kaiser8_table, 32};
static const struct FuncDef _KAISER8 = {kaiser8_table, 32};
#define KAISER8 (&_KAISER8)
static struct FuncDef _KAISER6 = {kaiser6_table, 32};
static const struct FuncDef _KAISER6 = {kaiser6_table, 32};
#define KAISER6 (&_KAISER6)
struct QualityMapping {
@ -200,7 +212,7 @@ struct QualityMapping {
int oversample;
float downsample_bandwidth;
float upsample_bandwidth;
struct FuncDef *window_func;
const struct FuncDef *window_func;
};
@ -227,7 +239,7 @@ static const struct QualityMapping quality_map[11] = {
{256, 32, 0.975f, 0.975f, KAISER12}, /* Q10 */ /* 96.6% cutoff (~100 dB stop) 10 */
};
/*8,24,40,56,80,104,128,160,200,256,320*/
static double compute_func(float x, struct FuncDef *func)
static double compute_func(float x, const struct FuncDef *func)
{
float y, frac;
double interp[4];
@ -262,7 +274,7 @@ int main(int argc, char **argv)
#ifdef FIXED_POINT
/* The slow way of computing a sinc for the table. Should improve that some day */
static spx_word16_t sinc(float cutoff, float x, int N, struct FuncDef *window_func)
static spx_word16_t sinc(float cutoff, float x, int N, const struct FuncDef *window_func)
{
/*fprintf (stderr, "%f ", x);*/
float xx = x * cutoff;
@ -275,7 +287,7 @@ static spx_word16_t sinc(float cutoff, float x, int N, struct FuncDef *window_fu
}
#else
/* The slow way of computing a sinc for the table. Should improve that some day */
static spx_word16_t sinc(float cutoff, float x, int N, struct FuncDef *window_func)
static spx_word16_t sinc(float cutoff, float x, int N, const struct FuncDef *window_func)
{
/*fprintf (stderr, "%f ", x);*/
float xx = x * cutoff;
@ -330,28 +342,35 @@ static int resampler_basic_direct_single(SpeexResamplerState *st, spx_uint32_t c
const int frac_advance = st->frac_advance;
const spx_uint32_t den_rate = st->den_rate;
spx_word32_t sum;
int j;
while (!(last_sample >= (spx_int32_t)*in_len || out_sample >= (spx_int32_t)*out_len))
{
const spx_word16_t *sinc = & sinc_table[samp_frac_num*N];
const spx_word16_t *sinct = & sinc_table[samp_frac_num*N];
const spx_word16_t *iptr = & in[last_sample];
#ifndef OVERRIDE_INNER_PRODUCT_SINGLE
float accum[4] = {0,0,0,0};
int j;
sum = 0;
for(j=0;j<N;j++) sum += MULT16_16(sinct[j], iptr[j]);
/* This code is slower on most DSPs which have only 2 accumulators.
Plus this this forces truncation to 32 bits and you lose the HW guard bits.
I think we can trust the compiler and let it vectorize and/or unroll itself.
spx_word32_t accum[4] = {0,0,0,0};
for(j=0;j<N;j+=4) {
accum[0] += sinc[j]*iptr[j];
accum[1] += sinc[j+1]*iptr[j+1];
accum[2] += sinc[j+2]*iptr[j+2];
accum[3] += sinc[j+3]*iptr[j+3];
accum[0] += MULT16_16(sinct[j], iptr[j]);
accum[1] += MULT16_16(sinct[j+1], iptr[j+1]);
accum[2] += MULT16_16(sinct[j+2], iptr[j+2]);
accum[3] += MULT16_16(sinct[j+3], iptr[j+3]);
}
sum = accum[0] + accum[1] + accum[2] + accum[3];
*/
sum = SATURATE32PSHR(sum, 15, 32767);
#else
sum = inner_product_single(sinc, iptr, N);
sum = inner_product_single(sinct, iptr, N);
#endif
out[out_stride * out_sample++] = PSHR32(sum, 15);
out[out_stride * out_sample++] = sum;
last_sample += int_advance;
samp_frac_num += frac_advance;
if (samp_frac_num >= den_rate)
@ -381,25 +400,25 @@ static int resampler_basic_direct_double(SpeexResamplerState *st, spx_uint32_t c
const int frac_advance = st->frac_advance;
const spx_uint32_t den_rate = st->den_rate;
double sum;
int j;
while (!(last_sample >= (spx_int32_t)*in_len || out_sample >= (spx_int32_t)*out_len))
{
const spx_word16_t *sinc = & sinc_table[samp_frac_num*N];
const spx_word16_t *sinct = & sinc_table[samp_frac_num*N];
const spx_word16_t *iptr = & in[last_sample];
#ifndef OVERRIDE_INNER_PRODUCT_DOUBLE
int j;
double accum[4] = {0,0,0,0};
for(j=0;j<N;j+=4) {
accum[0] += sinc[j]*iptr[j];
accum[1] += sinc[j+1]*iptr[j+1];
accum[2] += sinc[j+2]*iptr[j+2];
accum[3] += sinc[j+3]*iptr[j+3];
accum[0] += sinct[j]*iptr[j];
accum[1] += sinct[j+1]*iptr[j+1];
accum[2] += sinct[j+2]*iptr[j+2];
accum[3] += sinct[j+3]*iptr[j+3];
}
sum = accum[0] + accum[1] + accum[2] + accum[3];
#else
sum = inner_product_double(sinc, iptr, N);
sum = inner_product_double(sinct, iptr, N);
#endif
out[out_stride * out_sample++] = PSHR32(sum, 15);
@ -428,7 +447,6 @@ static int resampler_basic_interpolate_single(SpeexResamplerState *st, spx_uint3
const int int_advance = st->int_advance;
const int frac_advance = st->frac_advance;
const spx_uint32_t den_rate = st->den_rate;
int j;
spx_word32_t sum;
while (!(last_sample >= (spx_int32_t)*in_len || out_sample >= (spx_int32_t)*out_len))
@ -445,6 +463,7 @@ static int resampler_basic_interpolate_single(SpeexResamplerState *st, spx_uint3
#ifndef OVERRIDE_INTERPOLATE_PRODUCT_SINGLE
int j;
spx_word32_t accum[4] = {0,0,0,0};
for(j=0;j<N;j++) {
@ -456,13 +475,14 @@ static int resampler_basic_interpolate_single(SpeexResamplerState *st, spx_uint3
}
cubic_coef(frac, interp);
sum = MULT16_32_Q15(interp[0],accum[0]) + MULT16_32_Q15(interp[1],accum[1]) + MULT16_32_Q15(interp[2],accum[2]) + MULT16_32_Q15(interp[3],accum[3]);
sum = MULT16_32_Q15(interp[0],SHR32(accum[0], 1)) + MULT16_32_Q15(interp[1],SHR32(accum[1], 1)) + MULT16_32_Q15(interp[2],SHR32(accum[2], 1)) + MULT16_32_Q15(interp[3],SHR32(accum[3], 1));
sum = SATURATE32PSHR(sum, 15, 32767);
#else
cubic_coef(frac, interp);
sum = interpolate_product_single(iptr, st->sinc_table + st->oversample + 4 - offset - 2, N, st->oversample, interp);
#endif
out[out_stride * out_sample++] = PSHR32(sum,15);
out[out_stride * out_sample++] = sum;
last_sample += int_advance;
samp_frac_num += frac_advance;
if (samp_frac_num >= den_rate)
@ -490,7 +510,6 @@ static int resampler_basic_interpolate_double(SpeexResamplerState *st, spx_uint3
const int int_advance = st->int_advance;
const int frac_advance = st->frac_advance;
const spx_uint32_t den_rate = st->den_rate;
int j;
spx_word32_t sum;
while (!(last_sample >= (spx_int32_t)*in_len || out_sample >= (spx_int32_t)*out_len))
@ -507,6 +526,7 @@ static int resampler_basic_interpolate_double(SpeexResamplerState *st, spx_uint3
#ifndef OVERRIDE_INTERPOLATE_PRODUCT_DOUBLE
int j;
double accum[4] = {0,0,0,0};
for(j=0;j<N;j++) {
@ -540,11 +560,47 @@ static int resampler_basic_interpolate_double(SpeexResamplerState *st, spx_uint3
}
#endif
static void update_filter(SpeexResamplerState *st)
/* This resampler is used to produce zero output in situations where memory
for the filter could not be allocated. The expected numbers of input and
output samples are still processed so that callers failing to check error
codes are not surprised, possibly getting into infinite loops. */
static int resampler_basic_zero(SpeexResamplerState *st, spx_uint32_t channel_index, const spx_word16_t *in, spx_uint32_t *in_len, spx_word16_t *out, spx_uint32_t *out_len)
{
spx_uint32_t old_length;
int out_sample = 0;
int last_sample = st->last_sample[channel_index];
spx_uint32_t samp_frac_num = st->samp_frac_num[channel_index];
const int out_stride = st->out_stride;
const int int_advance = st->int_advance;
const int frac_advance = st->frac_advance;
const spx_uint32_t den_rate = st->den_rate;
old_length = st->filt_len;
while (!(last_sample >= (spx_int32_t)*in_len || out_sample >= (spx_int32_t)*out_len))
{
out[out_stride * out_sample++] = 0;
last_sample += int_advance;
samp_frac_num += frac_advance;
if (samp_frac_num >= den_rate)
{
samp_frac_num -= den_rate;
last_sample++;
}
}
st->last_sample[channel_index] = last_sample;
st->samp_frac_num[channel_index] = samp_frac_num;
return out_sample;
}
static int update_filter(SpeexResamplerState *st)
{
spx_uint32_t old_length = st->filt_len;
spx_uint32_t old_alloc_size = st->mem_alloc_size;
int use_direct;
spx_uint32_t min_sinc_table_length;
spx_uint32_t min_alloc_size;
st->int_advance = st->num_rate/st->den_rate;
st->frac_advance = st->num_rate%st->den_rate;
st->oversample = quality_map[st->quality].oversample;
st->filt_len = quality_map[st->quality].base_length;
@ -554,8 +610,8 @@ static void update_filter(SpeexResamplerState *st)
st->cutoff = quality_map[st->quality].downsample_bandwidth * st->den_rate / st->num_rate;
/* FIXME: divide the numerator and denominator by a certain amount if they're too large */
st->filt_len = st->filt_len*st->num_rate / st->den_rate;
/* Round down to make sure we have a multiple of 4 */
st->filt_len &= (~0x3);
/* Round up to make sure we have a multiple of 8 for SSE */
st->filt_len = ((st->filt_len-1)&(~0x7))+8;
if (2*st->den_rate < st->num_rate)
st->oversample >>= 1;
if (4*st->den_rate < st->num_rate)
@ -572,16 +628,35 @@ static void update_filter(SpeexResamplerState *st)
}
/* Choose the resampling type that requires the least amount of memory */
if (st->den_rate <= st->oversample)
#ifdef RESAMPLE_FULL_SINC_TABLE
use_direct = 1;
if (INT_MAX/sizeof(spx_word16_t)/st->den_rate < st->filt_len)
goto fail;
#else
use_direct = st->filt_len*st->den_rate <= st->filt_len*st->oversample+8
&& INT_MAX/sizeof(spx_word16_t)/st->den_rate >= st->filt_len;
#endif
if (use_direct)
{
min_sinc_table_length = st->filt_len*st->den_rate;
} else {
if ((INT_MAX/sizeof(spx_word16_t)-8)/st->oversample < st->filt_len)
goto fail;
min_sinc_table_length = st->filt_len*st->oversample+8;
}
if (st->sinc_table_length < min_sinc_table_length)
{
spx_word16_t *sinc_table = (spx_word16_t *)speex_realloc(st->sinc_table,min_sinc_table_length*sizeof(spx_word16_t));
if (!sinc_table)
goto fail;
st->sinc_table = sinc_table;
st->sinc_table_length = min_sinc_table_length;
}
if (use_direct)
{
spx_uint32_t i;
if (!st->sinc_table)
st->sinc_table = (spx_word16_t *)speex_alloc(st->filt_len*st->den_rate*sizeof(spx_word16_t));
else if (st->sinc_table_length < st->filt_len*st->den_rate)
{
st->sinc_table = (spx_word16_t *)speex_realloc(st->sinc_table,st->filt_len*st->den_rate*sizeof(spx_word16_t));
st->sinc_table_length = st->filt_len*st->den_rate;
}
for (i=0;i<st->den_rate;i++)
{
spx_int32_t j;
@ -601,13 +676,6 @@ static void update_filter(SpeexResamplerState *st)
/*fprintf (stderr, "resampler uses direct sinc table and normalised cutoff %f\n", cutoff);*/
} else {
spx_int32_t i;
if (!st->sinc_table)
st->sinc_table = (spx_word16_t *)speex_alloc((st->filt_len*st->oversample+8)*sizeof(spx_word16_t));
else if (st->sinc_table_length < st->filt_len*st->oversample+8)
{
st->sinc_table = (spx_word16_t *)speex_realloc(st->sinc_table,(st->filt_len*st->oversample+8)*sizeof(spx_word16_t));
st->sinc_table_length = st->filt_len*st->oversample+8;
}
for (i=-4;i<(spx_int32_t)(st->oversample*st->filt_len+4);i++)
st->sinc_table[i+4] = sinc(st->cutoff,(i/(float)st->oversample - st->filt_len/2), st->filt_len, quality_map[st->quality].window_func);
#ifdef FIXED_POINT
@ -620,43 +688,39 @@ static void update_filter(SpeexResamplerState *st)
#endif
/*fprintf (stderr, "resampler uses interpolated sinc table and normalised cutoff %f\n", cutoff);*/
}
st->int_advance = st->num_rate/st->den_rate;
st->frac_advance = st->num_rate%st->den_rate;
/* Here's the place where we update the filter memory to take into account
the change in filter length. It's probably the messiest part of the code
due to handling of lots of corner cases. */
if (!st->mem)
/* Adding buffer_size to filt_len won't overflow here because filt_len
could be multiplied by sizeof(spx_word16_t) above. */
min_alloc_size = st->filt_len-1 + st->buffer_size;
if (min_alloc_size > st->mem_alloc_size)
{
spx_word16_t *mem;
if (INT_MAX/sizeof(spx_word16_t)/st->nb_channels < min_alloc_size)
goto fail;
else if (!(mem = (spx_word16_t*)speex_realloc(st->mem, st->nb_channels*min_alloc_size * sizeof(*mem))))
goto fail;
st->mem = mem;
st->mem_alloc_size = min_alloc_size;
}
if (!st->started)
{
spx_uint32_t i;
st->mem_alloc_size = st->filt_len-1 + st->buffer_size;
st->mem = (spx_word16_t*)speex_alloc(st->nb_channels*st->mem_alloc_size * sizeof(spx_word16_t));
for (i=0;i<st->nb_channels*st->mem_alloc_size;i++)
st->mem[i] = 0;
/*speex_warning("init filter");*/
} else if (!st->started)
{
spx_uint32_t i;
st->mem_alloc_size = st->filt_len-1 + st->buffer_size;
st->mem = (spx_word16_t*)speex_realloc(st->mem, st->nb_channels*st->mem_alloc_size * sizeof(spx_word16_t));
for (i=0;i<st->nb_channels*st->mem_alloc_size;i++)
st->mem[i] = 0;
/*speex_warning("reinit filter");*/
} else if (st->filt_len > old_length)
{
spx_int32_t i;
spx_uint32_t i;
/* Increase the filter length */
/*speex_warning("increase filter size");*/
int old_alloc_size = st->mem_alloc_size;
if ((st->filt_len-1 + st->buffer_size) > st->mem_alloc_size)
for (i=st->nb_channels;i--;)
{
st->mem_alloc_size = st->filt_len-1 + st->buffer_size;
st->mem = (spx_word16_t*)speex_realloc(st->mem, st->nb_channels*st->mem_alloc_size * sizeof(spx_word16_t));
}
for (i=st->nb_channels-1;i>=0;i--)
{
spx_int32_t j;
spx_uint32_t j;
spx_uint32_t olen = old_length;
/*if (st->magic_samples[i])*/
{
@ -664,7 +728,7 @@ static void update_filter(SpeexResamplerState *st)
/* FIXME: This is wrong but for now we need it to avoid going over the array bounds */
olen = old_length + 2*st->magic_samples[i];
for (j=old_length-2+st->magic_samples[i];j>=0;j--)
for (j=old_length-1+st->magic_samples[i];j--;)
st->mem[i*st->mem_alloc_size+j+st->magic_samples[i]] = st->mem[i*old_alloc_size+j];
for (j=0;j<st->magic_samples[i];j++)
st->mem[i*st->mem_alloc_size+j] = 0;
@ -705,18 +769,28 @@ static void update_filter(SpeexResamplerState *st)
st->magic_samples[i] += old_magic;
}
}
return RESAMPLER_ERR_SUCCESS;
fail:
st->resampler_ptr = resampler_basic_zero;
/* st->mem may still contain consumed input samples for the filter.
Restore filt_len so that filt_len - 1 still points to the position after
the last of these samples. */
st->filt_len = old_length;
return RESAMPLER_ERR_ALLOC_FAILED;
}
SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels, spx_uint32_t in_rate, spx_uint32_t out_rate, int quality, int *err)
EXPORT SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels, spx_uint32_t in_rate, spx_uint32_t out_rate, int quality, int *err)
{
return speex_resampler_init_frac(nb_channels, in_rate, out_rate, in_rate, out_rate, quality, err);
}
SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels, spx_uint32_t ratio_num, spx_uint32_t ratio_den, spx_uint32_t in_rate, spx_uint32_t out_rate, int quality, int *err)
EXPORT SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels, spx_uint32_t ratio_num, spx_uint32_t ratio_den, spx_uint32_t in_rate, spx_uint32_t out_rate, int quality, int *err)
{
spx_uint32_t i;
SpeexResamplerState *st;
int filter_err;
if (quality > 10 || quality < 0)
{
if (err)
@ -742,16 +816,12 @@ static void update_filter(SpeexResamplerState *st)
st->in_stride = 1;
st->out_stride = 1;
#ifdef FIXED_POINT
st->buffer_size = 160;
#else
st->buffer_size = 160;
#endif
/* Per channel data */
st->last_sample = (spx_int32_t*)speex_alloc(nb_channels*sizeof(int));
st->magic_samples = (spx_uint32_t*)speex_alloc(nb_channels*sizeof(int));
st->samp_frac_num = (spx_uint32_t*)speex_alloc(nb_channels*sizeof(int));
st->last_sample = (spx_int32_t*)speex_alloc(nb_channels*sizeof(spx_int32_t));
st->magic_samples = (spx_uint32_t*)speex_alloc(nb_channels*sizeof(spx_uint32_t));
st->samp_frac_num = (spx_uint32_t*)speex_alloc(nb_channels*sizeof(spx_uint32_t));
for (i=0;i<nb_channels;i++)
{
st->last_sample[i] = 0;
@ -762,17 +832,21 @@ static void update_filter(SpeexResamplerState *st)
speex_resampler_set_quality(st, quality);
speex_resampler_set_rate_frac(st, ratio_num, ratio_den, in_rate, out_rate);
update_filter(st);
st->initialised = 1;
filter_err = update_filter(st);
if (filter_err == RESAMPLER_ERR_SUCCESS)
{
st->initialised = 1;
} else {
speex_resampler_destroy(st);
st = NULL;
}
if (err)
*err = RESAMPLER_ERR_SUCCESS;
*err = filter_err;
return st;
}
void speex_resampler_destroy(SpeexResamplerState *st)
EXPORT void speex_resampler_destroy(SpeexResamplerState *st)
{
speex_free(st->mem);
speex_free(st->sinc_table);
@ -829,9 +903,9 @@ static int speex_resampler_magic(SpeexResamplerState *st, spx_uint32_t channel_i
}
#ifdef FIXED_POINT
int speex_resampler_process_int(SpeexResamplerState *st, spx_uint32_t channel_index, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len)
EXPORT int speex_resampler_process_int(SpeexResamplerState *st, spx_uint32_t channel_index, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len)
#else
int speex_resampler_process_float(SpeexResamplerState *st, spx_uint32_t channel_index, const float *in, spx_uint32_t *in_len, float *out, spx_uint32_t *out_len)
EXPORT int speex_resampler_process_float(SpeexResamplerState *st, spx_uint32_t channel_index, const float *in, spx_uint32_t *in_len, float *out, spx_uint32_t *out_len)
#endif
{
int j;
@ -866,13 +940,13 @@ static int speex_resampler_magic(SpeexResamplerState *st, spx_uint32_t channel_i
}
*in_len -= ilen;
*out_len -= olen;
return RESAMPLER_ERR_SUCCESS;
return st->resampler_ptr == resampler_basic_zero ? RESAMPLER_ERR_ALLOC_FAILED : RESAMPLER_ERR_SUCCESS;
}
#ifdef FIXED_POINT
int speex_resampler_process_float(SpeexResamplerState *st, spx_uint32_t channel_index, const float *in, spx_uint32_t *in_len, float *out, spx_uint32_t *out_len)
EXPORT int speex_resampler_process_float(SpeexResamplerState *st, spx_uint32_t channel_index, const float *in, spx_uint32_t *in_len, float *out, spx_uint32_t *out_len)
#else
int speex_resampler_process_int(SpeexResamplerState *st, spx_uint32_t channel_index, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len)
EXPORT int speex_resampler_process_int(SpeexResamplerState *st, spx_uint32_t channel_index, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len)
#endif
{
int j;
@ -940,20 +1014,22 @@ static int speex_resampler_magic(SpeexResamplerState *st, spx_uint32_t channel_i
*in_len -= ilen;
*out_len -= olen;
return RESAMPLER_ERR_SUCCESS;
return st->resampler_ptr == resampler_basic_zero ? RESAMPLER_ERR_ALLOC_FAILED : RESAMPLER_ERR_SUCCESS;
}
int speex_resampler_process_interleaved_float(SpeexResamplerState *st, const float *in, spx_uint32_t *in_len, float *out, spx_uint32_t *out_len)
EXPORT int speex_resampler_process_interleaved_float(SpeexResamplerState *st, const float *in, spx_uint32_t *in_len, float *out, spx_uint32_t *out_len)
{
spx_uint32_t i;
int istride_save, ostride_save;
spx_uint32_t bak_len = *out_len;
spx_uint32_t bak_out_len = *out_len;
spx_uint32_t bak_in_len = *in_len;
istride_save = st->in_stride;
ostride_save = st->out_stride;
st->in_stride = st->out_stride = st->nb_channels;
for (i=0;i<st->nb_channels;i++)
{
*out_len = bak_len;
*out_len = bak_out_len;
*in_len = bak_in_len;
if (in != NULL)
speex_resampler_process_float(st, i, in+i, in_len, out+i, out_len);
else
@ -961,20 +1037,22 @@ static int speex_resampler_magic(SpeexResamplerState *st, spx_uint32_t channel_i
}
st->in_stride = istride_save;
st->out_stride = ostride_save;
return RESAMPLER_ERR_SUCCESS;
return st->resampler_ptr == resampler_basic_zero ? RESAMPLER_ERR_ALLOC_FAILED : RESAMPLER_ERR_SUCCESS;
}
int speex_resampler_process_interleaved_int(SpeexResamplerState *st, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len)
EXPORT int speex_resampler_process_interleaved_int(SpeexResamplerState *st, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len)
{
spx_uint32_t i;
int istride_save, ostride_save;
spx_uint32_t bak_len = *out_len;
spx_uint32_t bak_out_len = *out_len;
spx_uint32_t bak_in_len = *in_len;
istride_save = st->in_stride;
ostride_save = st->out_stride;
st->in_stride = st->out_stride = st->nb_channels;
for (i=0;i<st->nb_channels;i++)
{
*out_len = bak_len;
*out_len = bak_out_len;
*in_len = bak_in_len;
if (in != NULL)
speex_resampler_process_int(st, i, in+i, in_len, out+i, out_len);
else
@ -982,21 +1060,21 @@ static int speex_resampler_magic(SpeexResamplerState *st, spx_uint32_t channel_i
}
st->in_stride = istride_save;
st->out_stride = ostride_save;
return RESAMPLER_ERR_SUCCESS;
return st->resampler_ptr == resampler_basic_zero ? RESAMPLER_ERR_ALLOC_FAILED : RESAMPLER_ERR_SUCCESS;
}
int speex_resampler_set_rate(SpeexResamplerState *st, spx_uint32_t in_rate, spx_uint32_t out_rate)
EXPORT int speex_resampler_set_rate(SpeexResamplerState *st, spx_uint32_t in_rate, spx_uint32_t out_rate)
{
return speex_resampler_set_rate_frac(st, in_rate, out_rate, in_rate, out_rate);
}
void speex_resampler_get_rate(SpeexResamplerState *st, spx_uint32_t *in_rate, spx_uint32_t *out_rate)
EXPORT void speex_resampler_get_rate(SpeexResamplerState *st, spx_uint32_t *in_rate, spx_uint32_t *out_rate)
{
*in_rate = st->in_rate;
*out_rate = st->out_rate;
}
int speex_resampler_set_rate_frac(SpeexResamplerState *st, spx_uint32_t ratio_num, spx_uint32_t ratio_den, spx_uint32_t in_rate, spx_uint32_t out_rate)
EXPORT int speex_resampler_set_rate_frac(SpeexResamplerState *st, spx_uint32_t ratio_num, spx_uint32_t ratio_den, spx_uint32_t in_rate, spx_uint32_t out_rate)
{
spx_uint32_t fact;
spx_uint32_t old_den;
@ -1031,17 +1109,17 @@ static int speex_resampler_magic(SpeexResamplerState *st, spx_uint32_t channel_i
}
if (st->initialised)
update_filter(st);
return update_filter(st);
return RESAMPLER_ERR_SUCCESS;
}
void speex_resampler_get_ratio(SpeexResamplerState *st, spx_uint32_t *ratio_num, spx_uint32_t *ratio_den)
EXPORT void speex_resampler_get_ratio(SpeexResamplerState *st, spx_uint32_t *ratio_num, spx_uint32_t *ratio_den)
{
*ratio_num = st->num_rate;
*ratio_den = st->den_rate;
}
int speex_resampler_set_quality(SpeexResamplerState *st, int quality)
EXPORT int speex_resampler_set_quality(SpeexResamplerState *st, int quality)
{
if (quality > 10 || quality < 0)
return RESAMPLER_ERR_INVALID_ARG;
@ -1049,46 +1127,46 @@ static int speex_resampler_magic(SpeexResamplerState *st, spx_uint32_t channel_i
return RESAMPLER_ERR_SUCCESS;
st->quality = quality;
if (st->initialised)
update_filter(st);
return update_filter(st);
return RESAMPLER_ERR_SUCCESS;
}
void speex_resampler_get_quality(SpeexResamplerState *st, int *quality)
EXPORT void speex_resampler_get_quality(SpeexResamplerState *st, int *quality)
{
*quality = st->quality;
}
void speex_resampler_set_input_stride(SpeexResamplerState *st, spx_uint32_t stride)
EXPORT void speex_resampler_set_input_stride(SpeexResamplerState *st, spx_uint32_t stride)
{
st->in_stride = stride;
}
void speex_resampler_get_input_stride(SpeexResamplerState *st, spx_uint32_t *stride)
EXPORT void speex_resampler_get_input_stride(SpeexResamplerState *st, spx_uint32_t *stride)
{
*stride = st->in_stride;
}
void speex_resampler_set_output_stride(SpeexResamplerState *st, spx_uint32_t stride)
EXPORT void speex_resampler_set_output_stride(SpeexResamplerState *st, spx_uint32_t stride)
{
st->out_stride = stride;
}
void speex_resampler_get_output_stride(SpeexResamplerState *st, spx_uint32_t *stride)
EXPORT void speex_resampler_get_output_stride(SpeexResamplerState *st, spx_uint32_t *stride)
{
*stride = st->out_stride;
}
int speex_resampler_get_input_latency(SpeexResamplerState *st)
EXPORT int speex_resampler_get_input_latency(SpeexResamplerState *st)
{
return st->filt_len / 2;
}
int speex_resampler_get_output_latency(SpeexResamplerState *st)
EXPORT int speex_resampler_get_output_latency(SpeexResamplerState *st)
{
return ((st->filt_len / 2) * st->den_rate + (st->num_rate >> 1)) / st->num_rate;
}
int speex_resampler_skip_zeros(SpeexResamplerState *st)
EXPORT int speex_resampler_skip_zeros(SpeexResamplerState *st)
{
spx_uint32_t i;
for (i=0;i<st->nb_channels;i++)
@ -1096,15 +1174,21 @@ static int speex_resampler_magic(SpeexResamplerState *st, spx_uint32_t channel_i
return RESAMPLER_ERR_SUCCESS;
}
int speex_resampler_reset_mem(SpeexResamplerState *st)
EXPORT int speex_resampler_reset_mem(SpeexResamplerState *st)
{
spx_uint32_t i;
for (i=0;i<st->nb_channels;i++)
{
st->last_sample[i] = 0;
st->magic_samples[i] = 0;
st->samp_frac_num[i] = 0;
}
for (i=0;i<st->nb_channels*(st->filt_len-1);i++)
st->mem[i] = 0;
return RESAMPLER_ERR_SUCCESS;
}
const char *speex_resampler_strerror(int err)
EXPORT const char *speex_resampler_strerror(int err)
{
switch (err)
{

View File

@ -39,8 +39,6 @@
#ifndef SPEEX_RESAMPLER_H
#define SPEEX_RESAMPLER_H
#define OUTSIDE_SPEEX
#ifdef OUTSIDE_SPEEX
/********* WARNING: MENTAL SANITY ENDS HERE *************/
@ -48,7 +46,7 @@
/* If the resampler is defined outside of Speex, we change the symbol names so that
there won't be any clash if linking with Speex later on. */
#define RANDOM_PREFIX ast
#define RANDOM_PREFIX speex
#ifndef RANDOM_PREFIX
#error "Please define RANDOM_PREFIX (above) to something specific to your project to prevent symbol name clashes"
#endif

View File

@ -36,6 +36,20 @@ exten = 2565551234,1,Verbose(1, "User ${CALLERID(num)} dialed into remote voicem
same = n,VoiceMailMain(example)
same = n,Hangup()
; Extension to queue for sales.
; The queue has a 300 second timeout.
exten = 2565551200,1,Verbose(1, "User ${CALLERID(num)} dialed the sales queue.")
same = n,Answer()
same = n,Queue(sales,,,,300)
same = n,Goto(operator,1)
; Extension to queue for a customer advocate.
; The queue has a 1200 second timeout.
exten = 2565551250,1,Verbose(1, "User ${CALLERID(num)} dialed the customer advocate queue.")
same = n,Answer()
same = n,Queue(customer_advocate,,,,1200)
same = n,Goto(operator,1)
[Dialing-Errors]
; Handle any extensions dialed internally that don't otherwise exist.
; Comment out or remove this extension if you would rather have the calls

View File

@ -14,6 +14,7 @@ load = app_verbose.so
load = app_voicemail.so
load = app_directory.so
load = app_confbridge.so
load = app_queue.so
; Bridging

View File

@ -0,0 +1,19 @@
[general]
monitor-type = MixMonitor
;========================Sales Queue ==
; Calls all sales persons in a ring-all fashion
[sales]
strategy=ringall
member => PJSIP/1109 ; Terry Jules - Director of Sales
member => PJSIP/1105 ; Garnet Claude - Sales Associate
member => PJSIP/1112 ; Franny Ocean - Sales Associate
;===================== Customer Advocate Queue ==
; Calls all customer advocates in a ring-all fashion
[customer_advocate]
strategy=ringall
member => PJSIP/1101 ; Maria Berny - Director of Customer Experience
member => PJSIP/1115 ; Dusty Williams - Customer Advocate
member => PJSIP/1102 ; Tommy Briar - Customer Advocate

View File

@ -95,6 +95,7 @@
;queue_rules => odbc,asterisk
;acls => odbc,asterisk
;musiconhold => mysql,general
;musiconhold_entry => mysql,general
;queue_log => mysql,general
;
;

View File

@ -13,6 +13,7 @@
; valid mode options:
; files -- read files from a directory in any Asterisk supported
; media format
; playlist -- provide a fixed list of filenames or URLs to play
; quietmp3 -- default
; mp3 -- loud
; mp3nb -- unbuffered
@ -44,6 +45,22 @@
; this, res_musiconhold will skip the files it is not able to
; understand when it loads.
;
; =========
; Playlist (native) music on hold
; =========
;
; This mode is similar to 'files' mode in that it plays through a list
; of files, but instead of scanning a directory the files are
; explicitly configured using one or more 'entry' options.
;
; Each entry must be one of:
;
; * An absolute path to the file to be played, without an extension.
; * A URL
;
; The entries are played in the order in which they appear in the
; configuration. The 'sort' option is not used for this mode.
;
[default]
mode=files
@ -71,6 +88,12 @@ directory=moh
;directory=moh
;sort=alpha ; Sort the files in alphabetical order.
;[sales-queue-hold]
;mode=playlist
;entry=/var/lib/asterisk/sounds/en/yourcallisimportant
;entry=http://example.local/sales-queue-hold-music.ulaw
;entry=/var/lib/asterisk/moh/macroform-robot_dity
; =========
; Other (non-native) playback methods
; =========

82
configure vendored
View File

@ -1350,6 +1350,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
@ -1538,6 +1539,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@ -1790,6 +1792,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@ -1927,7 +1938,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@ -2080,6 +2091,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@ -14946,7 +14958,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@ -14992,7 +15004,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@ -15016,7 +15028,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@ -15061,7 +15073,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@ -15085,7 +15097,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@ -16385,6 +16397,8 @@ main ()
if (*(data + i) != *(data3 + i))
return 14;
close (fd);
free (data);
free (data3);
return 0;
}
_ACEOF
@ -22958,6 +22972,7 @@ fi
fi
if test "x${PBX_MYSQLCLIENT}" != "x1" -a "${USE_MYSQLCLIENT}" != "no"; then
PBX_MYSQLCLIENT=0
if test -n "$ac_tool_prefix"; then
@ -23077,6 +23092,61 @@ $as_echo "#define HAVE_MYSQLCLIENT 1" >>confdefs.h
fi
if test "${PBX_MYSQLCLIENT}" = 1; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MySQL client bool support" >&5
$as_echo_n "checking for MySQL client bool support... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <mysql/mysql.h>
int
main ()
{
bool test = 1;
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
$as_echo "#define HAVE_MYSQLCLIENT_BOOL 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MySQL client my_bool support" >&5
$as_echo_n "checking for MySQL client my_bool support... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <mysql/mysql.h>
int
main ()
{
my_bool test = 1;
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
$as_echo "#define HAVE_MYSQLCLIENT_MY_BOOL 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
if test "x${PBX_NBS}" != "x1" -a "${USE_NBS}" != "no"; then
pbxlibdir=""

View File

@ -2279,8 +2279,28 @@ if test "${PBX_MISDN}" = 1; then
AC_CHECK_MEMBER([Q931_info_t.redirect_dn], [], [PBX_MISDN=0], [#include <mISDNuser/mISDNlib.h>])
fi
AST_EXT_TOOL_CHECK([MYSQLCLIENT], [mysql_config])
if test "${PBX_MYSQLCLIENT}" = 1; then
AC_MSG_CHECKING(for MySQL client bool support)
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <mysql/mysql.h>],
[bool test = 1;])],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MYSQLCLIENT_BOOL, 1, [Define to 1 if mysql/mysql.h has bool defined.]),
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(for MySQL client my_bool support)
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <mysql/mysql.h>],
[my_bool test = 1;])],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MYSQLCLIENT_MY_BOOL, 1, [Define to 1 if mysql/mysql.h has my_bool defined.]),
AC_MSG_RESULT(no)
)
fi
AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
AST_EXT_TOOL_CHECK([NEON], [neon-config])

View File

@ -0,0 +1,54 @@
"""add playlist to moh
Revision ID: fbb7766f17bc
Revises: 3a094a18e75b
Create Date: 2019-09-18 10:24:18.731798
"""
# revision identifiers, used by Alembic.
revision = 'fbb7766f17bc'
down_revision = '3a094a18e75b'
from alembic import op
import sqlalchemy as sa
def enum_update(table_name, column_name, enum_name, enum_values):
if op.get_context().bind.dialect.name != 'postgresql':
if op.get_context().bind.dialect.name == 'mssql':
op.drop_constraint('ck_musiconhold_mode_moh_mode_values', 'musiconhold')
op.alter_column(table_name, column_name,
type_=sa.Enum(*enum_values, name=enum_name))
return
# Postgres requires a few more steps
tmp = enum_name + '_tmp'
op.execute('ALTER TYPE ' + enum_name + ' RENAME TO ' + tmp)
updated = sa.Enum(*enum_values, name=enum_name)
updated.create(op.get_bind(), checkfirst=False)
op.execute('ALTER TABLE ' + table_name + ' ALTER COLUMN ' + column_name +
' TYPE ' + enum_name + ' USING mode::text::' + enum_name)
op.execute('DROP TYPE ' + tmp)
def upgrade():
op.create_table(
'musiconhold_entry',
sa.Column('name', sa.String(80), primary_key=True, nullable=False),
sa.Column('position', sa.Integer, primary_key=True, nullable=False),
sa.Column('entry', sa.String(1024), nullable=False)
)
op.create_foreign_key('fk_musiconhold_entry_name_musiconhold', 'musiconhold_entry', 'musiconhold', ['name'], ['name'])
enum_update('musiconhold', 'mode', 'moh_mode_values',
['custom', 'files', 'mp3nb', 'quietmp3nb', 'quietmp3', 'playlist'])
def downgrade():
enum_update('musiconhold', 'mode', 'moh_mode_values',
['custom', 'files', 'mp3nb', 'quietmp3nb', 'quietmp3'])
op.drop_table('musiconhold_entry')

View File

@ -0,0 +1,41 @@
CREATE TABLE alembic_version (
version_num VARCHAR(32) NOT NULL,
CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num)
);
-- Running upgrade -> 210693f3123d
CREATE TABLE cdr (
accountcode VARCHAR(20),
src VARCHAR(80),
dst VARCHAR(80),
dcontext VARCHAR(80),
clid VARCHAR(80),
channel VARCHAR(80),
dstchannel VARCHAR(80),
lastapp VARCHAR(80),
lastdata VARCHAR(80),
start DATETIME,
answer DATETIME,
end DATETIME,
duration INTEGER,
billsec INTEGER,
disposition VARCHAR(45),
amaflags VARCHAR(45),
userfield VARCHAR(256),
uniqueid VARCHAR(150),
linkedid VARCHAR(150),
peeraccount VARCHAR(20),
sequence INTEGER
);
INSERT INTO alembic_version (version_num) VALUES ('210693f3123d');
-- Running upgrade 210693f3123d -> 54cde9847798
ALTER TABLE cdr MODIFY accountcode VARCHAR(80) NULL;
ALTER TABLE cdr MODIFY peeraccount VARCHAR(80) NULL;
UPDATE alembic_version SET version_num='54cde9847798' WHERE alembic_version.version_num = '210693f3123d';

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,35 @@
CREATE TABLE alembic_version (
version_num VARCHAR(32) NOT NULL,
CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num)
);
-- Running upgrade -> a2e9769475e
CREATE TABLE voicemail_messages (
dir VARCHAR(255) NOT NULL,
msgnum INTEGER NOT NULL,
context VARCHAR(80),
macrocontext VARCHAR(80),
callerid VARCHAR(80),
origtime INTEGER,
duration INTEGER,
recording BLOB,
flag VARCHAR(30),
category VARCHAR(30),
mailboxuser VARCHAR(30),
mailboxcontext VARCHAR(30),
msg_id VARCHAR(40)
);
ALTER TABLE voicemail_messages ADD CONSTRAINT voicemail_messages_dir_msgnum PRIMARY KEY (dir, msgnum);
CREATE INDEX voicemail_messages_dir ON voicemail_messages (dir);
INSERT INTO alembic_version (version_num) VALUES ('a2e9769475e');
-- Running upgrade a2e9769475e -> 39428242f7f5
ALTER TABLE voicemail_messages MODIFY recording BLOB(4294967295) NULL;
UPDATE alembic_version SET version_num='39428242f7f5' WHERE alembic_version.version_num = 'a2e9769475e';

View File

@ -0,0 +1,45 @@
BEGIN;
CREATE TABLE alembic_version (
version_num VARCHAR(32) NOT NULL,
CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num)
);
-- Running upgrade -> 210693f3123d
CREATE TABLE cdr (
accountcode VARCHAR(20),
src VARCHAR(80),
dst VARCHAR(80),
dcontext VARCHAR(80),
clid VARCHAR(80),
channel VARCHAR(80),
dstchannel VARCHAR(80),
lastapp VARCHAR(80),
lastdata VARCHAR(80),
start TIMESTAMP WITHOUT TIME ZONE,
answer TIMESTAMP WITHOUT TIME ZONE,
"end" TIMESTAMP WITHOUT TIME ZONE,
duration INTEGER,
billsec INTEGER,
disposition VARCHAR(45),
amaflags VARCHAR(45),
userfield VARCHAR(256),
uniqueid VARCHAR(150),
linkedid VARCHAR(150),
peeraccount VARCHAR(20),
sequence INTEGER
);
INSERT INTO alembic_version (version_num) VALUES ('210693f3123d');
-- Running upgrade 210693f3123d -> 54cde9847798
ALTER TABLE cdr ALTER COLUMN accountcode TYPE VARCHAR(80);
ALTER TABLE cdr ALTER COLUMN peeraccount TYPE VARCHAR(80);
UPDATE alembic_version SET version_num='54cde9847798' WHERE alembic_version.version_num = '210693f3123d';
COMMIT;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,39 @@
BEGIN;
CREATE TABLE alembic_version (
version_num VARCHAR(32) NOT NULL,
CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num)
);
-- Running upgrade -> a2e9769475e
CREATE TABLE voicemail_messages (
dir VARCHAR(255) NOT NULL,
msgnum INTEGER NOT NULL,
context VARCHAR(80),
macrocontext VARCHAR(80),
callerid VARCHAR(80),
origtime INTEGER,
duration INTEGER,
recording BYTEA,
flag VARCHAR(30),
category VARCHAR(30),
mailboxuser VARCHAR(30),
mailboxcontext VARCHAR(30),
msg_id VARCHAR(40)
);
ALTER TABLE voicemail_messages ADD CONSTRAINT voicemail_messages_dir_msgnum PRIMARY KEY (dir, msgnum);
CREATE INDEX voicemail_messages_dir ON voicemail_messages (dir);
INSERT INTO alembic_version (version_num) VALUES ('a2e9769475e');
-- Running upgrade a2e9769475e -> 39428242f7f5
ALTER TABLE voicemail_messages ALTER COLUMN recording TYPE BYTEA;
UPDATE alembic_version SET version_num='39428242f7f5' WHERE alembic_version.version_num = 'a2e9769475e';
COMMIT;

View File

@ -1,3 +0,0 @@
Subject: AttendedTransfer
A new application, this will queue up attended transfer to the given extension.

View File

@ -1,4 +0,0 @@
Subject: BlindTransfer
A new application, this will redirect all channels currently
bridged to the caller channel to the specified destination.

View File

@ -1,7 +0,0 @@
Subject: ConfBridge
Add "average_all", "highest_all", and "lowest_all" values for
the remb_behavior option. These values operate on a bridge
level instead of a per-source level. This means that a single
REMB value is calculated and sent to every sender, instead of
a REMB value that is unique for the specific sender..

View File

@ -1,12 +0,0 @@
Subject: Dial
Add RINGTIME and RINGTIME_MS variables containing respectively seconds and
milliseconds between creation of the dialing channel and receiving the first
RINGING signal
Add PROGRESSTIME and PROGRESSTIME_MS variables analogous to the above with respect to
the PROGRESS signal. Shorter of these two times should be equivalent to
the PDD (Post Dial Delay) value
Add DIALEDTIME_MS and ANSWEREDTIME_MS variables to get millisecond resolution
versions of DIALEDTIME and ANSWEREDTIME

View File

@ -1,3 +0,0 @@
Subject: ReadExten
Add 'p' option to stop reading extension if user presses '#' key.

View File

@ -1,36 +0,0 @@
Subject: Bridging
Master-Only: true
The bridging core no longer uses the stasis cache for bridge
snapshots. The latest bridge snapshot is now stored on the
ast_bridge structure itself.
The following APIs are no longer available since the stasis cache
is no longer used:
ast_bridge_topic_cached()
ast_bridge_topic_all_cached()
A topic pool is now used for individual bridge topics.
The ast_bridge_cache() function was removed since there's no
longer a separate container of snapshots.
A new function "ast_bridges()" was created to retrieve the
container of all bridges. Users formerly calling
ast_bridge_cache() can use the new function to iterate over
bridges and retrieve the latest snapshot directly from the
bridge.
The ast_bridge_snapshot_get_latest() function was renamed to
ast_bridge_get_snapshot_by_uniqueid().
A new function "ast_bridge_get_snapshot()" was created to retrieve
the bridge snapshot directly from the bridge structure.
The ast_bridge_topic_all() function now returns a normal topic
not a cached one so you can't use stasis cache functions on it
either.
The ast_bridge_snapshot_type() stasis message now has the
ast_bridge_snapshot_update structure as it's data. It contains
the last snapshot and the new one.

View File

@ -1,7 +0,0 @@
Subject: chan_sip
Master-Only: true
The chan_sip module is now deprecated, users should migrate to the
replacement module chan_pjsip. See guides at the Asterisk Wiki:
https://wiki.asterisk.org/wiki/x/tAHOAQ
https://wiki.asterisk.org/wiki/x/hYCLAQ

View File

@ -1,16 +0,0 @@
Subject: Channels
Master-Only: true
The core no longer uses the stasis cache for channels snapshots.
The following APIs are no longer available:
ast_channel_topic_cached()
ast_channel_topic_all_cached()
The ast_channel_cache_all() and ast_channel_cache_by_name() functions
now returns an ao2_container of ast_channel_snapshots rather than a
container of stasis_messages therefore you can't call stasis_cache
functions on it.
The ast_channel_topic_all() function now returns a normal topic,
not a cached one so you can't use stasis cache functions on it either.
The ast_channel_snapshot_type() stasis message now has the
ast_channel_snapshot_update structure as it's data.
ast_channel_snapshot_get_latest() still returns the latest snapshot.

View File

@ -1,3 +0,0 @@
Subject: pbx_dundi
The DUNDi PBX module now supports IPv4/IPv6 dual binding.

View File

@ -1,13 +0,0 @@
Subject: res_pjsip
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.

View File

@ -1,5 +0,0 @@
Subject: res_rtp_asterisk
DTLS packets will now be fragmented according to the MTU as set in rtp.conf. This
allows larger certificates to be used for the DTLS negotiation. By default this value
is 1200.

View File

@ -1,5 +0,0 @@
Subject: RTP/ICE
You can now indicate that you'd like an ice_host_candidate's local address
to be published as well as the mapped address. See the sample rtp.conf
for more information.

View File

@ -1,9 +0,0 @@
Subject: app_voicemail.c
The "Voicemail Build Options" section of menuselect has been removed along with
the FILE_STORAGE, ODBC_STORAGE and IMAP_STORAGE menuselect options. All 3 variants
of the voicemail app can now be built at the same by enabling app_voicemail,
app_voicemail_imap, and app_voicemail_odbc under the "Applications" section.
By default, only app_voicemail is enabled. Also, the modules.conf sample has
been updated to "noload" app_voicemail_imap and app_voicemail_odbc should they
all be built. Packagers must update their build scripts appropriately.

View File

@ -1,4 +0,0 @@
Subject: Applications
Master-Only: true
The JabberStatus application, deprecated in Asterisk 12, has been removed.

View File

@ -1,36 +0,0 @@
Subject: Bridging
Master-Only: true
The bridging core no longer uses the stasis cache for bridge
snapshots. The latest bridge snapshot is now stored on the
ast_bridge structure itself.
The following APIs are no longer available since the stasis cache
is no longer used:
ast_bridge_topic_cached()
ast_bridge_topic_all_cached()
A topic pool is now used for individual bridge topics.
The ast_bridge_cache() function was removed since there's no
longer a separate container of snapshots.
A new function "ast_bridges()" was created to retrieve the
container of all bridges. Users formerly calling
ast_bridge_cache() can use the new function to iterate over
bridges and retrieve the latest snapshot directly from the
bridge.
The ast_bridge_snapshot_get_latest() function was renamed to
ast_bridge_get_snapshot_by_uniqueid().
A new function "ast_bridge_get_snapshot()" was created to retrieve
the bridge snapshot directly from the bridge structure.
The ast_bridge_topic_all() function now returns a normal topic
not a cached one so you can't use stasis cache functions on it
either.
The ast_bridge_snapshot_type() stasis message now has the
ast_bridge_snapshot_update structure as it's data. It contains
the last snapshot and the new one.

View File

@ -1,5 +0,0 @@
Subject: chan_pjsip
Subject: Core
res_pjsip_pubsub is now required so call transfer progress can be monitored
and reported in the channel variable TRANSFERSTATUS.

View File

@ -1,7 +0,0 @@
Subject: chan_sip
Master-Only: true
The chan_sip module is now deprecated, users should migrate to the
replacement module chan_pjsip. See guides at the Asterisk Wiki:
https://wiki.asterisk.org/wiki/x/tAHOAQ
https://wiki.asterisk.org/wiki/x/hYCLAQ

View File

@ -1,16 +0,0 @@
Subject: Channels
Master-Only: true
The core no longer uses the stasis cache for channels snapshots.
The following APIs are no longer available:
ast_channel_topic_cached()
ast_channel_topic_all_cached()
The ast_channel_cache_all() and ast_channel_cache_by_name() functions
now returns an ao2_container of ast_channel_snapshots rather than a
container of stasis_messages therefore you can't call stasis_cache
functions on it.
The ast_channel_topic_all() function now returns a normal topic,
not a cached one so you can't use stasis cache functions on it either.
The ast_channel_snapshot_type() stasis message now has the
ast_channel_snapshot_update structure as it's data.
ast_channel_snapshot_get_latest() still returns the latest snapshot.

View File

@ -1,5 +0,0 @@
Subject: func_callerid
Master-Only: true
The CALLERPRES() dialplan function, deprecated in Asterisk 1.8, has been
removed.

View File

@ -1,7 +0,0 @@
Subject: Build
Master-Only: true
Asterisk headers are no longer installed and uninstalled automatically when
performing a "make install" or a "make uninstall". To install/uninstall the
headers, use "make install-headers" and "make uninstall-headers". The headers
also continue to be uninstalled when performing a "make uninstall-all".

View File

@ -1,5 +0,0 @@
Subject: res_parking
Master-Only: true
The PARKINGSLOT channel variable, deprecated in Asterisk 12 in favor of the
PARKING_SPACE channel variable, will no longer be set.

View File

@ -1,4 +0,0 @@
Subject: res_xmpp
Master-Only: true
The JabberStatus application, deprecated in Asterisk 12, has been removed.

View File

@ -199,7 +199,7 @@ static off_t g726_tell(struct ast_filestream *fs)
return ftello(fs->f) << 1;
}
static struct ast_format_def f[] = {
static struct ast_format_def f_def[] = {
{
.name = "g726-40",
.exts = "g726-40",
@ -259,9 +259,9 @@ static int unload_module(void)
{
int i;
for (i = 0; f[i].desc_size ; i++) {
if (ast_format_def_unregister(f[i].name))
ast_log(LOG_WARNING, "Failed to unregister format %s.\n", f[i].name);
for (i = 0; f_def[i].desc_size ; i++) {
if (ast_format_def_unregister(f_def[i].name))
ast_log(LOG_WARNING, "Failed to unregister format %s.\n", f_def[i].name);
}
return(0);
}
@ -270,10 +270,10 @@ static int load_module(void)
{
int i;
for (i = 0; f[i].desc_size ; i++) {
f[i].format = ast_format_g726;
if (ast_format_def_register(&f[i])) { /* errors are fatal */
ast_log(LOG_WARNING, "Failed to register format %s.\n", f[i].name);
for (i = 0; f_def[i].desc_size ; i++) {
f_def[i].format = ast_format_g726;
if (ast_format_def_register(&f_def[i])) { /* errors are fatal */
ast_log(LOG_WARNING, "Failed to register format %s.\n", f_def[i].name);
unload_module();
return AST_MODULE_LOAD_DECLINE;
}

View File

@ -1,4 +1,6 @@
/* Conversion routines derived from code by guido@sienanet.it */
#ifndef ASTERISK_MSGSM_H
#define ASTERISK_MSGSM_H
#define GSM_MAGIC 0xD
@ -687,3 +689,5 @@ static inline void conv65( wav_byte * c, gsm_byte * d){
writeGSM_33(d+33);
}
#endif /* ASTERISK_MSGSM_H */

View File

@ -121,6 +121,11 @@
<para>Include header information in the result
(boolean)</para>
</enum>
<enum name="httpheader">
<para>Add HTTP header. Multiple calls add multiple headers.
Setting of any header will remove the default
"Content-Type application/x-www-form-urlencoded"</para>
</enum>
<enum name="httptimeout">
<para>For HTTP(S) URIs, number of seconds to wait for a
server response</para>
@ -181,7 +186,7 @@
</syntax>
<description>
<para>Options may be set globally or per channel. Per-channel
settings will override global settings.</para>
settings will override global settings. Only HTTP headers are added instead of overriding</para>
</description>
<see-also>
<ref type="function">CURL</ref>
@ -243,6 +248,9 @@ static int parse_curlopt_key(const char *name, CURLoption *key, enum optiontype
if (!strcasecmp(name, "header")) {
*key = CURLOPT_HEADER;
*ot = OT_BOOLEAN;
} else if (!strcasecmp(name, "httpheader")) {
*key = CURLOPT_HTTPHEADER;
*ot = OT_STRING;
} else if (!strcasecmp(name, "proxy")) {
*key = CURLOPT_PROXY;
*ot = OT_STRING;
@ -412,16 +420,18 @@ yuck:
return -1;
}
/* Remove any existing entry */
/* Remove any existing entry, only http headers are left */
AST_LIST_LOCK(list);
AST_LIST_TRAVERSE_SAFE_BEGIN(list, cur, list) {
if (cur->key == new->key) {
AST_LIST_REMOVE_CURRENT(list);
ast_free(cur);
break;
if (new->key != CURLOPT_HTTPHEADER) {
AST_LIST_TRAVERSE_SAFE_BEGIN(list, cur, list) {
if (cur->key == new->key) {
AST_LIST_REMOVE_CURRENT(list);
ast_free(cur);
break;
}
}
AST_LIST_TRAVERSE_SAFE_END
}
AST_LIST_TRAVERSE_SAFE_END
/* Insert new entry */
ast_debug(1, "Inserting entry %p with key %d and value %p\n", new, new->key, new->value);
@ -639,6 +649,7 @@ static int acf_curl_helper(struct ast_channel *chan, struct curl_args *args)
int ret = -1;
CURL **curl;
struct curl_settings *cur;
struct curl_slist *headers = NULL;
struct ast_datastore *store = NULL;
int hashcompat = 0;
AST_LIST_HEAD(global_curl_info, curl_settings) *list = NULL;
@ -666,6 +677,8 @@ static int acf_curl_helper(struct ast_channel *chan, struct curl_args *args)
AST_LIST_TRAVERSE(&global_curl_info, cur, list) {
if (cur->key == CURLOPT_SPECIAL_HASHCOMPAT) {
hashcompat = (long) cur->value;
} else if (cur->key == CURLOPT_HTTPHEADER) {
headers = curl_slist_append(headers, (char*) cur->value);
} else {
curl_easy_setopt(*curl, cur->key, cur->value);
}
@ -682,6 +695,8 @@ static int acf_curl_helper(struct ast_channel *chan, struct curl_args *args)
AST_LIST_TRAVERSE(list, cur, list) {
if (cur->key == CURLOPT_SPECIAL_HASHCOMPAT) {
hashcompat = (long) cur->value;
} else if (cur->key == CURLOPT_HTTPHEADER) {
headers = curl_slist_append(headers, (char*) cur->value);
} else {
curl_easy_setopt(*curl, cur->key, cur->value);
}
@ -697,6 +712,10 @@ static int acf_curl_helper(struct ast_channel *chan, struct curl_args *args)
curl_easy_setopt(*curl, CURLOPT_POSTFIELDS, args->postdata);
}
if (headers) {
curl_easy_setopt(*curl, CURLOPT_HTTPHEADER, headers);
}
/* Temporarily assign a buffer for curl to write errors to. */
curl_errbuf[0] = curl_errbuf[CURL_ERROR_SIZE] = '\0';
curl_easy_setopt(*curl, CURLOPT_ERRORBUFFER, curl_errbuf);
@ -714,6 +733,7 @@ static int acf_curl_helper(struct ast_channel *chan, struct curl_args *args)
if (store) {
AST_LIST_UNLOCK(list);
}
curl_slist_free_all(headers);
if (args->postdata) {
curl_easy_setopt(*curl, CURLOPT_POST, 0);
@ -841,6 +861,7 @@ static struct ast_custom_function acf_curlopt = {
" ftptext - For FTP, force a text transfer (boolean)\n"
" ftptimeout - For FTP, the server response timeout\n"
" header - Retrieve header information (boolean)\n"
" httpheader - Add new custom http header (string)\n"
" httptimeout - Number of seconds to wait for HTTP response\n"
" maxredirs - Maximum number of redirects to follow\n"
" proxy - Hostname or IP to use as a proxy\n"

View File

@ -709,12 +709,13 @@ static int file_read(struct ast_channel *chan, const char *cmd, char *data, stru
ast_debug(3, "offset=%" PRId64 ", length=%" PRId64 ", offset_offset=%" PRId64 ", length_offset=%" PRId64 "\n", offset, length, offset_offset, length_offset);
for (i = offset_offset; i < flength; i += sizeof(fbuf)) {
char *pos;
if (fread(fbuf, 1, sizeof(fbuf), ff) < sizeof(fbuf) && !feof(ff)) {
size_t bytes_read;
if ((bytes_read = fread(fbuf, 1, sizeof(fbuf), ff)) < sizeof(fbuf) && !feof(ff)) {
ast_log(LOG_ERROR, "Short read?!!\n");
fclose(ff);
return -1;
}
for (pos = fbuf; pos < fbuf + sizeof(fbuf); pos++) {
for (pos = fbuf; pos < fbuf + bytes_read; pos++) {
LINE_COUNTER(pos, format, current_length);
if (current_length == length) {

View File

@ -62,8 +62,9 @@
</syntax>
<description>
<para>Jitterbuffers are constructed in two different ways.
The first always take three arguments: <replaceable>max_size</replaceable>,
<replaceable>resync_threshold</replaceable>, and <replaceable>target_extra</replaceable>.
The first always take four arguments: <replaceable>max_size</replaceable>,
<replaceable>resync_threshold</replaceable>, <replaceable>target_extra</replaceable>,
and <replaceable>sync_video</replaceable>.
Alternatively, a single argument of <literal>default</literal> can be provided,
which will construct the default jitterbuffer for the given
<replaceable>jitterbuffer type</replaceable>.</para>
@ -76,12 +77,17 @@
<para>target_extra: This option only affects the adaptive jitterbuffer. It represents
the amount time in milliseconds by which the new jitter buffer will pad its size.
Defaults to 40ms.</para>
<para>sync_video: This option enables video synchronization with the audio stream. It can be
turned on and off. Defaults to off.</para>
<example title="Fixed with defaults" language="text">
exten => 1,1,Set(JITTERBUFFER(fixed)=default)
</example>
<example title="Fixed with 200ms max size" language="text">
exten => 1,1,Set(JITTERBUFFER(fixed)=200)
</example>
<example title="Fixed with 200ms max size and video sync support" language="text">
exten => 1,1,Set(JITTERBUFFER(fixed)=200,,,yes)
</example>
<example title="Fixed with 200ms max size, resync threshold 1500" language="text">
exten => 1,1,Set(JITTERBUFFER(fixed)=200,1500)
</example>
@ -91,6 +97,9 @@
<example title="Adaptive with 200ms max size, 60ms target extra" language="text">
exten => 1,1,Set(JITTERBUFFER(adaptive)=200,,60)
</example>
<example title="Adaptive with 200ms max size and video sync support" language="text">
exten => 1,1,Set(JITTERBUFFER(adaptive)=200,,,yes)
</example>
<example title="Set a fixed jitterbuffer with defaults; then remove it" language="text">
exten => 1,1,Set(JITTERBUFFER(fixed)=default)
exten => 1,n,Set(JITTERBUFFER(disabled)=)
@ -133,6 +142,7 @@ static int jb_helper(struct ast_channel *chan, const char *cmd, char *data, cons
AST_APP_ARG(max_size);
AST_APP_ARG(resync_threshold);
AST_APP_ARG(target_extra);
AST_APP_ARG(sync_video);
);
AST_STANDARD_APP_ARGS(args, parse);
@ -151,6 +161,11 @@ static int jb_helper(struct ast_channel *chan, const char *cmd, char *data, cons
"jbtargetextra",
args.target_extra);
}
if (!ast_strlen_zero(args.sync_video)) {
res |= ast_jb_read_conf(&jb_conf,
"jbsyncvideo",
args.sync_video);
}
if (res) {
ast_log(LOG_WARNING, "Invalid jitterbuffer parameters %s\n", value);
}

View File

@ -203,7 +203,7 @@ static int talk_detect_audiohook_cb(struct ast_audiohook *audiohook, struct ast_
int64_t diff_ms = ast_tvdiff_ms(ast_tvnow(), td_params->talking_start);
diff_ms -= td_params->dsp_silence_threshold;
blob = ast_json_pack("{s: i}", "duration", diff_ms);
blob = ast_json_pack("{s: I}", "duration", (ast_json_int_t)diff_ms);
if (!blob) {
return 1;
}

View File

@ -44,7 +44,8 @@ struct ast_frame;
enum {
AST_JB_ENABLED = (1 << 0),
AST_JB_FORCED = (1 << 1),
AST_JB_LOG = (1 << 2)
AST_JB_LOG = (1 << 2),
AST_JB_SYNC_VIDEO = (1 << 3)
};
enum ast_jb_type {
@ -89,6 +90,7 @@ struct ast_jb_conf
#define AST_JB_CONF_TARGET_EXTRA "targetextra"
#define AST_JB_CONF_IMPL "impl"
#define AST_JB_CONF_LOG "log"
#define AST_JB_CONF_SYNC_VIDEO "syncvideo"
/* Hooks for the abstract jb implementation */
/*! \brief Create */

View File

@ -101,7 +101,7 @@ struct ast_ari_response {
/*! Corresponding text for the response code */
const char *response_text; /* Shouldn't http.c handle this? */
/*! Flag to indicate that no further response is needed */
int no_response:1;
unsigned int no_response:1;
};
/*!

View File

@ -376,6 +376,8 @@ enum ao2_alloc_opts {
* should never be passed directly to ao2_alloc.
*/
AO2_ALLOC_OPT_LOCK_OBJ = AO2_ALLOC_OPT_LOCK_MASK,
/*! The ao2 object will not record any REF_DEBUG entries */
AO2_ALLOC_OPT_NO_REF_DEBUG = (1 << 2),
};
/*!
@ -396,8 +398,6 @@ enum ao2_alloc_opts {
* - the returned pointer cannot be free()'d or realloc()'ed;
* rather, we just call ao2_ref(o, -1);
*
* \note refdebug logging is skipped if debug_msg is NULL
*
* @{
*/
@ -457,7 +457,6 @@ void *__ao2_alloc_with_lockobj(size_t data_size, ao2_destructor_fn destructor_fn
* can go away is when we release our reference, and it is
* the last one in existence.
*
* \note refdebug logging is skipped if tag is NULL
* @{
*/

View File

@ -64,6 +64,8 @@ enum ast_audiohook_flags {
AST_AUDIOHOOK_MUTE_READ = (1 << 5), /*!< audiohook should be mute frames read */
AST_AUDIOHOOK_MUTE_WRITE = (1 << 6), /*!< audiohook should be mute frames written */
AST_AUDIOHOOK_COMPATIBLE = (1 << 7), /*!< is the audiohook native slin compatible */
AST_AUDIOHOOK_SUBSTITUTE_SILENCE = (1 << 8), /*!< Substitute silence for missing audio */
};
enum ast_audiohook_init_flags {

View File

@ -537,6 +537,12 @@
/* Define if your system has the MYSQLCLIENT libraries. */
#undef HAVE_MYSQLCLIENT
/* Define to 1 if mysql/mysql.h has bool defined. */
#undef HAVE_MYSQLCLIENT_BOOL
/* Define to 1 if mysql/mysql.h has my_bool defined. */
#undef HAVE_MYSQLCLIENT_MY_BOOL
/* Define to 1 if you have the Network Broadcast Sound library. */
#undef HAVE_NBS

View File

@ -133,8 +133,8 @@ struct ast_calendar {
int timeframe; /*!< Span (in mins) of calendar data to pull with each request */
pthread_t thread; /*!< The thread that the calendar is loaded/updated in */
ast_cond_t unload;
int unloading:1;
int pending_deletion:1;
unsigned int unloading:1;
unsigned int pending_deletion:1;
struct ao2_container *events; /*!< The events that are known at this time */
};

View File

@ -263,6 +263,28 @@ struct ast_event *ast_cel_create_event(struct ast_channel_snapshot *snapshot,
enum ast_cel_event_type event_type, const char *userdefevname,
struct ast_json *extra, const char *peer_str);
/*!
* \brief Allocate and populate a CEL event structure
*
* \param snapshot An ast_channel_snapshot of the primary channel associated
* with this channel event.
* \param event_type The type of call event being reported.
* \param event_time The time at which the event occurred.
* \param userdefevname Custom name for the call event. (optional)
* \param extra An event-specific opaque JSON blob to be rendered and placed
* in the "CEL_EXTRA" information element of the call event. (optional)
* \param peer_str A list of comma-separated peer channel names. (optional)
*
* \since 13.29.0
* \since 16.6.0
*
* \retval The created ast_event structure
* \retval NULL on failure
*/
struct ast_event *ast_cel_create_event_with_time(struct ast_channel_snapshot *snapshot,
enum ast_cel_event_type event_type, const struct timeval *event_time,
const char *userdefevname, struct ast_json *extra, const char *peer_str);
/*!
* \brief CEL backend callback
*/

View File

@ -18,6 +18,9 @@
* \brief Internal channel functions for channel.c to use
*/
#ifndef ASTERISK_CHANNEL_INTERNAL_H
#define ASTERISK_CHANNEL_INTERNAL_H
#define ast_channel_internal_alloc(destructor, assignedid, requestor) __ast_channel_internal_alloc(destructor, assignedid, requestor, __FILE__, __LINE__, __PRETTY_FUNCTION__)
struct ast_channel *__ast_channel_internal_alloc(void (*destructor)(void *obj), const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *file, int line, const char *function);
void ast_channel_internal_finalize(struct ast_channel *chan);
@ -33,3 +36,5 @@ void ast_channel_internal_set_stream_topology_change_source(
struct ast_channel *chan, void *change_source);
void ast_channel_internal_swap_stream_topology(struct ast_channel *chan1,
struct ast_channel *chan2);
#endif /* ASTERISK_CHANNEL_INTERNAL_H */

View File

@ -948,6 +948,24 @@ struct ast_variable *ast_variable_list_append_hint(struct ast_variable **head, s
struct ast_variable *new_var);
#define ast_variable_list_append(head, new_var) ast_variable_list_append_hint(head, NULL, new_var)
/*!
* \brief Replace a variable in the given list with a new value
* \since 13.30.0
*
* \param head A pointer to an ast_variable * of the existing variable list head. May NOT be NULL
* but the content may be to initialize a new list. If so, upon return, this parameter will be updated
* with a pointer to the new list head.
* \param replacement The variable that replaces another variable in the list with the
* same name.
*
* \retval 0 if a variable was replaced in the list
* \retval -1 if no replacement occured
*
* \note The variable name comparison is performed case-sensitively
* \note If a variable is replaced, its memory is freed.
*/
int ast_variable_list_replace(struct ast_variable **head, struct ast_variable *replacement);
/*!
* \brief Update variable value within a config
*

Some files were not shown because too many files have changed in this diff Show More