asterisk/asterisk.git
6 years agoMove JSON event generators into separate modules
Kinsey Moore [Tue, 14 May 2013 12:47:52 +0000 (12:47 +0000)]
Move JSON event generators into separate modules

This moves the JSON event generators out of the Stasis-HTTP modules and
into standalone JSON-related counterparts so that Stasis-HTTP and
res_stasis can depend on them without creating dependency cycles. This
also provides a future location for Swagger Model validator functions
once the generators for that code are written.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388668 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix Missing CALL-ID When Logging Through Syslog
Michael L. Young [Mon, 13 May 2013 21:21:03 +0000 (21:21 +0000)]
Fix Missing CALL-ID When Logging Through Syslog

The CALL-ID (ie [C-00000074]) is missing when logging to syslog.  This was just
an oversight when this feature was added.

* Add CALL-IDs when using syslog

(closes issue ASTERISK-21430)
Reported by: Nikola Ciprich
Tested by: Nikola Ciprich, Michael L. Young
Patches:
    asterisk-21430-syslog-callid_trunk.diff by Michael L. Young (license 5026)

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

Merged revisions 388605 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388617 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix Crash Caused By One-way Audio With auto_* NAT Settings Fix
Michael L. Young [Mon, 13 May 2013 21:07:02 +0000 (21:07 +0000)]
Fix Crash Caused By One-way Audio With auto_* NAT Settings Fix

The prior code committed, r385473, failed to take into consideration that not
all outgoing calls will be to a peer.  My fault.

This patch does the following:

* Check if there is a related peer involved.  If there is, check and set NAT
  settings according to the peer's settings.

* Fix a problem with realtime peers.  If the global setting has auto_force_rport
  set and we issued a "sip reload" while a peer is still registered, the peer's
  flags for NAT are reset to off.  When this happens, we were always setting the
  contact address of the peer to that of the full contact info that we had.

(closes issue ASTERISK-21374)
Reported by: jmls
Tested by: Michael L. Young
Patches:
   asterisk-21374-fix-crash-and-rt-peers.diff by Michael L. Young (license 5026)

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

Merged revisions 388601 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388602 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRevert r388529 for now
Kinsey Moore [Mon, 13 May 2013 20:37:11 +0000 (20:37 +0000)]
Revert r388529 for now

Adding the cleanup function needs some deeper thought since it
apparently doesn't exist for all variants of libsrtp.
........

Merged revisions 388596 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 388597 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388598 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agopbx: Fix lack of cleanup on macrolock and context_table
Jonathan Rose [Mon, 13 May 2013 19:29:56 +0000 (19:29 +0000)]
pbx: Fix lack of cleanup on macrolock and context_table

(closes issue ASTERISK-21723)
Reported by: Corey Farrell
Patches:
    core-pbx-cleanup.patch uploaded by Correy Farrell (license 5909)
........

Merged revisions 388532 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 388578 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388579 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoClose libsrtp properly
Kinsey Moore [Mon, 13 May 2013 18:10:22 +0000 (18:10 +0000)]
Close libsrtp properly

Ensure that libsrtp is shutdown properly when res_srtp is unloaded.

(closes issue ASTERISK-21719)
Reported by: Corey Farrell
Patches:
    res_srtp-library-shutdown.patch uploaded by Corey Farrell
........

Merged revisions 388529 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 388530 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388531 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agochan_gulp: Minor readability Improvements to chan_gulp
Jonathan Rose [Mon, 13 May 2013 17:20:33 +0000 (17:20 +0000)]
chan_gulp: Minor readability Improvements to chan_gulp

(closes issue ASTERISK-21670)
Reported by: Snuffy
Review: https://reviewboard.asterisk.org/r/2473/
Patches:
    gulp-coding-guide.diff uploaded by snuffy (license 5024)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388526 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix SendText AMI action to never return non-zero.
Richard Mudgett [Mon, 13 May 2013 14:28:50 +0000 (14:28 +0000)]
Fix SendText AMI action to never return non-zero.

AMI actions must never return non-zero unless they intend to close the AMI
connection.  (Which is almost never.)

(closes issue ASTERISK-21779)
Reported by: Paul Goldbaum
........

Merged revisions 388477 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 388478 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388479 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAllow mISDN to send PROGRESS messsage.
Richard Mudgett [Fri, 10 May 2013 22:12:52 +0000 (22:12 +0000)]
Allow mISDN to send PROGRESS messsage.

* Made isdn_msg_parser.c build a progress message with the mandatory
progress indicator IE.  (The mISDNuser NT state machine rejected sending
the incomplete message.)

Note: The associated mISDN and mISDNuser patches respectively are viewable
here:
http://svnview.digium.com/svn/thirdparty?view=rev&rev=200
http://svnview.digium.com/svn/thirdparty?view=rev&rev=201

