Commit Graph

139 Commits

Author SHA1 Message Date
Matt Jordan 4a58261694 git migration: Refactor the ASTERISK_FILE_VERSION macro
Git does not support the ability to replace a token with a version
string during check-in. While it does have support for replacing a
token on clone, this is somewhat sub-optimal: the token is replaced
with the object hash, which is not particularly easy for human
consumption. What's more, in practice, the source file version was often
not terribly useful. Generally, when triaging bugs, the overall version
of Asterisk is far more useful than an individual SVN version of a file. As a
result, this patch removes Asterisk's support for showing source file
versions.

Specifically, it does the following:

* Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and
  remove passing the version in with the macro. Other facilities
  than 'core show file version' make use of the file names, such as
  setting a debug level only on a specific file. As such, the act of
  registering source files with the Asterisk core still has use. The
  macro rename now reflects the new macro purpose.

* main/asterisk:
  - Refactor the file_version structure to reflect that it no longer
    tracks a version field.
  - Remove the "core show file version" CLI command. Without the file
    version, it is no longer useful.
  - Remove the ast_file_version_find function. The file version is no
    longer tracked.
  - Rename ast_register_file_version/ast_unregister_file_version to
    ast_register_file/ast_unregister_file, respectively.

* main/manager: Remove value from the Version key of the ModuleCheck
  Action. The actual key itself has not been removed, as doing so would
  absolutely constitute a backwards incompatible change. However, since
  the file version is no longer tracked, there is no need to attempt to
  include it in the Version key.

* UPGRADE: Add notes for:
  - Modification to the ModuleCheck AMI Action
  - Removal of the "core show file version" CLI command

Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
2015-04-13 03:48:57 -04:00
Matthew Jordan 8bae18ab93 res_pjsip: Add an 'auto' option for DTMF Mode
This patch adds support for automatically detecting the type of DTMF that a
PJSIP endpoint supports. When the 'dtmf_mode' endpoint option is set to 'auto',
the channel created for an endpoint will attempt to determine if RFC 4733
DTMF is supported. If so, it will use that DTMF type. If not, the DTMF type
for the channel will be set to inband.

Review: https://reviewboard.asterisk.org/r/4438

ASTERISK-24706 #close
Reported by: yaron nahum
patches:
  yaron_patch_3_Feb.diff submitted by yaron nahum (License 6676)
........

Merged revisions 434637 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-10 17:56:47 +00:00
Kevin Harwell 520b9f2174 res_pjsip: add CLI command to show global and system configuration
Added a new CLI command for res_pjsip that shows both global and system
configuration settings: pjsip show settings

ASTERISK-24918 #close
Reported by: Scott Griepentrog
Review: https://reviewboard.asterisk.org/r/4597/
........

Merged revisions 434527 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434528 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-09 22:07:50 +00:00
Kevin Harwell 87d7c90e4e res_pjsip: config option 'timers' can't be set to 'no'
When setting the configuration option 'timers' equal to 'no' the bit flag was
not properly negated. This patch clears all associated flags and only sets the
specified one. pjsip will handle any necessary flag combinations. Also went
ahead and did similar for the '100rel' option.

ASTERISK-24910 #close
Reported by: Ray Crumrine
Review: https://reviewboard.asterisk.org/r/4582/
........

Merged revisions 434131 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-06 19:23:57 +00:00
Matthew Jordan c747b3b12a clang compiler warnings: Fix -Winitializer-overrides
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
2015-03-28 12:32:42 +00:00
Mark Michelson 0b62e41654 Add stateful PJSIP response API call, and use it for out-of-dialog responses.
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
2015-03-27 20:46:55 +00:00
Richard Mudgett 4c2fc5b811 chan_pjsip: Add "rpid_immediate" option to prevent unnecessary "180 Ringing" messages.
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
2015-03-24 19:41:36 +00:00
Richard Mudgett 7e097bce86 Audit ast_pjsip_rdata_get_endpoint() usage for ref leaks.
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
2015-03-20 19:54:48 +00:00
Kevin Harwell aef7278af6 res_pjsip: Allow configuration of endpoint identifier query order
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
2015-03-17 18:22:20 +00:00
Richard Mudgett c52adca396 chan_pjsip: AMI action PJSIPShowEndpoint closes AMI connection on error.
Also fixed similar problem with AMI action PJSIPShowEndpoints.

