asterisk/asterisk.git
7 years agoconfbridge: Rename i iterator variables to iter.
Richard Mudgett [Sat, 16 Feb 2013 20:44:44 +0000 (20:44 +0000)]
confbridge: Rename i iterator variables to iter.

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

7 years agoDon't send presencestate information if the state is invalid
Matthew Jordan [Sat, 16 Feb 2013 16:28:43 +0000 (16:28 +0000)]
Don't send presencestate information if the state is invalid

Previously, presencestate information was sent whenever the state was not
NOT_SET. When r381594 actually returned INVALID presence state in all the
places it was supposed to, it caused chan_sip to start adding presence
state information to NOTIFY requests that it previously would not have
added. chan_sip shouldn't be adding presence state information when the
provider is in an invalid state; users can't set the state to invalid and
an invalid state always implies that the provider is in an error condition.

(issue AST-1084)
........

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

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

7 years agoAdd support for retrieving multiple objects from sorcery using a regex on their id.
Joshua Colp [Sat, 16 Feb 2013 16:24:21 +0000 (16:24 +0000)]
Add support for retrieving multiple objects from sorcery using a regex on their id.

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

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

7 years agoFix crash in PresenceState AMI action when specifying an invalid provider
Matthew Jordan [Fri, 15 Feb 2013 23:29:28 +0000 (23:29 +0000)]
Fix crash in PresenceState AMI action when specifying an invalid provider

This patch fixes a crash in Asterisk that could be caused by using the
PresenceState AMI action while providing an invalid provider. This patch
also adds some additional warnings when a user attempts to provide the
PresenceState action with invalid data, and removes some NOTICE statements
that were still lurking in the code from testing.

(closes issue AST-1084)
Reported by: John Bigelow
Tested by: John Bigelow
........

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

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

7 years agoFix a crash that occurred when a BYE was received on a replaced dialog.
Mark Michelson [Fri, 15 Feb 2013 18:51:40 +0000 (18:51 +0000)]
Fix a crash that occurred when a BYE was received on a replaced dialog.

Reference counting for the channel and its tech_pvt got messed up at
some point between 1.8 and 11. The result was that if a BYE for a dialog
that had been replaced (via an INVITE with Replaces) was received, Asterisk
would crash due to trying to access data on a channel that was no longer there.

The fix I introduced is to remove code that both unrefs the sip_pvt and sets
the channel's tech_pvt to NULL when an INVITE with Replaces is handled. This
way when a BYE is received, the tech_pvt will be non-NULL and so the BYE can
be processed and not cause a crash.