(closes issue AST-1153)
Reported by: Guenther Kelleter
Patches:
      progress-chan_misdn.diff (license #6372) patch uploaded by Guenther Kelleter
      progress-misdn.diff (license #6372) mISDN patch uploaded by Guenther Kelleter
      progress-misdnuser.diff (license #6372) mISDNuser patch uploaded by Guenther Kelleter
........

Merged revisions 388425 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 388426 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388427 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix memory leak in pbx_dundi
Mark Michelson [Fri, 10 May 2013 20:50:53 +0000 (20:50 +0000)]
Fix memory leak in pbx_dundi

pbx_dundi added an io context without removing
it. This caused a memory leak when the module was
unloaded.

(closes ASTERISK-21718)
Reported by Corey Farrell
Patches:
pbx_dundi-ast_io_remove.patch uploaded by Corey Farrell (License #5909)
........

Merged revisions 388376 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 388378 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388380 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix Finding Extensions With Patterns Using ODBC Realtime
Michael L. Young [Fri, 10 May 2013 20:28:18 +0000 (20:28 +0000)]
Fix Finding Extensions With Patterns Using ODBC Realtime

After the merge of support for the realtime sorcery module, extensions that
contained a pattern were not being found through odbc realtime.  It was tracked
down to this one line that was advancing to the next variable list before it
should have been.  The removal of this one line fixes this.

Tested this fix on my machine.

Received confirmation that this is the right fix from file on IRC.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388375 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAddress unload order issues for res_stasis* modules
David M. Lee [Fri, 10 May 2013 17:12:57 +0000 (17:12 +0000)]
Address unload order issues for res_stasis* modules

I've noticed when doing a graceful shutdown that the res_stasis_http.so
module gets unloaded before the modules that use it, which causes some
asserts during their unload.

While r386928 was a quick hack to get it to not assert and die, this
patch increases the use counts on res_stasis.so and res_stasis_http.so
properly. It's a bigger change than I expected, hence the review instead
of just committing it.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388350 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAvoided __ast names for the private variables created by the
David M. Lee [Fri, 10 May 2013 15:55:42 +0000 (15:55 +0000)]
Avoided __ast names for the private variables created by the
STASIS_MESSAGE_TYPE_*() macros.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388318 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd channel events for res_stasis apps
Kinsey Moore [Fri, 10 May 2013 13:13:06 +0000 (13:13 +0000)]
Add channel events for res_stasis apps

This change adds a framework in res_stasis for handling events from
channel topics. JSON event generation and validation code is created
from event documentation in rest-api/api-docs/events.json to assist in
JSON event generation, ensure consistency, and ensure that accurate
documentation is available for ALL events that are received by
res_stasis applications.

The userevent application has been refactored along with the code that
handles userevent channel blob events to pass the headers as key/value
pairs in the JSON blob. As a side-effect, app_userevent now handles
duplicate keys by overwriting the previous value.

Review: https://reviewboard.asterisk.org/r/2428/
(closes issue ASTERISK-21180)
Patch-By: Kinsey Moore <kmoore@digium.com>

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388275 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix copy/paste error in one-touch-recording implementation.
Sean Bright [Fri, 10 May 2013 11:47:04 +0000 (11:47 +0000)]
Fix copy/paste error in one-touch-recording implementation.
........

Merged revisions 388253 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388254 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoDon't expect to pack three tuples when you only have two
Matthew Jordan [Thu, 9 May 2013 14:41:38 +0000 (14:41 +0000)]
Don't expect to pack three tuples when you only have two

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388175 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix The Payload Being Set On CN Packets And Do Not Set Marker Bit
Michael L. Young [Thu, 9 May 2013 04:11:59 +0000 (04:11 +0000)]
Fix The Payload Being Set On CN Packets And Do Not Set Marker Bit

When we send out a CN packet (for instance, in the case of using rtpkeepalives),
we are not setting the payload code properly.  Also, we are setting the marker
bit when we shouldn't be according to RFC 3389, section 4.

AST_RTP_CN is not defined by AST_FORMAT codes.  Therefore, we should be using
ast_rtp_codecs_payload_code() rather than ast_rtp_codecs_payload_lookup().

11 and trunk already use the appropriate function.

* In 1.8, use ast_rtp_codecs_payload_code()

* Remove the setting of the marker bit

* Fix the debug message by incrementing the seqno after the debug message is set
  in order to display the correct seqno that was sent out

(closes issue ASTERISK-21246)
Reported by: Peter Katzmann
Tested by: Peter Katzmann, Michael L. Young
Patches:
    asterisk-21246-rtp-cng-payload-error_1.8_v2.diff
                                     uploaded by Michael L. Young (license 5026)

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

Merged revisions 388111 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 388112 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388113 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix Segfault In app_queue When "persistentmembers" Is Enabled And Using Realtime
Michael L. Young [Thu, 9 May 2013 03:35:25 +0000 (03:35 +0000)]
Fix Segfault In app_queue When "persistentmembers" Is Enabled And Using Realtime

When the "ignorebusy" setting was deprecated, we added some code to allow us to
be compatible with older setups that are still using the "ignorebusy" setting
instead of "ringinuse".  We set a char *variable with the column name to use,
which helps the realtime functions to use the correct column in their SQL
queries.  When "persistentmembers" is enabled, we are not setting this variable
before the realtime functions were called to load members.  This results in the
variable being NULL and therefore causing a segfault when loading members during
the module's process of loading.

The solution was to move the code that sets that variable to be before these
realtime functions are called during the loading of the module.

(closes issue ASTERISK-21738)
Reported by: JoshE
Tested by: JoshE
Patches:
    asterisk-21738-rt-ringinuse-field-not-set.diff
                                     uploaded by Michael L. Young (license 5026)

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

Merged revisions 388108 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388110 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFixed MODFLAG for res_stasis_websocket
David M. Lee [Wed, 8 May 2013 22:00:53 +0000 (22:00 +0000)]
Fixed MODFLAG for res_stasis_websocket

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388075 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd development flag to disable the inline API.
David M. Lee [Wed, 8 May 2013 21:01:33 +0000 (21:01 +0000)]
Add development flag to disable the inline API.

A GCC bug[1] can, in some cases, pop up an unsuppressible pedwarn when
using a static inline standard library function from a non-static
inline function.

This normally doesn't show up, but can occur if you're running an
upgrade version of GCC (such as GCC 4.8 on OS X, which normally runs
GCC 4.2).

 [1]: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47816

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388046 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRemoved #if checks for crazy old versions of OS X.
David M. Lee [Wed, 8 May 2013 20:25:28 +0000 (20:25 +0000)]
Removed #if checks for crazy old versions of OS X.

The <arpa/nameser_compat.h> was introduced way back in OS X Panther, which
itself was end-of-lifed back in 2007. We can assume that any OS X machine
we build on will need that header file :-)

Why bother removing it? The flag we're checking (__APPLE_CC__) is actually
Apple's build number. Self-compiled versions of GCC (such as installing the
latest version of GCC from homebrew) sets the value to 0, making it useless
for this sort of compile flaggery.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388045 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFixed set-but-not-used warning caught by newer GCC
David M. Lee [Wed, 8 May 2013 19:00:55 +0000 (19:00 +0000)]
Fixed set-but-not-used warning caught by newer GCC

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388014 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoDon't perform a realtime lookup with a NULL keyword
Matthew Jordan [Wed, 8 May 2013 18:36:21 +0000 (18:36 +0000)]
Don't perform a realtime lookup with a NULL keyword

Previously, a call to ast_load_realtime_multientry could get away with
passing a NULL parameter to the function, even though it really isn't
supposed to do that. After the change over to using ast_variable instead
of variadic arguments, the realtime engine gets unhappy if you do this.

This was always an unintended function call in app_directory anyway - now,
we just don't call into the realtime function calls if we don't have anything
to query on.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388008 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRemove required type field from channel blobs
David M. Lee [Wed, 8 May 2013 18:34:50 +0000 (18:34 +0000)]
Remove required type field from channel blobs

When we first introduced the channel blob types, the JSON blobs were
self identifying by a required "type" field in the JSON object
itself. This, as it turns out, was a bad idea.

When we introduced the message router, it was useless for routing based
on the JSON type. And messages had two type fields to check: the
stasis_message_type() of the message itself, plus the type field in the
JSON blob (but only if it was a blob message).

This patch corrects that mistake by removing the required type field
from JSON blobs, and introducing first class stasis_message_type objects
for the actual message type.

Since we now will have a proliferation of message types, I introduced a
few macros to help reduce the amount of boilerplate necessary to set
them up.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388005 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd version.c to list of ignored files in the utils directory.
Richard Mudgett [Wed, 8 May 2013 16:58:04 +0000 (16:58 +0000)]
Add version.c to list of ignored files in the utils directory.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387974 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoInitial support for endpoints.
David M. Lee [Wed, 8 May 2013 13:39:08 +0000 (13:39 +0000)]
Initial support for endpoints.

An endpoint is an external device/system that may offer/accept
channels to/from Asterisk. While this is a very useful concept for end
users, it is surprisingly not a core concept within Asterisk itself.

This patch defines ast_endpoint as a separate object, which channel
drivers may use to expose their concept of an endpoint. As the channel
driver creates channels, it can use ast_endpoint_add_channel() to
associate channels to the endpoint. This updated the endpoint
appropriately, and forwards all of the channel's events to the
endpoint's topic.

In order to avoid excessive locking on the endpoint object itself, the
mutable state is not accessible via getters. Instead, you can create a
snapshot using ast_endpoint_snapshot_create() to get a consistent
snapshot of the internal state.

This patch also includes a set of topics and messages associated with
endpoints, and implementations of the endpoint-related RESTful
API. chan_sip was updated to create endpoints with SIP peers, but the
state of the endpoints is not updated with the state of the peer.

Along for the ride in this patch is a Stasis test API. This is a
stasis_message_sink object, which can be subscribed to a Stasis
topic. It has functions for blocking while waiting for conditions in
the message sink to be fulfilled.

(closes issue ASTERISK-21421)
Review: https://reviewboard.asterisk.org/r/2492/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387932 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agochan_sip: NOTIFYs for BLF start queuing up and fail to be sent out after retries...
Alec L Davis [Wed, 8 May 2013 07:21:09 +0000 (07:21 +0000)]
chan_sip: NOTIFYs for BLF start queuing up and fail to be sent out after retries fail

RFC6665 4.2.2: ... after a failed State NOTIFY transaction remove the subscription

The problem is that the State Notify requests rely on the 200OK reponse for pacing control
and to not confuse the notify susbsystem.
The issue is, the pendinginvite isn't cleared if a response isn't received,
thus further notify's are never sent.

The solution, follow RFC 6665 4.2.2's 'SHOULD' and remove the subscription after failure.

(closes issue ASTERISK-21677)

Reported by: Dan Martens
Tested by: alecdavis
alecdavis (license 585)

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

Merged revisions 387875 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 387880 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387885 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFixed up \example marker in lock.h Doxygen comment.
David M. Lee [Tue, 7 May 2013 18:32:34 +0000 (18:32 +0000)]
Fixed up \example marker in lock.h Doxygen comment.

The \example tags marks an entire file as an example, not a code snippet.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387825 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMinor fixups to Doxygen comments.
David M. Lee [Tue, 7 May 2013 18:30:55 +0000 (18:30 +0000)]
Minor fixups to Doxygen comments.

The \example tags marks an entire file as an example, not a code snippet.
........

Merged revisions 387823 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387824 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoBetter explained the depths of reference stealing.
David M. Lee [Tue, 7 May 2013 18:12:26 +0000 (18:12 +0000)]
Better explained the depths of reference stealing.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387803 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix build breakage, from LOW_MEMORY fix.
Jason Parker [Tue, 7 May 2013 17:53:50 +0000 (17:53 +0000)]
Fix build breakage, from LOW_MEMORY fix.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387802 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoUpdate ao2_destructor_fn doxygen.
Richard Mudgett [Mon, 6 May 2013 17:15:20 +0000 (17:15 +0000)]
Update ao2_destructor_fn doxygen.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387741 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMake a log NOTICE more explicit that the event comes from DAHDI and not PRI.
Richard Mudgett [Mon, 6 May 2013 17:09:50 +0000 (17:09 +0000)]
Make a log NOTICE more explicit that the event comes from DAHDI and not PRI.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387740 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix building with LOW_MEMORY defined.
Jason Parker [Mon, 6 May 2013 17:01:41 +0000 (17:01 +0000)]
Fix building with LOW_MEMORY defined.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387738 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMake SLA reload more paranoid.
Russell Bryant [Mon, 6 May 2013 15:58:32 +0000 (15:58 +0000)]
Make SLA reload more paranoid.

Reload support was originally not included for SLA.  It was added later,
but in a fairly non-traditional way.  It basically sets a flag
indicating that a reload is pending, and then waits for a time where it
thinks everything SLA related is idle and unused, and *then* executes
the reload.  It does this because the reload process is destructive.  It
starts by throwing everything away and starting over.

There are a number of problems with this approach.  One of them is that
the check to see if anything in use was incomplete.  This patch makes it
more complete and thus less likely for a crash to occur during reload
processing.  However, this approach still has problems so some much more
significant reworking of this code will need to come in as a next step.

Patch credit and testing by CoreDial, LLC.
........

Merged revisions 387688 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 387689 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387690 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd support for observers and JSON objectset creation to sorcery.
Joshua Colp [Mon, 6 May 2013 13:04:08 +0000 (13:04 +0000)]
Add support for observers and JSON objectset creation to sorcery.

This change adds the ability for modules to add themselves as observers
to sorcery object types. Observers can be notified when objects are
created, updated, or deleted as well as when the object type is loaded or
reloaded. Observer notifications are done using a thread pool in a serialized
fashion so the caller of the sorcery API calls is minimally impacted.

This also adds the ability to create JSON changesets of a sorcery object.

Tests are also present to confirm all of the above functionality.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387662 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoClean up documentation; prevent ref leak on exit
Matthew Jordan [Sat, 4 May 2013 16:00:46 +0000 (16:00 +0000)]
Clean up documentation; prevent ref leak on exit

This patch:
 * Cleans up some doxygen
 * Prevents leaking the system level Stasis topics and messages
   on exit (users of valgrind will be happier)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387633 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMigrate SHARED's use of the VarSet AMI event to Stasis-Core
Matthew Jordan [Sat, 4 May 2013 15:24:31 +0000 (15:24 +0000)]
Migrate SHARED's use of the VarSet AMI event to Stasis-Core

This patch removes the direct call to AMI from the SHARED function
and instead call Stasis-Core. Stasis-Core delivers the notification
that a shared variable has changed on a channel to all interested
consumers.

(issue ASTERISK-21462)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387630 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoStasis: Convert network change events into network change stasis messages
Jonathan Rose [Fri, 3 May 2013 18:03:26 +0000 (18:03 +0000)]
Stasis: Convert network change events into network change stasis messages

(issue ASTERISK-21103)
Review: https://reviewboard.asterisk.org/r/2490/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387594 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoUse the configured formats for Gulp sessions if there are no joint formats between...
Joshua Colp [Fri, 3 May 2013 11:35:14 +0000 (11:35 +0000)]
Use the configured formats for Gulp sessions if there are no joint formats between requested formats and configured formats.

(closes issue ASTERISK-21756)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387545 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMigrate AMI VarSet events raised by GoSub local variables
Matthew Jordan [Thu, 2 May 2013 20:59:20 +0000 (20:59 +0000)]
Migrate AMI VarSet events raised by GoSub local variables

This patch moves VarSet events for local variables raised by GoSub
over to Stasis-Core. It also tweaks up the post-processing documentation
scripts to not combine parameters if both parameters are already documented.

(issue ASTERISK-21462)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387519 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRemove the ABI compatability ast_channel_alloc(). It is no longer needed.
Richard Mudgett [Thu, 2 May 2013 19:06:53 +0000 (19:06 +0000)]
Remove the ABI compatability ast_channel_alloc().  It is no longer needed.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387482 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoUpdate utils Makefile to handle r387294
Matthew Jordan [Thu, 2 May 2013 17:15:46 +0000 (17:15 +0000)]
Update utils Makefile to handle r387294

Alec's patch that added the Asterisk version to 'core show locks' angered the
items in utils, as they exist somewhat outside of the Asterisk build system.
Some day, this Makefile should get nuked from high orbit, but for now, include
version.c in its list of stuff to pile in.
........

Merged revisions 387421 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 387422 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387423 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoPutting all event defs and names back for now due to res_corosync dependency
Jonathan Rose [Thu, 2 May 2013 16:39:28 +0000 (16:39 +0000)]
Putting all event defs and names back for now due to res_corosync dependency

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387420 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agochan_sip: Session-Expires: Set timer to correctly expire at (~2/3) of the interval...
Alec L Davis [Thu, 2 May 2013 08:24:31 +0000 (08:24 +0000)]
chan_sip: Session-Expires: Set timer to correctly expire at (~2/3) of the interval when not the refresher

RFC 4028 Section 10
if the side not performing refreshes does not receive a
session refresh request before the session expiration, it SHOULD send
a BYE to terminate the session, slightly before the session
expiration.  The minimum of 32 seconds and one third of the session
interval is RECOMMENDED.

Prior to this asterisk would refresh at 1/2 the Session-Expires interval,
or if the remote device was the refresher, asterisk would timeout at interval end.

Now, when not refresher, timeout as per RFC noted above.

(closes issue ASTERISK-21742)

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

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

Merged revisions 387344 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 387345 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387369 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agochan_sip: Honor Session-Expires in 200OK response when it's a RE-INVITE when asterisk...
Alec L Davis [Thu, 2 May 2013 07:25:33 +0000 (07:25 +0000)]
chan_sip: Honor Session-Expires in 200OK response when it's a RE-INVITE when asterisk is the refresher.

RFC 4028 Section 7.2
 "UACs MUST be prepared to receive a Session-Expires header field in a
 response, even if none were present in the request."

What changed
  After ASTERISK-20787, inbound calls to asterisk with no Session-Expires in the INVITE are now are offered
  a Session-Expires (1800 asterisk default) in the response, with asterisk as the refresher.

Symptom:
  After 900 seconds (asterisk default refresher period 1800), asterisk RE-INVITEs the device, the device
   may respond with a much lower Session-Expires (180 in our case) value that it is now using.

  Asterisk ignores this response, as it's deemed both an INBOUND CALL, and a RE-INVITE.

  After 180 seconds the device times out and sends BYE (hangs up), asterisk is still working with the
  refresher period of 1800 as it ignored the 'Session Expires: 180' in the previous 200OK response.

Fix:
handle_response_invite() when 200OK, remove check for outbound and reinvite.

(closes issue ASTERISK-21664)

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

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

Merged revisions 387312 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 387319 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387327 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agochan_dahdi: fix lower bound check with -ve integer conversion from a float
Alec L Davis [Thu, 2 May 2013 06:57:04 +0000 (06:57 +0000)]
chan_dahdi: fix lower bound check with -ve integer conversion from a float

Lower bound of a 16bit signed int is -32768 not -32767

(closes issue ASTERISK-21744)

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)
........

Merged revisions 387297 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 387298 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387299 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd Asterisk Version to core show locks
Alec L Davis [Thu, 2 May 2013 06:47:16 +0000 (06:47 +0000)]
Add Asterisk Version to core show locks

Assist with reporting 'core show locks' when submitting bug reports.

Example below:

===========================
== SVN-branch-1.8-...
== Currently Held Locks
===========================

(closes issue ASTERISK-21743)

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)
........

