Commit Graph

25207 Commits

Author SHA1 Message Date
Mark Michelson
2a48cbd86c Revert changes to sorcery that accidentally got committed.
These changes were still up for review and have not been approved
yet. I must have had the changes in my working copy when making
a different change.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410696 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-17 18:36:05 +00:00
Mark Michelson
e4d161e03c Fix stuck channel in ARI through the introduction of synchronous bridge actions.
Playing back a file to a channel in an ARI bridge would attempt to wait until
the playback concluded before returning. The method used involved signaling the
waiting thread in the ARI custom playback function.

The problem with this is that there were some corner cases that were not accounted for:
* If a bridge channel could not be found, then we never would attempt the playback but
  would still attempt to wait for the playback to complete.
* If the bridge playfile action failed to queue, we would still attempt to wait for the
  playback to complete.
* If the bridge playfile action were queued but some circumstance caused the playback
  not to occur (the bridge dies, the channel is removed from the bridge), then we would
  never be notified.

The solution to this is to move the waiting logic into the bridge code. A new bridge
API function is added to queue a synchronous action on a bridge. The waiting thread
is notified when the queued frame has been freed, either due to an error occurring
or due to successful playback. As a failsafe, the waiting thread has a 10 minute
timeout just in case there is a frame leak somewhere.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410673 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-17 16:52:12 +00:00
Richard Mudgett
952ea1d5c1 app_confbridge: Add missing destructor call to announcer channel destructor.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410671 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-17 16:42:05 +00:00
Matthew Jordan
ec0e0a2abe stasis/app.c: Add some extra debugging for subscription counts
Events are sent to a connected ARI application based on the things that ARI
application cares about. These subscriptions can be set up implicitly - such
as when that ARI application creates a new object - or explicitly, via the
application resource's subscription operations. Debugging *why* something was
being sent to an application - or why something was not being sent to an
application - was a bit tricky, as there was no debug information for the
subscriptions.

This patch adds some debug level 3 statements that show the subscription counts
for applications. (Level 3 was chosen as it matches the verbose level 3
statements elsewhere)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410650 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-16 20:20:14 +00:00
Mark Michelson
81f55d47e7 Fix failing realtime sorcery tests.
The store realtime callback needs to return a positive value for
sorcery to treat the store as a success.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410625 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-14 21:55:45 +00:00
Jonathan Rose
30fe39aac6 manager: fix memory leak in manager_add_filter function
(closes issue ASTERISK-23420)
Reported by: Etienne Lessard
Patches:
    manager_eventfilter_leak uploaded by Etienne Lessard (license 6394)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410623 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-14 21:28:31 +00:00
Mark Michelson
8b20abe24e Remove an extra ast_cond_wait() that slipped through the patch.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410607 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-14 20:53:35 +00:00
Mark Michelson
0d0c99489c Handle the return values of realtime updates and stores more accurately.
Realtime backends' update and store callbacks return the number of rows affected,
or -1 if there was a failure. There were a couple of issues:

* The config API was treating 0 as a successful return, and positive values as
  a failure. Now the config API treats anything >= 0 as a success.

* res_sorcery_realtime was treating 0 as a successful return from the store
  procedure, and any positive values as a failure. Now sorcery treats anything
  > 0 as a success. It still considers 0 a "failure" since there is no change
  to report to observers.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-14 18:10:47 +00:00
Mark Michelson
60a527ce73 Prevent conflicts regarding unsolicited and solicited MWI to an endpoint.
If an endpoint is receiving unsolicited MWI for a mailbox and then attempts
to subscribe to an AOR that provides MWI for the same mailbox, then the SUBSCRIBE
is rejected with a 500 response.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410590 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-14 18:00:03 +00:00
Scott Griepentrog
4b8ea0dc29 uniqueid: Update CHANGES to reflect new features
Note the new features provided by uniqueid in the
CHANGES file.

(issue ASTERISK-23120)
Review: https://reviewboard.asterisk.org/r/3316/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-14 17:56:13 +00:00
Jonathan Rose
6f4a3ead75 PJSIP: TOS values should be represented as decimals in sorcery objects
(closes issue ASTERISK-23235)
Reported by: George Joseph
Review: https://reviewboard.asterisk.org/r/3324/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410574 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-14 16:26:07 +00:00
Mark Michelson
10e8ad8604 Prevent delayed astdb syncs.
The syncing thread sleeps for a second before waiting to be
told to attempt to sync again. If a signal were sent during this
sleeping period, we would end up having to wait until the next
sync signal occurred in order to sync up the astdb.