(closes issue ASTERISK-20929)
reported by Kristopher Lalletti
patches:
ASTERISK-20929.patch uploaded by Mark Michelson (License #5049)
........

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

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

7 years agoDisable strict XML documentation config checking; fix crash caused by sorcery
Matthew Jordan [Fri, 15 Feb 2013 18:44:24 +0000 (18:44 +0000)]
Disable strict XML documentation config checking; fix crash caused by sorcery

This patch does two things:
 1. It disables (temporarily) strict XML documentation checking for module
    configurations. We should re-enable it before making any release from
    trunk.
 2. Pass the module flag AST_MODULE through sorcery. This means several of the
    API calls are now macros and will do this automatically for you. The config
    framework needs the module that objects are registering to so it can
    properly construct the documentation. (This was already a required field,
    but sorcery was getting by without it)

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

7 years agoStopped spamming of debug messages during attended transfer.
Kevin Harwell [Fri, 15 Feb 2013 17:38:22 +0000 (17:38 +0000)]
Stopped spamming of debug messages during attended transfer.

While autoservice is running and servicing a channel the callid is being stored
and removed in the thread's local storage for each iteration of the thread loop.
If debug was set to a sufficient level the log file would be spammed with callid
thread local storage debug messages.

Added a new function that checks to see if the callid to be stored is different
than what is already contained (if anything).  If it is different then
store/replace and log, otherwise just leave as is.  Also made it so all logging
of debug messages pertaining to the callid thread storage outputs only when
TEST_FRAMEWORK is defined.

(issue ASTERISK-21014)
(closes issue ASTERISK-21014)
Report by: Rusty Newton
Review: https://reviewboard.asterisk.org/r/2324/

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

7 years agochan_sip: Use video and text crypto attributes to append RTP profiles to SDP
Jonathan Rose [Fri, 15 Feb 2013 17:33:32 +0000 (17:33 +0000)]
chan_sip: Use video and text crypto attributes to append RTP profiles to SDP

Some bad copy/pasting resulted in using the audio crypto attribute for both
text and video RTP. Also the audio crypto isn't set until after these, so it
was really just bad all around.

(closes ASTERISK-20905)
Reported by: Kristopher Lalletti
patches:
rtp_crypto_video_text.diff uploaded by Jonathan Rose (license 6182)
........

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

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

7 years agoRemove automerge propertrties added in r381527
Matthew Jordan [Fri, 15 Feb 2013 15:26:51 +0000 (15:26 +0000)]
Remove automerge propertrties added in r381527

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

7 years agoAdd CLI configuration documentation
Matthew Jordan [Fri, 15 Feb 2013 13:38:12 +0000 (13:38 +0000)]
Add CLI configuration documentation

This patch allows a module to define its configuration in XML in source, such
that it can be parsed by the XML documentation engine. Documentation is
generated in a two-pass approach:

1. The documentation is first generated from the XML pulled from the source
2. The documentation is then enhanced by the registration of configuration
   options that use the configuration framework

This patch include configuration documentation for the following modules:
 * chan_motif
 * res_xmpp
 * app_confbridge
 * app_skel
 * udptl

Two new CLI commands have been added:
 * config show help - show configuration help by module, category, and item
 * xmldoc dump - dump the in-memory representation of the XML documentation to
   a new XML file.

Review: https://reviewboard.asterisk.org/r/2278
Review: https://reviewboard.asterisk.org/r/2058

patches:
  on review 2058 uploaded by twilson

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

7 years agoRemove extraneous stuff from r381470.
Damien Wedhorn [Thu, 14 Feb 2013 19:58:33 +0000 (19:58 +0000)]
Remove extraneous stuff from r381470.

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

7 years agoAdd back sending dialnumber to skinny.
Damien Wedhorn [Thu, 14 Feb 2013 19:55:29 +0000 (19:55 +0000)]
Add back sending dialnumber to skinny.

Don't know why it seemed to work during testing, but it really is needed
for protocol v17 (and probably above).

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

7 years agoEnd stuck DTMF if AST_SOFTHANGUP_ASYNCGOTO because it isn't a real hangup.
Richard Mudgett [Thu, 14 Feb 2013 19:52:14 +0000 (19:52 +0000)]
End stuck DTMF if AST_SOFTHANGUP_ASYNCGOTO because it isn't a real hangup.

It doesn't hurt to check AST_SOFTHANGUP_UNBRIDGE either, but it should not
be set outside of a bridge.

(issue ASTERISK-20492)
........

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

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

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

7 years agoRespect callerid presentation in skinny.
Damien Wedhorn [Thu, 14 Feb 2013 19:25:52 +0000 (19:25 +0000)]
Respect callerid presentation in skinny.

Fix chan_skinny so that it respects callerID presentation of inbound calls to
device and a couple of other minor fixes: 145 packet (add OCTAL_FROM amd callerid),
and dont send dialednumber message if protocol >= 17.

(closes issue ASTERISK-21066)
Reported by: snuffy
Tested by: snuffy, myself
Patches:
    skinny-respect-clid-restrictions-v2.diff uploaded by snuffy (license 5024)

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

7 years agoRevamp of terminal color codes
Kinsey Moore [Thu, 14 Feb 2013 18:47:56 +0000 (18:47 +0000)]
Revamp of terminal color codes

The core module related to coloring terminal output was old and needed
some love.  The main thing here was an attempt to get rid of the
obscene number of stack-local buffers that were allocated for no other
reason than to colorize some output.  Instead, this uses a simple trick
to allocate several buffers within threadlocal storage, then
automatically rotates between them, so that you can make multiple calls
to the colorization routine within one function and not need to
allocate multiple buffers.

Review: https://reviewboard.asterisk.org/r/2241/
Patches:
    bug.patch uploaded by Tilghman Lesher

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

7 years agoUse a shuffling algorithm to find unused IAX2 call numbers.
Sean Bright [Thu, 14 Feb 2013 17:06:02 +0000 (17:06 +0000)]
Use a shuffling algorithm to find unused IAX2 call numbers.

While adding red-black tree containers to astobj2 in r376575, Richard pointed
out the way chan_iax2 finds unused call numbers will prevent ao2_container
integrity checks at runtime.

This patch removes the ao2_container and instead uses fixed sized arrays and a
modified Fisher-Yates-Durstenfeld shuffle to maintain the call number list.

While the locking semantics are similar to the ao2_container implementation,
this implementation should be faster and more memory efficient.

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

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

7 years agoUpdate the name of the update_tags utility in the git mirror how-to.
Sean Bright [Thu, 14 Feb 2013 14:45:09 +0000 (14:45 +0000)]
Update the name of the update_tags utility in the git mirror how-to.

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

7 years agoDon't throw a spurious error when using DBdeltree
Matthew Jordan [Thu, 14 Feb 2013 03:49:52 +0000 (03:49 +0000)]
Don't throw a spurious error when using DBdeltree

The function call ast_db_deltree returns the number of row deleted, or a
negative number if it failed. DBdeltree was treating any non-zero return
as an error, causing a spurious verbose error message to be displayed.

This patch handles the return code of ast_db_deltree correctly.

(closes issue ASTERISK-21070)
Reported by: ianc
patches:
  dbdeltree.diff uploaded by ianc (License #5955)
........

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

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

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

7 years agoAdd a serializer interface to the threadpool
David M. Lee [Tue, 12 Feb 2013 21:45:59 +0000 (21:45 +0000)]
Add a serializer interface to the threadpool

This patch adds the ability to create a serializer from a thread pool. A
serializer is a ast_taskprocessor with the same contract as a default
taskprocessor (tasks execute serially) except instead of executing out
of a dedicated thread, execution occurs in a thread from a
ast_threadpool. Think of it as a lightweight thread.

While it guarantees that each task will complete before executing the
next, there is no guarantee as to which thread from the pool individual
tasks will execute. This normally only matters if your code relys on
thread specific information, such as thread locals.

This patch also fixes a bug in how the 'was_empty' parameter is computed
for the push callback, and gets rid of the unused 'shutting_down' field.

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

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

7 years agoDo not allow native RTP bridging if packetization of media streams differs.
Mark Michelson [Tue, 12 Feb 2013 20:57:31 +0000 (20:57 +0000)]
Do not allow native RTP bridging if packetization of media streams differs.

The RTP engine will no longer allow for local and remote native RTP bridges
if packetization of streams differs. Allowing native bridging in this scenario
has been known to cause FAX failures.

(closes ASTERISK-20650)
Reported by: Maciej Krajewski
Patches:
ASTERISK-20659.patch uploaded by Mark Michelson (License #5049)

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

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

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

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

7 years agoFix some more REF_DEBUG-related build errors
Kinsey Moore [Tue, 12 Feb 2013 20:18:21 +0000 (20:18 +0000)]
Fix some more REF_DEBUG-related build errors

When sip_ref_peer and sip_unref_peer were exported to be usable in
channels/sip/security_events.c, modifications to those functions when
building under REF_DEBUG were not taken into account. This change
moves the necessary defines into sip.h to make them accessible to
other parts of chan_sip that need them.
........

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

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

7 years agoAdding Some More Manager Events To ConfBridge
Michael L. Young [Tue, 12 Feb 2013 03:31:46 +0000 (03:31 +0000)]
Adding Some More Manager Events To ConfBridge

Currently, ConfBridge does not send manager events for ConfbridgeMute,
ConfbridgeUnmute, ConfbridgeStartRecord and ConfbridgeStopRecord.  This patch
adds these events to the manager.

The reporter's patch moves some other events up to the beginning of the file.

The patch being committed is based on the patch contributed from the reporter of
this issue.  I have made a lot of modifications to the patch in order for it to
fit in better with what we currently are doing in the code when it comes to
manager events.  I also made a few changes to the <see-also> elements on some of
the events.

(closes issue ASTERISK-20827)
Reported by: Clint Davis
Tested by: Clint Davis, Michael L. Young
Patches:
    20827.diff uploaded by Clint Davis (license 6453)
    asterisk-20827-confbridge-events.diff uploaded by
                                                 Michael L. Young (license 5026)

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

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

7 years agoProperly load say.conf upon reload of module app_playback.
Kevin Harwell [Mon, 11 Feb 2013 21:17:04 +0000 (21:17 +0000)]
Properly load say.conf upon reload of module app_playback.

If say.conf did not exists prior to originally loading module app_playback it
would not load on subsequent reloads of the module once it had been created.
This occurred because upon reload of the app_playback module it would only
load a new configuration if an old one had previously existed.  This fix simply
removed the association between checking if an old configuration existed and
the loading of the new one.

(closes issue ASTERISK-20800)
Reported by: pgoergler
........

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

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

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

7 years agoFix compilation error with REF_DEBUG
Kinsey Moore [Mon, 11 Feb 2013 21:10:53 +0000 (21:10 +0000)]
Fix compilation error with REF_DEBUG

When the red/black tree work was committed, there was an extra ", " in
the REF_DEBUG definition of ao2_container_alloc_rbtree.

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

7 years agoMinor fixes to res_json and test_json.
David M. Lee [Mon, 11 Feb 2013 20:39:11 +0000 (20:39 +0000)]
Minor fixes to res_json and test_json.

* Made input checking more consistent with other Asterisk code
* Added validation to ast_json_dump_new_file
* Fixed tests for ownereship semantics

(issue ASTERISK-20887)

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

7 years agoFix some issues with skinny callid.
Damien Wedhorn [Mon, 11 Feb 2013 18:54:12 +0000 (18:54 +0000)]
Fix some issues with skinny callid.

Add extra string to transmit_callinfo_var, Only set string2 to tonum for outgoing calls
and changes to send_callinfo and push_callinfo to not set callid name to last number.

(closes issue ASTERISK-21063)
Reported by: wedhorn
Tested by: snuffy, myself
Patches:
    skinny-callinfoupdate03.diff uploaded by wedhorn (license 5019)

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

7 years agofeatures: Don't cache a struct ast_app pointer.
Richard Mudgett [Mon, 11 Feb 2013 18:00:05 +0000 (18:00 +0000)]
features: Don't cache a struct ast_app pointer.

Caching a struct ast_app pointer is not a good idea because someone could
unload the application.  After the applicaiton unload the cached ast_app
pointer is no longer valid.  Only pbx.c can cache the pointer because it
knows when the application is unloaded and removes the pointer.

* Fixed one-touch Monitor and MixMonitor to not cache the ast_app pointer
and not use the silly monitor_ok/mixmonitor_ok/stopmixmonitor_ok flags.

* Extracted bridge_check_monitor() from ast_bridge_call() and use propper
locking.

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

7 years agoFix crash in res_xmpp when deleting pubsub node from CLI
Matthew Jordan [Mon, 11 Feb 2013 15:11:47 +0000 (15:11 +0000)]
Fix crash in res_xmpp when deleting pubsub node from CLI

An error existed in res_xmpp where it would attempt to delete attributes from
a node that itself was also deleted. Per the iksemel documentation, attributes
added using iks_insert are copied to the parent node's stack, and will be
reclaimed when that node is itself destroyed.

(closes issue ASTERISK-20982)
Reported by: marcelloceschia
patches:
  delete-node-fix.diff uploaded by marcelloceschia (License 6036)
........

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

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

7 years agoAdd additional functionality to the Sorcery API.
Joshua Colp [Sun, 10 Feb 2013 14:58:37 +0000 (14:58 +0000)]
Add additional functionality to the Sorcery API.

This commit adds native implementation support for copying and diffing objects,
as well as the ability to load or reload on a per-object type level.

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

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

7 years agopbx: Fix regression caused by taking advantage of the function name sort.
Richard Mudgett [Sat, 9 Feb 2013 20:58:53 +0000 (20:58 +0000)]
pbx: Fix regression caused by taking advantage of the function name sort.

Taking advantage of the sorted order of the registered functions container
requires that they are actually inserted in the expected sort order.

* Insert the registered functions into the container in case sensitive
position.  As a result, only the complete_functions() routine needs to
search the entire container because it does a case insensitive search for
convenience.

Caught by the unit tests.

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

7 years agopbx: Make function and application containers take advantage of being sorted.
Richard Mudgett [Sat, 9 Feb 2013 03:51:32 +0000 (03:51 +0000)]
pbx: Make function and application containers take advantage of being sorted.

* Fixed "core show function" tab completion and token count checking.

* Refactored function and application container handling code to reduce
redundancy.

* Made __ast_pbx_run() return using the defines the caller should expect.
Doesn't change the returned values.  Just made use the defines.

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

7 years agoMake ast_do_masquerade() a void function.
Richard Mudgett [Sat, 9 Feb 2013 01:31:55 +0000 (01:31 +0000)]
Make ast_do_masquerade() a void function.

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

7 years agoapp_confbridge: Fix crash from receiving an AMI action after ConfBridge unloaded.
Richard Mudgett [Fri, 8 Feb 2013 17:37:27 +0000 (17:37 +0000)]
app_confbridge: Fix crash from receiving an AMI action after ConfBridge unloaded.

Unloading ConfBridge caused the next AMI action received to crash
Asterisk.

* Add the missing unregister of AMI action ConfbridgeSetSingleVideoSrc
when ConfBridge is unloaded.

(closes issue ASTERISK-20994)
Reported by: Jeremy Kister
Patches:
      jira_asterisk_20994_v11.patch (license #5621) patch uploaded by rmudgett
Tested by: Rusty Newton, Jeremy Kister
........

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

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

7 years agoCall Parking: Set PARKINGLOT and PARKINGSLOT variables on all parked calls
Jonathan Rose [Fri, 8 Feb 2013 17:36:23 +0000 (17:36 +0000)]
Call Parking: Set PARKINGLOT and PARKINGSLOT variables on all parked calls

These two variables were previously not being set when comebacktoorigin=yes
and the example configs seemed to imply that they should be. Since there
is no harm in this and since calls that are sent back to origin are capable
of continuing in the dialplan, this seemed like a no-brainer. Also it
supports some bridging tests I've been working on.

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

7 years agoFix a bug where a changed configuration file might not be available to all sorcery...
Joshua Colp [Thu, 7 Feb 2013 17:57:10 +0000 (17:57 +0000)]
Fix a bug where a changed configuration file might not be available to all sorcery object types.

Since res_sorcery_config used a static name of "res_sorcery_config" to inform the configuration
file API that it asked for the configuration file it was possible during a reload for some sorcery
object types not to receive the new configuration file.

This change introduces a UUID on a per-sorcery config instance basis so that the unchanged state
is kept on an instance basis and not for the res_sorcery_config module as a whole.

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

7 years agoAdd aggregate operations for stuctures with string fields
Kinsey Moore [Thu, 7 Feb 2013 15:16:44 +0000 (15:16 +0000)]
Add aggregate operations for stuctures with string fields

Add struct-level comparison and copying of string fields to reduce the
complexity of whole-struct comparison and copying when using string
fields. The new macros do not take into account non-stringfield data.

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

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

7 years agoFixed failing test from r380696.
David M. Lee [Wed, 6 Feb 2013 20:18:05 +0000 (20:18 +0000)]
Fixed failing test from r380696.

When I added my extensive suite of session timer unit tests, apparently one of
them was failing and I never noticed. If neither Min-SE nor Session-Expires is
set in the header, it was responding with a Session-Expires of the global
maxmimum instead of the configured max for the endpoint.

(issue ASTERISK-20787)
........

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

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

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

7 years agoFix reload skinny with active devices.
Damien Wedhorn [Wed, 6 Feb 2013 08:44:32 +0000 (08:44 +0000)]
Fix reload skinny with active devices.

Patch ensures that d->activeline and l->activesub are moved over to the
new device and line so that on callend the appropriate subs can be found
to complete hangup before device resets.

(closes issue ASTERISK-16610)
Reported by: wedhorn
Tested by: snuffy, myself
Patches:
    skinny-reloadactive01.diff uploaded by wedhorn (license 5019)
........

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

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

7 years agoReset skinny vmexten and immeddial char on reload.
Damien Wedhorn [Wed, 6 Feb 2013 06:55:02 +0000 (06:55 +0000)]
Reset skinny vmexten and immeddial char on reload.

Make skinny reset vmexten and immeddial to '\0' on reload to ensure that
it is set to '\0' if the appropriate item is removed/commented in
skinny.conf. Also small fix re immeddial char in skinny.conf and add
immedial setting to skinny show settings.

(closes issue ASTERISK-21037)
Reported by: snuffy
Tested by: snuffy, myself
Patches:
    immed_dial_fix.diff uploaded by snuffy (license 5024)

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

7 years agoapp_page and app_confbridge: Fix custom announcement on entering conference.
Richard Mudgett [Tue, 5 Feb 2013 19:11:33 +0000 (19:11 +0000)]
app_page and app_confbridge: Fix custom announcement on entering conference.

The Page and ConfBridge custom announcement did not play when users
entered the conference.

* Fix the CONFBRIDGE(user,announcement) file not getting played.  The code
to do this got removed accidentally when the ConfBridge code was
restructured to be more state machine like.

* Fixed play_prompt_to_user() doxygen comments.

* Fixed the Page A(x) and n options for the caller.  The caller never
played the announcement file and totally ignored the n option.  The code
to do this was lost when the application was converted to use ConfBridge.

* Factored out setup_profile_bridge(), setup_profile_paged(), and
setup_profile_caller() routines to setup ConfBridge profiles.  Made each
profile setup routine use the default template if one has not already been
setup by dialplan.

(closes issue ASTERISK-20990)
Reported by: Jeremy Kister
Tested by: rmudgett
........

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

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

7 years agoapp_confbridge: Fix error messages on exiting conference.
Richard Mudgett [Tue, 5 Feb 2013 18:50:50 +0000 (18:50 +0000)]
app_confbridge: Fix error messages on exiting conference.

A marked user ending a conference with only end_marked users generates
error messages:
ERROR[0000][C-00000000]: confbridge/conf_state.c:47 conf_invalid_event_fn: Invalid event for confbridge user ''

* The MULTI_MARKED state was doing too much when it was kicking out the
end_marked users from the conference.  The kicked out users will clean up
after themselves when they exit the conference.

(closes issue ASTERISK-20991)
Reported by: Jeremy Kister
Tested by: rmudgett
........

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

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

7 years agoapp_page: Fixup application XML documentation typos and inaccuracies.
Richard Mudgett [Tue, 5 Feb 2013 18:28:51 +0000 (18:28 +0000)]
app_page: Fixup application XML documentation typos and inaccuracies.
........

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

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

7 years agoBecause the compiler can check types with a struct copy and memcpy() cannot.
Richard Mudgett [Tue, 5 Feb 2013 18:17:29 +0000 (18:17 +0000)]
Because the compiler can check types with a struct copy and memcpy() cannot.
........

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

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

7 years agoSeparate option_types[] from the struct definition.
Richard Mudgett [Tue, 5 Feb 2013 18:13:09 +0000 (18:13 +0000)]
Separate option_types[] from the struct definition.

Updated the option_types[] doxygen comment.
........

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

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

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

7 years agoFix how we build pjproject.
Jason Parker [Mon, 4 Feb 2013 19:52:14 +0000 (19:52 +0000)]
Fix how we build pjproject.

Allow parallel builds, better tolerate failures, build faster.

This also stops running dependencies before top-level configure has been run.

(closes issue ASTERISK-20815)

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

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

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

7 years agoAdd variable length displayprompt packet to skinny and use octals.
Damien Wedhorn [Sat, 2 Feb 2013 01:52:21 +0000 (01:52 +0000)]
Add variable length displayprompt packet to skinny and use octals.

Add new variable length displayprompt packet (0x0145) to skinny. Uses the new
packet if the device is reporting protocol versions >= 17.

Add the use of octal codes for sending prompts to both the new and old
displayprompt messages (also cleaned up soft_key_template_default to use the
defined octal codes).

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

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

7 years agochan_iax2: Fix compile error if MALLOC_DEBUG enabled.
Richard Mudgett [Fri, 1 Feb 2013 19:35:26 +0000 (19:35 +0000)]
chan_iax2: Fix compile error if MALLOC_DEBUG enabled.

NEVER INCLUDE astmm.h DIRECTLY!!

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

7 years agoAdds variable length callinfo packets to skinny.
Damien Wedhorn [Fri, 1 Feb 2013 06:37:22 +0000 (06:37 +0000)]
Adds variable length callinfo packets to skinny.

Add packet 0x014A (variable length call info messages) to skinny for newer
firmware. Plenty of unknown information but includes the equivalent functionality
as the fixed size callinfo packet already included.
Only send this packet if protocol reported is >= 17.

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

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

7 years agoMultiple revisions 380735-380736
Jason Parker [Thu, 31 Jan 2013 22:03:44 +0000 (22:03 +0000)]
Multiple revisions 380735-380736

........
  r380735 | qwell | 2013-01-31 15:40:09 -0600 (Thu, 31 Jan 2013) | 1 line

  Fix a few compiler warnings.
........
  r380736 | qwell | 2013-01-31 15:42:34 -0600 (Thu, 31 Jan 2013) | 1 line

  Ignore warnings caused by PJ_TODO()s in pjproject.
........

Merged revisions 380735-380736 from http://svn.asterisk.org/svn/asterisk/branches/11

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

7 years agoProcess session timers, even if Session-Expires header is missing
David M. Lee [Thu, 31 Jan 2013 20:17:15 +0000 (20:17 +0000)]
Process session timers, even if Session-Expires header is missing

Previously, Asterisk only processed session timer information if both the
'Supported: timer' and 'Session-Expires' headers were present. However, the
Session-Expires header is optional. If we were to receive a request with a
Min-SE greater than our configured session-expires, we would respond with a
'Session-Expires' header that was too small.

This patch cleans the situation up a bit, always processing timer information
if the 'Supported: timer' header is present.

(closes issue ASTERISK-20787)
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/2299/
........

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

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

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

7 years agoMove IAX firmware related functionality into separate files.
Sean Bright [Thu, 31 Jan 2013 19:52:48 +0000 (19:52 +0000)]
Move IAX firmware related functionality into separate files.

This patch is mostly a reorganization of existing code with a few exceptions:

* Added doxygen comments to all of the extracted functions.

* Split reload_firmware(int unload) into iax_firmware_reload() and
  iax_firmware_unload() for readability.

* Create iax_firmware_traverse() to support the 'iax2 show firmware' CLI
  command.

* Renamed iax_check_version() to iax_firmware_get_version() and change its
  arguments and return value so that it returns a success/failure value and sets
  the selected version into an out parameter to avoid confusion with failure and
  version 0.

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

7 years agoMultiple revisions 380671-380673
Jason Parker [Thu, 31 Jan 2013 19:04:57 +0000 (19:04 +0000)]
Multiple revisions 380671-380673

........
  r380671 | qwell | 2013-01-31 12:59:28 -0600 (Thu, 31 Jan 2013) | 4 lines

  Remove a cross-compile workaround.

  ar and ranlib can be easily detected with autoconf.
........
  r380672 | qwell | 2013-01-31 13:00:38 -0600 (Thu, 31 Jan 2013) | 2 lines

  Always check for libm, regardless of configure options.
........
  r380673 | qwell | 2013-01-31 13:03:03 -0600 (Thu, 31 Jan 2013) | 7 lines

  Add support for parallel builds of pjproject.

  Also adds proper dependency checking, and direct .a file targets.  We don't
  take advantage of this currently, but we will soon.

  (issue ASTERISK-20815)
........

Merged revisions 380671-380673 from http://svn.asterisk.org/svn/asterisk/branches/11

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

7 years agobridge_multiplexed: Keep the multiplexed thread until no more bridges use it.
Richard Mudgett [Thu, 31 Jan 2013 18:22:56 +0000 (18:22 +0000)]
bridge_multiplexed: Keep the multiplexed thread until no more bridges use it.

* Fixed the potential of losing the multiplexed bridge thread when the
last channel leaves and another joins while the multiplexed thread is
being shut down.

* Refactored and improved the management of the serviced channels array.

* Changed the channels count to a bridges count so it only needs to be
incremented rather than changed by two.

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

7 years agoImprove func FRAME_TRACE DTMF digit format.
Richard Mudgett [Thu, 31 Jan 2013 18:15:49 +0000 (18:15 +0000)]
Improve func FRAME_TRACE DTMF digit format.

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

7 years agoEliminate an unused lock in ast_bridge_channel.
Richard Mudgett [Thu, 31 Jan 2013 18:14:55 +0000 (18:14 +0000)]
Eliminate an unused lock in ast_bridge_channel.

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

7 years agoEliminate a use of a C++ keyword as a variable. new to new_frame
Richard Mudgett [Thu, 31 Jan 2013 18:14:05 +0000 (18:14 +0000)]
Eliminate a use of a C++ keyword as a variable. new to new_frame

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

7 years agoAdd ignore properties to channels/iax2
Richard Mudgett [Thu, 31 Jan 2013 00:57:30 +0000 (00:57 +0000)]
Add ignore properties to channels/iax2

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

7 years agoMake CHECK_BLOCKING() debug message more useful.
Richard Mudgett [Thu, 31 Jan 2013 00:37:03 +0000 (00:37 +0000)]
Make CHECK_BLOCKING() debug message more useful.

Change the displayed pthread value to hex format so it can be easily
matched with CLI core show threads or gdb.
........

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

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

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

7 years agochan_dahdi: Fix "dahdi show channels group" for groups greater than 31.
Richard Mudgett [Wed, 30 Jan 2013 21:59:07 +0000 (21:59 +0000)]
chan_dahdi: Fix "dahdi show channels group" for groups greater than 31.

The variable type used was not large enough to hold a group bit field.
........

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

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

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

7 years agoSupport building Asterisk for Raspberry Pi/Raspbian with hard-float support
Matthew Jordan [Wed, 30 Jan 2013 17:49:38 +0000 (17:49 +0000)]
Support building Asterisk for Raspberry Pi/Raspbian with hard-float support

Building Asterisk on Raspbian with hard-float support fails as it uses the
string 'linux-gnueabihf' for host os, as opposed to 'linux-gnueabi'. This patch
modifies the configure script for Asterisk such that it will match on any
string beginning with 'linux-gnueabi', as opposed to requiring an explicit
match.

(closes issue ASTERISK-21006)
Reported by: Christian Hesse
Tested by: Christian Hesse
patches:
  linux-gnueabihf.patch uploaded by Christian Hesse (license 6459)
  linux-gnueabihf-autoconf.patch uploaded by Christian Hesse (license 6459)
........

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

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

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

7 years agoUnregister SIP provider API if module load is declined
Matthew Jordan [Wed, 30 Jan 2013 15:57:41 +0000 (15:57 +0000)]
Unregister SIP provider API if module load is declined

A user in #asterisk ran into a problem where a configuration error prevented
the chan_sip module from being loaded. Upon fixing their configuratione error,
they could no longer load the chan_sip module. This was because the
configuration checking happened after the SIP provider was registered with the
Asterisk core, and subsequent attempts to load the SIP module failed as the
provider was already registered.

Since we want to detect any failure in registering chan_sip as early as
possible (as that could be emblematic of a deeper mismatch between module
and Asterisk core), this patch does not change the registration location, but
does ensure that if a module load is declined, we unregister the module as
the SIP api provider.
........

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

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

7 years agoPerform case insensitive comparisons for T.38 attributes
Matthew Jordan [Wed, 30 Jan 2013 14:47:26 +0000 (14:47 +0000)]
Perform case insensitive comparisons for T.38 attributes

RFC5347 section 2.5.2 states the following:
...
The attribute "T38MaxBitRate" was once incorrectly registered with
IANA as "T38maxBitRate" (lower-case "m"). In accordance with T.38
examples and common implementation practice, the form "T38MaxBitRate"
SHOULD be generated by implementations conforming to this package.
In general, it is RECOMMENDED that implementations of this package
accept lowercase, uppercase, and mixed upper/lowercase encodings of
all the T.38 attributes.
...

Asterisk currently does not perform case insensitive matching on the T.38
attributes. This causes the T38MaxBitRate attribute to be negotiated at
2400 baud instead of 14400 (or whatever value you actually wanted).

This patch makes it so that when we compare T.38 attributes, we do so in a case
insensitive fashion.

Note that while the issue reporter did not directly write the patch, they
contributed to it (and would have provided one themselves if the license had
gone through a tad faster), and hence get attribution for it.

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

(closes issue ASTERISK-20897)
Reported by: Eric Hill
Tested by: Eric Hill
patches:
  -- uploaded by Eric Hill
........

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

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

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

7 years agoFix memory leak in res_calendar_icalendar
Matthew Jordan [Wed, 30 Jan 2013 14:19:29 +0000 (14:19 +0000)]
Fix memory leak in res_calendar_icalendar

The ICalendar module had a systemic memory leak on each fetch of data from
the ICalendar source. The previous fetched data was not being properly
disposed. This patch makes it so that before each fetch of data, we dispose
of the previously fetched data.

(closes issue ASTERISK-21012)
Reported by: Joel Vandal
Tested by: Joel Vandal
........

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

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

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

7 years agoMove the ancillary iax2 source files into a separate sub-directory.
Sean Bright [Tue, 29 Jan 2013 22:58:33 +0000 (22:58 +0000)]
Move the ancillary iax2 source files into a separate sub-directory.

This patch just moves the IAX2 source and header files into a separate iax2
sub-directory in the channels directory, similar to how the sip source files are
structured.

The only thing that was added was an #ifndef to protect provision.h from multiple
inclusion.

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

7 years agoFix an issue where building with DEBUG_FD_LEAKS enabled would not work due to sorcery...
Joshua Colp [Tue, 29 Jan 2013 20:19:28 +0000 (20:19 +0000)]
Fix an issue where building with DEBUG_FD_LEAKS enabled would not work due to sorcery using calls called "open" and "close".

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

7 years agochan_agent: Prevent multiple channels from logging in as the same agent.
Richard Mudgett [Tue, 29 Jan 2013 18:02:07 +0000 (18:02 +0000)]
chan_agent: Prevent multiple channels from logging in as the same agent.

Multiple channels logging in as the same agent can result in dead channels
waiting for a condition signal that will never come because another
channel thread stole it.  A symptom is chan_sip repeatedly generating
warning messages about rescheduling autodestruction of dialogs with an
agent channel owner.

* Made only login_exec() (the app AgentLogin) clear the agent_pvt->chan
pointer to prevent multiple channels from logging in as the same agent.
agent_read(), agent_call(), and agent_set_base_channel() no longer
disconnect the agent channel from the agent_pvt.  This also eliminates the
need to keep checking for agent_pvt->chan being NULL.

* Made agent_hangup() not wake up the AgentLogin agent thread until it is
done.

* Made agent_request() not able to get the agent until he has logged in
and any wrapup time has expired.

* Made agent_request() use ast_hangup() instead of agent_hangup() to
correctly dispose of a channel.

* Removed agent_set_base_channel().  Nobody calls it and it is a bad thing
in general.

* Made only agent_devicestate() determine the current device state of an
agent.  Note: Agent group device states have never been supported.

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

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

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

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

7 years agoCorrected crypto tag in SDP ANSWER for SRTP. (again)
David M. Lee [Tue, 29 Jan 2013 17:46:30 +0000 (17:46 +0000)]
Corrected crypto tag in SDP ANSWER for SRTP. (again)

The original fix (r380043) for getting Asterisk to respond with the correct
tag overlooked some corner cases, and the fact that the same code is in 1.8.

This patch moves the building of the crypto line out of
sdp_crypto_process(). Instead, it merely copies the accepted tag. The call to
sdp_crypto_offer() will build the crypto line in all cases now, using a tag of
"1" in the case of sending offers.

(closes issue ASTERISK-20849)
Reported by: José Luis Millán
Review: https://reviewboard.asterisk.org/r/2295/
........

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

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

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

7 years agocall_parking: Make sure fallbacks are used when lacking a flat channel exten
Jonathan Rose [Tue, 29 Jan 2013 17:06:17 +0000 (17:06 +0000)]
call_parking: Make sure fallbacks are used when lacking a flat channel exten

A regression was introduced which removed automatic fallback behavior from
the PBX. This behavior was used by call parking (or at least documented as
how the feature works) in order to select an extension when the flat channel
extension wasn't available from the comebackcontext. Parking now handles
the fallbacks internally in order to keep behavior matching with how it is
documented.

(closes issue ASTERISK-20716)
Reported by: Chris Gentle
Review: https://reviewboard.asterisk.org/r/2296/
........

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

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

7 years agoEnsure that a declined media stream is terminated with a '\r\n'
Matthew Jordan [Tue, 29 Jan 2013 14:48:28 +0000 (14:48 +0000)]
Ensure that a declined media stream is terminated with a '\r\n'

In r369028, chan_sip's processing of media streams in an SDP was modified to
better handle multiple offered media streams. Part of that change modified
how streams were declined. Previously, declined media streams were not
handled in an RFC compliant manner; now, we set the port number to 0 in the
media stream definition and proceed on with the next media stream.

Unfortunately, the formatting of the declined media stream forgot to append a
'\r\n' to the end of the media stream. This is normally added to the accepted
media streams later on in the processing of the SDP. Since the declined media
stream uses a different buffer than the accepted media streams (and is a
malloc'd buffer as opposed to a struct ast_str), it's easier to just slap the
'\r\n' on the declined media stream buffer rather than attempt to append it
later on.

So, that's what we do. And now some devices (and probably some providers) will
be a bit happier (but probably not terribly happy, since we just rejected
something they offered).

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

(closes issue ASTERISK-20908)
Reported by: Dennis DeDonatis
Tested by: Dennis DeDonatis
........

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

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

7 years agoUpdate configure script to be compatible with ptlib 2.10.9
Matthew Jordan [Tue, 29 Jan 2013 02:12:04 +0000 (02:12 +0000)]
Update configure script to be compatible with ptlib 2.10.9

With ptlib 2.10.9, the configure script fails due to grep returning multiple
matches for the pattern it searches for. This patch updates the pattern
matching to return only the actual version for the symbol searched for,
PTLIB_VERSION.

(closes issue ASTERISK-20980)
Reported by: Stefan Reuter
patches:
  ASTERISK-20980-1.patch uploaded by Stefan Reuter (license 5339)
........

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

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

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

7 years agoCorrect the number of available call numbers in IAX2.
Sean Bright [Mon, 28 Jan 2013 21:09:52 +0000 (21:09 +0000)]
Correct the number of available call numbers in IAX2.

There is currently an edge case where call number 32768 might be allocated for
a call, even though the IAX2 protocol requires call numbers be only 15 bits.
This resulted in some unpredictable behavior when call number 32678 is chosen.

This patch was mostly written by Richard Mudgett via ReviewBoard.  I'm just
committing it.

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

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

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

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

7 years agoChange cleanup ordering in filestream destructor.
Russell Bryant [Mon, 28 Jan 2013 01:58:41 +0000 (01:58 +0000)]
Change cleanup ordering in filestream destructor.

This patch came about due to a problem observed where wav files had an
empty header.  The header is supposed to be updated in wav_close().  It
turns out that this was broken when the cache_record_files option from
asterisk.conf was enabled.  The cleanup code was moving the file to its
final destination *before* running the close() method of the file
destructor, so the header didn't get updated.

Another problem here is that the move was being done before actually
closing the FILE *.

Finally, the last bug fixed here is that I noticed that wav_close()
checks for stream->filename to be non-NULL.  In the previous cleanup
order, it's checking a pointer to freed memory.  This doesn't actually
cause anything to break, but it's treading on dangerous waters.  Now the
free() of stream->filename is happening after the format module's
close() method gets called, so it's safer.

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

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

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

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

7 years agoAdd queue_log_realtime_use_gmt option to logger.conf
Russell Bryant [Mon, 28 Jan 2013 01:50:54 +0000 (01:50 +0000)]
Add queue_log_realtime_use_gmt option to logger.conf

Add an option that lets you specify that the timestamps going into the realtime
queue log should be in GMT instead of local time.

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

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

7 years agoFix Some Configured Conference Bridge Sounds Not Being Set
Michael L. Young [Sun, 27 Jan 2013 20:33:38 +0000 (20:33 +0000)]
Fix Some Configured Conference Bridge Sounds Not Being Set

The "sound_only_one" sound was not being set even though it was configured.  In
looking into this, I found that the "join" and "leave" prompts were not being
set either.

(closes issue ASTERISK-20898)
Reported by: Stephan
Tested by: Stephan
Patches:
    asterisk-20898-custom-sounds-ignored.diff uploaded by
                                                 Michael L. Young (license 5026)

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

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

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

7 years agoAdd a unit test which confirms the apply handler callback is called when it should be.
Joshua Colp [Sun, 27 Jan 2013 18:40:15 +0000 (18:40 +0000)]
Add a unit test which confirms the apply handler callback is called when it should be.

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

7 years agoFix a bug where the apply function was not getting called.
Joshua Colp [Sun, 27 Jan 2013 17:13:22 +0000 (17:13 +0000)]
Fix a bug where the apply function was not getting called.

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

7 years agobridge_multiplexed: Rename variables so they are not the same as the struct name.
Richard Mudgett [Fri, 25 Jan 2013 23:23:26 +0000 (23:23 +0000)]
bridge_multiplexed: Rename variables so they are not the same as the struct name.

* Rename multiplexed_thread variables to muxed_thread.  It is shorter and
my editer tagging works much better.  Struct names and variable names have
different purposes and therefore should have different names.

* Renamed the multiplexed_threads container to muxed_threads for
consistency.

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

7 years agoMake sorcery modules global, since they are required by other modules that are global.
Jason Parker [Fri, 25 Jan 2013 20:46:09 +0000 (20:46 +0000)]
Make sorcery modules global, since they are required by other modules that are global.

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

7 years agoMisc bridge code improvements
Richard Mudgett [Fri, 25 Jan 2013 20:00:21 +0000 (20:00 +0000)]
Misc bridge code improvements

* Made multiplexed_bridge_destroy() check if anything to destroy and
cleared bridge_pvt pointer after destruction.

* Made multiplexed_add_or_remove() handling of the chans array simpler.

* Extracted bridge_channel_poke().

* Simplified bridge_array_remove() handling of the bridge->array[].  The
array does not have a NULL sentinel pointer.

* Made ast_bridge_new() not create a temporary bridge just to see if it
can be done.  Only need to check if there is an appropriate bridge tech
available.

* Made ast_bridge_new() clean up on allocation failures.

* Made destroy_bridge() free resources in the opposite order of creation.

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

7 years agoMore trivial bridge code cleanup.
Richard Mudgett [Fri, 25 Jan 2013 19:29:04 +0000 (19:29 +0000)]
More trivial bridge code cleanup.

* Breaking long lines
* Word wrapping comment blocks.
* Removing redundant initializers.
* Debug message wording.

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

7 years agoAdd a missing '\' to a log message.
Joshua Colp [Fri, 25 Jan 2013 14:23:46 +0000 (14:23 +0000)]
Add a missing '\' to a log message.

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

7 years agoMerge the sorcery data access layer API.
Joshua Colp [Fri, 25 Jan 2013 14:01:04 +0000 (14:01 +0000)]
Merge the sorcery data access layer API.

Sorcery is a unifying data access layer which provides a pluggable mechanism to allow
object creation, retrieval, updating, and deletion using different backends (or wizards).

This is a fancy way of saying "one interface to rule them all" where them is configuration,
realtime, and anything else that comes along.

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

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

7 years agoAdd force dial keys to skinny.
Damien Wedhorn [Fri, 25 Jan 2013 05:49:54 +0000 (05:49 +0000)]
Add force dial keys to skinny.

Adds a dial softkey when the device is in DAFD. The softkey is greyed (unusable)
until a possible dialplan match is entered. Code includes updating
transmit_selectsoftkeys to allow the use of a button mask. Also add option
to use # or * as a dial now button. Original patch by snuffy cleaned up by myself.

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

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

7 years agoCorrected crypto tag in SDP ANSWER for SRTP.
David M. Lee [Thu, 24 Jan 2013 16:40:42 +0000 (16:40 +0000)]
Corrected crypto tag in SDP ANSWER for SRTP.

When Asterisk responds with an SDP ANSWER for SRTP, it had the code to
correctly fill in the crypto data, which was overwritten by a call to
sdp_crypto_offer. Corrected the situation by changing sdp_crypto_offer
to not replacing crypto data if it already exists.

(closes issue ASTERISK-20849)
Reported by: José Luis Millán
Tested by: Iñaki Baz Castillo
Patches:
fix_sdp_crypto_tags.diff uploaded by Pedro Kiefer (license 6407)
........

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

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

7 years agoCorrect documentation for ConfbridgeList AMI action
Matthew Jordan [Thu, 24 Jan 2013 04:02:47 +0000 (04:02 +0000)]
Correct documentation for ConfbridgeList AMI action

The documentation for ConfbridgeList states that the Conference field is
optional. That's not really the case: if you fail to provide a Conference
number, the command will kick back an error.

(closes issue AST-1090)
Reported by: John Bigelow
........

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

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

7 years agoAdd support for DPMA to autosupport
Kinsey Moore [Wed, 23 Jan 2013 16:50:00 +0000 (16:50 +0000)]
Add support for DPMA to autosupport

This adds the ability to get the DPMA version, a listing of the local
firmware directory, and indexes of configured remote directories.

(closes issue AST-1070)
Reported By: Malcolm Davenport
Tested By: Kinsey Moore <kmoore@digium.com>

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

7 years agoAttempt to be more helpful when using a bad ao2 object pointer.
Richard Mudgett [Wed, 23 Jan 2013 00:30:00 +0000 (00:30 +0000)]
Attempt to be more helpful when using a bad ao2 object pointer.

Put the external obj pointer in the message instead of the internal version.
........

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

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

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

7 years agores_fax_spandsp: fix t38 transmission bug caused by not returning success
Jonathan Rose [Tue, 22 Jan 2013 22:19:02 +0000 (22:19 +0000)]
res_fax_spandsp: fix t38 transmission bug caused by not returning success

This patch fixes the problem, but the issue includes a test which is still
being considered for the automated test suite.

(issue ASTERISK-20919)
Reported by: NITESH BANSAL
Patches:
patch_ast_fax_spandsp.patch uploaded by NITESH BANSAL (license 6418)
........

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

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

7 years agoRemove a large block of commented out code from chan_iax2.
Sean Bright [Tue, 22 Jan 2013 20:58:08 +0000 (20:58 +0000)]
Remove a large block of commented out code from chan_iax2.

During the conversion to the newer CLI command structure the old definitions were
commented out.  I think it's safe to remove them completely now.

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

7 years agoapp_meetme: Use new prompts for administrator menu
Jonathan Rose [Tue, 22 Jan 2013 19:29:50 +0000 (19:29 +0000)]
app_meetme: Use new prompts for administrator menu

The old prompts for the administrator menu were inadequate. They didn't mention
that the menu had additional options through the 8 key and pressing the 8 key
wouldn't reveal what those options were. This patch fixes all of that while
also organizing code pertaining to each individual menu type which was
previously all stored in one gigantic function along with many of the basic
conference functions.

(closes issue AST-996)
Reported by: John Bigelow
Review: http://reviewboard.digium.internal/r/360/
........

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

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

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

7 years agoRemove stray property.
Richard Mudgett [Tue, 22 Jan 2013 16:48:36 +0000 (16:48 +0000)]
Remove stray property.

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

7 years agoAdd ControlPlayback manager action
Matthew Jordan [Tue, 22 Jan 2013 15:16:20 +0000 (15:16 +0000)]
Add ControlPlayback manager action

This patch adds the capability for asynchronous manipulation of audio being
played back to a channel though a new AMI action "ControlPlayback". The
ControlPlayback action supports a number of operations, the availability of
which depend on the application being used to send audio to the channel.
When the audio playback was initiated using the ControlPlayback application
or CONTROL STREAM FILE AGI command, the audio can be paused, stopped,
restarted, reversed, or skipped forward. When initiated by other mechanisms
(such as the Playback application), the audio can be stopped, reversed, or
skipped forward.

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

(closes issue ASTERISK-20882)
Reported by: mjordan

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

7 years agoFix station ringback; trunk hangup issues in SLA
Matthew Jordan [Tue, 22 Jan 2013 15:15:04 +0000 (15:15 +0000)]
Fix station ringback; trunk hangup issues in SLA

This patch fixes two bugs:
 * If an outbound call is made from a SLA phone using SLAStation, then there is
   no ringtone audible to the phone that originates the call. The indication of
   the ringing was not being passed to the SLA station; this patch fixes that
   by passing through the progress indications.
 * If an SLA station hangs up before the called party answers, then the channel
   to the called party continues to ring until a timeout occurs. If the called
   party manages to answer, Asterisk attempts to connect the called party to
   a non-existant MeetMe room. This patch corrects the behavior by abandoning
   the call attempt if it detects that the SLA station is no longer in use
   while attempting to call the called party.

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

(closes issue ASTERISK-20462)
Reported by: dkerr
patches:
  asterisk-11-bugid20440+20462.patch uploaded by dkerr (license 5558)
  asterisk-11-bugid20462.patch uploaded by dkerr (license 5558)

(closes issue ASTERISK-20440)
Reported by: dkerr
patches:
  asterisk-11-bugid20440.patch uploaded by dkerr (license 5558)
  asterisk-11-bugid20440+20462.patch uploaded by dkerr (license 5558)
........

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

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

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

7 years agoconfbridge: Minor fixes playing user counts to the conference.
Richard Mudgett [Tue, 22 Jan 2013 00:36:52 +0000 (00:36 +0000)]
confbridge: Minor fixes playing user counts to the conference.

* Generate a warning message if sound files do not exist when trying to
play the user count to the conference.  Use the new helper routine
sound_file_exists() for consistency.

* Put the new user into autoservice when playing user counts to the
conference.

* Check the return value of ast_bridge_impart().
........

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

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

7 years agoUpdate init.d scripts to handle stderr; readd splash screen for remote consoles
Matthew Jordan [Mon, 21 Jan 2013 20:41:12 +0000 (20:41 +0000)]
Update init.d scripts to handle stderr; readd splash screen for remote consoles

When r376428 was commited to re-order start up sequences to be more tolerant of
forking with thread primitives, a few items were changed that caused changes
in behavior on some distros. This includes:
 * Not displaying the splash screen on a remote console.
 * Displaying an error message on stderr when a remote console cannot connect
   to a running instance of Asterisk.

In the first case, the splash screen was re-added (thanks to Michael L. Young).
In the second case, the various init.d scripts were modified to pipe stderr
to /dev/null, as the error message is useful - if you execute a remote
console or a remote console command execution and it fail, it should tell
you. Note that the error message was always present, it just failed to be
printed prior to r376428.

Much thanks to the folks who quickly reported this problem, provided solutions,
and promptly tested the various init.d scripts on a variety of distros.

(closes issue ASTERISK-20945)
Reported by: Warren Selby
Tested by: Michael L. Young, Jamuel Starkey, kaldemar, Danny Nicholas, mjordan
patches:
  asterisk-20945-remote-intro-msg.diff uploaded by elguero (license 5026)
  ASTERISK-20945-1.8-mjordan.diff uploaded by mjordan (license 6283)
........

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

Merged revisions 379777 from http://svn.asterisk.org/svn/asterisk/branches/10
........

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

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

7 years agoBetter protect bridge_channel state from other threads.
Richard Mudgett [Mon, 21 Jan 2013 20:35:12 +0000 (20:35 +0000)]
Better protect bridge_channel state from other threads.

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

7 years agoExtract common bridging code into bridge_stop() and bridge_force_out_all().
Richard Mudgett [Mon, 21 Jan 2013 20:24:23 +0000 (20:24 +0000)]
Extract common bridging code into bridge_stop() and bridge_force_out_all().

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

7 years agoMade some bridging API calls void. Some bridging comments updated.
Richard Mudgett [Mon, 21 Jan 2013 20:15:57 +0000 (20:15 +0000)]
Made some bridging API calls void. Some bridging comments updated.

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

7 years agoPrevent segfault for interpolated iLBC frames
Kinsey Moore [Mon, 21 Jan 2013 18:47:47 +0000 (18:47 +0000)]
Prevent segfault for interpolated iLBC frames

When iLBC is being used with a jitter buffer and the jb has to
interpolate frames, it generates frames with a null pointer and a
non-zero datalen. This is now handled properly.

(closes issue ASTERISK-20914)
Reported By: John McEleney
Patches:
  ASTERISK-20914-1.8.diff uploaded by Matt Jordan (license 6283)
........

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

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

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

7 years agoTrivial bridge code cleanup.
Richard Mudgett [Mon, 21 Jan 2013 18:45:17 +0000 (18:45 +0000)]
Trivial bridge code cleanup.

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