Merged revisions 387294 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 387295 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387296 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoSimplify chan_local.c:manager_optimize_away() using ao2_find().
Richard Mudgett [Wed, 1 May 2013 21:55:53 +0000 (21:55 +0000)]
Simplify chan_local.c:manager_optimize_away() using ao2_find().

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387261 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoCleanup chan_local.c:local_new().
Richard Mudgett [Wed, 1 May 2013 21:35:53 +0000 (21:35 +0000)]
Cleanup chan_local.c:local_new().

* Remove t and ama local variables.  There is no way they could be
anything other than default because p->owner can only be NULL at this
point.

* Rename tmp and tmp2 to owner and chan respectively.

* Remove redundant initialization of channel context, exten, priority.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387260 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoClear the DTMF sending digit tracking on off nominal paths
Matthew Jordan [Wed, 1 May 2013 21:18:24 +0000 (21:18 +0000)]
Clear the DTMF sending digit tracking on off nominal paths

In certain situations, when the RTP engine goes to send a DTMF end digit
it may be in a situation where the remote address is no longer available,
or the digit that was supposed to be sent is invalid. In such cases, we
need to clear the RTP counters appropriately. Otherwise, when the RTP
source is set again, we'll continue to think that we're in the middle of
sending a DTMF digit, which can confuse the remote party (signficantly).

