This patch fixes clange compiler warnings for initializer overrides.
Specifically:
res_pjsip/config_transport maps PJSIP_TLSV1_METHOD to the same enumeration
value as PJSIP_SSL_DEFAULT_METHOD. When initializing an array containing
those enum values, we therefore initialize the value twice to two different
values, "tlsv1" and "default". This patch changes it to just initialize
the index in the array to "tlsv1".
Review: https://reviewboard.asterisk.org/r/4539/
ASTERISK-24917
Reported by: dkdegroot
patches:
rb4539.patch submitted by dkdegroot (License 6600)
........
Merged revisions 433682 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Asterisk had an issue where retransmissions of MESSAGE requests resulted in
Asterisk processing the retransmission as if it were a new MESSAGE request.
This patch fixes the issue by creating a transaction in PJSIP on the incoming
request. This way, if a retransmission arrives, the PJSIP transaction layer
will resend the response and Asterisk will not ever see the retransmission.
ASTERISK-24920 #close
Reported by Mark Michelson
Review: https://reviewboard.asterisk.org/r/4532/
........
Merged revisions 433619 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch updates the kqueue timing module to conform to current timer API.
This fixes issues with using the kqueue timing source on Asterisk 13 on
FreeBSD 10. These issues include:
- Remove support for kevent64(). The values used to support Asterisk timers
fit within 32bits and so can be handled on all platforms via kevent().
- Provide debug logging for, but do not track, unacked events. This matches
the behavior of all other timer implementations.
- Implement continuous mode by triggering and leaving active, a user event.
This ensures that the file descriptor for the timer returns immediately from
poll(), without placing the load of a high speed timer on the kernel.
- In kqueue_timer_get_max_rate(), don't overstate the capability of the timer.
On some platforms, UINT_MAX is greater than INTPTR_MAX, the largest integer
type kqueue supports for timers.
- In kqueue_timer_get_event(), assume the caller woke up from poll() and just
return the mode the timer is currently in. This matches all other timer
implementations.
- Adjust the test code now that unacked events are not tracked.
Review: https://reviewboard.asterisk.org/r/4465/
ASTERISK-24857 #close
Reported by: scsiguy
Tested by: Ed Hynan
patches:
rb4465.patch submitted by scsiguy (License 6692)
........
Merged revisions 433574 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This introduces a new logger routine ast_log_safe. This routine should be
used for all error messages in code that can be run as a result of ast_log.
ast_log_safe does nothing if run recursively. All error logging in
astobj2.c, strings.c and utils.h have been switched to ast_log_safe.
This required adding support for raw threadstorage. This provides direct
access to the void* pointer in threadstorage. In ast_log_safe, NULL is used
to signify that this thread is not already running ast_log_safe, (void*)1 when
it is already running. This was done since it's critical that ast_log_safe
do nothing that could log during recursion checking.
ASTERISK-24155 #close
Reported by: Timo Teräs
Review: https://reviewboard.asterisk.org/r/4502/
........
Merged revisions 433522 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 433523 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433524 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Since 'core stop now' and 'core restart now' do not stop modules,
it is unsafe for most of the core to run cleanups. Originally all
cleanups used ast_register_atexit, and were only changed when it
was shown to be unsafe. ast_register_atexit is now used only when
absolutely required to prevent corruption and close child processes.
Exceptions that need to use ast_register_atexit:
* CDR: Flush records.
* res_musiconhold: Kill external applications.
* AstDB: Close the DB.
* canary_exit: Kill canary process.
ASTERISK-24142 #close
Reported by: David Brillert
ASTERISK-24683 #close
Reported by: Peter Katzmann
ASTERISK-24805 #close
Reported by: Badalian Vyacheslav
ASTERISK-24881 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4500/
Review: https://reviewboard.asterisk.org/r/4501/
........
Merged revisions 433495 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 433497 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433498 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Move most of res_pjsip:module_unload to unload_pjsip to resolve crashes
caused by running PJSIP functions from non-PJSIP threads.
* Remove call to pjsip_endpt_destroy(ast_pjsip_endpoint), it was causing
crashes in some cases. In theory pj_shutdown() should take care of this.
* Mark res_pjsip_keepalive and res_pjsip_session as allowed to unload at
shutdown.
* Resolve leaked config global in res_pjsip_notify.
* Unregister pubsub pjsip service module.
* Implement cleanup for res_pjsip_session.
ASTERISK-24731 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4498/
........
Merged revisions 433469 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433470 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Attempting to execute DTMF in a confbridge while file playback (prompt,
announcement, etc) is occurring is not allowed. You have to wait until
the sound file has completed before entering DTMF. This patch fixes it
so that app_confbridge now monitors for dtmf key presses during menu
driven file playback. If a key is pressed playback stops and it executes
the matched menu option.
ASTERISK-24864 #close
Reported by: Steve Pitts
Review: https://reviewboard.asterisk.org/r/4510/
........
Merged revisions 433445 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 433446 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433447 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* In res/res_sorcery_realtime.c: Broke long line.
* In main/bucket.c: Eliminated unnecessary NULL check as
ast_sorcery_unref() is NULL tolerant and set the global object to NULL
after unref in the system shutdown bucket_cleanup().
........
Merged revisions 433420 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433421 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This change adds an abstracted core DNS API which resembles the API described
here[1]. The API provides a pluggable mechanism for resolvers and also a
consistent view for records. Both synchronous and asynchronous queries are
supported.
This change also adds a res_resolver_unbound module which uses the libunbound
library to provide resolution.
Unit tests have also been written for all of the above to confirm the API and
functionality.
ASTERISK-24834 #close
Reported by: Matt Jordan
ASTERISK-24836 #close
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/4474/
Review: https://reviewboard.asterisk.org/r/4512/
[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+DNS+API
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Incoming PJSIP call legs that have not been answered yet send unnecessary
"180 Ringing" or "183 Progress" messages every time a connected line
update happens. If the outgoing channel is also PJSIP then the incoming
channel will always send a "180 Ringing" or "183 Progress" message when
the outgoing channel sends the INVITE.
Consequences of these unnecessary messages:
* The caller can start hearing ringback before the far end even gets the
call.
* Many phones tend to grab the first connected line information and refuse
to update the display if it changes. The first information is not likely
to be correct if the call goes to an endpoint not under the control of the
first Asterisk box.
When connected line first went into Asterisk in v1.8, chan_sip received an
undocumented option "rpid_immediate" that defaults to disabled. When
enabled, the option immediately passes connected line update information
to the caller in "180 Ringing" or "183 Progress" messages as described
above.
* Added "rpid_immediate" option to prevent unnecessary "180 Ringing" or
"183 Progress" messages. The default is "no" to disable sending the
unnecessary messages.
ASTERISK-24781 #close
Reported by: Richard Mudgett
Review: https://reviewboard.asterisk.org/r/4473/
........
Merged revisions 433338 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433339 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Valgrind found some memory leaks associated with
ast_pjsip_rdata_get_endpoint(). The leaks would manifest when sending
responses to OPTIONS requests, processing MESSAGE requests, and
res_pjsip supplements implementing the incoming_request callback.
* Fix ast_pjsip_rdata_get_endpoint() endpoint ref leaks in
res/res_pjsip.c:supplement_on_rx_request(),
res/res_pjsip/pjsip_options.c:send_options_response(),
res/res_pjsip_messaging.c:rx_data_to_ast_msg(), and
res/res_pjsip_messaging.c:send_response().
* Eliminated RAII_VAR() use with ast_pjsip_rdata_get_endpoint() in
res/res_pjsip_nat.c:nat_on_rx_message().
* Fixed inconsistent but benign return value in
res/res_pjsip/pjsip_options.c:options_on_rx_request().
Review: https://reviewboard.asterisk.org/r/4511/
........
Merged revisions 433222 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Valgrind found a memory leak and invalid access.
* Fix invalid access by sscanf() being fed a non-nul terminated string of
digits in res/res_pjsip_sdp_rtp.c:get_codecs().
* Fix memory leak in main/sorcery.c:sorcery_object_field_destructor().
* Fix potential NULL pointer dereference in
main/xmldoc.c:xmldoc_get_syntax_config_option().
Review: https://reviewboard.asterisk.org/r/4513/
........
Merged revisions 433199 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When r432935 was merged, it did correctly fix a situation where a FILE read
operation on the middle of a file buffer would not read the requested length
in the parameters passed to the FILE function. Unfortunately, it would also
allow the FILE function to append more bytes than what was available in the
buffer if the length exceeded the end of the buffer length.
This patch takes the minimum of the remaining bytes in the buffer along with
the calculated length to append provided by the original patch, and uses
that as the length to append in the return result. This patch also updates
the unit tests with the scenarios that were originally pointed out in
ASTERISK-21765 that the original implementation treated incorrectly.
ASTERISK-21765
........
Merged revisions 433173 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 433174 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433175 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The script was added in 13, but when committed to trunk it caused a branch to
occur due to some trunk only alemebic changes. This fixes it so that the new
'add_pjsip_endpoint_identifier_order script points to the correct down revision.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433152 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Valgrind found some memory leaks associated with ast_sockaddr_resolve().
Most of the leaks had already been fixed by earlier memory leak hunt
patches. This patch performs an audit of ast_sockaddr_resolve() and found
one more.
* Fix ast_sockaddr_resolve() memory leak in
apps/app_externalivr.c:app_exec().
* Made main/netsock2.c:ast_sockaddr_resolve() always set the addrs
parameter for safety so the pointer will never be uninitialized on return.
The same goes for res/res_pjsip_acl.c:extract_contact_addr().
* Made functions that call ast_sockaddr_resolve() with RAII_VAR()
controlling the addrs variable use ast_free instead of ast_free_ptr to
provide better MALLOC_DEBUG information.
Review: https://reviewboard.asterisk.org/r/4509/
........
Merged revisions 433056 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 433057 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433058 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Updated some documentation stating that endpoint identifiers registered without
a name are place at the front of the lookup list. Also renamed register method
'ast_sip_register_endpoint_identifier_by_name' to
'ast_sip_register_endpoint_identifier_with_name'
ASTERISK-24840
Reported by: Mark Michelson
........
Merged revisions 433031 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433032 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch fixes previously reverted code that caused binary incompatibility
problems with some modules. And like the original patch it makes sure that
no matter what order the endpoint identifier modules were loaded, priority is
given based on the ones specified in the new global 'endpoint_identifier_order'
option.
ASTERISK-24840
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/4489/
........
Merged revisions 433028 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
In realtime, it is normal to have a database with both 'allow' and 'disallow'
columns in the schema. It is perfectly valid to have an 'allow' value of
'!all,g722,ulaw,alaw' and no 'disallow' value. Unlike in static conf files,
you can't *not* provide the disallow value. Thus, the empty disallow value
causes a spurious WARNING message, which is kind of annoying.
This patch makes it so that a 'disallow' value with no ... value ... is
ignored. Granted, you can still screw this up as well, as technically
specifying 'disallow=all,!ulaw' allows only ulaw, and then you would have no
'allow' value in your database. But really, why would you do that? WHY?
ASTERISK-16779 #close
Reported by: Atis Lezdins
........
Merged revisions 432970 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 432971 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432972 65c4cc65-6c06-0410-ace0-fbb531ad65f3
In some countries, privacy laws specify that SMS content cannot be saved by a
provider. This patch adds a new option to the SMS application, 'n', which
prevents the SMS content from being written to the SMS log.
ASTERISK-22591 #close
Reported by: Jan Juergens
patches:
DisableSmsContentLoggingByParam.patch uploaded by Jan Juergens (License 6538)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The loop that reads in a file was not correctly using the offset when
determining what bytes to append to the output. This patch corrects
the logic such that the correct portion of the file is extracted when an
offset is specified.
ASTERISK-21765
Reported by: John Zhong
Tested by: Matt Jordan, Di-Shi Sun
patches:
file_read_390821.patch uploaded by Di-Shi Sun (License 5076)
........
Merged revisions 432935 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 432938 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch corrects the documentation for the AMD application. Specifically:
* It documents the maximum_word_length option, which limits the maximum allowed
length of a single utterance.
* It clarifies the AMDCAUSE values MAXWORDS and MAXWORDLENGTH. MAXWORDLENGTH
was documented as MAXWORDS, while MAXWORDS was undocumented.
Thanks to the issue reporter, Frank DiGennaro, for pointing out the issues.
ASTERISK-19470 #close
Reported by: Frank DiGennaro
........
Merged revisions 432918 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 432920 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432921 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The res_pjsip modules were manually checking both name and number
presentation values when there is a function that determines the combined
presentation for a party ID struct. The function takes into account if
the name or number components are valid while the manual code rarely
checked if the data was even valid.
* Made use ast_party_id_presentation() rather than manually checking party
ID presentation values.
* Ensure that set_id_from_pai() and set_id_from_rpid() will not return
presentation values other than what is pulled out of the SIP headers. It
is best if the code doesn't assume that AST_PRES_ALLOWED and
AST_PRES_USER_NUMBER_UNSCREENED are zero.
* Fixed copy paste error in add_privacy_params() dealing with RPID
privacy.
* Pulled the id->number.valid test from add_privacy_header() and
add_privacy_params() up into the parent function add_id_headers() to skip
adding PAI/RPID headers earlier.
* Made update_connected_line_information() not send out connected line
updates if the connected line number is invalid. Lower level code would
not add the party ID information and thus the sent message would be
unnecessary.
* Eliminated RAII_VAR usage in send_direct_media_request().
Review: https://reviewboard.asterisk.org/r/4472/
........
Merged revisions 432892 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432893 65c4cc65-6c06-0410-ace0-fbb531ad65f3