This code rearrangement also ensures that any pending transactions
will be synced prior to Asterisk shutting down.

Patches: db_sync.patch by John Hardin (License #6512)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-14 16:11:42 +00:00
Jonathan Rose
14160f9a4d ARI/bridges: Forward Playback/Recording Started/Finished to bridge topic
(closes issue ASTERISK-23444)
Reported by: Ben Merrills
Review: https://reviewboard.asterisk.org/r/3340/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-14 16:05:45 +00:00
Richard Mudgett
92252df9ac res_mwi_external: Clear the stasis cache entry when the external MWI is deleted.
One of the things missing when external MWI support was added was the
ability to clear the stasis cache entry of deleted external MWI mailboxes.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410555 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-14 15:55:51 +00:00
Richard Mudgett
b12e561e42 cdr.c: Add missing aow_unlock(cdr) in off nominal path of handle_dial_message().
* Trivial common code hoisting in handle_bridge_leave_message().

* Some whitespace fixing.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-13 21:25:40 +00:00
Kinsey Moore
c677439861 ARI: Ensure managing application receives ChannelEnteredBridge messages
This fixes an issue where a Stasis application running over ARI and
subscribed to ari/events could miss the ChannelEnteredBridge event
because it did not subscribe to the new bridge fast enough.

To accomplish this, it subscribes the application controlling the
channel to the new bridge before adding it to that bridge which
required the stasis_app_control structure to maintain a reference to
the stasis_app.

(closes issue ASTERISK-23295)
Review: https://reviewboard.asterisk.org/r/3336/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-13 19:30:06 +00:00
Joshua Colp
030482f591 res_pjsip_multihomed: Remove change for testing fix.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410510 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-13 13:24:17 +00:00
Joshua Colp
95d37a266f res_pjsip_multihomed: Fix a bug where the 200 OK for a REGISTER would contain the wrong contact.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-13 13:23:14 +00:00
Richard Mudgett
e2ac75e4bd res_musiconhold.c: Generate MOH start/stop events whenever the MOH stream is started/stopped.
* Made res_musiconhold.c always post the MusicOnHoldStart/MusicOnHoldStop
events when it actually starts/stops the music streams.  This allows the
events to always happen when MOH starts/stops.  The event posting code was
moved to the MOH alloc/release routines.

* Made channel_do_masquerade() stop any MOH on the original channel before
masquerading so the original channel will get a stop event with correct
information.

* Cleaned up a couple odd codings in moh_files_alloc() and moh_alloc()
dealing with the music state variable.

(issue ASTERISK-23311)
Reported by: Benjamin Keith Ford

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-12 19:05:27 +00:00
Richard Mudgett
d7f3395e4d app_confbridge: Make explicitly stop MOH if a user is kicked or hangs up while MOH is playing.
When MOH is playing to a user in a conference and the user is kicked or
hangs up from the conference then the AMI MusicOnHoldStop events didn't
happen.  (Asterisk v11 AMI event: MusicOnHold, state:Stop)

(closes issue ASTERISK-23311)
Reported by: Benjamin Keith Ford

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410491 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-12 18:45:54 +00:00
Joshua Colp
ece1671625 res_pjsip_multihomed: Fix a bug where outgoing messages for TCP would go out using UDP.
This change fixes a bug where the code which changes the transport did not check whether
the message is going out over UDP or not before changing it. For TCP and TLS transports
we don't need to change the transport as the correct one is already chosen.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-12 12:50:46 +00:00
Joshua Colp
9c82c32f80 res_pjsip_multihomed: Add module which places the correct address within messages.
Due to how messages are handled within PJSIP it is not until a message is actually
sent that the destination is reliably known. This means that the addresses placed
within the message may not be of the interface the message is being sent out on.

This module determines what interface a message is being sent on and updates the
message to contain the correct address if applicable.

This module was tested by myself in a virtualized environment with multiple interfaces
and also by Kinsey Moore in the following configuration:

Networks:
* 10.24.16.0/21
** hard phone
** default gateway
* 10.24.64.0/21
** softphone with pjsip-based stack

Transport details:
bind address: 0.0.0.0
protocol: UDP

All endpoints were tested with explicitly configured transports and unconfigured transports.

This was tested with inbound and outbound calls, both of which were experiencing detrimental
effects from incorrect IP addresses in SIP messages. These effects were only experienced by the
soft phone on the 10.24.64.0 network since the messages to the hard phone on the 10.24.16.0
network had the correct IP address.

(closes issue ASTERISK-23020)
Reported by: xrobau

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410451 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-11 16:06:42 +00:00
Richard Mudgett
9b94422e59 AST-2014-001: Stack overflow in HTTP processing of Cookie headers.
Sending a HTTP request that is handled by Asterisk with a large number of
Cookie headers could overflow the stack.

Another vulnerability along similar lines is any HTTP request with a
ridiculous number of headers in the request could exhaust system memory.

(closes issue ASTERISK-23340)
Reported by: Lucas Molas, researcher at Programa STIC, Fundacion; and Dr. Manuel Sadosky, Buenos Aires, Argentina
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-10 17:16:38 +00:00
Scott Griepentrog
972bc14e20 unqiueid: correct max uniqueid length test
This patch adds null string test prior to checking for
a max uniqueid value that was added in r410157.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-10 16:32:13 +00:00
Kinsey Moore
8e0c31777c AST-2014-002: chan_sip: Exit early on bad session timers request
This change allows chan_sip to avoid creation of the channel and
consumption of associated file descriptors altogether if the inbound
request is going to be rejected anyway.

(closes issue ASTERISK-23373)
Reported by: Corey Farrell
Patches:
     chan_sip-earlier-st-1.8.patch uploaded by Corey Farrell (license 5909)
     chan_sip-earlier-st-11.patch uploaded by Corey Farrell (license 5909)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-10 13:25:05 +00:00
Joshua Colp
f119ac4460 AST-2014-003: res_pjsip: When handling 401/407 responses don't assume a request will have an endpoint.
This change removes the assumption that an outgoing request will always
have an endpoint and makes the authenticate_qualify option work once again.

(closes issue ASTERISK-23210)
Reported by: Joshua Colp


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410306 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-10 12:52:07 +00:00
George Joseph
e59a4de0e4 pjsip_cli: Create pjsip show channel and contact, and general cli code cleanup.
Created the 'pjsip show channel' and 'pjsip show contact' commands.
Refactored out the hated ast_hashtab.  Replaced with ao2_container.
Cleaned up function naming.  Internal only, no public name changes.
Cleaned up whitespace and brace formatting in cli code.
Changed some NULL checking from "if"s to ast_asserts.
Fixed some register/unregister ordering to reduce deadlock potential.
Fixed ast_sip_location_add_contact where the 'name' buffer was too short.
Fixed some self-assignment issues in res_pjsip_outbound_registration.

(closes issue ASTERISK-23276)
Review: http://reviewboard.asterisk.org/r/3283/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-08 16:41:04 +00:00
Matthew Jordan
14afa32979 resource_channels: Check if a passed in ID is NULL before checking its length
Calling strlen on a NULL string is explosive. This patch checks whether or not
the passed in string is NULL or zero length before checking to see if the
string is too long.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-08 15:43:30 +00:00
Corey Farrell
20330c41db chan_sip: Fix deadlock of monlock between unload_module and do_monitor
Release monlock before calling pthread_join.  This ensures do_monitor
cannot freeze by locking monlock during module unload.

(closes issue ASTERISK-21406)
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/3284/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410226 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07 22:53:58 +00:00
Scott Griepentrog
c229ebf8e4 sorcery: correct field register argument list
This fixes mistakes I previously made in merging
gtjoseph's changes with mine.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07 22:07:52 +00:00
Matthew Jordan
10deefeace config_options: Display the see-also information for CLI config option help
The config option help information has always parsed the <see-also> tags in the
XML documentation. Unfortunately, it just never bothered displaying them on
the CLI. With this patch, when you execute 'config show help [module] [obj]
[option]', it will display what other options are useful to you.

(closes issue ASTERISK-22008)
Reported by: Richard Mudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07 21:53:17 +00:00
Matthew Jordan
48ec1231f8 res_pjsip: Fix documentation for one touch recording see-also links
The one touch recording options have several see-also links between the
various configuration options. These were 'broken' by the snake casing
of those options. This patch corrects the see-also links such that they
reference the correct option names.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410194 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07 21:13:31 +00:00
Scott Griepentrog
2e0396eac3 pjsip: allow and disallow show same codecs
In order to prevent confusion over the allow and disallow
list of codecs being the same an option for registering a
field as an alias is added.  The alias field will be read
from the configuration file, but afterwards is not listed
as a known field.  With disallow set as an alias, the CLI
command pjsip show endpoint # will list the allow= field,
but not the disallow field.

(closes issue ASTERISK-23092)
Review: https://reviewboard.asterisk.org/r/3193/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07 21:10:41 +00:00
Mark Michelson
b24cb88190 Make res_sorcery_realtime filter unknown retrieved results.
When retrieving data from a database or other realtime backend, it's quite
possible to retrieve variables that Asterisk does not care about but that
are legitimate to exist. Asterisk does not need to throw a hissy fit when
these variables are encountered but rather just filter them out.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07 21:03:57 +00:00
Richard Mudgett
42ecadbf49 stasis cache: Enhance to keep track of an item from different entities.
A stasis cache entry now contains more than a single message/snapshot.  It
contains messages/snapshots for the local entity as well as any remote
entities that post to the cached item.  In addition callbacks can be
supplied when the cache is created to compute and post the aggregate
message/snapshot representing all entities stored in the cache entry.

* All stasis messages now have an eid to indicate what entity posted it.

* The stasis cache enhancements allow device state to cache and aggregate
the device states from local and remote entities in a single operation.
The cached aggregate device state is available immediately after it is
posted to the stasis bus.  This improves performance by eliminating a
cache dump and associated ao2 container traversals to calculate the
aggregate state.

(closes issue ASTERISK-23204)
Reported by: Mark Michelson

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07 20:28:12 +00:00
Richard Mudgett
995d27b888 uniqueid: Fix chan_dahdi, sig_pri, sig_ss7, test_cdr, and test_cel compiler errors.
(issue ASTERISK-23120)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07 19:11:27 +00:00
Scott Griepentrog
7bcf69eaad uniqueid: channel linkedid, ami, ari object creation with id's
Much needed was a way to assign id to objects on creation, and
much change was necessary to accomplish it.  Channel uniqueids
and linkedids are split into separate string and creation time
components without breaking linkedid propgation.  This allowed
the uniqueid to be specified by the user interface - and those
values are now carried through to channel creation, adding the
assignedids value to every function in the chain including the
channel drivers. For local channels, the second channel can be
specified or left to default to a ;2 suffix of first.  In ARI,
bridge, playback, and snoop objects can also be created with a
specified uniqueid.

Along the way, the args order to allocating channels was fixed
in chan_mgcp and chan_gtalk, and linkedid is no longer lost as
masquerade occurs.

(closes issue ASTERISK-23120)
Review: https://reviewboard.asterisk.org/r/3191/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410157 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07 15:46:32 +00:00
Matthew Jordan
9b77c08180 chan_sip: Allow static realtime members to be qualified during module load.
When a static realtime peer with qualify=yes is loaded, Asterisk will fail to
send an OPTIONS request due to the lastms being equal to 0. This results in
the peer being unable to receive calls from Asterisk because the status is
permanently UNKNOWN.

This patch allows an OPTIONS request to be sent during module load by
ignoring the lastms value on startup only.

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

(closes issue ASTERISK-17523)
Reported by: Maciej Krajewski
Tested by: wushumasters
patches:
  realtime_fix_11.7.0.txt uploaded by Trevor Peirce (license 6112)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07 04:51:15 +00:00
Russell Bryant
5f22c3ae65 moh: fix a refcount error with realtime MOH
I observed a crash in res_musiconhold on an Asterisk 11 system using realtime
MOH.  Investigation of the backtrace showed a corrupt mohclass, implying that
it got destroyed before the code expected it to.  I went looking for reference
counting errors that could have caused this crash and this patch this result.
It contains 2 changes.

1) Remove a usless block of code that was impossible to reach.  There was even
a comment indicating that it was impossible to reach.  The conditional includes
"!ast_test_flag(global_flags, MOH_CACHERTCLASSES)" and it's inside of an if
block with the opposite check "ast_test_flag(global_flags,
MOH_CACHERTCLASSES)".  There's no good reason to keep it around.