(closes issue ASTERISK-21522)
Reported by: Corey Farrell
patches:
  rtp_dtmf_process_end.patch uploaded by Corey Farrell (License 5909)
........

Merged revisions 387213 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 387216 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387220 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoTrivial changes. Comments, parentheses, spelling, wording.
Richard Mudgett [Wed, 1 May 2013 21:09:14 +0000 (21:09 +0000)]
Trivial changes. Comments, parentheses, spelling, wording.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387212 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMake chan_local locals container an explicit list container.
Richard Mudgett [Wed, 1 May 2013 20:59:29 +0000 (20:59 +0000)]
Make chan_local locals container an explicit list container.

Pretending that chan_local locals container can have more than one bucket
is silly.  The container has no key to help search.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387211 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoWhitespace changes.
Richard Mudgett [Wed, 1 May 2013 20:53:30 +0000 (20:53 +0000)]
Whitespace changes.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387210 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMake mod_load_cmp() not as klunky.
Richard Mudgett [Wed, 1 May 2013 20:35:25 +0000 (20:35 +0000)]
Make mod_load_cmp() not as klunky.

There is a reason the heap comparison functions like qsort(), and other
comparison functions specify <0, >0, and =0 for the return values.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387209 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRemove some unnecessary calls to ast_bridged_channel() in chan_unistim.c
Richard Mudgett [Wed, 1 May 2013 20:01:43 +0000 (20:01 +0000)]
Remove some unnecessary calls to ast_bridged_channel() in chan_unistim.c

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387185 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRemove some unnecessary calls to ast_bridged_channel() in chan_mgcp.c
Richard Mudgett [Wed, 1 May 2013 20:01:27 +0000 (20:01 +0000)]
Remove some unnecessary calls to ast_bridged_channel() in chan_mgcp.c

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387184 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRemove some unnecessary calls to ast_bridged_channel() in chan_skinny.c
Richard Mudgett [Wed, 1 May 2013 20:01:10 +0000 (20:01 +0000)]
Remove some unnecessary calls to ast_bridged_channel() in chan_skinny.c

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387183 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRemove some unnecessary calls to ast_bridged_channel() in chan_iax2.c
Richard Mudgett [Wed, 1 May 2013 20:00:53 +0000 (20:00 +0000)]
Remove some unnecessary calls to ast_bridged_channel() in chan_iax2.c

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387182 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRemove some unnecessary calls to ast_bridged_channel() in chan_dahdi.c/sig_analog.c
Richard Mudgett [Wed, 1 May 2013 20:00:31 +0000 (20:00 +0000)]
Remove some unnecessary calls to ast_bridged_channel() in chan_dahdi.c/sig_analog.c

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387181 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoPrevent crash in 'sip show peers' when the number of peers on a system is large
Matthew Jordan [Wed, 1 May 2013 18:38:40 +0000 (18:38 +0000)]
Prevent crash in 'sip show peers' when the number of peers on a system is large