ASTERISK-24872 #close
Reported by: Dmitriy Serov

Review: https://reviewboard.asterisk.org/r/4487/
........

Merged revisions 432894 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432895 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-13 17:06:39 +00:00
Kevin Harwell d42c6adb1a Revert - res_pjsip: Allow configuration of endpoint identifier query order
Due to a break in binary compatibility with some other modules these changes
are being reverted until the issue can be resolved.

ASTERISK-24840
Reported by: Mark Michelson
........

Merged revisions 432868 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432869 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-13 14:55:44 +00:00
Richard Mudgett 4115e327ac res_pjsip: Move internal init/destroy prototypes to private header file.
Done as a separate commit from a finding in
https://reviewboard.asterisk.org/r/4467/
........

Merged revisions 432787 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432788 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-11 16:39:29 +00:00
Richard Mudgett 89b65f5dda res_pjsip: Fix pjsip.conf type=global object default value handling.
When a type=global section is not defined in pjsip.conf the global
defaults are not applied.  As a result the mandatory Max-Forwards header
is not added to SIP messages for res_pjsip/chan_pjsip.

The handling of pjsip.conf type=global objects has several problems:

1) If the global object is missing the defaults are not applied.

2) If the global object is missing the default_outbound_endpoint's default
value is not returned by ast_sip_global_default_outbound_endpoint().

3) Defines are needed so default values only need to be changed in one
place.

* Added a sorcery instance observer callback to check if there were any
type=global sections loaded.  If there were more than one then issue an
error message.  If there were none then apply the global defaults.

* Fixed ast_sip_global_default_outbound_endpoint() to return the
documented default when no type=global object is defined.

* Made defines for the global default values.

* Increased the default_useragent[] size because SVN version strings can
get lengthy and 128 characters may not be enough.

* Fixed an off-nominal code path ref leak in global_alloc() if the string
fields fail to initialize.

* Eliminated RAII_VAR in get_global_cfg() and
ast_sip_global_default_outbound_endpoint().

ASTERISK-24807 #close
Reported by: Anatoli

Review: https://reviewboard.asterisk.org/r/4467/
........

Merged revisions 432766 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432767 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-11 15:26:32 +00:00
Richard Mudgett 185d2e082a res_pjsip: Fixed invalid empty Server and User-Agent SIP headers.
Setting pjsip.conf useragent to an empty string results in an empty SIP
header being sent.

* Made not add an empty SIP header item to the global SIP headers list.

Review: https://reviewboard.asterisk.org/r/4467/
........

Merged revisions 432764 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432765 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-11 15:22:01 +00:00
Kevin Harwell 1ce529d30e res_pjsip: allow configuration of endpoint identifier query order
It's possible to have a scenario that will create a conflict between endpoint
identifiers. For instance an incoming call could be identified by two different
endpoint identifiers and the one chosen depended upon which identifier module
loaded first. This of course causes problems when, for example, the incoming
call is expected to be identified by username, but instead is identified by ip.
This patch adds a new 'global' option to res_pjsip called
'endpoint_identifier_order'. It is a comma separated list of endpoint
identifier names that specifies the order by which identifiers are processed
and checked.

ASTERISK-24840 #close
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/4455/
........

Merged revisions 432638 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-09 16:13:40 +00:00
Joshua Colp e6fe69b76c res_pjsip: Add "pjsip show version" CLI command.
When debugging things it can be useful to know absolutely what
version of pjproject res_pjsip is running against. This change
adds a "pjsip show version" CLI command which can be used to
query for this.

ASTERISK-24685 #close
Reported by: Joshua Colp

Review: https://reviewboard.asterisk.org/r/4424/
........

Merged revisions 431824 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-15 16:01:09 +00:00
Kevin Harwell 9d081ed06c res_pjsip: dtls_handler causes Asterisk to crash
There have been a couple of times where a crash occurred in the dtls_handler
section of the code for res_pjsip. Unfortunately, in working this issue the
problem was unable to be reproduced. After looking at the backtraces and
through the code the current best guess as to why this happened might be due
to a reentrance problem and the strtok function. So, the current fix is to
convert the strtok function into the reentrant version of the function,
strtok_r.