2) A similar block to #1 contained a reference counting error.  It stores
state->class in the local variable mohclass without increasing its reference
count.  The reference count on mohclass is decremented at the end of the
function.  This block of code probably very rarely runs, which would help
explain why this system was working fine for many months before experiencing a
crash.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410090 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06 23:40:42 +00:00
Richard Mudgett
b4865a4b53 sorcery.c: Fix off-nominal path ref and memory leak in ast_sorcery_objectset_json_create().
* Made exit a loop early on error in ast_sorcery_objectset_json_create().

* Removed some dead code in ast_sorcery_objectset_create2().


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06 23:35:33 +00:00
Jonathan Rose
3cdbf978d1 pjsip configuration: Make transport TOS values consistent with endpoints
Transport TOS values were interpreted as DSCP values without being documented
as such. Endpoint TOS values (tos_audio/tos_video) behaved normally as TOS
values have historically. This patch makes the transport TOS values behave as
TOS values and makes all TOS values readable as string values (e.g. AF11).
In addition, alembic scripts have been updated to use the proper field types
for all TOS/COS values.

(issue ASTERISK-23235)
Reported by: George Joseph
Review: https://reviewboard.asterisk.org/r/3304/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06 18:50:44 +00:00
Joshua Colp
b7326c2be7 res_stasis_recording: Add a "target_uri" field to recording events.
This change adds a target_uri field to the live recording object. It
contains the URI of what is being recorded.