When you have lots of SIP peers (according to the issue reporter, around 3500),
the 'sip show peers' CLI command or AMI action can crash due to a poorly placed
string duplication that occurs on the stack. This patch refactors the command
to not allocate the string on the stack, and handles the formatting of a single
peer in a separate function call.

(closes issue ASTERISK-21466)
Reported by: Guillaume Knispel
patches:
  fix_sip_show_peers_stack_overflow_asterisk_11.3.0-v2.patch uploaded by gknispel (License 6492)
........

Merged revisions 387134 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387135 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMove some annoying chan_dahdi debug messages to level 5.
Richard Mudgett [Wed, 1 May 2013 17:15:26 +0000 (17:15 +0000)]
Move some annoying chan_dahdi debug messages to level 5.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387108 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix CDR not being created during an externally initiated blind transfer
Matthew Jordan [Tue, 30 Apr 2013 22:50:40 +0000 (22:50 +0000)]
Fix CDR not being created during an externally initiated blind transfer

Way back when in the dark days of Asterisk 1.8.9, blind transferring a call
in a context that included the 'h' extension would inadvertently execute the
hangup code logic on the transferred channel. This was a "bad thing". The fix
was to properly check for the softhangup flags on the channel and only execute
the 'h' extension logic (and, in later versions, hangup handler logic) if the
channel was well and truly dead (Jim).