ASTERISK-24741 #close
Reported by: Zane Conkle
Review: https://reviewboard.asterisk.org/r/4409/
........

Merged revisions 431698 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431699 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-11 18:03:01 +00:00
Richard Mudgett e2d3215b83 HTTP: Stop accepting requests on final system shutdown.
There are three CLI commands to stop and restart Asterisk each.

1) core stop/restart now - Hangup all calls and stop or restart Asterisk.
New channels are prevented while the shutdown request is pending.

2) core stop/restart gracefully - Stop or restart Asterisk when there are
no calls remaining in the system.  New channels are prevented while the
shutdown request is pending.

3) core stop/restart when convenient - Stop or restart Asterisk when there
are no calls in the system.  New calls are not prevented while the
shutdown request is pending.

ARI has made stopping/restarting Asterisk more problematic.  While a
shutdown request is pending it is desirable to continue to process ARI
HTTP requests for current calls.  To handle the current calls while a
shutdown request is pending, a new committed to shutdown phase is needed
so ARI applications can deal with the calls until the system is fully
committed to shutdown.

* Added a new shutdown committed phase so ARI applications can deal with
calls until the final committed to shutdown phase is reached.

* Made refuse new HTTP requests when the system has reached the final
system shutdown phase.  Starting anything while the system is actively
releasing resources and unloading modules is not a good thing.

* Split the bridging framework shutdown to not cleanup the global bridging
containers when shutting down in a hurry.  This is similar to how other
modules prevent crashes on rapid system shutdown.

* Moved ast_begin_shutdown(), ast_cancel_shutdown(), and
ast_shutting_down().  You should not have to include channel.h just to
access these system functions.

ASTERISK-24752 #close
Reported by: Matthew Jordan

Review: https://reviewboard.asterisk.org/r/4399/
........

Merged revisions 431692 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431694 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-11 17:39:13 +00:00
Mark Michelson f61c80a8f7 Allow disabling of 100rel support on PJSIP endpoints.
Due to an inversion error, setting 100rel=no would not actually
change the current value of the setting (which defaulted to "yes").
With this fix, the inversion is corrected.
........

Merged revisions 431420 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-29 21:20:07 +00:00
Kevin Harwell e62bd46511 res_pjsip: make it unloadable (take 2)
Due to the original patch causing memory corruptions it was removed until the
problem could be resolved. This patch is the original patch plus some added
locking around stasis router subcription that was needed to avoid the memory
corruption.

Description of the original problem and patch (still applicable):

The res_pjsip module was previously unloadable. With this patch it can now
be unloaded.

This patch is based off the original patch on the issue (listed below) by Corey
Farrell with a few modifications. Namely, removed a few changes not required to
make the module unloadable and also fixed a bug that would cause asterisk to
crash on unloading.

This patch is the first step (should hopefully be followed by another/others at
some point) in allowing res_pjsip and the modules that depend on it to be
unloadable. At this time, res_pjsip and some of the modules that depend on
res_pjsip cannot be unloaded without causing problems of some sort.

The goal of this patch is to get res_pjsip and only res_pjsip to be able to
unload successfully and/or shutdown without incident (crashes, leaks, etc...).
Other dependent modules may still cause problems on unload.

Basically made sure, with the patch applied, that res_pjsip (with no other
dependent modules loaded) could be succesfully unloaded and Asterisk could
shutdown without any leaks or crashes that pertained directly to res_pjsip.

ASTERISK-24485 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4363/
patches:
  pjsip_unload-broken-r1.patch submitted by Corey Farrell (license 5909)
........

Merged revisions 431179 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431180 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-27 19:12:56 +00:00
Kevin Harwell ca02121ef7 Investigate and fix memory leaks in Asterisk
Fixed memory leaks that were found in Asterisk.

ASTERISK-24693 #close
Reported by:  Kevin Harwell
Review: https://reviewboard.asterisk.org/r/4347/
........