(closes issue ASTERISK-23258)
Reported by: Ben Merrills

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410025 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06 18:18:16 +00:00
Mark Michelson
5ac921edc3 Don't attempt to link in an aggregate MWI subscription if an endpoint does not aggregate MWI.
Attempting to link a NULL object into an ao2 container had been benign previously, but since
enabling DO_CRASH in the testsuite, this is now causing a crash. It's better to be right
here anyway.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06 15:43:43 +00:00
George Joseph
2bad4d070d sorcery: Create AST_SORCERY dialplan function.
This patch creates the AST_SORCERY dialplan function which allows someone to
retrieve any value from a sorcery-based config file.  It's similar to 
AST_CONFIG.

The creation of the function itself was fairly straightforward but it required
changes to the underlying sorcery infrastructure that rippled into individual
sorcery objects.  The changes stemmed from inconsistencies in how sorcery
created ast_variable objectsets from sorcery objects and the inconsistency
in how individual objects used that feature especially when it came to
parameters that can be specified multiple times like contact in aor and match
in identify.  You can read more here...
http://lists.digium.com/pipermail/asterisk-dev/2014-February/065202.html

So, what this patch does, besides actually creating the AST_SORCERY function,
is the following...

* Creates ast_variable_list_append which is a helper to append one ast_variable
  list to another.