Unfortunately, CDRs are fickle. Setting the softhangup flag when we detected
that the channel was leaving the bridge (but not to die) caused some crucial
snippet of CDR code, lying in ambush in the middle of the bridging code, to
not get executed. This had the effect of blowing away one of the CDRs that is
typically created during a blind transfer.

While we live and die by the adage "don't touch CDRs in release branches", this
was our bad. The attached patch restores the CDR behavior, and still manages to
not run the 'h' extension during a blind transfer (at least not when it's
supposed to).

Thanks to Steve Davies for diagnosing this and providing a fix.

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

(closes issue ASTERISK-21394)
Reported by: Ishfaq Malik
Tested by: Ishfaq Malik, mjordan
patches:
  fix_missing_blindXfer_cdr2 uploaded by one47 (License 5012)
........

Merged revisions 387036 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 387038 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387039 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoStasis Core: Refactor ACL Change events to go out over the stasis core msg bus
Jonathan Rose [Tue, 30 Apr 2013 22:37:24 +0000 (22:37 +0000)]
Stasis Core: Refactor ACL Change events to go out over the stasis core msg bus

(issue ASTERISK-21103)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2481/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387037 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd forgotten event types to event_names array
Jonathan Rose [Tue, 30 Apr 2013 22:20:55 +0000 (22:20 +0000)]
Add forgotten event types to event_names array
........

Merged revisions 387030 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387035 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix a log message.
Jason Parker [Tue, 30 Apr 2013 18:12:36 +0000 (18:12 +0000)]
Fix a log message.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386990 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoUse the proper lower bound when doing saturation arithmetic.
Sean Bright [Tue, 30 Apr 2013 13:48:12 +0000 (13:48 +0000)]
Use the proper lower bound when doing saturation arithmetic.

16 bit signed integers have a range of [-32768, 32768).  The existing code
was using the interval (-32768, 32768) instead.  This patch fixes that.

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

Merged revisions 386929 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 386930 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386931 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoJust a couple of Stasis-HTTP nitpick fixes.
David M. Lee [Tue, 30 Apr 2013 13:37:09 +0000 (13:37 +0000)]
Just a couple of Stasis-HTTP nitpick fixes.

* Fixed crash when res_stasis_http is unloaded before the
  implementation modules.
* Cleaned up test initialization for test_stasis_http.so.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386928 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoModifying sounds/Makefile to pull down 1.4.24 core sounds
Rusty Newton [Mon, 29 Apr 2013 23:36:42 +0000 (23:36 +0000)]
Modifying sounds/Makefile to pull down 1.4.24 core sounds

1.4.24 core sounds includes a full set of Italian prompts for core sounds and a fix for the missing voicemail prompts in the Russian language.

(closes issue ASTERISK-19431)
(closes issue ASTERISK-19721)
........

Merged revisions 386877 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 386878 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386879 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoPlay periodic prompts for first call in a call queue
Olle Johansson [Mon, 29 Apr 2013 13:38:59 +0000 (13:38 +0000)]
Play periodic prompts for first call in a call queue

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

Merged revisions 386792 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 386794 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386841 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoChange pointer to existing wiki page instead of non-existing page
Olle Johansson [Mon, 29 Apr 2013 08:40:16 +0000 (08:40 +0000)]
Change pointer to existing wiki page instead of non-existing page

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386793 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix spelling error in python doc
Kinsey Moore [Sun, 28 Apr 2013 03:32:35 +0000 (03:32 +0000)]
Fix spelling error in python doc

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386774 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoTweak res_sip priority so it gets loaded first before all other SIP stuff.
Joshua Colp [Sat, 27 Apr 2013 19:03:39 +0000 (19:03 +0000)]
Tweak res_sip priority so it gets loaded first before all other SIP stuff.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386760 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoUpdate res_config_sqlite to use the ast_variable lists.
Joshua Colp [Sat, 27 Apr 2013 16:17:01 +0000 (16:17 +0000)]
Update res_config_sqlite to use the ast_variable lists.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386746 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd support for a realtime sorcery module.
Joshua Colp [Sat, 27 Apr 2013 12:01:29 +0000 (12:01 +0000)]
Add support for a realtime sorcery module.

This change does the following:

1. Adds the sorcery realtime module
2. Adds unit tests for the sorcery realtime module
3. Changes the realtime core to use an ast_variable list instead of variadic arguments
4. Changes all realtime drivers to accept an ast_variable list

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386731 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd missing module dependencies to various res_sip* modules
Matthew Jordan [Fri, 26 Apr 2013 21:52:06 +0000 (21:52 +0000)]
Add missing module dependencies to various res_sip* modules

This patch updates the various res_sip modules with their proper menuselect
options and proper dependencies, such that Asterisk still has a snowball's
chance in hell of compiling without pjproject.

Much thanks to snuffy(-home|-work) for making everyone's life
easier with this patch.

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