Merged revisions 430999 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-23 15:21:56 +00:00
Kevin Harwell 07e2a48ab1 REVERTING res_pjsip: make it unloadable
Due to the original patch causing memory corruptions the patch is
being removed until the problem can be resolved.
........

Merged revisions 430734 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-17 00:35:59 +00:00
Mark Michelson 023fa0f9e8 Add support for the ca_list_path option for PJSIP transports.
This allows for a path to be specified that has a collection of CA
certificates in it.

ASTERISK-24575 #close
Reported by cloos
Patches:
	pj-ca-path-trunk.diff uploaded by cloos (License #5956)

Review: https://reviewboard.asterisk.org/r/4344
........

Merged revisions 430709 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-16 21:46:09 +00:00
Kevin Harwell 49542a794b res_pjsip: make it unloadable
The res_pjsip module was previously unloadable. With this patch it can now
be unloaded.

This patch is based off the original patch on the issue (listed below) by Corey
Farrell with a few modifications. Namely, removed a few changes not required to
make the module unloadable and also fixed a bug that would cause asterisk to
crash on unloading.

This patch is the first step (should hopefully be followed by another/others at
some point) in allowing res_pjsip and the modules that depend on it to be
unloadable. At this time, res_pjsip and some of the modules that depend on
res_pjsip cannot be unloaded without causing problems of some sort.

The goal of this patch is to get res_pjsip and only res_pjsip to be able to
unload successfully and/or shutdown without incident (crashes, leaks, etc...).
Other dependent modules may still cause problems on unload.

Basically made sure, with the patch applied, that res_pjsip (with no other
dependent modules loaded) could be succesfully unloaded and Asterisk could
shutdown without any leaks or crashes that pertained directly to res_pjsip.

ASTERISK-24485 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4311/
patches:
  pjsip_unload-broken-r1.patch submitted by Corey Farrell (license 5909)
........

Merged revisions 430628 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-14 23:15:23 +00:00
Richard Mudgett c7ea108e02 Revert -r430452 It needs to be redone for the next major AMI version change instead.
ASTERISK-24049


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-12 18:09:27 +00:00
Richard Mudgett ef34a05f21 AMI: Remove no longer used parameter from astman_send_listack().
Follow-up issue to -r430435 from reviewboard review.

ASTERISK-24049
Review: https://reviewboard.asterisk.org/r/4315/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-09 18:53:49 +00:00
Richard Mudgett 52a7cdb101 AMI: Make AMI actions that generate event lists consistent.
* Made the following AMI actions use list API calls for consistency:
Agents
BridgeInfo
BridgeList
BridgeTechnologyList
ConfbridgeLIst
ConfbridgeLIstRooms
CoreShowChannels
DAHDIShowChannels
DBGet
DeviceStateList
ExtensionStateList
FAXSessions
Hangup
IAXpeerlist
IAXpeers
IAXregistry
MeetmeList
MeetmeListRooms
MWIGet
ParkedCalls
Parkinglots
PJSIPShowEndpoint
PJSIPShowEndpoints
PJSIPShowRegistrationsInbound
PJSIPShowRegistrationsOutbound
PJSIPShowResourceLists
PJSIPShowSubscriptionsInbound
PJSIPShowSubscriptionsOutbound
PresenceStateList
PRIShowSpans
QueueStatus
QueueSummary
ShowDialPlan
SIPpeers
SIPpeerstatus
SIPshowregistry
SKINNYdevices
SKINNYlines
Status
VoicemailUsersList

* Incremented the AMI version to 2.7.0.

* Changed astman_send_listack() to not use the listflag parameter and
always set the value to "Start" so the start capitalization is consistent.
i.e., The FAXSessions used "Start" while the rest of the system used
"start".  The corresponding complete event always used "Complete".

* Fixed ami_show_resource_lists() "PJSIPShowResourceLists" to output the
AMI ActionID for all of its list events.

* Fixed off-nominal AMI protocol error in manager_bridge_info(),
manager_parking_status_single_lot(), and
manager_parking_status_all_lots().  Use of astman_send_error() after
responding to the original AMI action request violates the action response
pattern by sending two responses.

* Fixed minor protocol error in action_getconfig() when no requested
categories are found.  Each line needs to be formatted as "Header: text".

* Fixed off-nominal memory leak in manager_build_parked_call_string().

* Eliminated unnecessary use of RAII_VAR() in ami_subscription_detail().

ASTERISK-24049 #close
Reported by: Jonathan Rose

Review: https://reviewboard.asterisk.org/r/4315/
........

Merged revisions 430434 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-09 18:16:54 +00:00
Kinsey Moore 0c5234f12a Fix dev-mode build on recent gcc
........

Merged revisions 430274 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-07 03:01:39 +00:00
George Joseph 7dc0c88fc6 pjsip cli: Fix sorting of contacts for 'pjsip list contacts'
For some reason I was using a hash container instead of a list to gather the
contacts for 'pjsip list/show contacts' so even though I had a sort function,
the output wasn't sorted.  This patch just changes the hash container to a
list container and the contacts now appear sorted in the CLI.

Tested-by: George Joseph

Review: https://reviewboard.asterisk.org/r/4305/
........

Merged revisions 430221 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430222 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-06 17:29:33 +00:00
Joshua Colp f7cf988a82 pjsip: Add 'PJSIP_AOR' and 'PJSIP_CONTACT' dialplan functions.
The PJSIP_AOR dialplan function allows inspection of configured AORs including
what contacts are currently bound to them.

The PJSIP_CONTACT dialplan function allows inspection of contacts in existence.
These can include both externally added (by way of registration) or permanent
ones.

ASTERISK-24341
Reported by: xrobau

Review: https://reviewboard.asterisk.org/r/4308/
........

Merged revisions 430179 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430180 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-05 17:53:42 +00:00
George Joseph 7ea4156a5e pjsip_options: Fix continued qualifies after endpoint/aor deletion
If you remove an endpoint/aor from pjsip.conf then do a core reload,
qualifies will continue even though the object are gone.  This happens
because nothing clears out the qualify tasks.

This patch unschedules all existing qualify tasks before scheduling
new ones on reload.

Tested-by: George Joseph

Review: https://reviewboard.asterisk.org/r/4290/
........

Merged revisions 430064 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430067 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-23 23:19:30 +00:00
Kinsey Moore 0cba439c4d PJSIP: Fix assert on initial mass qualify
This fixes the MWI test regressions caused by r429127 and ensures that
contacts have non-zero qualify_frequency before attempting scheduling.
........

Merged revisions 429245 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 429246 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429247 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-10 13:16:19 +00:00
Kinsey Moore b6e18cae5c PJSIP: Stagger outbound qualifies
This change staggers initiation of outbound qualify (OPTIONS) attempts
to reduce instantaneous server load and prevent network congestion.

Review: https://reviewboard.asterisk.org/r/4246/
ASTERISK-24342 #close
Reported by: Richard Mudgett
........

Merged revisions 429127 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 429128 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-09 14:01:43 +00:00
George Joseph f418f25c44 res_pjsip_endpoint_identifier_ip: Add 'show identify(ies)' cli commands
While troubleshooting other things I realized there were no pjsip cli
commands for identify.  This patch adds them.  It also also fixes a
reference leak when a 'show endpoint' displayed identifies and properly
sets the return code if load_module can't allocate a cli formatter structure.

Tested-by: George Joseph

Review: https://reviewboard.asterisk.org/r/4212/
........

Merged revisions 428725 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 428731 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-02 00:31:49 +00:00
Joshua Colp 7f8b7ace72 res_pjsip_sdp_rtp: Add support for optimistic SRTP.
Optimistic SRTP is the ability to enable SRTP but not have it be
a fatal requirement. If SRTP can be used it will be, if not it won't be.
This gives you a better chance of using it without having your sessions
fail when it can't be.

Encrypt all the things!

Review: https://reviewboard.asterisk.org/r/3992/
........

Merged revisions 428222 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428224 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-19 12:50:47 +00:00
Joshua Colp 9d2882d274 res_pjsip: Enforce requirements for session timer minimum expiration period and normal expiration period.
This change enforces the requirements in PJSIP for session timer configuration. The minimum
expiration period must be 90 seconds or higher and the normal expiration period can not
be lower than the minimum expiration period. If either of these were done the code would
assert at session setup time.

ASTERISK-24336 #close
Reported by: Leon Rowland
........

Merged revisions 427978 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427979 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-15 18:29:12 +00:00
Joshua Colp 47074f4bfd res_pjsip: Ensure in-dialog responses have an endpoint associated.
When handling incoming messages we determine if it is associated with
a dialog. If so we use that to determine what serializer and endpoint
to use for the message. Previously this would pass the endpoint to the
endpoint lookup module to actually place the endpoint completely on the
message. For in-dialog responses, however, this did not occur as
dialog processing took over and the endpoint lookup did not occur.

This change just places the endpoint in the expected spot immediately
instead of relying on the endpoint lookup module. In-dialog responses
thus have the expected endpoint.

AST-1459 #close

Review: https://reviewboard.asterisk.org/r/4146/
........

Merged revisions 427490 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427491 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427492 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-06 18:21:12 +00:00
Mark Michelson 69f29e627f Make the disable_tcp_switch PJSIP system object enabled by default.
Testing has shown repeatedly that PJSIP's default behavior of switching
automatically to TCP for large messages can cause issues. The most common
issues are that devices that we are communicating with do not handle the
switch to TCP gracefully, thus causing situations such as broken calls or
broken subscriptions. Now, in order to have this behavior happen, you must
opt into it. The sample file has been updated to warn that enabling the
TCP switch behavior may cause issues for you, so use at your own risk.
........

Merged revisions 427334 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-05 19:53:29 +00:00
Richard Mudgett 33f0251b6c res_pjsip: Add disable_tcp_switch option.
When a packet exceeds the MTU, pjproject will switch from UDP to TCP.  In
some circumstances (on some networks), this can cause some issues with
messages not getting sent to the correct destination - and can also cause
connections to get dropped due to quirks in pjproject deciding to
terminate TCP connections with no messages.

While fixing the routing/messaging issues is important, having a
configuration option in Asterisk that tells pjproject to not switch over
to TCP would be useful.  That way, if some glitch is discovered on some
other network/site, we can at least disable the behavior until a fix is
put into place.

AFS-197 #close

Review: https://reviewboard.asterisk.org/r/4137/
........

Merged revisions 427129 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427130 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-03 18:22:59 +00:00
Joshua Colp ac091d4184 chan_pjsip: Add support for passing hold and unhold requests through.
This change adds an option, moh_passthrough, that when enabled will pass
hold and unhold requests through using a SIP re-invite. When placing on
hold a re-invite with sendonly will be sent and when taking off hold a
re-invite with sendrecv will be sent. This allows remote servers to handle
the musiconhold instead of the local Asterisk instance being responsible.

Review: https://reviewboard.asterisk.org/r/4103/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427112 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-03 14:45:01 +00:00
Kevin Harwell cd52456ea1 res_pjsip: incorrect qualify statistics after disabling for contact
When removing the qualify_frequency from an AoR or a contact the statistics
shown when issuing "pjsip show aors" from the CLI are incorrect. This patch
deletes the contact's status object from sorcery, disassociating it from the
contact, if the qualify_freqency is removed from configuration.

ASTERISK-24462 #close
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/4116/
........

Merged revisions 426755 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 426757 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426761 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-30 17:18:47 +00:00
Joshua Colp 0d0e38a0e1 res_pjsip_keepalive: Add runtime configurable keepalive module for connection-oriented transports.
This change adds a module which is configurable using the keep_alive_interval setting in the
global section that will send a CRLF keep alive to all active connection-oriented transports at
the provided interval. This is useful because it can help keep connections open through NATs.
This functionality also exists within PJSIP but can not be controlled at runtime and requires
recompiling it.

Review: https://reviewboard.asterisk.org/r/4084/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-17 13:17:58 +00:00
Joshua Colp 7144c739e9 res_pjsip: Add 'user_eq_phone' option to add a 'user=phone' parameter when applicable.
This change adds a configuration option which adds a 'user=phone' parameter if the user
portion of the request URI or the From URI is determined to be a number.

Review: https://reviewboard.asterisk.org/r/4073/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-17 11:30:23 +00:00
Matthew Jordan cce3d99ec8 res_pjsip/pjsip_options: Do not 404 an OPTIONS request not sent to an endpoint
An OPTIONS request that is sent to Asterisk but not to a specific endpoint is
currently sent a 404 in response. This is because, not surprisingly, an empty
extension is never going to be found in the dialplan.

This patch makes it so that we only attempt to look up the endpoint in the
dialplan if it is specified in the OPTIONS request URI.

#SIPit31

ASTERISK-24370 #close
Reported by: Matt Jordan
........

Merged revisions 424624 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 424625 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-06 01:01:43 +00:00
Matthew Jordan 45b7b474ac res_pjsip: Prevent crashes when PJPROJECT presents an rdata with no message
When a message that exceeds the PJ_MAX_PKT_SIZE is sent over a reliable
transport, it is possible (although it shouldn't occur) for pjproject to pass
up an rdata object with a NULL msg in the msg_info. Needless to say, things
that attempt to dereference this are in for a rough ride.

In particular, this caused crashes in three different locations, all of which
are 'low level' enough to intercept an rdata object early in processing:

(1) res_pjsip_logger
(2) res_hep_pjsip
(3) res_pjsip/distributor

Anything that can intercept an rdata object before res_pjsip/distributor should
be defensive when looking at the received packet.

#SIPit31

ASTERISK-24369 #close
Reported by: Matt Jordan
........

Merged revisions 424618 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 424619 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-06 00:31:48 +00:00
Kinsey Moore b1f8eba178 PJSIP: Restore functional default for callerid_privacy
The pjsip config option default fixups from r424263 altered the
functional default from "allowed_not_screened" to "allowed". This
change restores the functional default value when none is provided.
........

Merged revisions 424426 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 424427 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424428 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-03 13:59:09 +00:00
Richard Mudgett 2b0777c017 res_pjsip: Make transport cipher option accept a comma separated list of cipher names.
Improvements to the res_pjsip transport cipher option.

* Made the cipher option accept a comma separated list of OpenSSL cipher
names.  Users of realtime will be glad if they have more than one name to
list.

* Added the CLI command 'pjsip list ciphers' so a user can know what
OpenSSL names are available for the cipher option.

* Updated the cipher option online XML documentation to specify what is
expected for the value.

* Updated pjsip.conf.sample to not indicate that ALL is acceptable since
ALL does not imply a preference order for the ciphers and PJSIP does not
simply pass the string to OpenSSL for interpretation.

ASTERISK-24199 #close
Reported by: Joshua Colp

Review: https://reviewboard.asterisk.org/r/4018/
........

Merged revisions 424393 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 424394 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424395 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-02 21:55:37 +00:00
Joshua Colp adba2a8d7f res_pjsip: Add 'dtls_fingerprint' option to configure DTLS fingerprint hash.
During the latest update to DTLS-SRTP support the ability to configure
the hash used for fingerprints was added. This gave us two supported ones:
SHA-1 and SHA-256. The default was accordingly updated to SHA-256.
Unfortunately this configuration ability was not exposed within res_pjsip.
This change adds a dtls_fingerprint option that controls it.

#SIPit31
........

Merged revisions 424290 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 424291 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424292 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-01 16:39:45 +00:00
Kinsey Moore 4d2c7c23f8 PJSIP: Handle defaults properly
This updates the code behind PJSIP configuration options with custom
handlers to deal with the assigned default values properly where it
makes sense and adjusting the default value where it doesn't. Before
applying this patch, there were several cases where the default value
for an option would prevent that config section from loading properly.

Reported by: Thomas Thompson
Review: https://reviewboard.asterisk.org/r/4019/
........

Merged revisions 424263 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 424266 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424267 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-01 12:28:05 +00:00
George Joseph 27396a6b59 pjsip_cli: Suppress header print on error or no objects
If there's an error on the pjsip command line or there are no objects, don't
print the column headers.

ASTERISK-24350 #close
Reported-by: Brad Latus
Tested-by: George Joseph
Tested-by: Brad Latus

Review: https://reviewboard.asterisk.org/r/4025/
........

Merged revisions 424128 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 424129 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424130 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-29 22:00:38 +00:00