* Modifies the ast_sorcery_object_field_register functions to accept the
  already-defined sorcery_fields_handler callback.
* Modifies ast_sorcery_objectset_create to accept a parameter indicating return
  type preference...a single ast_variable with all values concatenated or an
  ast_variable list with multiple entries.  Also fixed a few bugs.
* Modifies individual sorcery object implementations to use the new function
  definition of the ast_sorcery_object_field_register functions.
* Modifies location.c and res_pjsip_endpoint_identifier_ip.c to implement
  sorcery_fields_handler handlers so they return multiple occurrences as an
  ast_variable_list.
* Added a whole bunch of tests to test_sorcery.

(closes issue ASTERISK-22537)
Review: http://reviewboard.asterisk.org/r/3254/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06 15:13:03 +00:00
Matthew Jordan
a088e23f26 res_fax_spandsp: Fix crash when passing ulaw/alaw data to spandsp
When acting as a T.38 fax gateway, res_fax_spandsp would at times cause a crash
in libspandsp. This would occur when, during fax tone detection, a ulaw/alaw
frame would be passed to modem_connect_tones_rx. That particular routine
expects the data to be in slin format. This patch looks at the frame type and,
if the data is ulaw/alaw, converts the format to slin before passing it to
modem_connect_tones_rx.

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

(closes issue ASTERISK-20149)
Reported by: Alexandr Gordeev
Tested by: Michal Rybarik
patches:
  spandsp_g711decode.diff uploaded by Michal Rybarik (license 6578)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06 02:05:26 +00:00
Richard Mudgett
d3498bd700 app_confbridge: Remove some noop code.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06 00:32:07 +00:00
Richard Mudgett
93f81ee4ef res_musiconhold.c: Remove some unnecessary RAII_VAR() usage.
* Made the moh_register() define use useful parameter names.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409967 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06 00:17:11 +00:00
Kinsey Moore
774847cbde config: Fix inverted test
The test of the result of the stat() call was inverted such that its
output was only used if the call failed. This inverts the test so that
the output of stat() is used correctly. This was causing full reloads
on unchanged files.

(closes issue ASTERISK-23383)
Reported by: David Woolley
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409918 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-05 20:40:44 +00:00
Kinsey Moore
9650cb5f88 bridge_native_rtp: Fix crash involving masquerade
It is possible for a channel to be masqueraded out of a bridge which
means it may no longer have RTP glue to check upon leaving said bridge.
If this situation occurred (it's possible at least during dial and call
pickup) then Asterisk would crash. This change makes sure the glue is
checked before use.

(closes issue AST-1290)
Reported by: John Bigelow


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409900 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-05 19:21:39 +00:00
Mark Michelson
fd375c623c Fix documentation for PRESENCE_STATE to properly illustrate how to create a presence hint.
There was a missing comma.
This was discovered by Dan Kaplan.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-05 18:46:31 +00:00