(closes issue ASTERISK-21669)
Reported by: snuffy
patches:
  xml-depends.diff uploaded by snuffy (license 5024)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386686 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoClean up memory leak in config file on off nominal paths when glob is allowed
Matthew Jordan [Fri, 26 Apr 2013 21:34:16 +0000 (21:34 +0000)]
Clean up memory leak in config file on off nominal paths when glob is allowed

If a system allows for its usage, Asterisk will use glob to help parse
Asterisk .conf files. The config file loading routine was leaking the memory
allocated by the glob() routine when the config file was in an unmodified
or invalid state.

This patch properly calls globfree in those off nominal paths.

(closes issue ASTERISK-21412)
Reported by: Corey Farrell
patches:
  config_glob_leak.patch uploaded by Corey Farrell (license 5909)
........

Merged revisions 386672 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 386677 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386685 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoBy popular demand, putting the about-to-load-module printf back.
David M. Lee [Fri, 26 Apr 2013 21:31:39 +0000 (21:31 +0000)]
By popular demand, putting the about-to-load-module printf back.

But now it only prints during the initial startup, and prints at verbose 1
level.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386684 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoClean up resources in features on exit
Matthew Jordan [Fri, 26 Apr 2013 21:27:24 +0000 (21:27 +0000)]
Clean up resources in features on exit

This patch cleans up two things features:
* It properly unregisters the CLI commands that features registered
* It cancels and performs a pthread_join on the created parking thread. This
  not only properly joins a non-detached thread, but also prevents disposing
  of the parking lots prior to the parking thread completely exiting.

(closes issue ASTERISK-21407)
Reported by: Corey Farrell
patches:
  features_shutdown-r2.patch uploaded by Corey Farrell (License 5909)
........

Merged revisions 386641 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 386642 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386676 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRemoving stray printf from r386540
David M. Lee [Fri, 26 Apr 2013 21:00:45 +0000 (21:00 +0000)]
Removing stray printf from r386540

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386640 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd an \extref doxygen pointer for libuuid.
Mark Michelson [Fri, 26 Apr 2013 20:32:11 +0000 (20:32 +0000)]
Add an \extref doxygen pointer for libuuid.

Thanks to Olle Johansson for suggesting this.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386638 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoExample of how to use the Stasis message bus
David M. Lee [Fri, 26 Apr 2013 20:05:15 +0000 (20:05 +0000)]
Example of how to use the Stasis message bus

In order to get people familiar with the Stasis message bus, it would
be useful to have something of a tutorial. Since I'm not clever enough
to think of some cool integration we could do with Twitter, I settled
for something that might actually be useful.

This patch adds a res_statsd.so module, which implements a basic
statsd[1] client. Statsd is a very simple statistics gathering server,
which can publish its results to a backend graphing engine, like
Graphite[2]. There are several different Statsd server
implementations[3], so you can pick what works best for your
environment.

The actual example of how to use the Stasis message bus is in
res_chan_stats.so. This module demonstrates how to use subscriptions
and the message router by monitoring messages and posting channels
stats to the statsd server.

A wiki page walking through res_chan_stats.so is forthcoming.

 [1]: https://github.com/etsy/statsd/
 [2]: http://graphite.readthedocs.org/en/latest/
 [3]: http://joemiller.me/2011/09/21/list-of-statsd-server-implementations/

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386624 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoIgnore *.[oi] files in res/res_sip
David M. Lee [Fri, 26 Apr 2013 20:03:32 +0000 (20:03 +0000)]
Ignore *.[oi] files in res/res_sip

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386623 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoDon't bind to anything in the sample configuration so we don't clash with chan_sip...
Joshua Colp [Thu, 25 Apr 2013 21:32:48 +0000 (21:32 +0000)]
Don't bind to anything in the sample configuration so we don't clash with chan_sip on a "make samples" right now.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386577 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoREmove automerge properties.
Mark Michelson [Thu, 25 Apr 2013 18:28:37 +0000 (18:28 +0000)]
REmove automerge properties.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386541 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMerge the pimp_my_sip branch into trunk.
Mark Michelson [Thu, 25 Apr 2013 18:25:31 +0000 (18:25 +0000)]
Merge the pimp_my_sip branch into trunk.

The pimp_my_sip branch is being merged at this point because
it offers basic functionality, and from an API standpoint, things
are complete.

SIP work is *not* feature-complete; however, with the completion
of the SUBSCRIBE/NOTIFY API, all APIs (except a PUBLISH API) have
been created, and thus it is possible for developers to attempt
to create new SIP work.

API documentation can be found in the doxygen in the code, but
usability documentation is still lacking.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386540 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix Displaying Symmetric RTP Global Setting
Michael L. Young [Thu, 25 Apr 2013 03:04:21 +0000 (03:04 +0000)]
Fix Displaying Symmetric RTP Global Setting

* Use comedia_string() to display correctly the symmetric rtp setting when
  running "sip show settings"
........

Merged revisions 386486 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386487 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoChange Case On Forcerport For Consistency
Michael L. Young [Thu, 25 Apr 2013 02:48:44 +0000 (02:48 +0000)]
Change Case On Forcerport For Consistency

* Change "ForcerPort" to "Forcerport" to match everywhere else it is displayed
........

Merged revisions 386483 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 386484 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386485 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoDocument JSON models in resource_*.h
David M. Lee [Wed, 24 Apr 2013 21:47:03 +0000 (21:47 +0000)]
Document JSON models in resource_*.h

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386462 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoOops. Mustache doesn't like dictionaries
David M. Lee [Wed, 24 Apr 2013 21:43:16 +0000 (21:43 +0000)]
Oops. Mustache doesn't like dictionaries

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386461 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoconfbridge: Make search the conference bridges container using OBJ_KEY.
Richard Mudgett [Tue, 23 Apr 2013 20:18:44 +0000 (20:18 +0000)]
confbridge: Make search the conference bridges container using OBJ_KEY.

* Make confbridge config parsing user profile, bridge profile, and menu
container hash/cmp functions correctly check the OBJ_POINTER, OBJ_KEY, and
OBJ_PARTIAL_KEY flags.

* Made confbridge load_module()/unload_module() free all resources on
failure conditions.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386375 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix some bad whitespace
Kinsey Moore [Tue, 23 Apr 2013 18:57:00 +0000 (18:57 +0000)]
Fix some bad whitespace

This crept in with the RESTful HTTP interface merge.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386352 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix crash when AMI redirect action redirects two channels out of a bridge.
Richard Mudgett [Mon, 22 Apr 2013 16:44:21 +0000 (16:44 +0000)]
Fix crash when AMI redirect action redirects two channels out of a bridge.

The two party bridging loops were changing the bridge peer pointers
without the channel locks held.  Thus when ast_channel_massquerade()
tested and used the pointer there is a small window of opportunity for the
pointers to become NULL even though the masquerade code has the channels
locked.

(closes issue ASTERISK-21356)
Reported by: William luke
Patches:
      jira_asterisk_21356_v11.patch (license #5621) patch uploaded by rmudgett
Tested by: William luke
........

Merged revisions 386256 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 386286 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386289 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoDoxygen - Markup Guidelines
Andrew Latham [Mon, 22 Apr 2013 16:22:00 +0000 (16:22 +0000)]
Doxygen - Markup Guidelines

Expand on a commit by OEJ to use the Coding-Guidelines

(issue ASTERISK-20259)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386266 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoThis patch adds a RESTful HTTP interface to Asterisk.
David M. Lee [Mon, 22 Apr 2013 14:58:53 +0000 (14:58 +0000)]
This patch adds a RESTful HTTP interface to Asterisk.

The API itself is documented using Swagger, a lightweight mechanism for
documenting RESTful API's using JSON. This allows us to use swagger-ui
to provide executable documentation for the API, generate client
bindings in different languages, and generate a lot of the boilerplate
code for implementing the RESTful bindings. The API docs live in the
rest-api/ directory.

The RESTful bindings are generated from the Swagger API docs using a set
of Mustache templates.  The code generator is written in Python, and
uses Pystache. Pystache has no dependencies, and be installed easily
using pip. Code generation code lives in rest-api-templates/.

The generated code reduces a lot of boilerplate when it comes to
handling HTTP requests. It also helps us have greater consistency in the
REST API.

(closes issue ASTERISK-20891)
Review: https://reviewboard.asterisk.org/r/2376/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386232 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix mistake in Doxygen.
Olle Johansson [Mon, 22 Apr 2013 12:45:26 +0000 (12:45 +0000)]
Fix mistake in Doxygen.

Doxygen is only *ONE* comment that applies to the NEXT piece of code.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386211 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agosla: remove redundant locking.
Russell Bryant [Mon, 22 Apr 2013 01:05:43 +0000 (01:05 +0000)]
sla: remove redundant locking.

sla.lock was already locked in the only place that sla_check_reload() was called.
Remove the redundant locking of sla.lock done in this function.  Less recursive
locking is A Good Thing.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386190 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoPrevent res_timing_pthread from blocking callers
Matthew Jordan [Fri, 19 Apr 2013 22:27:08 +0000 (22:27 +0000)]
Prevent res_timing_pthread from blocking callers

There were several reports of deadlock when using
res_timing_pthread. Backtraces indicated that one thread was blocked
waiting for the write to the pipe to complete and this thread held
the container lock for the timers.  Therefore any thread that wanted
to create a new timer or read an existing timer would block waiting
for either the timer lock or the container lock and deadlock ensued.

This patch changes the way the pipe is used to eliminate this source
of deadlocks:

1) The pipe is placed in non-blocking mode so that it would never
block even if the following changes someone fail...

2) Instead of writing bytes into the pipe for each "tick" that's
fired the pipe now has two states--signaled and unsignaled. If
signaled, the pipe is hot and any pollers of the read side
filedescriptor will be woken up. If unsigned the pipe is idle. This
eliminates even the chance of filling up the pipe and reduces the
potential overhead of calling unnecessary writes.

3) Since we're tracking the signaled / unsignaled state, we can
eliminate the exta poll system call for every firing because we know
that there is data to be read.

(closes issue ASTERISK-21389)
Reported by: Matt Jordan
Tested by: Shaun Ruffell, Matt Jordan, Tony Lewis
patches:
  0001-res_timing_pthread-Reduce-probability-of-deadlocking.patch uploaded by sruffell (License 5417)

(closes issue ASTERISK-19754)
Reported by: Nikola Ciprich

(closes issue ASTERISK-20577)
Reported by: Kien Kennedy

(closes issue ASTERISK-17436)
Reported by: Henry Fernandes

(closes issue ASTERISK-17467)
Reported by: isrl

(closes issue ASTERISK-17458)
Reported by: isrl

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

Merged revisions 386109 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 386159 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386160 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agocli.c: Properly initialize debug_modules and verbose_modules.
David M. Lee [Fri, 19 Apr 2013 05:20:02 +0000 (05:20 +0000)]
cli.c: Properly initialize debug_modules and verbose_modules.

This avoids some lock errors on the core set {debug,verbose} commands.
........

Merged revisions 386049 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 386051 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386054 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAllow WebSocket connections on more URL's
David M. Lee [Thu, 18 Apr 2013 17:30:28 +0000 (17:30 +0000)]
Allow WebSocket connections on more URL's

This patch adds the concept of ast_websocket_server to
res_http_websocket, allowing WebSocket connections on URL's more more
than /ws.

The existing funcitons for managing the WebSocket subprotocols on /ws
still work, so this patch should be completely backward compatible.

(closes issue ASTERISK-21279)
Review: https://reviewboard.asterisk.org/r/2453/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386020 65c4cc65-6c06-0410-ace0-fbb531ad65f3